New shadow + more infos songs and artists
This commit is contained in:
parent
eaa534c276
commit
b293123603
32 changed files with 272 additions and 179 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
package com.kabouzeid.gramophone;
|
package com.kabouzeid.gramophone;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
|
|
@ -24,42 +23,26 @@ public class App extends Application {
|
||||||
|
|
||||||
public static Bus bus = new Bus(ThreadEnforcer.MAIN);
|
public static Bus bus = new Bus(ThreadEnforcer.MAIN);
|
||||||
|
|
||||||
private MusicPlayerRemote playerRemote;
|
|
||||||
private int appTheme;
|
private int appTheme;
|
||||||
private SharedPreferences defaultSharedPreferences;
|
|
||||||
private RequestQueue requestQueue;
|
private RequestQueue requestQueue;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
Fabric.with(this, new Crashlytics());
|
Fabric.with(this, new Crashlytics());
|
||||||
}
|
MusicPlayerRemote.init(this);
|
||||||
|
|
||||||
public MusicPlayerRemote getMusicPlayerRemote() {
|
|
||||||
if (playerRemote == null) {
|
|
||||||
playerRemote = new MusicPlayerRemote(this);
|
|
||||||
playerRemote.restorePreviousState();
|
|
||||||
}
|
|
||||||
return playerRemote;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAppTheme() {
|
public int getAppTheme() {
|
||||||
if (appTheme == 0) {
|
if (appTheme == 0) {
|
||||||
appTheme = getDefaultSharedPreferences().getInt(AppKeys.SP_THEME, R.style.Theme_MaterialMusic);
|
appTheme = PreferenceManager.getDefaultSharedPreferences(this).getInt(AppKeys.SP_THEME, R.style.Theme_MaterialMusic);
|
||||||
}
|
}
|
||||||
return appTheme;
|
return appTheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SharedPreferences getDefaultSharedPreferences() {
|
|
||||||
if (defaultSharedPreferences == null) {
|
|
||||||
defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
|
||||||
}
|
|
||||||
return defaultSharedPreferences;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAppTheme(int appTheme) {
|
public void setAppTheme(int appTheme) {
|
||||||
this.appTheme = appTheme;
|
this.appTheme = appTheme;
|
||||||
defaultSharedPreferences.edit().putInt(AppKeys.SP_THEME, appTheme).apply();
|
PreferenceManager.getDefaultSharedPreferences(this).edit().putInt(AppKeys.SP_THEME, appTheme).apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isTablet() {
|
public boolean isTablet() {
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,12 @@ public class ArtistViewListAdapter extends ArrayAdapter<Artist> {
|
||||||
convertView = LayoutInflater.from(context).inflate(R.layout.item_artist_view, parent, false);
|
convertView = LayoutInflater.from(context).inflate(R.layout.item_artist_view, parent, false);
|
||||||
}
|
}
|
||||||
final TextView artistName = (TextView) convertView.findViewById(R.id.artist_name);
|
final TextView artistName = (TextView) convertView.findViewById(R.id.artist_name);
|
||||||
|
final TextView artistInfo = (TextView) convertView.findViewById(R.id.artist_info);
|
||||||
final ImageView artistArt = (ImageView) convertView.findViewById(R.id.artist_image);
|
final ImageView artistArt = (ImageView) convertView.findViewById(R.id.artist_image);
|
||||||
|
|
||||||
artistName.setText(artist.name);
|
artistName.setText(artist.name);
|
||||||
|
artistInfo.setText(artist.getSubTitle());
|
||||||
|
|
||||||
artistArt.setImageResource(R.drawable.default_artist_image);
|
artistArt.setImageResource(R.drawable.default_artist_image);
|
||||||
|
|
||||||
LastFMArtistThumbnailUrlLoader.loadArtistThumbnailUrl(context, artist.name, false, new LastFMArtistThumbnailUrlLoader.ArtistThumbnailUrlLoaderCallback() {
|
LastFMArtistThumbnailUrlLoader.loadArtistThumbnailUrl(context, artist.name, false, new LastFMArtistThumbnailUrlLoader.ArtistThumbnailUrlLoaderCallback() {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import android.widget.TextView;
|
||||||
import com.kabouzeid.gramophone.App;
|
import com.kabouzeid.gramophone.App;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.adapter.songadapter.SongAdapter;
|
import com.kabouzeid.gramophone.adapter.songadapter.SongAdapter;
|
||||||
|
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.kabouzeid.gramophone.helper.SongDetailDialogHelper;
|
import com.kabouzeid.gramophone.helper.SongDetailDialogHelper;
|
||||||
import com.kabouzeid.gramophone.loader.SongFilePathLoader;
|
import com.kabouzeid.gramophone.loader.SongFilePathLoader;
|
||||||
import com.kabouzeid.gramophone.misc.AppKeys;
|
import com.kabouzeid.gramophone.misc.AppKeys;
|
||||||
|
|
@ -49,7 +50,7 @@ public class PlayingQueueAdapter extends ArrayAdapter<Song> {
|
||||||
final ImageView overflowButton = (ImageView) convertView.findViewById(R.id.menu);
|
final ImageView overflowButton = (ImageView) convertView.findViewById(R.id.menu);
|
||||||
|
|
||||||
title.setText(song.title);
|
title.setText(song.title);
|
||||||
if (app.getMusicPlayerRemote().getPosition() == position) {
|
if (MusicPlayerRemote.getPosition() == position) {
|
||||||
playingIndicator.setVisibility(View.VISIBLE);
|
playingIndicator.setVisibility(View.VISIBLE);
|
||||||
playingIndicator.setImageResource(R.drawable.ic_speaker_white_48dp);
|
playingIndicator.setImageResource(R.drawable.ic_speaker_white_48dp);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import android.widget.TextView;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.model.SearchEntry;
|
import com.kabouzeid.gramophone.model.SearchEntry;
|
||||||
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
import com.kabouzeid.gramophone.ui.activities.SearchActivity;
|
import com.kabouzeid.gramophone.ui.activities.SearchActivity;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -42,6 +43,11 @@ public class SearchAdapter extends ArrayAdapter<SearchEntry> {
|
||||||
subTitle.setVisibility(View.GONE);
|
subTitle.setVisibility(View.GONE);
|
||||||
imageView.setVisibility(View.GONE);
|
imageView.setVisibility(View.GONE);
|
||||||
convertView.setBackgroundColor(getContext().getResources().getColor(R.color.materialmusic_default_bar_color));
|
convertView.setBackgroundColor(getContext().getResources().getColor(R.color.materialmusic_default_bar_color));
|
||||||
|
} else if (item instanceof Song) {
|
||||||
|
title.setTypeface(null, Typeface.NORMAL);
|
||||||
|
subTitle.setVisibility(View.VISIBLE);
|
||||||
|
imageView.setVisibility(View.GONE);
|
||||||
|
convertView.setBackgroundColor(Color.TRANSPARENT);
|
||||||
} else {
|
} else {
|
||||||
title.setTypeface(null, Typeface.NORMAL);
|
title.setTypeface(null, Typeface.NORMAL);
|
||||||
subTitle.setVisibility(View.VISIBLE);
|
subTitle.setVisibility(View.VISIBLE);
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ public class SongViewListAdapter extends SongAdapter {
|
||||||
convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_song_view, parent, false);
|
convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_song_view, parent, false);
|
||||||
}
|
}
|
||||||
TextView songTitle = (TextView) convertView.findViewById(R.id.song_title);
|
TextView songTitle = (TextView) convertView.findViewById(R.id.song_title);
|
||||||
|
TextView songInfo = (TextView) convertView.findViewById(R.id.song_info);
|
||||||
final ImageView albumArt = (ImageView) convertView.findViewById(R.id.album_art);
|
final ImageView albumArt = (ImageView) convertView.findViewById(R.id.album_art);
|
||||||
ImageView overflowButton = (ImageView) convertView.findViewById(R.id.menu);
|
ImageView overflowButton = (ImageView) convertView.findViewById(R.id.menu);
|
||||||
|
|
||||||
|
|
@ -80,6 +81,8 @@ public class SongViewListAdapter extends SongAdapter {
|
||||||
});
|
});
|
||||||
|
|
||||||
songTitle.setText(song.title);
|
songTitle.setText(song.title);
|
||||||
|
songInfo.setText(song.getSubTitle());
|
||||||
|
|
||||||
Picasso.with(getContext())
|
Picasso.with(getContext())
|
||||||
.load(MusicUtil.getAlbumArtUri(song.albumId))
|
.load(MusicUtil.getAlbumArtUri(song.albumId))
|
||||||
.placeholder(R.drawable.default_album_art)
|
.placeholder(R.drawable.default_album_art)
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.App;
|
import com.kabouzeid.gramophone.App;
|
||||||
|
|
@ -24,94 +25,93 @@ import java.util.List;
|
||||||
public class MusicPlayerRemote {
|
public class MusicPlayerRemote {
|
||||||
private static final String TAG = MusicPlayerRemote.class.getSimpleName();
|
private static final String TAG = MusicPlayerRemote.class.getSimpleName();
|
||||||
|
|
||||||
private App app;
|
private static int position = -1;
|
||||||
|
|
||||||
private int position = -1;
|
private static List<Song> playingQueue;
|
||||||
|
private static List<Song> restoredOriginalQueue;
|
||||||
|
|
||||||
private List<Song> playingQueue;
|
private static Context context;
|
||||||
private List<Song> restoredOriginalQueue;
|
private static MusicService musicService;
|
||||||
|
private static Intent musicServiceIntent;
|
||||||
|
|
||||||
private MusicService musicService;
|
private static ServiceConnection musicConnection = new ServiceConnection() {
|
||||||
private Intent musicServiceIntent;
|
|
||||||
private boolean musicBound = false;
|
|
||||||
private ServiceConnection musicConnection = new ServiceConnection() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||||
MusicService.MusicBinder binder = (MusicService.MusicBinder) service;
|
MusicService.MusicBinder binder = (MusicService.MusicBinder) service;
|
||||||
musicService = binder.getService();
|
musicService = binder.getService();
|
||||||
musicBound = true;
|
|
||||||
musicService.restorePreviousState(restoredOriginalQueue, playingQueue, position);
|
musicService.restorePreviousState(restoredOriginalQueue, playingQueue, position);
|
||||||
notifyOnMusicRemoteEventListeners(MusicRemoteEvent.SERVICE_CONNECTED);
|
postToBus(MusicRemoteEvent.SERVICE_CONNECTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onServiceDisconnected(ComponentName name) {
|
public void onServiceDisconnected(ComponentName name) {
|
||||||
musicBound = false;
|
musicService = null;
|
||||||
notifyOnMusicRemoteEventListeners(MusicRemoteEvent.SERVICE_DISCONNECTED);
|
postToBus(MusicRemoteEvent.SERVICE_DISCONNECTED);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public MusicPlayerRemote(Context context) {
|
public static void init(final Context context) {
|
||||||
app = (App) context.getApplicationContext();
|
MusicPlayerRemote.context = context;
|
||||||
playingQueue = new ArrayList<>();
|
playingQueue = new ArrayList<>();
|
||||||
restoredOriginalQueue = new ArrayList<>();
|
restoredOriginalQueue = new ArrayList<>();
|
||||||
startAndBindService();
|
startAndBindService();
|
||||||
|
restorePreviousState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startAndBindService() {
|
private static void startAndBindService() {
|
||||||
if (musicServiceIntent == null) {
|
if (musicServiceIntent == null) {
|
||||||
musicServiceIntent = new Intent(app, MusicService.class);
|
musicServiceIntent = new Intent(context, MusicService.class);
|
||||||
app.bindService(musicServiceIntent, musicConnection, Context.BIND_AUTO_CREATE);
|
context.bindService(musicServiceIntent, musicConnection, Context.BIND_AUTO_CREATE);
|
||||||
app.startService(musicServiceIntent);
|
context.startService(musicServiceIntent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean playSongAt(final int position) {
|
public static boolean playSongAt(final int position) {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
musicService.playSongAt(position);
|
musicService.playSongAt(position);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pauseSong() {
|
public static void pauseSong() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
musicService.pausePlaying();
|
musicService.pausePlaying();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playNextSong() {
|
public static void playNextSong() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
musicService.playNextSong();
|
musicService.playNextSong();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playPreviousSong() {
|
public static void playPreviousSong() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
musicService.back();
|
musicService.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void back() {
|
public static void back() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
musicService.back();
|
musicService.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPlaying() {
|
public static boolean isPlaying() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
return musicService.isPlaying();
|
return musicService.isPlaying();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resumePlaying() {
|
public static void resumePlaying() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
musicService.resumePlaying();
|
musicService.resumePlaying();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getCurrentSongId() {
|
public static long getCurrentSongId() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
return musicService.getCurrentSongId();
|
return musicService.getCurrentSongId();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
@ -121,14 +121,14 @@ public class MusicPlayerRemote {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openQueue(final List<Song> playingQueue, final int startPosition, final boolean startPlaying) {
|
public static void openQueue(final List<Song> playingQueue, final int startPosition, final boolean startPlaying) {
|
||||||
this.playingQueue = playingQueue;
|
MusicPlayerRemote.playingQueue = playingQueue;
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
musicService.openQueue(this.playingQueue, startPosition, startPlaying);
|
musicService.openQueue(MusicPlayerRemote.playingQueue, startPosition, startPlaying);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Song getCurrentSong() {
|
public static Song getCurrentSong() {
|
||||||
final int position = getPosition();
|
final int position = getPosition();
|
||||||
if (position != -1) {
|
if (position != -1) {
|
||||||
return getPlayingQueue().get(position);
|
return getPlayingQueue().get(position);
|
||||||
|
|
@ -136,89 +136,85 @@ public class MusicPlayerRemote {
|
||||||
return new Song();
|
return new Song();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getPosition() {
|
public static int getPosition() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
position = musicService.getPosition();
|
position = musicService.getPosition();
|
||||||
}
|
}
|
||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPosition(int position) {
|
private static void setPosition(int position) {
|
||||||
this.position = position;
|
MusicPlayerRemote.position = position;
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
musicService.setPosition(position);
|
musicService.setPosition(position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Song> getPlayingQueue() {
|
public static List<Song> getPlayingQueue() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
playingQueue = musicService.getPlayingQueue();
|
playingQueue = musicService.getPlayingQueue();
|
||||||
}
|
}
|
||||||
return playingQueue;
|
return playingQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSongProgressMillis() {
|
public static int getSongProgressMillis() {
|
||||||
if (isPlayerPrepared()) {
|
if (isPlayerPrepared()) {
|
||||||
return musicService.getSongProgressMillis();
|
return musicService.getSongProgressMillis();
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPlayerPrepared() {
|
public static boolean isPlayerPrepared() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
return musicService.isPlayerPrepared();
|
return musicService.isPlayerPrepared();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSongDurationMillis() {
|
public static int getSongDurationMillis() {
|
||||||
if (isPlayerPrepared()) {
|
if (isPlayerPrepared()) {
|
||||||
return musicService.getSongDurationMillis();
|
return musicService.getSongDurationMillis();
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMusicBound() {
|
public static void seekTo(int millis) {
|
||||||
return musicBound;
|
if (musicService != null) {
|
||||||
}
|
|
||||||
|
|
||||||
public void seekTo(int millis) {
|
|
||||||
if (musicBound) {
|
|
||||||
musicService.seekTo(millis);
|
musicService.seekTo(millis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRepeatMode() {
|
public static int getRepeatMode() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
return musicService.getRepeatMode();
|
return musicService.getRepeatMode();
|
||||||
}
|
}
|
||||||
return app.getDefaultSharedPreferences().getInt(AppKeys.SP_REPEAT_MODE, 0);
|
return PreferenceManager.getDefaultSharedPreferences(context).getInt(AppKeys.SP_REPEAT_MODE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getShuffleMode() {
|
public static int getShuffleMode() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
return musicService.getShuffleMode();
|
return musicService.getShuffleMode();
|
||||||
}
|
}
|
||||||
return app.getDefaultSharedPreferences().getInt(AppKeys.SP_SHUFFLE_MODE, 0);
|
return PreferenceManager.getDefaultSharedPreferences(context).getInt(AppKeys.SP_SHUFFLE_MODE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean cycleRepeatMode() {
|
public static boolean cycleRepeatMode() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
musicService.cycleRepeatMode();
|
musicService.cycleRepeatMode();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean toggleShuffleMode() {
|
public static boolean toggleShuffleMode() {
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
musicService.toggleShuffle();
|
musicService.toggleShuffle();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void moveSong(int from, int to) {
|
public static void moveSong(int from, int to) {
|
||||||
final int currentPosition = getPosition();
|
final int currentPosition = getPosition();
|
||||||
Song songToMove = getPlayingQueue().remove(from);
|
Song songToMove = getPlayingQueue().remove(from);
|
||||||
getPlayingQueue().add(to, songToMove);
|
getPlayingQueue().add(to, songToMove);
|
||||||
|
|
@ -231,27 +227,27 @@ public class MusicPlayerRemote {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notifyOnMusicRemoteEventListeners(int event) {
|
private static void postToBus(int event) {
|
||||||
MusicRemoteEvent musicRemoteEvent = new MusicRemoteEvent(event);
|
MusicRemoteEvent musicRemoteEvent = new MusicRemoteEvent(event);
|
||||||
App.bus.post(musicRemoteEvent);
|
App.bus.post(musicRemoteEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void restorePreviousState() {
|
public static void restorePreviousState() {
|
||||||
try {
|
try {
|
||||||
List restoredQueue = (ArrayList<Song>) InternalStorageUtil.readObject(app, AppKeys.IS_PLAYING_QUEUE);
|
List restoredQueue = (ArrayList<Song>) InternalStorageUtil.readObject(context, AppKeys.IS_PLAYING_QUEUE);
|
||||||
List restoredOriginalQueue = (ArrayList<Song>) InternalStorageUtil.readObject(app, AppKeys.IS_ORIGINAL_PLAYING_QUEUE);
|
List restoredOriginalQueue = (ArrayList<Song>) InternalStorageUtil.readObject(context, AppKeys.IS_ORIGINAL_PLAYING_QUEUE);
|
||||||
int restoredPosition = (int) InternalStorageUtil.readObject(app, AppKeys.IS_POSITION_IN_QUEUE);
|
int restoredPosition = (int) InternalStorageUtil.readObject(context, AppKeys.IS_POSITION_IN_QUEUE);
|
||||||
|
|
||||||
if (musicBound) {
|
if (musicService != null) {
|
||||||
musicService.restorePreviousState(restoredOriginalQueue, restoredQueue, restoredPosition);
|
musicService.restorePreviousState(restoredOriginalQueue, restoredQueue, restoredPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
playingQueue = restoredQueue;
|
playingQueue = restoredQueue;
|
||||||
this.restoredOriginalQueue = restoredOriginalQueue;
|
MusicPlayerRemote.restoredOriginalQueue = restoredOriginalQueue;
|
||||||
position = restoredPosition;
|
position = restoredPosition;
|
||||||
|
|
||||||
notifyOnMusicRemoteEventListeners(MusicRemoteEvent.STATE_RESTORED);
|
postToBus(MusicRemoteEvent.STATE_RESTORED);
|
||||||
} catch (IOException | ClassNotFoundException | ClassCastException e) {
|
} catch (IOException | ClassNotFoundException | ClassCastException e) {
|
||||||
Log.e(TAG, "error while restoring music service state", e);
|
Log.e(TAG, "error while restoring music service state", e);
|
||||||
playingQueue = new ArrayList<>();
|
playingQueue = new ArrayList<>();
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||||
public class PlayingQueueDialogHelper {
|
public class PlayingQueueDialogHelper {
|
||||||
public static MaterialDialog getDialog(Context context, SongAdapter.GoToAble goToAble) {
|
public static MaterialDialog getDialog(Context context, SongAdapter.GoToAble goToAble) {
|
||||||
final App app = (App) context.getApplicationContext();
|
final App app = (App) context.getApplicationContext();
|
||||||
List<Song> playingQueue = app.getMusicPlayerRemote().getPlayingQueue();
|
List<Song> playingQueue = MusicPlayerRemote.getPlayingQueue();
|
||||||
if (playingQueue.isEmpty()) {
|
if (playingQueue.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -49,14 +49,14 @@ public class PlayingQueueDialogHelper {
|
||||||
dragSortListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
dragSortListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
app.getMusicPlayerRemote().playSongAt(position);
|
MusicPlayerRemote.playSongAt(position);
|
||||||
playingQueueAdapter.notifyDataSetChanged();
|
playingQueueAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dragSortListView.setDropListener(new DragSortListView.DropListener() {
|
dragSortListView.setDropListener(new DragSortListView.DropListener() {
|
||||||
@Override
|
@Override
|
||||||
public void drop(int from, int to) {
|
public void drop(int from, int to) {
|
||||||
app.getMusicPlayerRemote().moveSong(from, to);
|
MusicPlayerRemote.moveSong(from, to);
|
||||||
playingQueueAdapter.notifyDataSetChanged();
|
playingQueueAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,6 @@ package com.kabouzeid.gramophone.model;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.R;
|
|
||||||
import com.kabouzeid.gramophone.util.MusicUtil;
|
|
||||||
import com.squareup.picasso.Picasso;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -57,9 +53,6 @@ public class Song implements Serializable, SearchEntry {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadImage(Context context, ImageView imageView) {
|
public void loadImage(Context context, ImageView imageView) {
|
||||||
imageView.setImageResource(R.drawable.default_album_art);
|
|
||||||
Picasso.with(context)
|
|
||||||
.load(MusicUtil.getAlbumArtUri(albumId))
|
|
||||||
.into(imageView);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import com.kabouzeid.gramophone.App;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.adapter.songadapter.SongAdapter;
|
import com.kabouzeid.gramophone.adapter.songadapter.SongAdapter;
|
||||||
import com.kabouzeid.gramophone.comparator.SongTrackNumberComparator;
|
import com.kabouzeid.gramophone.comparator.SongTrackNumberComparator;
|
||||||
|
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.kabouzeid.gramophone.interfaces.KabViewsDisableAble;
|
import com.kabouzeid.gramophone.interfaces.KabViewsDisableAble;
|
||||||
import com.kabouzeid.gramophone.loader.AlbumLoader;
|
import com.kabouzeid.gramophone.loader.AlbumLoader;
|
||||||
import com.kabouzeid.gramophone.loader.AlbumSongLoader;
|
import com.kabouzeid.gramophone.loader.AlbumSongLoader;
|
||||||
|
|
@ -321,7 +322,7 @@ public class AlbumDetailActivity extends AbsFabActivity implements KabViewsDisab
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
if (position > 0) {
|
if (position > 0) {
|
||||||
app.getMusicPlayerRemote().openQueue(songs, position - 1, true);
|
MusicPlayerRemote.openQueue(songs, position - 1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.support.v13.app.FragmentPagerAdapter;
|
import android.support.v13.app.FragmentPagerAdapter;
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
import android.support.v4.widget.DrawerLayout;
|
import android.support.v4.widget.DrawerLayout;
|
||||||
|
|
@ -25,6 +26,7 @@ import com.afollestad.materialdialogs.MaterialDialog;
|
||||||
import com.google.samples.apps.iosched.ui.widget.SlidingTabLayout;
|
import com.google.samples.apps.iosched.ui.widget.SlidingTabLayout;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.helper.AboutDeveloperDialogHelper;
|
import com.kabouzeid.gramophone.helper.AboutDeveloperDialogHelper;
|
||||||
|
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.kabouzeid.gramophone.helper.PlayingQueueDialogHelper;
|
import com.kabouzeid.gramophone.helper.PlayingQueueDialogHelper;
|
||||||
import com.kabouzeid.gramophone.interfaces.KabViewsDisableAble;
|
import com.kabouzeid.gramophone.interfaces.KabViewsDisableAble;
|
||||||
import com.kabouzeid.gramophone.misc.AppKeys;
|
import com.kabouzeid.gramophone.misc.AppKeys;
|
||||||
|
|
@ -73,7 +75,7 @@ public class MainActivity extends AbsFabActivity
|
||||||
private void setUpViewPager() {
|
private void setUpViewPager() {
|
||||||
viewPagerAdapter = new MainActivityViewPagerAdapter(this);
|
viewPagerAdapter = new MainActivityViewPagerAdapter(this);
|
||||||
viewPager.setAdapter(viewPagerAdapter);
|
viewPager.setAdapter(viewPagerAdapter);
|
||||||
int startPosition = getApp().getDefaultSharedPreferences().getInt(AppKeys.SP_VIEWPAGER_ITEM_POSITION, 1);
|
int startPosition = PreferenceManager.getDefaultSharedPreferences(this).getInt(AppKeys.SP_VIEWPAGER_ITEM_POSITION, 1);
|
||||||
viewPager.setCurrentItem(startPosition);
|
viewPager.setCurrentItem(startPosition);
|
||||||
navigationDrawerFragment.setItemChecked(startPosition);
|
navigationDrawerFragment.setItemChecked(startPosition);
|
||||||
|
|
||||||
|
|
@ -87,7 +89,7 @@ public class MainActivity extends AbsFabActivity
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageSelected(final int position) {
|
public void onPageSelected(final int position) {
|
||||||
getApp().getDefaultSharedPreferences().edit().putInt(AppKeys.SP_VIEWPAGER_ITEM_POSITION, position).apply();
|
PreferenceManager.getDefaultSharedPreferences(MainActivity.this).edit().putInt(AppKeys.SP_VIEWPAGER_ITEM_POSITION, position).apply();
|
||||||
navigationDrawerFragment.setItemChecked(position);
|
navigationDrawerFragment.setItemChecked(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -147,7 +149,7 @@ public class MainActivity extends AbsFabActivity
|
||||||
|
|
||||||
private void updateNavigationDrawerHeader() {
|
private void updateNavigationDrawerHeader() {
|
||||||
if (navigationDrawerFragment != null) {
|
if (navigationDrawerFragment != null) {
|
||||||
Song song = getApp().getMusicPlayerRemote().getCurrentSong();
|
Song song = MusicPlayerRemote.getCurrentSong();
|
||||||
if (song.id != -1) {
|
if (song.id != -1) {
|
||||||
Picasso.with(this)
|
Picasso.with(this)
|
||||||
.load(MusicUtil.getAlbumArtUri(song.albumId))
|
.load(MusicUtil.getAlbumArtUri(song.albumId))
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import com.afollestad.materialdialogs.MaterialDialog;
|
import com.afollestad.materialdialogs.MaterialDialog;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
|
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.kabouzeid.gramophone.helper.PlayingQueueDialogHelper;
|
import com.kabouzeid.gramophone.helper.PlayingQueueDialogHelper;
|
||||||
import com.kabouzeid.gramophone.helper.SongDetailDialogHelper;
|
import com.kabouzeid.gramophone.helper.SongDetailDialogHelper;
|
||||||
import com.kabouzeid.gramophone.lastfm.artist.LastFMArtistImageUrlLoader;
|
import com.kabouzeid.gramophone.lastfm.artist.LastFMArtistImageUrlLoader;
|
||||||
|
|
@ -117,7 +118,7 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||||
if (fromUser) {
|
if (fromUser) {
|
||||||
getApp().getMusicPlayerRemote().seekTo(progress);
|
MusicPlayerRemote.seekTo(progress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -135,13 +136,13 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
nextButton.setOnClickListener(new View.OnClickListener() {
|
nextButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
getApp().getMusicPlayerRemote().playNextSong();
|
MusicPlayerRemote.playNextSong();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
prevButton.setOnClickListener(new View.OnClickListener() {
|
prevButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
getApp().getMusicPlayerRemote().back();
|
MusicPlayerRemote.back();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -151,13 +152,13 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
shuffleButton.setOnClickListener(new View.OnClickListener() {
|
shuffleButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
getApp().getMusicPlayerRemote().toggleShuffleMode();
|
MusicPlayerRemote.toggleShuffleMode();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateShuffleState() {
|
private void updateShuffleState() {
|
||||||
switch (getApp().getMusicPlayerRemote().getShuffleMode()) {
|
switch (MusicPlayerRemote.getShuffleMode()) {
|
||||||
case MusicService.SHUFFLE_MODE_SHUFFLE:
|
case MusicService.SHUFFLE_MODE_SHUFFLE:
|
||||||
shuffleButton.setImageResource(R.drawable.ic_shuffle_white_48dp);
|
shuffleButton.setImageResource(R.drawable.ic_shuffle_white_48dp);
|
||||||
break;
|
break;
|
||||||
|
|
@ -172,13 +173,13 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
repeatButton.setOnClickListener(new View.OnClickListener() {
|
repeatButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
getApp().getMusicPlayerRemote().cycleRepeatMode();
|
MusicPlayerRemote.cycleRepeatMode();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateRepeatState() {
|
private void updateRepeatState() {
|
||||||
switch (getApp().getMusicPlayerRemote().getRepeatMode()) {
|
switch (MusicPlayerRemote.getRepeatMode()) {
|
||||||
case MusicService.REPEAT_MODE_NONE:
|
case MusicService.REPEAT_MODE_NONE:
|
||||||
repeatButton.setImageResource(R.drawable.ic_repeat_grey600_48dp);
|
repeatButton.setImageResource(R.drawable.ic_repeat_grey600_48dp);
|
||||||
break;
|
break;
|
||||||
|
|
@ -299,7 +300,7 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getCurrentSong() {
|
private void getCurrentSong() {
|
||||||
song = getApp().getMusicPlayerRemote().getCurrentSong();
|
song = MusicPlayerRemote.getCurrentSong();
|
||||||
if (song.id == -1) {
|
if (song.id == -1) {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
@ -312,10 +313,10 @@ public class MusicControllerActivity extends AbsFabActivity {
|
||||||
public void run() {
|
public void run() {
|
||||||
int currentPosition = 0;
|
int currentPosition = 0;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
while (getApp().getMusicPlayerRemote().isMusicBound() && !killThreads) {
|
while (!killThreads) {
|
||||||
try {
|
try {
|
||||||
total = getApp().getMusicPlayerRemote().getSongDurationMillis();
|
total = MusicPlayerRemote.getSongDurationMillis();
|
||||||
currentPosition = getApp().getMusicPlayerRemote().getSongProgressMillis();
|
currentPosition = MusicPlayerRemote.getSongProgressMillis();
|
||||||
Thread.sleep(1);
|
Thread.sleep(1);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import android.widget.ListView;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.adapter.SearchAdapter;
|
import com.kabouzeid.gramophone.adapter.SearchAdapter;
|
||||||
|
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.kabouzeid.gramophone.loader.AlbumLoader;
|
import com.kabouzeid.gramophone.loader.AlbumLoader;
|
||||||
import com.kabouzeid.gramophone.loader.ArtistLoader;
|
import com.kabouzeid.gramophone.loader.ArtistLoader;
|
||||||
import com.kabouzeid.gramophone.loader.SongLoader;
|
import com.kabouzeid.gramophone.loader.SongLoader;
|
||||||
|
|
@ -60,7 +61,7 @@ public class SearchActivity extends AbsBaseActivity {
|
||||||
if (item instanceof Song) {
|
if (item instanceof Song) {
|
||||||
List<Song> playList = new ArrayList<>();
|
List<Song> playList = new ArrayList<>();
|
||||||
playList.add((Song) item);
|
playList.add((Song) item);
|
||||||
getApp().getMusicPlayerRemote().openQueue(playList, 0, true);
|
MusicPlayerRemote.openQueue(playList, 0, true);
|
||||||
} else if (item instanceof Album) {
|
} else if (item instanceof Album) {
|
||||||
goToAlbum(((Album) item).id, new Pair[]{Pair.create(view.findViewById(R.id.image), getResources().getString(R.string.transition_album_cover))});
|
goToAlbum(((Album) item).id, new Pair[]{Pair.create(view.findViewById(R.id.image), getResources().getString(R.string.transition_album_cover))});
|
||||||
} else if (item instanceof Artist) {
|
} else if (item instanceof Artist) {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import com.crashlytics.android.Crashlytics;
|
||||||
import com.kabouzeid.gramophone.App;
|
import com.kabouzeid.gramophone.App;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.adapter.songadapter.SongAdapter;
|
import com.kabouzeid.gramophone.adapter.songadapter.SongAdapter;
|
||||||
|
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.kabouzeid.gramophone.interfaces.KabViewsDisableAble;
|
import com.kabouzeid.gramophone.interfaces.KabViewsDisableAble;
|
||||||
import com.kabouzeid.gramophone.misc.AppKeys;
|
import com.kabouzeid.gramophone.misc.AppKeys;
|
||||||
import com.kabouzeid.gramophone.ui.activities.AlbumDetailActivity;
|
import com.kabouzeid.gramophone.ui.activities.AlbumDetailActivity;
|
||||||
|
|
@ -74,7 +75,7 @@ public abstract class AbsBaseActivity extends ActionBarActivity implements KabVi
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean openCurrentPlayingIfPossible(Pair[] sharedViews) {
|
protected boolean openCurrentPlayingIfPossible(Pair[] sharedViews) {
|
||||||
if (getApp().getMusicPlayerRemote().getPosition() != -1) {
|
if (MusicPlayerRemote.getPosition() != -1) {
|
||||||
if (areViewsEnabled()) {
|
if (areViewsEnabled()) {
|
||||||
disableViews();
|
disableViews();
|
||||||
Intent intent = new Intent(this, MusicControllerActivity.class);
|
Intent intent = new Intent(this, MusicControllerActivity.class);
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.App;
|
import com.kabouzeid.gramophone.App;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
|
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.kabouzeid.gramophone.misc.SmallOnGestureListener;
|
import com.kabouzeid.gramophone.misc.SmallOnGestureListener;
|
||||||
import com.kabouzeid.gramophone.model.MusicRemoteEvent;
|
import com.kabouzeid.gramophone.model.MusicRemoteEvent;
|
||||||
import com.melnykov.fab.FloatingActionButton;
|
import com.melnykov.fab.FloatingActionButton;
|
||||||
|
|
@ -47,11 +48,11 @@ public abstract class AbsFabActivity extends AbsBaseActivity {
|
||||||
getFab().setOnClickListener(new View.OnClickListener() {
|
getFab().setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (getApp().getMusicPlayerRemote().getPosition() != -1) {
|
if (MusicPlayerRemote.getPosition() != -1) {
|
||||||
if (getApp().getMusicPlayerRemote().isPlaying()) {
|
if (MusicPlayerRemote.isPlaying()) {
|
||||||
getApp().getMusicPlayerRemote().pauseSong();
|
MusicPlayerRemote.pauseSong();
|
||||||
} else {
|
} else {
|
||||||
getApp().getMusicPlayerRemote().resumePlaying();
|
MusicPlayerRemote.resumePlaying();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(AbsFabActivity.this, getResources().getString(R.string.nothing_playing), Toast.LENGTH_SHORT).show();
|
Toast.makeText(AbsFabActivity.this, getResources().getString(R.string.nothing_playing), Toast.LENGTH_SHORT).show();
|
||||||
|
|
@ -77,7 +78,7 @@ public abstract class AbsFabActivity extends AbsBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateFabState() {
|
private void updateFabState() {
|
||||||
if (getApp().getMusicPlayerRemote().isPlaying()) {
|
if (MusicPlayerRemote.isPlaying()) {
|
||||||
getFab().setImageResource(R.drawable.ic_pause_white_24dp);
|
getFab().setImageResource(R.drawable.ic_pause_white_24dp);
|
||||||
} else {
|
} else {
|
||||||
getFab().setImageResource(R.drawable.ic_play_arrow_white_24dp);
|
getFab().setImageResource(R.drawable.ic_play_arrow_white_24dp);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import android.app.Activity;
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.support.v4.view.GravityCompat;
|
import android.support.v4.view.GravityCompat;
|
||||||
import android.support.v4.widget.DrawerLayout;
|
import android.support.v4.widget.DrawerLayout;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
|
@ -62,7 +63,7 @@ public class NavigationDrawerFragment extends Fragment {
|
||||||
if (!userLearnedDrawer && !fromSavedInstanceState) {
|
if (!userLearnedDrawer && !fromSavedInstanceState) {
|
||||||
this.drawerLayout.openDrawer(fragmentContainerView);
|
this.drawerLayout.openDrawer(fragmentContainerView);
|
||||||
userLearnedDrawer = true;
|
userLearnedDrawer = true;
|
||||||
app.getDefaultSharedPreferences().edit().putBoolean(AppKeys.SP_USER_LEARNED_DRAWER, true).apply();
|
PreferenceManager.getDefaultSharedPreferences(getActivity()).edit().putBoolean(AppKeys.SP_USER_LEARNED_DRAWER, true).apply();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -91,7 +92,7 @@ public class NavigationDrawerFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
app = (App) getActivity().getApplicationContext();
|
app = (App) getActivity().getApplicationContext();
|
||||||
userLearnedDrawer = app.getDefaultSharedPreferences().getBoolean(AppKeys.SP_USER_LEARNED_DRAWER, false);
|
userLearnedDrawer = PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean(AppKeys.SP_USER_LEARNED_DRAWER, false);
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
setItemChecked(savedInstanceState.getInt(STATE_SELECTED_POSITION));
|
setItemChecked(savedInstanceState.getInt(STATE_SELECTED_POSITION));
|
||||||
fromSavedInstanceState = true;
|
fromSavedInstanceState = true;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import android.widget.ListAdapter;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.adapter.songadapter.SongAdapter;
|
import com.kabouzeid.gramophone.adapter.songadapter.SongAdapter;
|
||||||
import com.kabouzeid.gramophone.comparator.SongAlphabeticComparator;
|
import com.kabouzeid.gramophone.comparator.SongAlphabeticComparator;
|
||||||
|
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.kabouzeid.gramophone.loader.ArtistSongLoader;
|
import com.kabouzeid.gramophone.loader.ArtistSongLoader;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
import com.kabouzeid.gramophone.ui.activities.base.AbsBaseActivity;
|
import com.kabouzeid.gramophone.ui.activities.base.AbsBaseActivity;
|
||||||
|
|
@ -29,7 +30,7 @@ public class ViewPagerTabArtistSongListFragment extends AbsViewPagerTabArtistLis
|
||||||
setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
app.getMusicPlayerRemote().openQueue(songs, position, true);
|
MusicPlayerRemote.openQueue(songs, position, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return adapter;
|
return adapter;
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import com.kabouzeid.gramophone.App;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.adapter.songadapter.SongViewListAdapter;
|
import com.kabouzeid.gramophone.adapter.songadapter.SongViewListAdapter;
|
||||||
import com.kabouzeid.gramophone.comparator.SongAlphabeticComparator;
|
import com.kabouzeid.gramophone.comparator.SongAlphabeticComparator;
|
||||||
|
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
||||||
import com.kabouzeid.gramophone.loader.SongLoader;
|
import com.kabouzeid.gramophone.loader.SongLoader;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
import com.kabouzeid.gramophone.ui.activities.base.AbsBaseActivity;
|
import com.kabouzeid.gramophone.ui.activities.base.AbsBaseActivity;
|
||||||
|
|
@ -73,7 +74,7 @@ public class SongViewFragment extends MainActivityFragment {
|
||||||
absListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
absListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
app.getMusicPlayerRemote().openQueue(songs, position, true);
|
MusicPlayerRemote.openQueue(songs, position, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
@ -116,7 +117,7 @@ public class Util {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean state = false;
|
boolean state = false;
|
||||||
final boolean onlyOnWifi = ((App) context.getApplicationContext()).getDefaultSharedPreferences().getBoolean(AppKeys.SP_ONLY_ON_WIFI, true);
|
final boolean onlyOnWifi = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(AppKeys.SP_ONLY_ON_WIFI, true);
|
||||||
|
|
||||||
/* Monitor network connections */
|
/* Monitor network connections */
|
||||||
final ConnectivityManager connectivityManager = (ConnectivityManager) context
|
final ConnectivityManager connectivityManager = (ConnectivityManager) context
|
||||||
|
|
|
||||||
7
app/src/main/res/drawable/image_background.xml
Normal file
7
app/src/main/res/drawable/image_background.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="#FFFFFF" />
|
||||||
|
<stroke android:width="5px" android:color="#222222" />
|
||||||
|
<padding android:left="5px" android:top="5px" android:right="5px"
|
||||||
|
android:bottom="5px" />
|
||||||
|
</shape>
|
||||||
25
app/src/main/res/drawable/list_divider.xml
Normal file
25
app/src/main/res/drawable/list_divider.xml
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:bottom="3px">
|
||||||
|
<shape android:shape="line">
|
||||||
|
<stroke
|
||||||
|
android:color="#161616"
|
||||||
|
android:width="3px"
|
||||||
|
/>
|
||||||
|
<size
|
||||||
|
android:height="6px"
|
||||||
|
/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:top="3px">
|
||||||
|
<shape android:shape="line">
|
||||||
|
<stroke
|
||||||
|
android:color="#444444"
|
||||||
|
android:width="3px"
|
||||||
|
/>
|
||||||
|
<size
|
||||||
|
android:height="6px"
|
||||||
|
/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
||||||
8
app/src/main/res/drawable/shadow_up.xml
Normal file
8
app/src/main/res/drawable/shadow_up.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="90"
|
||||||
|
android:endColor="@android:color/transparent"
|
||||||
|
android:startColor="#34000000"/>
|
||||||
|
</shape>
|
||||||
|
|
@ -57,7 +57,6 @@
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
android:textColor="?attr/title_text_color"/>
|
android:textColor="?attr/title_text_color"/>
|
||||||
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,11 @@
|
||||||
android:layout_height="@dimen/tab_height"
|
android:layout_height="@dimen/tab_height"
|
||||||
android:background="?colorPrimary"
|
android:background="?colorPrimary"
|
||||||
android:elevation="2dp"/>
|
android:elevation="2dp"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="5dp"
|
||||||
|
android:background="@drawable/shadow_down" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,12 @@
|
||||||
android:src="@drawable/default_album_art"
|
android:src="@drawable/default_album_art"
|
||||||
android:transitionName="@string/transition_album_cover"/>
|
android:transitionName="@string/transition_album_cover"/>
|
||||||
|
|
||||||
<LinearLayout
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_above="@+id/footer"
|
android:layout_above="@+id/footer"
|
||||||
android:layout_alignTop="@+id/progress_container"
|
android:layout_alignTop="@+id/progress_container"
|
||||||
android:background="@drawable/navigation_drawer_gradient"
|
android:background="@drawable/shadow_up"/>
|
||||||
android:orientation="vertical"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/progress_container"
|
android:id="@+id/progress_container"
|
||||||
|
|
@ -90,6 +89,12 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_below="@id/footer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="5dp"
|
||||||
|
android:background="@drawable/shadow_down" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/media_controller_container"
|
android:id="@+id/media_controller_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -12,10 +13,20 @@
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
android:elevation="@dimen/toolbar_elevation"
|
||||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
||||||
|
|
||||||
<ListView
|
<FrameLayout
|
||||||
android:dividerHeight="0dp"
|
|
||||||
android:divider="@null"
|
|
||||||
android:id="@+id/list"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="wrap_content">
|
||||||
</LinearLayout>
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="5dp"
|
||||||
|
android:background="@drawable/shadow_down" />
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:dividerHeight="0px"
|
||||||
|
android:divider="@null"/>
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,16 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:padding="2dp">
|
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:listSelector="?rect_selector"
|
|
||||||
android:id="@+id/absList"
|
android:id="@+id/absList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
|
android:dividerHeight="0px"
|
||||||
android:divider="@null"
|
android:divider="@null"
|
||||||
android:dividerHeight="0dp"
|
android:listSelector="?rect_selector"
|
||||||
android:numColumns="@integer/grid_columns"
|
android:numColumns="@integer/grid_columns"
|
||||||
android:padding="2dp"
|
|
||||||
android:scrollbars="vertical"/>
|
android:scrollbars="vertical"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="64dp"
|
android:layout_height="64dp"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:background="@drawable/navigation_drawer_gradient"
|
android:background="@drawable/shadow_up"
|
||||||
android:orientation="vertical"/>
|
android:orientation="vertical"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,7 @@
|
||||||
android:id="@+id/fragment_songview"
|
android:id="@+id/fragment_songview"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:padding="2dp">
|
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:listSelector="?rect_selector"
|
android:listSelector="?rect_selector"
|
||||||
|
|
@ -12,9 +11,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
|
android:dividerHeight="0px"
|
||||||
android:divider="@null"
|
android:divider="@null"
|
||||||
android:dividerHeight="0dp"
|
|
||||||
android:numColumns="@integer/grid_columns"
|
android:numColumns="@integer/grid_columns"
|
||||||
android:padding="2dp"
|
|
||||||
android:scrollbars="vertical"/>
|
android:scrollbars="vertical"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
||||||
|
|
@ -12,20 +12,37 @@
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
android:background="@drawable/image_background"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/artist_name"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fontFamily="sans-serif"
|
android:orientation="vertical">
|
||||||
android:singleLine="true"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
|
<TextView
|
||||||
|
android:id="@+id/artist_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/artist_info"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Caption"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -12,15 +12,18 @@
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
android:background="@drawable/image_background"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
@ -29,7 +32,7 @@
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:fontFamily="sans-serif"
|
android:fontFamily="sans-serif"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"/>
|
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/sub_title"
|
android:id="@+id/sub_title"
|
||||||
|
|
@ -39,6 +42,6 @@
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:fontFamily="sans-serif"
|
android:fontFamily="sans-serif"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"/>
|
android:textAppearance="@style/TextAppearance.AppCompat.Caption"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -43,6 +43,8 @@
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:layout_marginLeft="2dp"
|
||||||
|
android:layout_marginRight="2dp"
|
||||||
android:id="@+id/menu"
|
android:id="@+id/menu"
|
||||||
style="@style/OverFlowButton"
|
style="@style/OverFlowButton"
|
||||||
android:layout_gravity="center_vertical"/>
|
android:layout_gravity="center_vertical"/>
|
||||||
|
|
|
||||||
|
|
@ -12,23 +12,42 @@
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
android:background="@drawable/image_background"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/song_title"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fontFamily="sans-serif"
|
android:orientation="vertical">
|
||||||
android:singleLine="true"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
|
<TextView
|
||||||
|
android:id="@+id/song_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/song_info"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:fontFamily="sans-serif"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Caption"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/menu"
|
android:id="@+id/menu"
|
||||||
style="@style/OverFlowButton"
|
style="@style/OverFlowButton"
|
||||||
android:layout_gravity="center_vertical"/>
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginRight="2dp"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue