mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 02:13:33 +00:00
Start of work for a structural modification of the player
This commit is contained in:
parent
9fdc9ff44d
commit
0fbf3a4cdf
18 changed files with 900 additions and 484 deletions
|
|
@ -0,0 +1,34 @@
|
|||
package com.cappielloantonio.play.adapter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
|
||||
import com.cappielloantonio.play.ui.fragment.PlayerControllerFragment;
|
||||
import com.cappielloantonio.play.ui.fragment.PlayerQueueFragment;
|
||||
|
||||
public class PlayerBodyAdapter extends FragmentStateAdapter {
|
||||
private static final String TAG = "PlayerNowPlayingSongInfoAdapter";
|
||||
|
||||
public PlayerBodyAdapter(@NonNull Fragment fragment) {
|
||||
super(fragment);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment createFragment(int position) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
return new PlayerControllerFragment();
|
||||
case 1:
|
||||
return new PlayerQueueFragment();
|
||||
}
|
||||
|
||||
return new PlayerControllerFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
|
@ -27,15 +27,13 @@ public class PlayerSongQueueAdapter extends RecyclerView.Adapter<PlayerSongQueue
|
|||
private static final String TAG = "SongResultSearchAdapter";
|
||||
|
||||
private final LayoutInflater mInflater;
|
||||
private final PlayerBottomSheetFragment playerBottomSheetFragment;
|
||||
private final Context context;
|
||||
|
||||
private ListenableFuture<MediaBrowser> mediaBrowserListenableFuture;
|
||||
private List<Song> songs;
|
||||
|
||||
public PlayerSongQueueAdapter(Context context, PlayerBottomSheetFragment playerBottomSheetFragment) {
|
||||
public PlayerSongQueueAdapter(Context context) {
|
||||
this.context = context;
|
||||
this.playerBottomSheetFragment = playerBottomSheetFragment;
|
||||
this.mInflater = LayoutInflater.from(context);
|
||||
this.songs = new ArrayList<>();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue