refactor some code and remove useless comments
This commit is contained in:
parent
422aab0334
commit
e876a57d01
55 changed files with 51 additions and 202 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
package com.kabouzeid.gramophone.adapter;
|
package com.kabouzeid.gramophone.adapter;
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
@ -16,7 +15,6 @@ import com.kabouzeid.gramophone.glide.CustomPaletteTarget;
|
||||||
import com.kabouzeid.gramophone.glide.SongGlideRequest;
|
import com.kabouzeid.gramophone.glide.SongGlideRequest;
|
||||||
import com.kabouzeid.gramophone.misc.CustomFragmentStatePagerAdapter;
|
import com.kabouzeid.gramophone.misc.CustomFragmentStatePagerAdapter;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
import com.kabouzeid.gramophone.util.PreferenceUtil;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -24,9 +22,6 @@ import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import butterknife.Unbinder;
|
import butterknife.Unbinder;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class AlbumCoverPagerAdapter extends CustomFragmentStatePagerAdapter {
|
public class AlbumCoverPagerAdapter extends CustomFragmentStatePagerAdapter {
|
||||||
|
|
||||||
private List<Song> dataSet;
|
private List<Song> dataSet;
|
||||||
|
|
|
||||||
|
|
@ -64,15 +64,19 @@ public class GenreAdapter extends RecyclerView.Adapter<GenreAdapter.ViewHolder>
|
||||||
holder.separator.setVisibility(View.VISIBLE);
|
holder.separator.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holder.shortSeparator != null) {
|
if (holder.shortSeparator != null) {
|
||||||
holder.shortSeparator.setVisibility(View.GONE);
|
holder.shortSeparator.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holder.menu != null) {
|
if (holder.menu != null) {
|
||||||
holder.menu.setVisibility(View.GONE);
|
holder.menu.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holder.title != null) {
|
if (holder.title != null) {
|
||||||
holder.title.setText(genre.name);
|
holder.title.setText(genre.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holder.text != null) {
|
if (holder.text != null) {
|
||||||
holder.text.setText(MusicUtil.getGenreInfoString(activity, genre));
|
holder.text.setText(MusicUtil.getGenreInfoString(activity, genre));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ public class MusicLibraryPagerAdapter extends FragmentPagerAdapter {
|
||||||
if (mWeakFragment != null && mWeakFragment.get() != null) {
|
if (mWeakFragment != null && mWeakFragment.get() != null) {
|
||||||
return mWeakFragment.get();
|
return mWeakFragment.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return getItem(position);
|
return getItem(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,6 +74,7 @@ public class MusicLibraryPagerAdapter extends FragmentPagerAdapter {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return POSITION_NONE;
|
return POSITION_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90,6 +92,7 @@ public class MusicLibraryPagerAdapter extends FragmentPagerAdapter {
|
||||||
if (mWeakFragment != null) {
|
if (mWeakFragment != null) {
|
||||||
mWeakFragment.clear();
|
mWeakFragment.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
mFragmentArray.put(position, new WeakReference<>(mFragment));
|
mFragmentArray.put(position, new WeakReference<>(mFragment));
|
||||||
return mFragment;
|
return mFragment;
|
||||||
}
|
}
|
||||||
|
|
@ -97,8 +100,7 @@ public class MusicLibraryPagerAdapter extends FragmentPagerAdapter {
|
||||||
@Override
|
@Override
|
||||||
public Fragment getItem(final int position) {
|
public Fragment getItem(final int position) {
|
||||||
final Holder mCurrentHolder = mHolderList.get(position);
|
final Holder mCurrentHolder = mHolderList.get(position);
|
||||||
return Fragment.instantiate(mContext,
|
return Fragment.instantiate(mContext, mCurrentHolder.mClassName, mCurrentHolder.mParams);
|
||||||
mCurrentHolder.mClassName, mCurrentHolder.mParams);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -128,7 +130,6 @@ public class MusicLibraryPagerAdapter extends FragmentPagerAdapter {
|
||||||
if (mFragmentArray.size() == 0) return;
|
if (mFragmentArray.size() == 0) return;
|
||||||
|
|
||||||
HashMap<String, WeakReference<Fragment>> mappings = new HashMap<>(mFragmentArray.size());
|
HashMap<String, WeakReference<Fragment>> mappings = new HashMap<>(mFragmentArray.size());
|
||||||
|
|
||||||
for (int i = 0, size = mFragmentArray.size(); i < size; i++) {
|
for (int i = 0, size = mFragmentArray.size(); i < size; i++) {
|
||||||
WeakReference<Fragment> ref = mFragmentArray.valueAt(i);
|
WeakReference<Fragment> ref = mFragmentArray.valueAt(i);
|
||||||
Fragment fragment = ref.get();
|
Fragment fragment = ref.get();
|
||||||
|
|
@ -136,6 +137,7 @@ public class MusicLibraryPagerAdapter extends FragmentPagerAdapter {
|
||||||
mappings.put(fragment.getClass().getName(), ref);
|
mappings.put(fragment.getClass().getName(), ref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0, size = mHolderList.size(); i < size; i++) {
|
for (int i = 0, size = mHolderList.size(); i < size; i++) {
|
||||||
WeakReference<Fragment> ref = mappings.get(mHolderList.get(i).mClassName);
|
WeakReference<Fragment> ref = mappings.get(mHolderList.get(i).mClassName);
|
||||||
if (ref != null) {
|
if (ref != null) {
|
||||||
|
|
@ -166,8 +168,9 @@ public class MusicLibraryPagerAdapter extends FragmentPagerAdapter {
|
||||||
public static MusicFragments of(Class<?> cl) {
|
public static MusicFragments of(Class<?> cl) {
|
||||||
MusicFragments[] fragments = All.FRAGMENTS;
|
MusicFragments[] fragments = All.FRAGMENTS;
|
||||||
for (MusicFragments fragment : fragments) {
|
for (MusicFragments fragment : fragments) {
|
||||||
if (cl.equals(fragment.mFragmentClass))
|
if (cl.equals(fragment.mFragmentClass)) {
|
||||||
return fragment;
|
return fragment;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new IllegalArgumentException("Unknown music fragment " + cl);
|
throw new IllegalArgumentException("Unknown music fragment " + cl);
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,6 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class PlaylistAdapter extends AbsMultiSelectAdapter<PlaylistAdapter.ViewHolder, Playlist> {
|
public class PlaylistAdapter extends AbsMultiSelectAdapter<PlaylistAdapter.ViewHolder, Playlist> {
|
||||||
|
|
||||||
private static final int SMART_PLAYLIST = 0;
|
private static final int SMART_PLAYLIST = 0;
|
||||||
|
|
@ -112,6 +109,7 @@ public class PlaylistAdapter extends AbsMultiSelectAdapter<PlaylistAdapter.ViewH
|
||||||
if (playlist instanceof AbsSmartPlaylist) {
|
if (playlist instanceof AbsSmartPlaylist) {
|
||||||
return ((AbsSmartPlaylist) playlist).iconRes;
|
return ((AbsSmartPlaylist) playlist).iconRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
return MusicUtil.isFavoritePlaylist(activity, playlist) ? R.drawable.ic_favorite_white_24dp : R.drawable.ic_queue_music_white_24dp;
|
return MusicUtil.isFavoritePlaylist(activity, playlist) ? R.drawable.ic_favorite_white_24dp : R.drawable.ic_queue_music_white_24dp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -148,6 +146,7 @@ public class PlaylistAdapter extends AbsMultiSelectAdapter<PlaylistAdapter.ViewH
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selection.size() > 0) {
|
if (selection.size() > 0) {
|
||||||
DeletePlaylistDialog.create(selection).show(activity.getSupportFragmentManager(), "DELETE_PLAYLIST");
|
DeletePlaylistDialog.create(selection).show(activity.getSupportFragmentManager(), "DELETE_PLAYLIST");
|
||||||
}
|
}
|
||||||
|
|
@ -176,7 +175,6 @@ public class PlaylistAdapter extends AbsMultiSelectAdapter<PlaylistAdapter.ViewH
|
||||||
int failures = 0;
|
int failures = 0;
|
||||||
|
|
||||||
String dir = "";
|
String dir = "";
|
||||||
|
|
||||||
for (Playlist playlist : params[0]) {
|
for (Playlist playlist : params[0]) {
|
||||||
try {
|
try {
|
||||||
dir = PlaylistsUtil.savePlaylist(App.getInstance().getApplicationContext(), playlist).getParent();
|
dir = PlaylistsUtil.savePlaylist(App.getInstance().getApplicationContext(), playlist).getParent();
|
||||||
|
|
@ -212,11 +210,11 @@ public class PlaylistAdapter extends AbsMultiSelectAdapter<PlaylistAdapter.ViewH
|
||||||
songs.addAll(PlaylistSongLoader.getPlaylistSongList(activity, playlist.id));
|
songs.addAll(PlaylistSongLoader.getPlaylistSongList(activity, playlist.id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return songs;
|
return songs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ViewHolder extends MediaEntryViewHolder {
|
public class ViewHolder extends MediaEntryViewHolder {
|
||||||
|
|
||||||
public ViewHolder(@NonNull View itemView, int itemViewType) {
|
public ViewHolder(@NonNull View itemView, int itemViewType) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
|
||||||
|
|
@ -244,6 +242,7 @@ public class PlaylistAdapter extends AbsMultiSelectAdapter<PlaylistAdapter.ViewH
|
||||||
if (playlist instanceof LatestPlaylist) {
|
if (playlist instanceof LatestPlaylist) {
|
||||||
popupMenu.getMenu().findItem(R.id.action_clear_playlist).setVisible(false);
|
popupMenu.getMenu().findItem(R.id.action_clear_playlist).setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
popupMenu.setOnMenuItemClickListener(item -> {
|
popupMenu.setOnMenuItemClickListener(item -> {
|
||||||
if (item.getItemId() == R.id.action_clear_playlist) {
|
if (item.getItemId() == R.id.action_clear_playlist) {
|
||||||
if (playlist instanceof AbsSmartPlaylist) {
|
if (playlist instanceof AbsSmartPlaylist) {
|
||||||
|
|
@ -254,6 +253,7 @@ public class PlaylistAdapter extends AbsMultiSelectAdapter<PlaylistAdapter.ViewH
|
||||||
return PlaylistMenuHelper.handleMenuClick(
|
return PlaylistMenuHelper.handleMenuClick(
|
||||||
activity, dataSet.get(getAdapterPosition()), item);
|
activity, dataSet.get(getAdapterPosition()), item);
|
||||||
});
|
});
|
||||||
|
|
||||||
popupMenu.show();
|
popupMenu.show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,6 @@ import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.ViewHolder> {
|
public class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.ViewHolder> {
|
||||||
|
|
||||||
private static final int HEADER = 0;
|
private static final int HEADER = 0;
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,7 @@ import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder, Album> implements FastScrollRecyclerView.SectionedAdapter {
|
public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder, Album> implements FastScrollRecyclerView.SectionedAdapter {
|
||||||
|
|
||||||
protected final AppCompatActivity activity;
|
protected final AppCompatActivity activity;
|
||||||
protected List<Album> dataSet;
|
protected List<Album> dataSet;
|
||||||
|
|
||||||
|
|
@ -124,6 +120,7 @@ public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder,
|
||||||
if (holder.title != null) {
|
if (holder.title != null) {
|
||||||
holder.title.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
|
holder.title.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holder.text != null) {
|
if (holder.text != null) {
|
||||||
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
|
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
|
||||||
}
|
}
|
||||||
|
|
@ -144,10 +141,11 @@ public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder,
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onColorReady(int color) {
|
public void onColorReady(int color) {
|
||||||
if (usePalette)
|
if (usePalette) {
|
||||||
setColors(color, holder);
|
setColors(color, holder);
|
||||||
else
|
} else {
|
||||||
setColors(getDefaultFooterColor(), holder);
|
setColors(getDefaultFooterColor(), holder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -183,6 +181,7 @@ public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder,
|
||||||
for (Album album : albums) {
|
for (Album album : albums) {
|
||||||
songs.addAll(album.songs);
|
songs.addAll(album.songs);
|
||||||
}
|
}
|
||||||
|
|
||||||
return songs;
|
return songs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -206,7 +205,6 @@ public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder,
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ViewHolder extends MediaEntryViewHolder {
|
public class ViewHolder extends MediaEntryViewHolder {
|
||||||
|
|
||||||
public ViewHolder(@NonNull final View itemView) {
|
public ViewHolder(@NonNull final View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
setImageTransitionName(activity.getString(R.string.transition_album_art));
|
setImageTransitionName(activity.getString(R.string.transition_album_art));
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,7 @@ import com.kabouzeid.gramophone.util.MusicUtil;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class HorizontalAlbumAdapter extends AlbumAdapter {
|
public class HorizontalAlbumAdapter extends AlbumAdapter {
|
||||||
|
|
||||||
public HorizontalAlbumAdapter(@NonNull AppCompatActivity activity, List<Album> dataSet, boolean usePalette, @Nullable CabHolder cabHolder) {
|
public HorizontalAlbumAdapter(@NonNull AppCompatActivity activity, List<Album> dataSet, boolean usePalette, @Nullable CabHolder cabHolder) {
|
||||||
super(activity, dataSet, HorizontalAdapterHelper.LAYOUT_RES, usePalette, cabHolder);
|
super(activity, dataSet, HorizontalAdapterHelper.LAYOUT_RES, usePalette, cabHolder);
|
||||||
}
|
}
|
||||||
|
|
@ -44,6 +40,7 @@ public class HorizontalAlbumAdapter extends AlbumAdapter {
|
||||||
if (holder.title != null) {
|
if (holder.title != null) {
|
||||||
holder.title.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
|
holder.title.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holder.text != null) {
|
if (holder.text != null) {
|
||||||
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
|
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
|
||||||
}
|
}
|
||||||
|
|
@ -65,10 +62,11 @@ public class HorizontalAlbumAdapter extends AlbumAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onColorReady(int color) {
|
public void onColorReady(int color) {
|
||||||
if (usePalette)
|
if (usePalette) {
|
||||||
setColors(color, holder);
|
setColors(color, holder);
|
||||||
else
|
} else {
|
||||||
setColors(getAlbumArtistFooterColor(), holder);
|
setColors(getAlbumArtistFooterColor(), holder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,7 @@ import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class ArtistAdapter extends AbsMultiSelectAdapter<ArtistAdapter.ViewHolder, Artist> implements FastScrollRecyclerView.SectionedAdapter {
|
public class ArtistAdapter extends AbsMultiSelectAdapter<ArtistAdapter.ViewHolder, Artist> implements FastScrollRecyclerView.SectionedAdapter {
|
||||||
|
|
||||||
protected final AppCompatActivity activity;
|
protected final AppCompatActivity activity;
|
||||||
protected List<Artist> dataSet;
|
protected List<Artist> dataSet;
|
||||||
|
|
||||||
|
|
@ -103,11 +99,12 @@ public class ArtistAdapter extends AbsMultiSelectAdapter<ArtistAdapter.ViewHolde
|
||||||
if (holder.title != null) {
|
if (holder.title != null) {
|
||||||
holder.title.setText(artist.getName());
|
holder.title.setText(artist.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holder.text != null) {
|
if (holder.text != null) {
|
||||||
holder.text.setText(MusicUtil.getArtistInfoString(activity, artist));
|
holder.text.setText(MusicUtil.getArtistInfoString(activity, artist));
|
||||||
}
|
}
|
||||||
holder.itemView.setActivated(isChecked(artist));
|
|
||||||
|
|
||||||
|
holder.itemView.setActivated(isChecked(artist));
|
||||||
loadArtistImage(artist, holder);
|
loadArtistImage(artist, holder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,6 +114,7 @@ public class ArtistAdapter extends AbsMultiSelectAdapter<ArtistAdapter.ViewHolde
|
||||||
if (holder.title != null) {
|
if (holder.title != null) {
|
||||||
holder.title.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
|
holder.title.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holder.text != null) {
|
if (holder.text != null) {
|
||||||
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
|
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
|
||||||
}
|
}
|
||||||
|
|
@ -136,10 +134,11 @@ public class ArtistAdapter extends AbsMultiSelectAdapter<ArtistAdapter.ViewHolde
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onColorReady(int color) {
|
public void onColorReady(int color) {
|
||||||
if (usePalette)
|
if (usePalette) {
|
||||||
setColors(color, holder);
|
setColors(color, holder);
|
||||||
else
|
} else {
|
||||||
setColors(getDefaultFooterColor(), holder);
|
setColors(getDefaultFooterColor(), holder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -170,6 +169,7 @@ public class ArtistAdapter extends AbsMultiSelectAdapter<ArtistAdapter.ViewHolde
|
||||||
for (Artist artist : artists) {
|
for (Artist artist : artists) {
|
||||||
songs.addAll(artist.getSongs());
|
songs.addAll(artist.getSongs());
|
||||||
}
|
}
|
||||||
|
|
||||||
return songs;
|
return songs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -188,7 +188,6 @@ public class ArtistAdapter extends AbsMultiSelectAdapter<ArtistAdapter.ViewHolde
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ViewHolder extends MediaEntryViewHolder {
|
public class ViewHolder extends MediaEntryViewHolder {
|
||||||
|
|
||||||
public ViewHolder(@NonNull View itemView) {
|
public ViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
setImageTransitionName(activity.getString(R.string.transition_artist_image));
|
setImageTransitionName(activity.getString(R.string.transition_artist_image));
|
||||||
|
|
@ -202,10 +201,7 @@ public class ArtistAdapter extends AbsMultiSelectAdapter<ArtistAdapter.ViewHolde
|
||||||
if (isInQuickSelectMode()) {
|
if (isInQuickSelectMode()) {
|
||||||
toggleChecked(getAdapterPosition());
|
toggleChecked(getAdapterPosition());
|
||||||
} else {
|
} else {
|
||||||
Pair[] artistPairs = new Pair[]{
|
Pair[] artistPairs = new Pair[]{Pair.create(image, activity.getResources().getString(R.string.transition_artist_image))};
|
||||||
Pair.create(image,
|
|
||||||
activity.getResources().getString(R.string.transition_artist_image)
|
|
||||||
)};
|
|
||||||
NavigationUtil.goToArtist(activity, dataSet.get(getAdapterPosition()).getId(), artistPairs);
|
NavigationUtil.goToArtist(activity, dataSet.get(getAdapterPosition()).getId(), artistPairs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,6 @@ import com.kabouzeid.gramophone.interfaces.CabHolder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public abstract class AbsMultiSelectAdapter<VH extends RecyclerView.ViewHolder, I> extends RecyclerView.Adapter<VH> implements MaterialCab.Callback {
|
public abstract class AbsMultiSelectAdapter<VH extends RecyclerView.ViewHolder, I> extends RecyclerView.Adapter<VH> implements MaterialCab.Callback {
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final CabHolder cabHolder;
|
private final CabHolder cabHolder;
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,6 @@ import com.kabouzeid.gramophone.R;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class MediaEntryViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
|
public class MediaEntryViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
|
||||||
@Nullable
|
@Nullable
|
||||||
@BindView(R.id.image)
|
@BindView(R.id.image)
|
||||||
|
|
@ -74,6 +71,5 @@ public class MediaEntryViewHolder extends RecyclerView.ViewHolder implements Vie
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ public abstract class AbsOffsetSongAdapter extends SongAdapter {
|
||||||
View view = LayoutInflater.from(activity).inflate(R.layout.item_list_single_row, parent, false);
|
View view = LayoutInflater.from(activity).inflate(R.layout.item_list_single_row, parent, false);
|
||||||
return createViewHolder(view);
|
return createViewHolder(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.onCreateViewHolder(parent, viewType);
|
return super.onCreateViewHolder(parent, viewType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,6 +51,7 @@ public abstract class AbsOffsetSongAdapter extends SongAdapter {
|
||||||
@Override
|
@Override
|
||||||
public long getItemId(int position) {
|
public long getItemId(int position) {
|
||||||
position--;
|
position--;
|
||||||
|
|
||||||
if (position < 0) return -2;
|
if (position < 0) return -2;
|
||||||
return super.getItemId(position);
|
return super.getItemId(position);
|
||||||
}
|
}
|
||||||
|
|
@ -58,6 +60,7 @@ public abstract class AbsOffsetSongAdapter extends SongAdapter {
|
||||||
@Override
|
@Override
|
||||||
protected Song getIdentifier(int position) {
|
protected Song getIdentifier(int position) {
|
||||||
position--;
|
position--;
|
||||||
|
|
||||||
if (position < 0) return null;
|
if (position < 0) return null;
|
||||||
return super.getIdentifier(position);
|
return super.getIdentifier(position);
|
||||||
}
|
}
|
||||||
|
|
@ -82,7 +85,6 @@ public abstract class AbsOffsetSongAdapter extends SongAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ViewHolder extends SongAdapter.ViewHolder {
|
public class ViewHolder extends SongAdapter.ViewHolder {
|
||||||
|
|
||||||
public ViewHolder(@NonNull View itemView) {
|
public ViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,6 @@ import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class ArtistSongAdapter extends ArrayAdapter<Song> implements MaterialCab.Callback {
|
public class ArtistSongAdapter extends ArrayAdapter<Song> implements MaterialCab.Callback {
|
||||||
@Nullable
|
@Nullable
|
||||||
private final CabHolder cabHolder;
|
private final CabHolder cabHolder;
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,6 @@ import com.kabouzeid.gramophone.util.ViewUtil;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public class OrderablePlaylistSongAdapter extends PlaylistSongAdapter implements DraggableItemAdapter<OrderablePlaylistSongAdapter.ViewHolder> {
|
public class OrderablePlaylistSongAdapter extends PlaylistSongAdapter implements DraggableItemAdapter<OrderablePlaylistSongAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
|
@ -43,6 +40,7 @@ public class OrderablePlaylistSongAdapter extends PlaylistSongAdapter implements
|
||||||
@Override
|
@Override
|
||||||
public long getItemId(int position) {
|
public long getItemId(int position) {
|
||||||
position--;
|
position--;
|
||||||
|
|
||||||
if (position < 0) return -2;
|
if (position < 0) return -2;
|
||||||
return ((List<PlaylistSong>) (List) dataSet).get(position).idInPlayList; // important!
|
return ((List<PlaylistSong>) (List) dataSet).get(position).idInPlayList; // important!
|
||||||
}
|
}
|
||||||
|
|
@ -54,6 +52,7 @@ public class OrderablePlaylistSongAdapter extends PlaylistSongAdapter implements
|
||||||
RemoveFromPlaylistDialog.create((List<PlaylistSong>) (List) selection).show(activity.getSupportFragmentManager(), "ADD_PLAYLIST");
|
RemoveFromPlaylistDialog.create((List<PlaylistSong>) (List) selection).show(activity.getSupportFragmentManager(), "ADD_PLAYLIST");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onMultipleItemAction(menuItem, selection);
|
super.onMultipleItemAction(menuItem, selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,7 @@ import com.kabouzeid.gramophone.util.ViewUtil;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class PlayingQueueAdapter extends SongAdapter implements DraggableItemAdapter<PlayingQueueAdapter.ViewHolder> {
|
public class PlayingQueueAdapter extends SongAdapter implements DraggableItemAdapter<PlayingQueueAdapter.ViewHolder> {
|
||||||
|
|
||||||
private static final int HISTORY = 0;
|
private static final int HISTORY = 0;
|
||||||
private static final int CURRENT = 1;
|
private static final int CURRENT = 1;
|
||||||
private static final int UP_NEXT = 2;
|
private static final int UP_NEXT = 2;
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,7 @@ import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class PlaylistSongAdapter extends AbsOffsetSongAdapter {
|
public class PlaylistSongAdapter extends AbsOffsetSongAdapter {
|
||||||
|
|
||||||
public PlaylistSongAdapter(AppCompatActivity activity, @NonNull List<Song> dataSet, @LayoutRes int itemLayoutRes, boolean usePalette, @Nullable CabHolder cabHolder) {
|
public PlaylistSongAdapter(AppCompatActivity activity, @NonNull List<Song> dataSet, @LayoutRes int itemLayoutRes, boolean usePalette, @Nullable CabHolder cabHolder) {
|
||||||
super(activity, dataSet, itemLayoutRes, usePalette, cabHolder, false);
|
super(activity, dataSet, itemLayoutRes, usePalette, cabHolder, false);
|
||||||
setMultiSelectMenuRes(R.menu.menu_cannot_delete_single_songs_playlist_songs_selection);
|
setMultiSelectMenuRes(R.menu.menu_cannot_delete_single_songs_playlist_songs_selection);
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,6 @@ import com.kabouzeid.gramophone.model.Song;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class ShuffleButtonSongAdapter extends AbsOffsetSongAdapter {
|
public class ShuffleButtonSongAdapter extends AbsOffsetSongAdapter {
|
||||||
|
|
||||||
public ShuffleButtonSongAdapter(AppCompatActivity activity, List<Song> dataSet, @LayoutRes int itemLayoutRes, boolean usePalette, @Nullable CabHolder cabHolder) {
|
public ShuffleButtonSongAdapter(AppCompatActivity activity, List<Song> dataSet, @LayoutRes int itemLayoutRes, boolean usePalette, @Nullable CabHolder cabHolder) {
|
||||||
|
|
@ -63,7 +60,6 @@ public class ShuffleButtonSongAdapter extends AbsOffsetSongAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ViewHolder extends AbsOffsetSongAdapter.ViewHolder {
|
public class ViewHolder extends AbsOffsetSongAdapter.ViewHolder {
|
||||||
|
|
||||||
public ViewHolder(@NonNull View itemView) {
|
public ViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
}
|
}
|
||||||
|
|
@ -74,6 +70,7 @@ public class ShuffleButtonSongAdapter extends AbsOffsetSongAdapter {
|
||||||
MusicPlayerRemote.openAndShuffleQueue(dataSet, true);
|
MusicPlayerRemote.openAndShuffleQueue(dataSet, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onClick(v);
|
super.onClick(v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,6 @@ import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class SongAdapter extends AbsMultiSelectAdapter<SongAdapter.ViewHolder, Song> implements MaterialCab.Callback, FastScrollRecyclerView.SectionedAdapter {
|
public class SongAdapter extends AbsMultiSelectAdapter<SongAdapter.ViewHolder, Song> implements MaterialCab.Callback, FastScrollRecyclerView.SectionedAdapter {
|
||||||
|
|
||||||
protected final AppCompatActivity activity;
|
protected final AppCompatActivity activity;
|
||||||
|
|
@ -115,7 +112,6 @@ public class SongAdapter extends AbsMultiSelectAdapter<SongAdapter.ViewHolder, S
|
||||||
}
|
}
|
||||||
|
|
||||||
loadAlbumCover(song, holder);
|
loadAlbumCover(song, holder);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setColors(int color, ViewHolder holder) {
|
private void setColors(int color, ViewHolder holder) {
|
||||||
|
|
@ -124,6 +120,7 @@ public class SongAdapter extends AbsMultiSelectAdapter<SongAdapter.ViewHolder, S
|
||||||
if (holder.title != null) {
|
if (holder.title != null) {
|
||||||
holder.title.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
|
holder.title.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holder.text != null) {
|
if (holder.text != null) {
|
||||||
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
|
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
|
||||||
}
|
}
|
||||||
|
|
@ -144,10 +141,11 @@ public class SongAdapter extends AbsMultiSelectAdapter<SongAdapter.ViewHolder, S
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onColorReady(int color) {
|
public void onColorReady(int color) {
|
||||||
if (usePalette)
|
if (usePalette) {
|
||||||
setColors(color, holder);
|
setColors(color, holder);
|
||||||
else
|
} else {
|
||||||
setColors(getDefaultFooterColor(), holder);
|
setColors(getDefaultFooterColor(), holder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -216,6 +214,7 @@ public class SongAdapter extends AbsMultiSelectAdapter<SongAdapter.ViewHolder, S
|
||||||
if (menu == null) {
|
if (menu == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.setOnClickListener(new SongMenuHelper.OnClickSongMenu(activity) {
|
menu.setOnClickListener(new SongMenuHelper.OnClickSongMenu(activity) {
|
||||||
@Override
|
@Override
|
||||||
public Song getSong() {
|
public Song getSong() {
|
||||||
|
|
@ -253,6 +252,7 @@ public class SongAdapter extends AbsMultiSelectAdapter<SongAdapter.ViewHolder, S
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ public class AddToPlaylistDialog extends DialogFragment {
|
||||||
for (int i = 1; i < playlistNames.length; i++) {
|
for (int i = 1; i < playlistNames.length; i++) {
|
||||||
playlistNames[i] = playlists.get(i - 1).name;
|
playlistNames[i] = playlists.get(i - 1).name;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new MaterialDialog.Builder(getActivity())
|
return new MaterialDialog.Builder(getActivity())
|
||||||
.title(R.string.action_add_to_playlist)
|
.title(R.string.action_add_to_playlist)
|
||||||
.items(playlistNames)
|
.items(playlistNames)
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,6 @@ import com.kabouzeid.gramophone.model.Artist;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
import com.kabouzeid.gramophone.util.ArtistSignatureUtil;
|
import com.kabouzeid.gramophone.util.ArtistSignatureUtil;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class ArtistGlideRequest {
|
public class ArtistGlideRequest {
|
||||||
|
|
||||||
private static final DiskCacheStrategy DEFAULT_DISK_CACHE_STRATEGY = DiskCacheStrategy.ALL;
|
private static final DiskCacheStrategy DEFAULT_DISK_CACHE_STRATEGY = DiskCacheStrategy.ALL;
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,6 @@ import com.kabouzeid.gramophone.BuildConfig;
|
||||||
import com.kabouzeid.gramophone.helper.StackBlur;
|
import com.kabouzeid.gramophone.helper.StackBlur;
|
||||||
import com.kabouzeid.gramophone.util.ImageUtil;
|
import com.kabouzeid.gramophone.util.ImageUtil;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class BlurTransformation extends BitmapTransformation {
|
public class BlurTransformation extends BitmapTransformation {
|
||||||
public static final float DEFAULT_BLUR_RADIUS = 5f;
|
public static final float DEFAULT_BLUR_RADIUS = 5f;
|
||||||
|
|
||||||
|
|
@ -131,7 +128,6 @@ public class BlurTransformation extends BitmapTransformation {
|
||||||
rs.destroy();
|
rs.destroy();
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
|
|
||||||
} catch (RSRuntimeException e) {
|
} catch (RSRuntimeException e) {
|
||||||
// on some devices RenderScript.create() throws: android.support.v8.renderscript.RSRuntimeException: Error loading libRSSupport library
|
// on some devices RenderScript.create() throws: android.support.v8.renderscript.RSRuntimeException: Error loading libRSSupport library
|
||||||
if (BuildConfig.DEBUG) e.printStackTrace();
|
if (BuildConfig.DEBUG) e.printStackTrace();
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,9 @@ import com.kabouzeid.gramophone.glide.artistimage.ArtistImageLoader;
|
||||||
import com.kabouzeid.gramophone.glide.audiocover.AudioFileCover;
|
import com.kabouzeid.gramophone.glide.audiocover.AudioFileCover;
|
||||||
import com.kabouzeid.gramophone.glide.audiocover.AudioFileCoverLoader;
|
import com.kabouzeid.gramophone.glide.audiocover.AudioFileCoverLoader;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class CustomGlideModule implements GlideModule {
|
public class CustomGlideModule implements GlideModule {
|
||||||
@Override
|
@Override
|
||||||
public void applyOptions(Context context, GlideBuilder builder) {
|
public void applyOptions(Context context, GlideBuilder builder) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,6 @@ import com.kabouzeid.gramophone.glide.palette.BitmapPaletteTranscoder;
|
||||||
import com.kabouzeid.gramophone.glide.palette.BitmapPaletteWrapper;
|
import com.kabouzeid.gramophone.glide.palette.BitmapPaletteWrapper;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class SongGlideRequest {
|
public class SongGlideRequest {
|
||||||
public static final DiskCacheStrategy DEFAULT_DISK_CACHE_STRATEGY = DiskCacheStrategy.NONE;
|
public static final DiskCacheStrategy DEFAULT_DISK_CACHE_STRATEGY = DiskCacheStrategy.NONE;
|
||||||
public static final int DEFAULT_ERROR_IMAGE = R.drawable.default_album_art;
|
public static final int DEFAULT_ERROR_IMAGE = R.drawable.default_album_art;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
package com.kabouzeid.gramophone.glide.artistimage;
|
package com.kabouzeid.gramophone.glide.artistimage;
|
||||||
|
|
||||||
/**
|
|
||||||
* Used to define the artist cover
|
|
||||||
*/
|
|
||||||
public class AlbumCover {
|
public class AlbumCover {
|
||||||
|
|
||||||
private int year;
|
private int year;
|
||||||
|
|
@ -10,28 +7,23 @@ public class AlbumCover {
|
||||||
private String filePath;
|
private String filePath;
|
||||||
|
|
||||||
public AlbumCover(int year, String filePath) {
|
public AlbumCover(int year, String filePath) {
|
||||||
|
|
||||||
this.filePath = filePath;
|
this.filePath = filePath;
|
||||||
this.year = year;
|
this.year = year;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getYear() {
|
public int getYear() {
|
||||||
|
|
||||||
return year;
|
return year;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setYear(int year) {
|
public void setYear(int year) {
|
||||||
|
|
||||||
this.year = year;
|
this.year = year;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFilePath() {
|
public String getFilePath() {
|
||||||
|
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFilePath(String filePath) {
|
public void setFilePath(String filePath) {
|
||||||
|
|
||||||
this.filePath = filePath;
|
this.filePath = filePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,6 @@ import com.bumptech.glide.load.data.DataFetcher;
|
||||||
import com.kabouzeid.gramophone.glide.audiocover.AudioFileCoverUtils;
|
import com.kabouzeid.gramophone.glide.audiocover.AudioFileCoverUtils;
|
||||||
import com.kabouzeid.gramophone.util.ImageUtil;
|
import com.kabouzeid.gramophone.util.ImageUtil;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class ArtistImageFetcher implements DataFetcher<InputStream> {
|
public class ArtistImageFetcher implements DataFetcher<InputStream> {
|
||||||
|
|
||||||
private ArtistImage model;
|
private ArtistImage model;
|
||||||
|
|
@ -47,7 +44,6 @@ public class ArtistImageFetcher implements DataFetcher<InputStream> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private InputStream getMosaic(final List<AlbumCover> albumCovers) throws FileNotFoundException {
|
private InputStream getMosaic(final List<AlbumCover> albumCovers) throws FileNotFoundException {
|
||||||
|
|
||||||
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
||||||
|
|
||||||
int artistBitMapSize = 512;
|
int artistBitMapSize = 512;
|
||||||
|
|
@ -66,7 +62,6 @@ public class ArtistImageFetcher implements DataFetcher<InputStream> {
|
||||||
}
|
}
|
||||||
|
|
||||||
int nbImages = images.size();
|
int nbImages = images.size();
|
||||||
|
|
||||||
if (nbImages > 3) {
|
if (nbImages > 3) {
|
||||||
streams = new ArrayList<>(images.keySet());
|
streams = new ArrayList<>(images.keySet());
|
||||||
|
|
||||||
|
|
@ -74,6 +69,7 @@ public class ArtistImageFetcher implements DataFetcher<InputStream> {
|
||||||
for (int i = 1; i < nbImages && Math.pow(i, 2) <= nbImages; ++i) {
|
for (int i = 1; i < nbImages && Math.pow(i, 2) <= nbImages; ++i) {
|
||||||
divisor = i;
|
divisor = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
divisor += 1;
|
divisor += 1;
|
||||||
double nbTiles = Math.pow(divisor, 2);
|
double nbTiles = Math.pow(divisor, 2);
|
||||||
|
|
||||||
|
|
@ -81,14 +77,13 @@ public class ArtistImageFetcher implements DataFetcher<InputStream> {
|
||||||
divisor -= 1;
|
divisor -= 1;
|
||||||
nbTiles = Math.pow(divisor, 2);
|
nbTiles = Math.pow(divisor, 2);
|
||||||
}
|
}
|
||||||
final int resize = (artistBitMapSize / divisor) + 1;
|
|
||||||
|
|
||||||
|
final int resize = (artistBitMapSize / divisor) + 1;
|
||||||
final Bitmap bitmap = Bitmap.createBitmap(artistBitMapSize, artistBitMapSize, Bitmap.Config.RGB_565);
|
final Bitmap bitmap = Bitmap.createBitmap(artistBitMapSize, artistBitMapSize, Bitmap.Config.RGB_565);
|
||||||
final Canvas canvas = new Canvas(bitmap);
|
final Canvas canvas = new Canvas(bitmap);
|
||||||
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
|
|
||||||
for (int i = 0; i < streams.size() && i < nbTiles; ++i) {
|
for (int i = 0; i < streams.size() && i < nbTiles; ++i) {
|
||||||
final Bitmap bitmap1 = ImageUtil.resize(streams.get(i), resize, resize);
|
final Bitmap bitmap1 = ImageUtil.resize(streams.get(i), resize, resize);
|
||||||
canvas.drawBitmap(bitmap1, x, y, null);
|
canvas.drawBitmap(bitmap1, x, y, null);
|
||||||
|
|
@ -128,6 +123,7 @@ public class ArtistImageFetcher implements DataFetcher<InputStream> {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,6 +141,5 @@ public class ArtistImageFetcher implements DataFetcher<InputStream> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancel() {
|
public void cancel() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,6 @@ import com.bumptech.glide.load.model.GenericLoaderFactory;
|
||||||
import com.bumptech.glide.load.model.ModelLoader;
|
import com.bumptech.glide.load.model.ModelLoader;
|
||||||
import com.bumptech.glide.load.model.ModelLoaderFactory;
|
import com.bumptech.glide.load.model.ModelLoaderFactory;
|
||||||
import com.bumptech.glide.load.model.stream.StreamModelLoader;
|
import com.bumptech.glide.load.model.stream.StreamModelLoader;
|
||||||
import com.kabouzeid.gramophone.util.PreferenceUtil;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class ArtistImageLoader implements StreamModelLoader<ArtistImage> {
|
public class ArtistImageLoader implements StreamModelLoader<ArtistImage> {
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
package com.kabouzeid.gramophone.glide.audiocover;
|
package com.kabouzeid.gramophone.glide.audiocover;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class AudioFileCover {
|
public class AudioFileCover {
|
||||||
public final String filePath;
|
public final String filePath;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,6 @@ import java.io.InputStream;
|
||||||
import com.bumptech.glide.Priority;
|
import com.bumptech.glide.Priority;
|
||||||
import com.bumptech.glide.load.data.DataFetcher;
|
import com.bumptech.glide.load.data.DataFetcher;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class AudioFileCoverFetcher implements DataFetcher<InputStream> {
|
public class AudioFileCoverFetcher implements DataFetcher<InputStream> {
|
||||||
private final AudioFileCover model;
|
private final AudioFileCover model;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,6 @@ import com.bumptech.glide.load.model.stream.StreamModelLoader;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class AudioFileCoverLoader implements StreamModelLoader<AudioFileCover> {
|
public class AudioFileCoverLoader implements StreamModelLoader<AudioFileCover> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ public class AudioFileCoverUtils {
|
||||||
return new FileInputStream(cover);
|
return new FileInputStream(cover);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,6 @@ import com.bumptech.glide.load.engine.Resource;
|
||||||
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
|
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
|
||||||
import com.bumptech.glide.util.Util;
|
import com.bumptech.glide.util.Util;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class BitmapPaletteResource implements Resource<BitmapPaletteWrapper> {
|
public class BitmapPaletteResource implements Resource<BitmapPaletteWrapper> {
|
||||||
|
|
||||||
private final BitmapPaletteWrapper bitmapPaletteWrapper;
|
private final BitmapPaletteWrapper bitmapPaletteWrapper;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@ import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class HorizontalAdapterHelper {
|
public class HorizontalAdapterHelper {
|
||||||
public static final int LAYOUT_RES = R.layout.item_grid_card_horizontal;
|
public static final int LAYOUT_RES = R.layout.item_grid_card_horizontal;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,6 @@ import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class MusicPlayerRemote {
|
public class MusicPlayerRemote {
|
||||||
|
|
||||||
public static final String TAG = MusicPlayerRemote.class.getSimpleName();
|
public static final String TAG = MusicPlayerRemote.class.getSimpleName();
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,6 @@ import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class MusicProgressViewUpdateHelper extends Handler {
|
public class MusicProgressViewUpdateHelper extends Handler {
|
||||||
private static final int CMD_REFRESH_PROGRESS_VIEWS = 1;
|
private static final int CMD_REFRESH_PROGRESS_VIEWS = 1;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@ package com.kabouzeid.gramophone.helper;
|
||||||
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class PlayPauseButtonOnClickHandler implements View.OnClickListener {
|
public class PlayPauseButtonOnClickHandler implements View.OnClickListener {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,6 @@ import com.kabouzeid.gramophone.model.Song;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class ShuffleHelper {
|
public class ShuffleHelper {
|
||||||
|
|
||||||
public static void makeShuffleList(@NonNull List<Song> listToShuffle, final int current) {
|
public static void makeShuffleList(@NonNull List<Song> listToShuffle, final int current) {
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,6 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class PlaylistMenuHelper {
|
public class PlaylistMenuHelper {
|
||||||
public static boolean handleMenuClick(@NonNull AppCompatActivity activity, @NonNull final Playlist playlist, @NonNull MenuItem item) {
|
public static boolean handleMenuClick(@NonNull AppCompatActivity activity, @NonNull final Playlist playlist, @NonNull MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,6 @@ import com.kabouzeid.gramophone.model.Song;
|
||||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
import com.kabouzeid.gramophone.util.MusicUtil;
|
||||||
import com.kabouzeid.gramophone.util.NavigationUtil;
|
import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class SongMenuHelper {
|
public class SongMenuHelper {
|
||||||
public static final int MENU_RES = R.menu.menu_item_song;
|
public static final int MENU_RES = R.menu.menu_item_song;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,6 @@ import com.kabouzeid.gramophone.model.Song;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class SongsMenuHelper {
|
public class SongsMenuHelper {
|
||||||
public static boolean handleMenuClick(@NonNull FragmentActivity activity, @NonNull List<Song> songs, int menuItemId) {
|
public static boolean handleMenuClick(@NonNull FragmentActivity activity, @NonNull List<Song> songs, int menuItemId) {
|
||||||
switch (menuItemId) {
|
switch (menuItemId) {
|
||||||
|
|
@ -30,6 +27,7 @@ public class SongsMenuHelper {
|
||||||
DeleteSongsDialog.create(songs).show(activity.getSupportFragmentManager(), "DELETE_SONGS");
|
DeleteSongsDialog.create(songs).show(activity.getSupportFragmentManager(), "DELETE_SONGS");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,6 @@ import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.afollestad.materialcab.MaterialCab;
|
import com.afollestad.materialcab.MaterialCab;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public interface CabHolder {
|
public interface CabHolder {
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
package com.kabouzeid.gramophone.interfaces;
|
package com.kabouzeid.gramophone.interfaces;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public interface LoaderIds {
|
public interface LoaderIds {
|
||||||
int ALBUM_DETAIL_ACTIVITY = 1;
|
int ALBUM_DETAIL_ACTIVITY = 1;
|
||||||
int ARTIST_DETAIL_ACTIVITY = 2;
|
int ARTIST_DETAIL_ACTIVITY = 2;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
package com.kabouzeid.gramophone.interfaces;
|
package com.kabouzeid.gramophone.interfaces;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public interface MusicServiceEventListener {
|
public interface MusicServiceEventListener {
|
||||||
void onServiceConnected();
|
void onServiceConnected();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@ package com.kabouzeid.gramophone.interfaces;
|
||||||
|
|
||||||
import androidx.annotation.ColorInt;
|
import androidx.annotation.ColorInt;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Aidan Follestad (afollestad)
|
|
||||||
*/
|
|
||||||
public interface PaletteColorHolder {
|
public interface PaletteColorHolder {
|
||||||
|
|
||||||
@ColorInt
|
@ColorInt
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,6 @@ import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public abstract class DialogAsyncTask<Params, Progress, Result> extends WeakContextAsyncTask<Params, Progress, Result> {
|
public abstract class DialogAsyncTask<Params, Progress, Result> extends WeakContextAsyncTask<Params, Progress, Result> {
|
||||||
private final int delay;
|
private final int delay;
|
||||||
private WeakReference<Dialog> dialogWeakReference;
|
private WeakReference<Dialog> dialogWeakReference;
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@ package com.kabouzeid.gramophone.misc;
|
||||||
|
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public abstract class SimpleAnimatorListener implements Animator.AnimatorListener {
|
public abstract class SimpleAnimatorListener implements Animator.AnimatorListener {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationStart(Animator animation) {
|
public void onAnimationStart(Animator animation) {
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,16 @@ package com.kabouzeid.gramophone.misc;
|
||||||
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks;
|
import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks;
|
||||||
import com.github.ksoichiro.android.observablescrollview.ScrollState;
|
import com.github.ksoichiro.android.observablescrollview.ScrollState;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public abstract class SimpleObservableScrollViewCallbacks implements ObservableScrollViewCallbacks {
|
public abstract class SimpleObservableScrollViewCallbacks implements ObservableScrollViewCallbacks {
|
||||||
@Override
|
@Override
|
||||||
public void onScrollChanged(int i, boolean b, boolean b2) {
|
public void onScrollChanged(int i, boolean b, boolean b2) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDownMotionEvent() {
|
public void onDownMotionEvent() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
|
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,22 +2,16 @@ package com.kabouzeid.gramophone.misc;
|
||||||
|
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public abstract class SimpleOnSeekbarChangeListener implements SeekBar.OnSeekBarChangeListener {
|
public abstract class SimpleOnSeekbarChangeListener implements SeekBar.OnSeekBarChangeListener {
|
||||||
@Override
|
@Override
|
||||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,6 @@ import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public abstract class WeakContextAsyncTask<Params, Progress, Result> extends AsyncTask<Params, Progress, Result> {
|
public abstract class WeakContextAsyncTask<Params, Progress, Result> extends AsyncTask<Params, Progress, Result> {
|
||||||
private WeakReference<Context> contextWeakReference;
|
private WeakReference<Context> contextWeakReference;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,6 @@ import org.jellyfin.apiclient.model.dto.BaseItemDto;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class Album implements Parcelable {
|
public class Album implements Parcelable {
|
||||||
public List<Song> songs;
|
public List<Song> songs;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,6 @@ import org.jellyfin.apiclient.model.dto.BaseItemDto;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class Artist implements Parcelable {
|
public class Artist implements Parcelable {
|
||||||
public static final String UNKNOWN_ARTIST_DISPLAY_NAME = "Unknown Artist";
|
public static final String UNKNOWN_ARTIST_DISPLAY_NAME = "Unknown Artist";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,6 @@ import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class Playlist implements Parcelable {
|
public class Playlist implements Parcelable {
|
||||||
public final int id;
|
public final int id;
|
||||||
public final String name;
|
public final String name;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@ import android.os.Parcelable;
|
||||||
|
|
||||||
import org.jellyfin.apiclient.model.dto.BaseItemDto;
|
import org.jellyfin.apiclient.model.dto.BaseItemDto;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class Song implements Parcelable {
|
public class Song implements Parcelable {
|
||||||
public static final Song EMPTY_SONG = new Song("", "", -1, -1, -1, "", -1, "", "", "", "");
|
public static final Song EMPTY_SONG = new Song("", "", -1, -1, -1, "", -1, "", "", "", "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,6 @@ import com.kabouzeid.gramophone.model.Song;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public abstract class AbsSmartPlaylist extends Playlist {
|
public abstract class AbsSmartPlaylist extends Playlist {
|
||||||
@DrawableRes
|
@DrawableRes
|
||||||
public final int iconRes;
|
public final int iconRes;
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,6 @@ import com.kabouzeid.gramophone.provider.SongPlayCountStore;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class FrequentPlaylist extends AbsSmartPlaylist {
|
public class FrequentPlaylist extends AbsSmartPlaylist {
|
||||||
|
|
||||||
public FrequentPlaylist(@NonNull Context context) {
|
public FrequentPlaylist(@NonNull Context context) {
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,6 @@ import com.kabouzeid.gramophone.R;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class LatestPlaylist extends AbsSmartPlaylist {
|
public class LatestPlaylist extends AbsSmartPlaylist {
|
||||||
|
|
||||||
public LatestPlaylist(@NonNull Context context) {
|
public LatestPlaylist(@NonNull Context context) {
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,6 @@ import com.kabouzeid.gramophone.R;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Karim Abou Zeid (kabouzeid)
|
|
||||||
*/
|
|
||||||
public class RecentPlaylist extends AbsSmartPlaylist {
|
public class RecentPlaylist extends AbsSmartPlaylist {
|
||||||
|
|
||||||
public RecentPlaylist(@NonNull Context context) {
|
public RecentPlaylist(@NonNull Context context) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue