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>
|
<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>
|
<h3>Version 0.9.46 beta 5</h3>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
|
|
|
||||||
|
|
@ -178,11 +178,11 @@ public abstract class AbsMainActivityRecyclerViewFragment<A extends RecyclerView
|
||||||
ButterKnife.unbind(this);
|
ButterKnife.unbind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getDefaultGridColumnNumber() {
|
protected int getDefaultGridColumnCount() {
|
||||||
return getActivity().getResources().getInteger(R.integer.grid_num_columns);
|
return getActivity().getResources().getInteger(R.integer.grid_num_columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getDefaultListColumnNumber() {
|
protected int getDefaultListColumnCount() {
|
||||||
return getActivity().getResources().getInteger(R.integer.list_num_columns);
|
return getActivity().getResources().getInteger(R.integer.list_num_columns);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.kabouzeid.gramophone.ui.fragments.mainactivityfragments;
|
package com.kabouzeid.gramophone.ui.fragments.mainactivityfragments;
|
||||||
|
|
||||||
|
import android.support.annotation.LayoutRes;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
|
|
@ -20,7 +21,8 @@ public abstract class AbsMainActivityRecyclerViewLayoutModeFragment<A extends Re
|
||||||
return layoutMode;
|
return layoutMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getItemLayout() {
|
@LayoutRes
|
||||||
|
protected int getItemLayoutRes() {
|
||||||
switch (getLayoutMode()) {
|
switch (getLayoutMode()) {
|
||||||
case PreferenceUtil.LAYOUT_MODE_LIST:
|
case PreferenceUtil.LAYOUT_MODE_LIST:
|
||||||
return R.layout.item_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()) {
|
switch (getLayoutMode()) {
|
||||||
case PreferenceUtil.LAYOUT_MODE_LIST:
|
case PreferenceUtil.LAYOUT_MODE_LIST:
|
||||||
return getDefaultListColumnNumber();
|
return getDefaultListColumnCount();
|
||||||
case PreferenceUtil.LAYOUT_MODE_GRID:
|
case PreferenceUtil.LAYOUT_MODE_GRID:
|
||||||
return getDefaultGridColumnNumber();
|
return getDefaultGridColumnCount();
|
||||||
default:
|
default:
|
||||||
return R.layout.item_list;
|
return getDefaultListColumnCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ public class AlbumViewFragment extends AbsMainActivityRecyclerViewLayoutModeFrag
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected GridLayoutManager createLayoutManager() {
|
protected GridLayoutManager createLayoutManager() {
|
||||||
return new GridLayoutManager(getActivity(), getColumnNumber());
|
return new GridLayoutManager(getActivity(), getColumnCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
|
|
@ -25,7 +25,7 @@ public class AlbumViewFragment extends AbsMainActivityRecyclerViewLayoutModeFrag
|
||||||
return new AlbumAdapter(
|
return new AlbumAdapter(
|
||||||
getMainActivity(),
|
getMainActivity(),
|
||||||
AlbumLoader.getAllAlbums(getActivity()),
|
AlbumLoader.getAllAlbums(getActivity()),
|
||||||
getItemLayout(),
|
getItemLayoutRes(),
|
||||||
loadUsePalette(),
|
loadUsePalette(),
|
||||||
getMainActivity());
|
getMainActivity());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ public class ArtistViewFragment extends AbsMainActivityRecyclerViewLayoutModeFra
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected GridLayoutManager createLayoutManager() {
|
protected GridLayoutManager createLayoutManager() {
|
||||||
return new GridLayoutManager(getActivity(), getColumnNumber());
|
return new GridLayoutManager(getActivity(), getColumnCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
|
|
@ -27,7 +27,7 @@ public class ArtistViewFragment extends AbsMainActivityRecyclerViewLayoutModeFra
|
||||||
return new ArtistAdapter(
|
return new ArtistAdapter(
|
||||||
getMainActivity(),
|
getMainActivity(),
|
||||||
ArtistLoader.getAllArtists(getActivity()),
|
ArtistLoader.getAllArtists(getActivity()),
|
||||||
getItemLayout(),
|
getItemLayoutRes(),
|
||||||
loadUsePalette(),
|
loadUsePalette(),
|
||||||
getMainActivity());
|
getMainActivity());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,31 +5,49 @@ import android.support.v7.widget.GridLayoutManager;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.adapter.song.ShuffleButtonSongAdapter;
|
import com.kabouzeid.gramophone.adapter.song.ShuffleButtonSongAdapter;
|
||||||
|
import com.kabouzeid.gramophone.adapter.song.SongAdapter;
|
||||||
import com.kabouzeid.gramophone.loader.SongLoader;
|
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 com.kabouzeid.gramophone.util.PreferenceUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
* @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();
|
public static final String TAG = SongViewFragment.class.getSimpleName();
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected GridLayoutManager createLayoutManager() {
|
protected GridLayoutManager createLayoutManager() {
|
||||||
return new GridLayoutManager(getActivity(), getColumnNumber());
|
return new GridLayoutManager(getActivity(), getColumnCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
protected ShuffleButtonSongAdapter createAdapter() {
|
protected SongAdapter createAdapter() {
|
||||||
return new ShuffleButtonSongAdapter(
|
MainActivity mainActivity = getMainActivity();
|
||||||
getMainActivity(),
|
ArrayList<Song> songs = SongLoader.getAllSongs(getActivity());
|
||||||
SongLoader.getAllSongs(getActivity()),
|
int itemLayoutRes = getItemLayoutRes();
|
||||||
getItemLayout(),
|
boolean usePalette = loadUsePalette();
|
||||||
loadUsePalette(),
|
|
||||||
getMainActivity());
|
if (getLayoutMode() == PreferenceUtil.LAYOUT_MODE_LIST) {
|
||||||
|
return new ShuffleButtonSongAdapter(
|
||||||
|
mainActivity,
|
||||||
|
songs,
|
||||||
|
itemLayoutRes,
|
||||||
|
usePalette,
|
||||||
|
mainActivity);
|
||||||
|
}
|
||||||
|
return new SongAdapter(
|
||||||
|
mainActivity,
|
||||||
|
songs,
|
||||||
|
itemLayoutRes,
|
||||||
|
usePalette,
|
||||||
|
mainActivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue