aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@users.noreply.github.com>2020-02-07 22:08:09 -0800
committerGitHub <noreply@github.com>2020-02-07 22:08:09 -0800
commit0f22342867fd805fe5320c900e05da410216f2e1 (patch)
treed9791d9ade99f6a0580a9d0bd1702ce29f27a42f /app/src/main/java/github
parent2c9056ac903ef4a87f714a66e12a0a43048a9154 (diff)
parent66208341d2be236c992e08720347ced5b110676f (diff)
downloaddsub-0f22342867fd805fe5320c900e05da410216f2e1.tar.gz
dsub-0f22342867fd805fe5320c900e05da410216f2e1.tar.bz2
dsub-0f22342867fd805fe5320c900e05da410216f2e1.zip
Merge pull request #984 from Kakadua/fix-decadesmax2010
Fix for decades maxing out at 2010
Diffstat (limited to 'app/src/main/java/github')
-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));
}