1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-26 10:35:50 +01:00

Better handling of end of summary items list

This commit is contained in:
vanous 2020-08-26 21:12:54 +02:00
parent 723bd6fb6e
commit 39a472216a

View File

@ -119,10 +119,11 @@ public class ActivitySummaryDetail extends AbstractGBActivity {
layout.setOnTouchListener(new SwipeEvents(this) { layout.setOnTouchListener(new SwipeEvents(this) {
@Override @Override
public void onSwipeRight() { public void onSwipeRight() {
currentItem = items.getNextItem(); BaseActivitySummary newItem = items.getNextItem();
if (currentItem != null) { if (newItem != null) {
makeSummaryHeader(currentItem); currentItem = newItem;
makeSummaryContent(currentItem); makeSummaryHeader(newItem);
makeSummaryContent(newItem);
layout.startAnimation(animFadeRight); layout.startAnimation(animFadeRight);
} else { } else {
@ -132,10 +133,11 @@ public class ActivitySummaryDetail extends AbstractGBActivity {
@Override @Override
public void onSwipeLeft() { public void onSwipeLeft() {
currentItem = items.getPrevItem(); BaseActivitySummary newItem = items.getPrevItem();
if (currentItem != null) { if (newItem != null) {
makeSummaryHeader(currentItem); currentItem = newItem;
makeSummaryContent(currentItem); makeSummaryHeader(newItem);
makeSummaryContent(newItem);
layout.startAnimation(animFadeLeft); layout.startAnimation(animFadeLeft);
} else { } else {
layout.startAnimation(animBounceLeft); layout.startAnimation(animBounceLeft);