Making great progress with the "view as" option to toggle between list and grid mode. Currently only implemented in the album fragment. To add the functionality to other fragments just extend the AbsMainActivityRecyclerViewLayoutModeFragment class and implement its abstract methods (class name should be changed to something shorter soon). In future the artist and song fragments should extend that class.
This commit is contained in:
parent
280e8a15eb
commit
294f3fc5d0
14 changed files with 282 additions and 179 deletions
|
|
@ -52,11 +52,12 @@ public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder,
|
|||
|
||||
protected boolean usePalette = false;
|
||||
|
||||
public AlbumAdapter(@NonNull AppCompatActivity activity, ArrayList<Album> dataSet, @LayoutRes int itemLayoutRes, @Nullable CabHolder cabHolder) {
|
||||
public AlbumAdapter(@NonNull AppCompatActivity activity, ArrayList<Album> dataSet, @LayoutRes int itemLayoutRes, boolean usePalette, @Nullable CabHolder cabHolder) {
|
||||
super(activity, cabHolder, R.menu.menu_media_selection);
|
||||
this.activity = activity;
|
||||
this.dataSet = dataSet;
|
||||
this.itemLayoutRes = itemLayoutRes;
|
||||
this.usePalette = usePalette;
|
||||
|
||||
setHasStableIds(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public class HorizontalAlbumAdapter extends AlbumAdapter {
|
|||
public static final String TAG = AlbumAdapter.class.getSimpleName();
|
||||
|
||||
public HorizontalAlbumAdapter(@NonNull AppCompatActivity activity, ArrayList<Album> dataSet, @Nullable CabHolder cabHolder) {
|
||||
super(activity, dataSet, HorizontalAdapterHelper.LAYOUT_RES, cabHolder);
|
||||
super(activity, dataSet, HorizontalAdapterHelper.LAYOUT_RES, false, cabHolder);
|
||||
usePalette = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue