mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
fix: fix click on mediaitem
This commit is contained in:
parent
1d65a79c20
commit
c0a665c00a
2 changed files with 7 additions and 3 deletions
|
|
@ -114,7 +114,7 @@ public class SongHorizontalAdapter extends RecyclerView.Adapter<SongHorizontalAd
|
|||
public void onClick() {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putParcelableArrayList(Constants.TRACKS_OBJECT, new ArrayList<>(MusicUtil.limitPlayableMedia(songs, getBindingAdapterPosition())));
|
||||
bundle.putInt(Constants.ITEM_POSITION, MusicUtil.getPlayableMediaPosition(getBindingAdapterPosition()));
|
||||
bundle.putInt(Constants.ITEM_POSITION, MusicUtil.getPlayableMediaPosition(songs, getBindingAdapterPosition()));
|
||||
|
||||
click.onMediaClick(bundle);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -271,8 +271,12 @@ public class MusicUtil {
|
|||
return toLimit;
|
||||
}
|
||||
|
||||
public static int getPlayableMediaPosition(int initialPosition) {
|
||||
return Math.min(initialPosition, Constants.PRE_PLAYABLE_MEDIA);
|
||||
public static int getPlayableMediaPosition(List<Child> toLimit, int position) {
|
||||
if (!toLimit.isEmpty() && toLimit.size() > Constants.PLAYABLE_MEDIA_LIMIT) {
|
||||
return Math.min(position, Constants.PRE_PLAYABLE_MEDIA);
|
||||
}
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
private static ConnectivityManager getConnectivityManager() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue