mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03: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() {
|
public MutableLiveData<List<Integer>> getDecades() {
|
||||||
MutableLiveData<List<Integer>> decades = new MutableLiveData<>();
|
MutableLiveData<List<Integer>> decades = new MutableLiveData<>();
|
||||||
|
|
||||||
getFirstAlbum(first -> getLastAlbum(last -> {
|
getFirstAlbum(new DecadesCallback() {
|
||||||
if (first != -1 && last != -1) {
|
@Override
|
||||||
List<Integer> decadeList = new ArrayList();
|
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 startDecade = first - (first % 10);
|
||||||
int lastDecade = last - (last % 10);
|
int lastDecade = last - (last % 10);
|
||||||
|
|
||||||
while (startDecade <= lastDecade) {
|
while (startDecade <= lastDecade) {
|
||||||
decadeList.add(startDecade);
|
decadeList.add(startDecade);
|
||||||
startDecade = startDecade + 10;
|
startDecade = startDecade + 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
decades.setValue(decadeList);
|
decades.setValue(decadeList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}));
|
});
|
||||||
|
|
||||||
return decades;
|
return decades;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import com.cappielloantonio.tempo.R;
|
||||||
import com.cappielloantonio.tempo.databinding.ItemPlayerQueueSongBinding;
|
import com.cappielloantonio.tempo.databinding.ItemPlayerQueueSongBinding;
|
||||||
import com.cappielloantonio.tempo.glide.CustomGlideRequest;
|
import com.cappielloantonio.tempo.glide.CustomGlideRequest;
|
||||||
import com.cappielloantonio.tempo.interfaces.ClickCallback;
|
import com.cappielloantonio.tempo.interfaces.ClickCallback;
|
||||||
|
import com.cappielloantonio.tempo.interfaces.MediaIndexCallback;
|
||||||
import com.cappielloantonio.tempo.service.MediaManager;
|
import com.cappielloantonio.tempo.service.MediaManager;
|
||||||
import com.cappielloantonio.tempo.subsonic.models.Child;
|
import com.cappielloantonio.tempo.subsonic.models.Child;
|
||||||
import com.cappielloantonio.tempo.util.Constants;
|
import com.cappielloantonio.tempo.util.Constants;
|
||||||
|
|
@ -52,13 +53,16 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
|
||||||
.build()
|
.build()
|
||||||
.into(holder.item.queueSongCoverImageView);
|
.into(holder.item.queueSongCoverImageView);
|
||||||
|
|
||||||
MediaManager.getCurrentIndex(mediaBrowserListenableFuture, index -> {
|
MediaManager.getCurrentIndex(mediaBrowserListenableFuture, new MediaIndexCallback() {
|
||||||
if (position < index) {
|
@Override
|
||||||
holder.item.queueSongTitleTextView.setAlpha(0.2f);
|
public void onRecovery(int index) {
|
||||||
holder.item.queueSongSubtitleTextView.setAlpha(0.2f);
|
if (position < index) {
|
||||||
} else {
|
holder.item.queueSongTitleTextView.setAlpha(0.2f);
|
||||||
holder.item.queueSongTitleTextView.setAlpha(1.0f);
|
holder.item.queueSongSubtitleTextView.setAlpha(0.2f);
|
||||||
holder.item.queueSongSubtitleTextView.setAlpha(1.0f);
|
} else {
|
||||||
|
holder.item.queueSongTitleTextView.setAlpha(1.0f);
|
||||||
|
holder.item.queueSongSubtitleTextView.setAlpha(1.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,12 @@ public class HomeTabRadioFragment extends Fragment implements ClickCallback, Rad
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInternetRadioStationLongClick(Bundle bundle) {
|
public void onInternetRadioStationLongClick(Bundle bundle) {
|
||||||
RadioEditorDialog dialog = new RadioEditorDialog(() -> radioViewModel.getInternetRadioStations(getViewLifecycleOwner()));
|
RadioEditorDialog dialog = new RadioEditorDialog(new RadioCallback() {
|
||||||
|
@Override
|
||||||
|
public void onDismiss() {
|
||||||
|
radioViewModel.getInternetRadioStations(getViewLifecycleOwner());
|
||||||
|
}
|
||||||
|
});
|
||||||
dialog.setArguments(bundle);
|
dialog.setArguments(bundle);
|
||||||
dialog.show(activity.getSupportFragmentManager(), null);
|
dialog.show(activity.getSupportFragmentManager(), null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue