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,7 +230,12 @@ 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() {
|
||||||
|
@Override
|
||||||
|
public void onLoadYear(int first) {
|
||||||
|
getLastAlbum(new DecadesCallback() {
|
||||||
|
@Override
|
||||||
|
public void onLoadYear(int last) {
|
||||||
if (first != -1 && last != -1) {
|
if (first != -1 && last != -1) {
|
||||||
List<Integer> decadeList = new ArrayList();
|
List<Integer> decadeList = new ArrayList();
|
||||||
|
|
||||||
|
|
@ -244,7 +249,10 @@ public class AlbumRepository {
|
||||||
|
|
||||||
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,7 +53,9 @@ 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() {
|
||||||
|
@Override
|
||||||
|
public void onRecovery(int index) {
|
||||||
if (position < index) {
|
if (position < index) {
|
||||||
holder.item.queueSongTitleTextView.setAlpha(0.2f);
|
holder.item.queueSongTitleTextView.setAlpha(0.2f);
|
||||||
holder.item.queueSongSubtitleTextView.setAlpha(0.2f);
|
holder.item.queueSongSubtitleTextView.setAlpha(0.2f);
|
||||||
|
|
@ -60,6 +63,7 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
|
||||||
holder.item.queueSongTitleTextView.setAlpha(1.0f);
|
holder.item.queueSongTitleTextView.setAlpha(1.0f);
|
||||||
holder.item.queueSongSubtitleTextView.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