mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 02:13:33 +00:00
style: lambda to explicit
This commit is contained in:
parent
76c53bd502
commit
aee791b0c3
3 changed files with 36 additions and 19 deletions
|
|
@ -230,21 +230,29 @@ public class AlbumRepository {
|
|||
public MutableLiveData<List<Integer>> getDecades() {
|
||||
MutableLiveData<List<Integer>> decades = new MutableLiveData<>();
|
||||
|
||||
getFirstAlbum(first -> getLastAlbum(last -> {
|
||||
if (first != -1 && last != -1) {
|
||||
List<Integer> decadeList = new ArrayList();
|
||||
getFirstAlbum(new DecadesCallback() {
|
||||
@Override
|
||||
public void onLoadYear(int first) {
|
||||
getLastAlbum(new DecadesCallback() {
|
||||
@Override
|
||||
public void onLoadYear(int last) {
|
||||
if (first != -1 && last != -1) {
|
||||
List<Integer> decadeList = new ArrayList();
|
||||
|
||||
int startDecade = first - (first % 10);
|
||||
int lastDecade = last - (last % 10);
|
||||
int startDecade = first - (first % 10);
|
||||
int lastDecade = last - (last % 10);
|
||||
|
||||
while (startDecade <= lastDecade) {
|
||||
decadeList.add(startDecade);
|
||||
startDecade = startDecade + 10;
|
||||
}
|
||||
while (startDecade <= lastDecade) {
|
||||
decadeList.add(startDecade);
|
||||
startDecade = startDecade + 10;
|
||||
}
|
||||
|
||||
decades.setValue(decadeList);
|
||||
decades.setValue(decadeList);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
return decades;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue