|
1 | 1 | package com.github.mikephil.charting.charts; |
2 | 2 |
|
3 | | -import android.animation.ValueAnimator; |
4 | | -import android.animation.ValueAnimator.AnimatorUpdateListener; |
5 | 3 | import android.content.Context; |
6 | 4 | import android.graphics.Bitmap; |
7 | 5 | import android.graphics.Canvas; |
@@ -167,12 +165,12 @@ public abstract class Chart<T extends ChartData<? extends IDataSet<? extends Ent |
167 | 165 | */ |
168 | 166 | private float mExtraTopOffset = 0.f, mExtraRightOffset = 0.f, mExtraBottomOffset = 0.f, mExtraLeftOffset = 0.f; |
169 | 167 |
|
170 | | - /** |
171 | | - * Additional data on top of dynamically generated description. This can be set by the user. |
172 | | - */ |
173 | | - private String accessibilitySummaryDescription = ""; |
| 168 | + /** |
| 169 | + * Additional data on top of dynamically generated description. This can be set by the user. |
| 170 | + */ |
| 171 | + private String accessibilitySummaryDescription = ""; |
174 | 172 |
|
175 | | - /** |
| 173 | + /** |
176 | 174 | * default constructor for initialization in code |
177 | 175 | */ |
178 | 176 | public Chart(Context context) { |
@@ -228,11 +226,12 @@ protected void init() { |
228 | 226 | mInfoPaint.setTextSize(Utils.convertDpToPixel(12f)); |
229 | 227 |
|
230 | 228 | if (mLogEnabled) { |
231 | | - Log.i("", "Chart.init()"); |
| 229 | + Log.i("", "Chart.init()"); |
232 | 230 |
|
233 | | - // enable being detected by ScreenReader |
234 | | - setFocusable(true); |
235 | | - }} |
| 231 | + // enable being detected by ScreenReader |
| 232 | + setFocusable(true); |
| 233 | + } |
| 234 | + } |
236 | 235 |
|
237 | 236 | // public void initWithDummyData() { |
238 | 237 | // ColorTemplate template = new ColorTemplate(); |
@@ -530,16 +529,19 @@ public void highlightValues(Highlight[] highs) { |
530 | 529 | } |
531 | 530 |
|
532 | 531 | public void highlightValues(List<Highlight> highs, List<IMarker> markers) { |
533 | | - if (highs.size() != markers.size()) throw new IllegalArgumentException("Markers and highs must be mutually corresponding. High size = " + highs.size() + " Markers size = " + markers.size()); |
534 | | - setMarkers(markers); |
535 | | - highlightValues(highs.toArray(new Highlight[0])); |
536 | | - } |
537 | | - |
538 | | - /** |
539 | | - * Highlights any y-value at the given x-value in the given DataSet. |
540 | | - * Provide -1 as the dataSetIndex to undo all highlighting. |
541 | | - * This method will call the listener. |
542 | | - ** @param x The x-value to highlight |
| 532 | + if (highs.size() != markers.size()) { |
| 533 | + throw new IllegalArgumentException("Markers and highs must be mutually corresponding. High size = " + highs.size() + " Markers size = " + markers.size()); |
| 534 | + } |
| 535 | + setMarkers(markers); |
| 536 | + highlightValues(highs.toArray(new Highlight[0])); |
| 537 | + } |
| 538 | + |
| 539 | + /** |
| 540 | + * Highlights any y-value at the given x-value in the given DataSet. |
| 541 | + * Provide -1 as the dataSetIndex to undo all highlighting. |
| 542 | + * This method will call the listener. |
| 543 | + * * @param x The x-value to highlight |
| 544 | + * |
543 | 545 | * @param dataSetIndex The dataset index to search in |
544 | 546 | * @param dataIndex The data index to search in (only used in CombinedChartView currently) |
545 | 547 | */ |
@@ -1134,18 +1136,18 @@ public void setTouchEnabled(boolean enabled) { |
1134 | 1136 | } |
1135 | 1137 |
|
1136 | 1138 | public void setMarkers(List<IMarker> marker) { |
1137 | | - mMarkers = marker; |
1138 | | - } |
| 1139 | + mMarkers = marker; |
| 1140 | + } |
1139 | 1141 |
|
1140 | | - /** |
1141 | | - * sets the marker that is displayed when a value is clicked on the chart |
1142 | | - */ |
| 1142 | + /** |
| 1143 | + * sets the marker that is displayed when a value is clicked on the chart |
| 1144 | + */ |
1143 | 1145 | public void setMarker(IMarker marker) { |
1144 | 1146 | setMarkers(Collections.singletonList(marker)); |
1145 | | - } |
1146 | | - /** |
1147 | | - * returns the marker that is set as a marker view for the chart |
| 1147 | + } |
1148 | 1148 |
|
| 1149 | + /** |
| 1150 | + * returns the marker that is set as a marker view for the chart |
1149 | 1151 | */ |
1150 | 1152 | public List<IMarker> getMarker() { |
1151 | 1153 | return mMarkers; |
@@ -1580,37 +1582,37 @@ public void setUnbindEnabled(boolean enabled) { |
1580 | 1582 | this.mUnbind = enabled; |
1581 | 1583 | } |
1582 | 1584 |
|
1583 | | - // region accessibility |
| 1585 | + // region accessibility |
1584 | 1586 |
|
1585 | | - /** |
1586 | | - * |
1587 | | - * @return accessibility description must be created for each chart |
1588 | | - */ |
1589 | | - public abstract String getAccessibilityDescription(); |
| 1587 | + /** |
| 1588 | + * |
| 1589 | + * @return accessibility description must be created for each chart |
| 1590 | + */ |
| 1591 | + public abstract String getAccessibilityDescription(); |
1590 | 1592 |
|
1591 | | - public String getAccessibilitySummaryDescription() { |
1592 | | - return accessibilitySummaryDescription; |
1593 | | - } |
| 1593 | + public String getAccessibilitySummaryDescription() { |
| 1594 | + return accessibilitySummaryDescription; |
| 1595 | + } |
1594 | 1596 |
|
1595 | | - public void setAccessibilitySummaryDescription(String accessibilitySummaryDescription) { |
1596 | | - this.accessibilitySummaryDescription = accessibilitySummaryDescription; |
1597 | | - } |
| 1597 | + public void setAccessibilitySummaryDescription(String accessibilitySummaryDescription) { |
| 1598 | + this.accessibilitySummaryDescription = accessibilitySummaryDescription; |
| 1599 | + } |
1598 | 1600 |
|
1599 | | - @Override |
1600 | | - public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { |
| 1601 | + @Override |
| 1602 | + public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { |
1601 | 1603 |
|
1602 | | - boolean completed = super.dispatchPopulateAccessibilityEvent(event); |
1603 | | - Log.d(LOG_TAG, "Dispatch called for Chart <View> and completed as " + completed); |
| 1604 | + boolean completed = super.dispatchPopulateAccessibilityEvent(event); |
| 1605 | + Log.d(LOG_TAG, "Dispatch called for Chart <View> and completed as " + completed); |
1604 | 1606 |
|
1605 | | - event.getText().add(getAccessibilityDescription()); |
| 1607 | + event.getText().add(getAccessibilityDescription()); |
1606 | 1608 |
|
1607 | | - // Add the user generated summary after the dynamic summary is complete. |
1608 | | - if (!TextUtils.isEmpty(this.getAccessibilitySummaryDescription())) { |
1609 | | - event.getText().add(this.getAccessibilitySummaryDescription()); |
1610 | | - } |
| 1609 | + // Add the user generated summary after the dynamic summary is complete. |
| 1610 | + if (!TextUtils.isEmpty(this.getAccessibilitySummaryDescription())) { |
| 1611 | + event.getText().add(this.getAccessibilitySummaryDescription()); |
| 1612 | + } |
1611 | 1613 |
|
1612 | | - return true; |
1613 | | - } |
| 1614 | + return true; |
| 1615 | + } |
1614 | 1616 |
|
1615 | | - // endregion |
| 1617 | + // endregion |
1616 | 1618 | } |
0 commit comments