5555import java .util .Collections ;
5656import java .util .List ;
5757
58- import androidx .annotation .NonNull ;
59-
6058/**
6159 * Baseclass of all Chart-Views.
6260 *
@@ -174,11 +172,6 @@ public abstract class Chart<T extends ChartData<? extends IDataSet<? extends Ent
174172 */
175173 private float mExtraTopOffset = 0.f , mExtraRightOffset = 0.f , mExtraBottomOffset = 0.f , mExtraLeftOffset = 0.f ;
176174
177- /**
178- * Tag for logging accessibility related content
179- */
180- private String TAG = "abilityTag" ;
181-
182175 /**
183176 * Additional data on top of dynamically generated description. This can be set by the user.
184177 */
@@ -754,7 +747,7 @@ public ChartTouchListener getOnTouchListener() {
754747 /**
755748 * the view that represents the marker
756749 */
757- protected List <IMarker > mMarkers ;
750+ protected List <IMarker > mMarkers = new ArrayList <>() ;
758751
759752 /**
760753 * draws all MarkerViews on the highlighted positions
@@ -766,7 +759,9 @@ protected void drawMarkers(Canvas canvas) {
766759 return ;
767760 }
768761
769- for (Highlight highlight : mIndicesToHighlight ) {
762+ for (int i = 0 ; i < mIndicesToHighlight .length ; i ++) {
763+
764+ Highlight highlight = mIndicesToHighlight [i ];
770765
771766 // When changing data sets and calling animation functions, sometimes an erroneous highlight is generated
772767 // on the dataset that is removed. Null check to prevent crash
@@ -778,7 +773,7 @@ protected void drawMarkers(Canvas canvas) {
778773 Entry e = mData .getEntryForHighlight (highlight );
779774
780775 // make sure entry not null before using it
781- if (e == null || set == null ) {
776+ if (e == null ) {
782777 continue ;
783778 }
784779
@@ -1153,7 +1148,7 @@ public void setMarkers(List<IMarker> marker) {
11531148 * sets the marker that is displayed when a value is clicked on the chart
11541149 */
11551150 public void setMarker (IMarker marker ) {
1156- setMarkers (Collections .unmodifiableList ( Collections . singletonList (marker ) ));
1151+ setMarkers (Collections .singletonList (marker ));
11571152 }
11581153 /**
11591154 * returns the marker that is set as a marker view for the chart
@@ -1703,7 +1698,7 @@ public void setAccessibilitySummaryDescription(String accessibilitySummaryDescri
17031698 public boolean dispatchPopulateAccessibilityEvent (AccessibilityEvent event ) {
17041699
17051700 boolean completed = super .dispatchPopulateAccessibilityEvent (event );
1706- Log .d (TAG , "Dispatch called for Chart <View> and completed as " + completed );
1701+ Log .d (LOG_TAG , "Dispatch called for Chart <View> and completed as " + completed );
17071702
17081703 event .getText ().add (getAccessibilityDescription ());
17091704
0 commit comments