Removed the blurry shuffle icon from the song grid view. Fixes kabouzeid/phonograph-issue-tracker#30
This commit is contained in:
parent
5d4ed7af50
commit
68dd679824
6 changed files with 49 additions and 20 deletions
|
|
@ -25,6 +25,15 @@
|
|||
|
||||
<p>You can view the changelog dialog again at any time from the <i>about</i> section.</p>
|
||||
|
||||
<h3>Version 0.9.46 beta 6</h3>
|
||||
|
||||
<ol>
|
||||
<li><b>FIX:</b> Removed the blurry shuffle icon from the song grid view.</li>
|
||||
<li><b>IMPROVEMENT:</b> Cards in the about section now with 8dp instead of 16dp padding to match
|
||||
the material design guidelines.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<h3>Version 0.9.46 beta 5</h3>
|
||||
|
||||
<ol>
|
||||
|
|
|
|||
|
|
@ -178,11 +178,11 @@ public abstract class AbsMainActivityRecyclerViewFragment<A extends RecyclerView
|
|||
ButterKnife.unbind(this);
|
||||
}
|
||||
|
||||
protected int getDefaultGridColumnNumber() {
|
||||
protected int getDefaultGridColumnCount() {
|
||||
return getActivity().getResources().getInteger(R.integer.grid_num_columns);
|
||||
}
|
||||
|
||||
protected int getDefaultListColumnNumber() {
|
||||
protected int getDefaultListColumnCount() {
|
||||
return getActivity().getResources().getInteger(R.integer.list_num_columns);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.kabouzeid.gramophone.ui.fragments.mainactivityfragments;
|
||||
|
||||
import android.support.annotation.LayoutRes;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
|
||||
import com.kabouzeid.gramophone.R;
|
||||
|
|
@ -20,7 +21,8 @@ public abstract class AbsMainActivityRecyclerViewLayoutModeFragment<A extends Re
|
|||
return layoutMode;
|
||||
}
|
||||
|
||||
protected int getItemLayout() {
|
||||
@LayoutRes
|
||||
protected int getItemLayoutRes() {
|
||||
switch (getLayoutMode()) {
|
||||
case PreferenceUtil.LAYOUT_MODE_LIST:
|
||||
return R.layout.item_list;
|
||||
|
|
@ -31,14 +33,14 @@ public abstract class AbsMainActivityRecyclerViewLayoutModeFragment<A extends Re
|
|||
}
|
||||
}
|
||||
|
||||
protected int getColumnNumber() {
|
||||
protected int getColumnCount() {
|
||||
switch (getLayoutMode()) {
|
||||
case PreferenceUtil.LAYOUT_MODE_LIST:
|
||||
return getDefaultListColumnNumber();
|
||||
return getDefaultListColumnCount();
|
||||
case PreferenceUtil.LAYOUT_MODE_GRID:
|
||||
return getDefaultGridColumnNumber();
|
||||
return getDefaultGridColumnCount();
|
||||
default:
|
||||
return R.layout.item_list;
|
||||
return getDefaultListColumnCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public class AlbumViewFragment extends AbsMainActivityRecyclerViewLayoutModeFrag
|
|||
|
||||
@Override
|
||||
protected GridLayoutManager createLayoutManager() {
|
||||
return new GridLayoutManager(getActivity(), getColumnNumber());
|
||||
return new GridLayoutManager(getActivity(), getColumnCount());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
|
@ -25,7 +25,7 @@ public class AlbumViewFragment extends AbsMainActivityRecyclerViewLayoutModeFrag
|
|||
return new AlbumAdapter(
|
||||
getMainActivity(),
|
||||
AlbumLoader.getAllAlbums(getActivity()),
|
||||
getItemLayout(),
|
||||
getItemLayoutRes(),
|
||||
loadUsePalette(),
|
||||
getMainActivity());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class ArtistViewFragment extends AbsMainActivityRecyclerViewLayoutModeFra
|
|||
@NonNull
|
||||
@Override
|
||||
protected GridLayoutManager createLayoutManager() {
|
||||
return new GridLayoutManager(getActivity(), getColumnNumber());
|
||||
return new GridLayoutManager(getActivity(), getColumnCount());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
|
@ -27,7 +27,7 @@ public class ArtistViewFragment extends AbsMainActivityRecyclerViewLayoutModeFra
|
|||
return new ArtistAdapter(
|
||||
getMainActivity(),
|
||||
ArtistLoader.getAllArtists(getActivity()),
|
||||
getItemLayout(),
|
||||
getItemLayoutRes(),
|
||||
loadUsePalette(),
|
||||
getMainActivity());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,31 +5,49 @@ import android.support.v7.widget.GridLayoutManager;
|
|||
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.adapter.song.ShuffleButtonSongAdapter;
|
||||
import com.kabouzeid.gramophone.adapter.song.SongAdapter;
|
||||
import com.kabouzeid.gramophone.loader.SongLoader;
|
||||
import com.kabouzeid.gramophone.model.Song;
|
||||
import com.kabouzeid.gramophone.ui.activities.MainActivity;
|
||||
import com.kabouzeid.gramophone.util.PreferenceUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class SongViewFragment extends AbsMainActivityRecyclerViewLayoutModeFragment<ShuffleButtonSongAdapter, GridLayoutManager> {
|
||||
public class SongViewFragment extends AbsMainActivityRecyclerViewLayoutModeFragment<SongAdapter, GridLayoutManager> {
|
||||
|
||||
public static final String TAG = SongViewFragment.class.getSimpleName();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected GridLayoutManager createLayoutManager() {
|
||||
return new GridLayoutManager(getActivity(), getColumnNumber());
|
||||
return new GridLayoutManager(getActivity(), getColumnCount());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected ShuffleButtonSongAdapter createAdapter() {
|
||||
return new ShuffleButtonSongAdapter(
|
||||
getMainActivity(),
|
||||
SongLoader.getAllSongs(getActivity()),
|
||||
getItemLayout(),
|
||||
loadUsePalette(),
|
||||
getMainActivity());
|
||||
protected SongAdapter createAdapter() {
|
||||
MainActivity mainActivity = getMainActivity();
|
||||
ArrayList<Song> songs = SongLoader.getAllSongs(getActivity());
|
||||
int itemLayoutRes = getItemLayoutRes();
|
||||
boolean usePalette = loadUsePalette();
|
||||
|
||||
if (getLayoutMode() == PreferenceUtil.LAYOUT_MODE_LIST) {
|
||||
return new ShuffleButtonSongAdapter(
|
||||
mainActivity,
|
||||
songs,
|
||||
itemLayoutRes,
|
||||
usePalette,
|
||||
mainActivity);
|
||||
}
|
||||
return new SongAdapter(
|
||||
mainActivity,
|
||||
songs,
|
||||
itemLayoutRes,
|
||||
usePalette,
|
||||
mainActivity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue