From 66208341d2be236c992e08720347ced5b110676f Mon Sep 17 00:00:00 2001 From: Patrik Date: Sat, 1 Feb 2020 20:22:46 +0100 Subject: Decades where hardcoded to max out at 2010, this fixes it so the current decade is always max --- .../java/github/daneren2005/dsub/fragments/SelectYearFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectYearFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectYearFragment.java index 14237d22..ce1e5548 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectYearFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectYearFragment.java @@ -21,6 +21,7 @@ import android.view.MenuInflater; import android.view.MenuItem; import java.util.ArrayList; +import java.util.Calendar; import java.util.List; import github.daneren2005.dsub.R; @@ -53,7 +54,7 @@ public class SelectYearFragment extends SelectRecyclerFragment { @Override public List getObjects(MusicService musicService, boolean refresh, ProgressListener listener) throws Exception { List decades = new ArrayList<>(); - for(int i = 2010; i >= 1800; i -= 10) { + for(int i = (int)(Math.ceil(Calendar.getInstance().get(Calendar.YEAR) / 10) * 10); i >= 1800; i -= 10) { decades.add(String.valueOf(i)); } -- cgit v1.2.3