style: lambda to explicit

This commit is contained in:
antonio 2023-06-21 10:51:20 +02:00
parent 76c53bd502
commit aee791b0c3
3 changed files with 36 additions and 19 deletions

View file

@ -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;
}