mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 23:13:36 +00:00
Start of work for a structural modification of the player
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user