aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorPatrik <patrik@ptjwebben.se>2020-02-01 20:22:46 +0100
committerPatrik <patrik@ptjwebben.se>2020-02-01 20:22:46 +0100
commit66208341d2be236c992e08720347ced5b110676f (patch)
treed9791d9ade99f6a0580a9d0bd1702ce29f27a42f /app/src/main/java
parent2c9056ac903ef4a87f714a66e12a0a43048a9154 (diff)
downloaddsub-66208341d2be236c992e08720347ced5b110676f.tar.gz
dsub-66208341d2be236c992e08720347ced5b110676f.tar.bz2
dsub-66208341d2be236c992e08720347ced5b110676f.zip
Decades where hardcoded to max out at 2010, this fixes it so the current decade is always max
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/SelectYearFragment.java3
1 files changed, 2 insertions, 1 deletions
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<String> {
@Override
public List<String> getObjects(MusicService musicService, boolean refresh, ProgressListener listener) throws Exception {
List<String> 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));
}