Faster animation
This commit is contained in:
parent
0bb3188bc8
commit
b4e34db1d2
|
@ -41,6 +41,8 @@ import nodomain.freeyourgadget.gadgetbridge.util.DateTimeUtils;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
|
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
|
||||||
|
|
||||||
public abstract class AbstractChartFragment extends AbstractGBFragment {
|
public abstract class AbstractChartFragment extends AbstractGBFragment {
|
||||||
|
protected int ANIM_TIME = 350;
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(ActivitySleepChartFragment.class);
|
private static final Logger LOG = LoggerFactory.getLogger(ActivitySleepChartFragment.class);
|
||||||
|
|
||||||
private final Set<String> mIntentFilterActions;
|
private final Set<String> mIntentFilterActions;
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class ActivitySleepChartFragment extends AbstractChartFragment {
|
||||||
yAxisRight.setDrawTopYLabelEntry(false);
|
yAxisRight.setDrawTopYLabelEntry(false);
|
||||||
yAxisRight.setTextColor(CHART_TEXT_COLOR);
|
yAxisRight.setTextColor(CHART_TEXT_COLOR);
|
||||||
|
|
||||||
// refreshIfVisible();
|
// refresh immediately instead of use refreshIfVisible(), for perceived performance
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ public class ActivitySleepChartFragment extends AbstractChartFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void renderCharts() {
|
protected void renderCharts() {
|
||||||
mChart.animateX(500, Easing.EasingOption.EaseInOutQuart);
|
mChart.animateX(ANIM_TIME, Easing.EasingOption.EaseInOutQuart);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setupLegend(Chart chart) {
|
protected void setupLegend(Chart chart) {
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class SleepChartFragment extends AbstractChartFragment {
|
||||||
setupActivityChart();
|
setupActivityChart();
|
||||||
setupSleepAmountChart();
|
setupSleepAmountChart();
|
||||||
|
|
||||||
// refreshIfVisible();
|
// refresh immediately instead of use refreshIfVisible(), for perceived performance
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
return rootView;
|
return rootView;
|
||||||
|
@ -177,7 +177,7 @@ public class SleepChartFragment extends AbstractChartFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void renderCharts() {
|
protected void renderCharts() {
|
||||||
mActivityChart.animateX(500, Easing.EasingOption.EaseInOutQuart);
|
mActivityChart.animateX(ANIM_TIME, Easing.EasingOption.EaseInOutQuart);
|
||||||
mSleepAmountChart.invalidate();
|
mSleepAmountChart.invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -137,7 +137,7 @@ public class WeekStepsChartFragment extends AbstractChartFragment {
|
||||||
setupWeekStepsChart();
|
setupWeekStepsChart();
|
||||||
setupTodayStepsChart();
|
setupTodayStepsChart();
|
||||||
|
|
||||||
// refreshIfVisible();
|
// refresh immediately instead of use refreshIfVisible(), for perceived performance
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
return rootView;
|
return rootView;
|
||||||
|
|
Loading…
Reference in New Issue