auto-sync

This commit is contained in:
rusEfi 2014-11-15 12:03:13 -06:00
parent 9d3de521c3
commit 5c9804e473
1 changed files with 11 additions and 4 deletions

View File

@ -56,16 +56,23 @@ public class ChartScrollControl {
private void previousPage() {
if (index.intValue() > 0) {
index.decrementAndGet();
showChart();
} else if (index.intValue() == 0) {
// let's go to the last chart
index.set(ChartRepository.getInstance().getSize() - 1);
showChart();
}
}
private void showChart() {
listener.onDigitalChart(ChartRepository.getInstance().getChart(index.get()));
setInfoText(index);
}
}
private void nextPage() {
if (index.intValue() < ChartRepository.getInstance().getSize() - 1) {
index.incrementAndGet();
listener.onDigitalChart(ChartRepository.getInstance().getChart(index.get()));
setInfoText(index);
showChart();
}
}