Merge pull request #188 from h4h13/composer

Composer, Now playing preview, Full screen theme
This commit is contained in:
Hemanth S 2019-02-26 22:22:09 +05:30 committed by GitHub
commit 41c2af0ed6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 718 additions and 373 deletions

View file

@ -32,8 +32,8 @@ android {
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic" applicationId "code.name.monkey.retromusic"
versionCode 292 versionCode 295
versionName '3.1.100' versionName '3.1.200'
multiDexEnabled true multiDexEnabled true

View file

@ -1 +1 @@
<html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h3 style="text-align:center;"> Subscribe to <a href="https://www.youtube.com/user/PewDiePie/">PewDiePie</a> 👊 </h3> <h4>v3.1.100</h4> <ul> <li>Fix Crash in Album tag editor while selecting options</li> </style> </li> <li>Added Filter song length</li> <li>Added Favourites playlist icon will be accent color</li> <li>Added Colorful settings icons</li> <li>Added Corners for dialog</li> </ul> <h4>v3.0.570</h4> <ul> <li>Fix Album/Artist square image</li> <li>Fix Delete dialog text format</li> <li>Fix Profile picture not showing after coming back from folders</li> <li>Fix Play button color i Simple and Plain themes</li> <li>Fix Sleep timer dialog crashing</li> <li>Fix Share song dialog title and text</li> </ul> <p>If you see entire app white or dark or black select same theme in settings to fix </p> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again. </p> </body> <html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h3 style="text-align:center;"> Subscribe to <a href="https://www.youtube.com/user/PewDiePie/">PewDiePie</a> 👊 </h3> <h4>v3.1.230</h4> <ul> <li>Improved full theme appearances</li> </style> Subscribe to <a href="https://www.youtube.com/user/PewDiePie/">PewDiePie</a> 👊 </style> </h3> </style> <h4>v3.1.100</h4> <h4>v3.1.200</h4> <ul> </style> <li>Fix Crash in Album tag editor while selecting options</li> </head> </li> <li>Added Filter song length</li> <li>Added Favourites playlist icon will be accent color</li> <li>Added Colorful settings icons</li> <li>Added Corners for dialog</li> </ul> <h4>v3.0.570</h4> <ul> <li>Fix Album/Artist square image</li> <li>Fix Delete dialog text format</li> <li>Fix Profile picture not showing after coming back from folders</li> <li>Fix Play button color i Simple and Plain themes</li> <li>Fix Sleep timer dialog crashing</li> <li>Fix Share song dialog title and text</li> </ul> <p>If you see entire app white or dark or black select same theme in settings to fix </p> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again. </p> </body>

View file

@ -81,6 +81,7 @@ object Constants {
val CAST_SERVER_PORT = 8080 val CAST_SERVER_PORT = 8080
const val BASE_SELECTION = MediaStore.Audio.AudioColumns.IS_MUSIC + "=1" + " AND " + MediaStore.Audio.AudioColumns.TITLE + " != ''" const val BASE_SELECTION = MediaStore.Audio.AudioColumns.IS_MUSIC + "=1" + " AND " + MediaStore.Audio.AudioColumns.TITLE + " != ''"
@JvmField @JvmField
val BASE_PROJECTION = arrayOf(BaseColumns._ID, // 0 val BASE_PROJECTION = arrayOf(BaseColumns._ID, // 0
MediaStore.Audio.AudioColumns.TITLE, // 1 MediaStore.Audio.AudioColumns.TITLE, // 1
@ -92,7 +93,8 @@ object Constants {
MediaStore.Audio.AudioColumns.ALBUM_ID, // 7 MediaStore.Audio.AudioColumns.ALBUM_ID, // 7
MediaStore.Audio.AudioColumns.ALBUM, // 8 MediaStore.Audio.AudioColumns.ALBUM, // 8
MediaStore.Audio.AudioColumns.ARTIST_ID, // 9 MediaStore.Audio.AudioColumns.ARTIST_ID, // 9
MediaStore.Audio.AudioColumns.ARTIST)// 10 MediaStore.Audio.AudioColumns.ARTIST,// 10
MediaStore.Audio.AudioColumns.COMPOSER)// 11
const val NUMBER_OF_TOP_TRACKS = 99 const val NUMBER_OF_TOP_TRACKS = 99

View file

@ -0,0 +1,22 @@
package code.name.monkey.retromusic.extensions
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.LayoutRes
@Suppress("UNCHECKED_CAST")
fun <T : View> ViewGroup.inflate(@LayoutRes layout: Int): T {
return LayoutInflater.from(context).inflate(layout, this, false) as T
}
fun View.show() {
visibility = View.VISIBLE
}
fun View.hide() {
visibility = View.GONE
}
fun View.showOrHide(show: Boolean) = if (show) show() else hide()

View file

@ -1,7 +1,5 @@
package code.name.monkey.retromusic.glide; package code.name.monkey.retromusic.glide;
import androidx.annotation.NonNull;
import com.bumptech.glide.GenericTransitionOptions; import com.bumptech.glide.GenericTransitionOptions;
import com.bumptech.glide.Priority; import com.bumptech.glide.Priority;
import com.bumptech.glide.RequestBuilder; import com.bumptech.glide.RequestBuilder;
@ -10,11 +8,11 @@ import com.bumptech.glide.annotation.GlideOption;
import com.bumptech.glide.annotation.GlideType; import com.bumptech.glide.annotation.GlideType;
import com.bumptech.glide.load.Key; import com.bumptech.glide.load.Key;
import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target; import com.bumptech.glide.request.target.Target;
import com.bumptech.glide.signature.MediaStoreSignature; import com.bumptech.glide.signature.MediaStoreSignature;
import androidx.annotation.NonNull;
import code.name.monkey.retromusic.App; import code.name.monkey.retromusic.App;
import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.glide.artistimage.ArtistImage; import code.name.monkey.retromusic.glide.artistimage.ArtistImage;

View file

@ -92,6 +92,9 @@ class SortOrder {
/* Song sort order date */ /* Song sort order date */
const val SONG_DATE = MediaStore.Audio.Media.DATE_ADDED + " DESC" const val SONG_DATE = MediaStore.Audio.Media.DATE_ADDED + " DESC"
/* Song sort order composer*/
const val COMPOSER = MediaStore.Audio.Media.COMPOSER
} }
} }

View file

@ -56,8 +56,9 @@ object PlaylistSongsLoader {
val artistId = cursor.getInt(9) val artistId = cursor.getInt(9)
val artistName = cursor.getString(10) val artistName = cursor.getString(10)
val idInPlaylist = cursor.getInt(11) val idInPlaylist = cursor.getInt(11)
val composer = cursor.getString(12)
return PlaylistSong(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName, artistId, artistName, playlistId, idInPlaylist) return PlaylistSong(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName, artistId, artistName, playlistId, idInPlaylist, composer)
} }
private fun makePlaylistSongCursor(@NonNull context: Context, playlistId: Int): Cursor? { private fun makePlaylistSongCursor(@NonNull context: Context, playlistId: Int): Cursor? {
@ -75,7 +76,8 @@ object PlaylistSongsLoader {
AudioColumns.ALBUM, // 8 AudioColumns.ALBUM, // 8
AudioColumns.ARTIST_ID, // 9 AudioColumns.ARTIST_ID, // 9
AudioColumns.ARTIST, // 10 AudioColumns.ARTIST, // 10
MediaStore.Audio.Playlists.Members._ID)// 11 MediaStore.Audio.Playlists.Members._ID,//11
AudioColumns.COMPOSER)// 12
, BASE_SELECTION, null, , BASE_SELECTION, null,
MediaStore.Audio.Playlists.Members.DEFAULT_SORT_ORDER) MediaStore.Audio.Playlists.Members.DEFAULT_SORT_ORDER)
} catch (e: SecurityException) { } catch (e: SecurityException) {

View file

@ -57,10 +57,10 @@ object SongLoader {
val albumName = cursor.getString(8) val albumName = cursor.getString(8)
val artistId = cursor.getInt(9) val artistId = cursor.getInt(9)
val artistName = cursor.getString(10) val artistName = cursor.getString(10)
val composer = cursor.getString(11)
return Song(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName return Song(id, title, trackNumber, year, duration, data, dateModified, albumId,
?: "", albumName ?: "", artistId, artistName, composer ?: "")
artistId, artistName)
} }
@JvmOverloads @JvmOverloads

View file

@ -3,17 +3,30 @@ package code.name.monkey.retromusic.model;
import android.os.Parcel; import android.os.Parcel;
public class PlaylistSong extends Song { public class PlaylistSong extends Song {
public static PlaylistSong EMPTY_PLAYLIST_SONG = new PlaylistSong(-1, "", -1, -1, -1, "", -1, -1, "", -1, "", -1, -1); public static final Creator<PlaylistSong> CREATOR = new Creator<PlaylistSong>() {
public PlaylistSong createFromParcel(Parcel source) {
return new PlaylistSong(source);
}
public PlaylistSong[] newArray(int size) {
return new PlaylistSong[size];
}
};
public final int playlistId; public final int playlistId;
public final int idInPlayList; public final int idInPlayList;
public PlaylistSong(int id, String title, int trackNumber, int year, long duration, String data, int dateModified, int albumId, String albumName, int artistId, String artistName, final int playlistId, final int idInPlayList) { public PlaylistSong(int id, String title, int trackNumber, int year, long duration, String data, int dateModified, int albumId, String albumName, int artistId, String artistName, final int playlistId, final int idInPlayList, String composer) {
super(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName, artistId, artistName); super(id, title, trackNumber, year, duration, data, dateModified, albumId, albumName, artistId, artistName, composer);
this.playlistId = playlistId; this.playlistId = playlistId;
this.idInPlayList = idInPlayList; this.idInPlayList = idInPlayList;
} }
protected PlaylistSong(Parcel in) {
super(in);
this.playlistId = in.readInt();
this.idInPlayList = in.readInt();
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
@ -44,7 +57,6 @@ public class PlaylistSong extends Song {
'}'; '}';
} }
@Override @Override
public int describeContents() { public int describeContents() {
return 0; return 0;
@ -56,20 +68,4 @@ public class PlaylistSong extends Song {
dest.writeInt(this.playlistId); dest.writeInt(this.playlistId);
dest.writeInt(this.idInPlayList); dest.writeInt(this.idInPlayList);
} }
protected PlaylistSong(Parcel in) {
super(in);
this.playlistId = in.readInt();
this.idInPlayList = in.readInt();
}
public static final Creator<PlaylistSong> CREATOR = new Creator<PlaylistSong>() {
public PlaylistSong createFromParcel(Parcel source) {
return new PlaylistSong(source);
}
public PlaylistSong[] newArray(int size) {
return new PlaylistSong[size];
}
};
} }

View file

@ -7,8 +7,16 @@ import android.os.Parcelable;
* @author Karim Abou Zeid (kabouzeid) * @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, "", -1, -1, "", -1, ""); public static final Song EMPTY_SONG = new Song(-1, "", -1, -1, -1, "", -1, -1, "", -1, "", "");
public static final Creator<Song> CREATOR = new Creator<Song>() {
public Song createFromParcel(Parcel source) {
return new Song(source);
}
public Song[] newArray(int size) {
return new Song[size];
}
};
public final int id; public final int id;
public final String title; public final String title;
public final int trackNumber; public final int trackNumber;
@ -20,8 +28,9 @@ public class Song implements Parcelable {
public final String albumName; public final String albumName;
public final int artistId; public final int artistId;
public final String artistName; public final String artistName;
public final String composer;
public Song(int id, String title, int trackNumber, int year, long duration, String data, long dateModified, int albumId, String albumName, int artistId, String artistName) { public Song(int id, String title, int trackNumber, int year, long duration, String data, long dateModified, int albumId, String albumName, int artistId, String artistName, String composer) {
this.id = id; this.id = id;
this.title = title; this.title = title;
this.trackNumber = trackNumber; this.trackNumber = trackNumber;
@ -33,61 +42,22 @@ public class Song implements Parcelable {
this.albumName = albumName; this.albumName = albumName;
this.artistId = artistId; this.artistId = artistId;
this.artistName = artistName; this.artistName = artistName;
this.composer = composer;
} }
@Override protected Song(Parcel in) {
public boolean equals(Object o) { this.id = in.readInt();
if (this == o) return true; this.title = in.readString();
if (o == null || getClass() != o.getClass()) return false; this.trackNumber = in.readInt();
this.year = in.readInt();
Song song = (Song) o; this.duration = in.readLong();
this.data = in.readString();
if (id != song.id) return false; this.dateModified = in.readLong();
if (trackNumber != song.trackNumber) return false; this.albumId = in.readInt();
if (year != song.year) return false; this.albumName = in.readString();
if (duration != song.duration) return false; this.artistId = in.readInt();
if (dateModified != song.dateModified) return false; this.artistName = in.readString();
if (albumId != song.albumId) return false; this.composer = in.readString();
if (artistId != song.artistId) return false;
if (title != null ? !title.equals(song.title) : song.title != null) return false;
if (data != null ? !data.equals(song.data) : song.data != null) return false;
if (albumName != null ? !albumName.equals(song.albumName) : song.albumName != null)
return false;
return artistName != null ? artistName.equals(song.artistName) : song.artistName == null;
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + (title != null ? title.hashCode() : 0);
result = 31 * result + trackNumber;
result = 31 * result + year;
result = 31 * result + (int) (duration ^ (duration >>> 32));
result = 31 * result + (data != null ? data.hashCode() : 0);
result = 31 * result + (int) (dateModified ^ (dateModified >>> 32));
result = 31 * result + albumId;
result = 31 * result + (albumName != null ? albumName.hashCode() : 0);
result = 31 * result + artistId;
result = 31 * result + (artistName != null ? artistName.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Song{" +
"id=" + id +
", title='" + title + '\'' +
", trackNumber=" + trackNumber +
", year=" + year +
", duration=" + duration +
", data='" + data + '\'' +
", dateModified=" + dateModified +
", albumId=" + albumId +
", albumName='" + albumName + '\'' +
", artistId=" + artistId +
", artistName='" + artistName + '\'' +
'}';
} }
@ -109,29 +79,6 @@ public class Song implements Parcelable {
dest.writeString(this.albumName); dest.writeString(this.albumName);
dest.writeInt(this.artistId); dest.writeInt(this.artistId);
dest.writeString(this.artistName); dest.writeString(this.artistName);
dest.writeString(this.composer);
} }
protected Song(Parcel in) {
this.id = in.readInt();
this.title = in.readString();
this.trackNumber = in.readInt();
this.year = in.readInt();
this.duration = in.readLong();
this.data = in.readString();
this.dateModified = in.readLong();
this.albumId = in.readInt();
this.albumName = in.readString();
this.artistId = in.readInt();
this.artistName = in.readString();
}
public static final Creator<Song> CREATOR = new Creator<Song>() {
public Song createFromParcel(Parcel source) {
return new Song(source);
}
public Song[] newArray(int size) {
return new Song[size];
}
};
} }

View file

@ -41,7 +41,7 @@ public class MusicPlaybackQueueStore extends SQLiteOpenHelper {
public static final String DATABASE_NAME = "music_playback_state.db"; public static final String DATABASE_NAME = "music_playback_state.db";
public static final String PLAYING_QUEUE_TABLE_NAME = "playing_queue"; public static final String PLAYING_QUEUE_TABLE_NAME = "playing_queue";
public static final String ORIGINAL_PLAYING_QUEUE_TABLE_NAME = "original_playing_queue"; public static final String ORIGINAL_PLAYING_QUEUE_TABLE_NAME = "original_playing_queue";
private static final int VERSION = 5; private static final int VERSION = 7;
@Nullable @Nullable
private static MusicPlaybackQueueStore sInstance = null; private static MusicPlaybackQueueStore sInstance = null;
@ -50,7 +50,7 @@ public class MusicPlaybackQueueStore extends SQLiteOpenHelper {
* *
* @param context The {@link Context} to use * @param context The {@link Context} to use
*/ */
public MusicPlaybackQueueStore(final Context context) { public MusicPlaybackQueueStore(final @NonNull Context context) {
super(context, DATABASE_NAME, null, VERSION); super(context, DATABASE_NAME, null, VERSION);
} }
@ -110,6 +110,9 @@ public class MusicPlaybackQueueStore extends SQLiteOpenHelper {
builder.append(" INT NOT NULL,"); builder.append(" INT NOT NULL,");
builder.append(AudioColumns.ARTIST); builder.append(AudioColumns.ARTIST);
builder.append(" STRING NOT NULL,");
builder.append(AudioColumns.COMPOSER);
builder.append(" STRING NOT NULL);"); builder.append(" STRING NOT NULL);");
db.execSQL(builder.toString()); db.execSQL(builder.toString());
@ -173,6 +176,7 @@ public class MusicPlaybackQueueStore extends SQLiteOpenHelper {
values.put(AudioColumns.ALBUM, song.albumName); values.put(AudioColumns.ALBUM, song.albumName);
values.put(AudioColumns.ARTIST_ID, song.artistId); values.put(AudioColumns.ARTIST_ID, song.artistId);
values.put(AudioColumns.ARTIST, song.artistName); values.put(AudioColumns.ARTIST, song.artistName);
values.put(AudioColumns.COMPOSER, song.composer);
database.insert(tableName, null, values); database.insert(tableName, null, values);
} }

View file

@ -192,7 +192,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
NowPlayingScreen.SIMPLE -> SimplePlayerFragment() NowPlayingScreen.SIMPLE -> SimplePlayerFragment()
NowPlayingScreen.MATERIAL -> MaterialFragment() NowPlayingScreen.MATERIAL -> MaterialFragment()
NowPlayingScreen.COLOR -> ColorFragment() NowPlayingScreen.COLOR -> ColorFragment()
NowPlayingScreen.CLASSIC -> ClassicPlayerFragment() //NowPlayingScreen.CLASSIC -> ClassicPlayerFragment()
else -> PlayerFragment() else -> PlayerFragment()
} // must implement AbsPlayerFragment } // must implement AbsPlayerFragment
supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment).commit() supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment).commit()
@ -260,7 +260,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
super.setLightNavigationBar(true) super.setLightNavigationBar(true)
super.setLightStatusbar(isColorLight) super.setLightStatusbar(isColorLight)
} else if (currentNowPlayingScreen == NowPlayingScreen.FULL || currentNowPlayingScreen == NowPlayingScreen.CARD || } else if (currentNowPlayingScreen == NowPlayingScreen.FULL || currentNowPlayingScreen == NowPlayingScreen.CARD ||
currentNowPlayingScreen == NowPlayingScreen.FIT || currentNowPlayingScreen == NowPlayingScreen.CLASSIC || currentNowPlayingScreen == NowPlayingScreen.FIT || /*currentNowPlayingScreen == NowPlayingScreen.CLASSIC ||*/
currentNowPlayingScreen == NowPlayingScreen.BLUR || currentNowPlayingScreen == NowPlayingScreen.BLUR_CARD) { currentNowPlayingScreen == NowPlayingScreen.BLUR || currentNowPlayingScreen == NowPlayingScreen.BLUR_CARD) {
super.setLightStatusbar(false) super.setLightStatusbar(false)
super.setLightNavigationBar(true) super.setLightNavigationBar(true)

View file

@ -67,6 +67,15 @@ abstract class AbsTagEditorActivity : AbsBaseActivity() {
} }
} }
protected val composer: String?
get() {
return try {
getAudioFile(songPaths!![0]).tagOrCreateAndSetDefault.getFirst(FieldKey.COMPOSER)
} catch (ignored: Exception) {
null
}
}
protected val albumTitle: String? protected val albumTitle: String?
get() { get() {

View file

@ -51,6 +51,7 @@ class SongTagEditorActivity : AbsTagEditorActivity(), TextWatcher {
yearText.addTextChangedListener(this) yearText.addTextChangedListener(this)
trackNumberText.addTextChangedListener(this) trackNumberText.addTextChangedListener(this)
lyricsText.addTextChangedListener(this) lyricsText.addTextChangedListener(this)
songComposerText.addTextChangedListener(this)
} }
private fun fillViewsWithFileTags() { private fun fillViewsWithFileTags() {
@ -62,6 +63,7 @@ class SongTagEditorActivity : AbsTagEditorActivity(), TextWatcher {
yearText.setText(songYear) yearText.setText(songYear)
trackNumberText.setText(trackNumber) trackNumberText.setText(trackNumber)
lyricsText.setText(lyrics) lyricsText.setText(lyrics)
songComposerText.setText(composer)
} }
override fun loadCurrentImage() { override fun loadCurrentImage() {
@ -90,6 +92,7 @@ class SongTagEditorActivity : AbsTagEditorActivity(), TextWatcher {
fieldKeyValueMap[FieldKey.TRACK] = trackNumberText.text.toString() fieldKeyValueMap[FieldKey.TRACK] = trackNumberText.text.toString()
fieldKeyValueMap[FieldKey.LYRICS] = lyricsText.text.toString() fieldKeyValueMap[FieldKey.LYRICS] = lyricsText.text.toString()
fieldKeyValueMap[FieldKey.ALBUM_ARTIST] = albumArtistText.text.toString() fieldKeyValueMap[FieldKey.ALBUM_ARTIST] = albumArtistText.text.toString()
fieldKeyValueMap[FieldKey.COMPOSER] = songComposerText.text.toString()
writeValuesToFiles(fieldKeyValueMap, null) writeValuesToFiles(fieldKeyValueMap, null)
} }

View file

@ -2,6 +2,7 @@ package code.name.monkey.retromusic.ui.adapter.base;
import android.content.Context; import android.content.Context;
import androidx.annotation.MenuRes; import androidx.annotation.MenuRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.view.Menu; import android.view.Menu;
@ -23,7 +24,7 @@ public abstract class AbsMultiSelectAdapter<VH extends RecyclerView.ViewHolder,
private ArrayList<I> checked; private ArrayList<I> checked;
private int menuRes; private int menuRes;
public AbsMultiSelectAdapter(Context context, @Nullable CabHolder cabHolder, @MenuRes int menuRes) { public AbsMultiSelectAdapter(@NonNull Context context, @Nullable CabHolder cabHolder, @MenuRes int menuRes) {
this.cabHolder = cabHolder; this.cabHolder = cabHolder;
checked = new ArrayList<>(); checked = new ArrayList<>();
this.menuRes = menuRes; this.menuRes = menuRes;

View file

@ -14,13 +14,13 @@ enum class NowPlayingScreen constructor(@param:StringRes @field:StringRes
BLUR_CARD(R.string.blur_card, R.drawable.np_blur_card, 9), BLUR_CARD(R.string.blur_card, R.drawable.np_blur_card, 9),
CARD(R.string.card, R.drawable.np_card, 6), CARD(R.string.card, R.drawable.np_card, 6),
COLOR(R.string.color, R.drawable.np_color, 5), COLOR(R.string.color, R.drawable.np_color, 5),
FIT(R.string.fit, R.drawable.np_adaptive, 12), FIT(R.string.fit, R.drawable.np_fit, 12),
FLAT(R.string.flat, R.drawable.np_flat, 1), FLAT(R.string.flat, R.drawable.np_flat, 1),
FULL(R.string.full, R.drawable.np_full, 2), FULL(R.string.full, R.drawable.np_full, 2),
MATERIAL(R.string.material, R.drawable.np_material, 11), MATERIAL(R.string.material, R.drawable.np_material, 11),
NORMAL(R.string.normal, R.drawable.np_normal, 0), NORMAL(R.string.normal, R.drawable.np_normal, 0),
PLAIN(R.string.plain, R.drawable.np_plain, 3), PLAIN(R.string.plain, R.drawable.np_plain, 3),
CLASSIC(R.string.classic, R.drawable.np_normal, 7), //CLASSIC(R.string.classic, R.drawable.np_normal, 7),
SIMPLE(R.string.simple, R.drawable.np_simple, 8) SIMPLE(R.string.simple, R.drawable.np_simple, 8)
} }

View file

@ -107,9 +107,8 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum
} }
fun setTintable(color: Int) { fun setTintable(color: Int) {
TintHelper.setTintAuto(volumeSeekBar, color, false) TintHelper.setTintAuto(volumeSeekBar, color, true)
} }
fun removeThumb() { fun removeThumb() {

View file

@ -194,7 +194,7 @@ abstract class AbsPlayerFragment : AbsMusicServiceFragment(), Toolbar.OnMenuItem
else else
code.name.monkey.retromusic.R.drawable.ic_favorite_border_white_24dp code.name.monkey.retromusic.R.drawable.ic_favorite_border_white_24dp
val drawable = RetroUtil.getTintedVectorDrawable(activity, res, toolbarIconColor()) val drawable = RetroUtil.getTintedVectorDrawable(activity, res, toolbarIconColor())
toolbarGet().menu.findItem(R.id.action_toggle_favorite).setIcon(drawable).title = if (isFavorite) getString(R.string.action_remove_from_favorites) else getString(R.string.action_add_to_favorites) toolbarGet().menu.findItem(R.id.action_toggle_favorite)?.setIcon(drawable)?.title = if (isFavorite) getString(R.string.action_remove_from_favorites) else getString(R.string.action_add_to_favorites)
} }
} }
}.execute(MusicPlayerRemote.currentSong) }.execute(MusicPlayerRemote.currentSong)

View file

@ -44,7 +44,6 @@ import code.name.monkey.retromusic.loaders.SongLoader;
import code.name.monkey.retromusic.ui.activities.SettingsActivity; import code.name.monkey.retromusic.ui.activities.SettingsActivity;
import code.name.monkey.retromusic.ui.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment; import code.name.monkey.retromusic.ui.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment;
import code.name.monkey.retromusic.ui.fragments.base.AbsMainActivityFragment; import code.name.monkey.retromusic.ui.fragments.base.AbsMainActivityFragment;
import code.name.monkey.retromusic.ui.fragments.mainactivity.home.BannerHomeFragment;
import code.name.monkey.retromusic.util.Compressor; import code.name.monkey.retromusic.util.Compressor;
import code.name.monkey.retromusic.util.NavigationUtil; import code.name.monkey.retromusic.util.NavigationUtil;
import code.name.monkey.retromusic.util.PreferenceUtil; import code.name.monkey.retromusic.util.PreferenceUtil;
@ -71,12 +70,6 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
private ImageView userImage; private ImageView userImage;
private CompositeDisposable disposable; private CompositeDisposable disposable;
@Override
public void onDestroyView() {
super.onDestroyView();
disposable.dispose();
}
public static Fragment newInstance(int tab) { public static Fragment newInstance(int tab) {
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putInt(CURRENT_TAB_ID, tab); args.putInt(CURRENT_TAB_ID, tab);
@ -89,6 +82,12 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
return new LibraryFragment(); return new LibraryFragment();
} }
@Override
public void onDestroyView() {
super.onDestroyView();
disposable.dispose();
}
@Nullable @Nullable
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@ -295,9 +294,10 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_ALBUM)); .setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_ALBUM));
sortOrderMenu.add(0, R.id.action_song_sort_order_year, 4, R.string.sort_order_year) sortOrderMenu.add(0, R.id.action_song_sort_order_year, 4, R.string.sort_order_year)
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_YEAR)); .setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_YEAR));
sortOrderMenu.add(0, R.id.action_song_sort_order_date, 4, R.string.sort_order_date) sortOrderMenu.add(0, R.id.action_song_sort_order_date, 5, R.string.sort_order_date)
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_DATE)); .setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_DATE));
sortOrderMenu.add(0, R.id.action_song_sort_order_composer, 6, R.string.sort_order_composer)
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.COMPOSER));
} }
sortOrderMenu.setGroupCheckable(0, true, true); sortOrderMenu.setGroupCheckable(0, true, true);
@ -351,6 +351,9 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
case R.id.action_song_sort_order_date: case R.id.action_song_sort_order_date:
sortOrder = SortOrder.SongSortOrder.SONG_DATE; sortOrder = SortOrder.SongSortOrder.SONG_DATE;
break; break;
case R.id.action_song_sort_order_composer:
sortOrder = SortOrder.SongSortOrder.COMPOSER;
break;
} }
} }

View file

@ -173,7 +173,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
private fun setupToolbar() { private fun setupToolbar() {
toolbar.navigationIcon = TintHelper.createTintedDrawable(ContextCompat.getDrawable(context!!, R.drawable.ic_search_white_24dp), ThemeStore.textColorSecondary(context!!)) toolbar.navigationIcon = TintHelper.createTintedDrawable(ContextCompat.getDrawable(context!!, R.drawable.ic_search_white_24dp), ThemeStore.textColorSecondary(context!!))
mainActivity.title = null mainActivity.title = null
mainActivity.setSupportActionBar(toolbar)
toolbar.setBackgroundColor(Color.TRANSPARENT) toolbar.setBackgroundColor(Color.TRANSPARENT)
} }

View file

@ -27,7 +27,6 @@ import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_player_playback_controls.* import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.* import kotlinx.android.synthetic.main.media_button.*
import kotlinx.android.synthetic.main.player_time.*
class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() { class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {

View file

@ -25,7 +25,6 @@ import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import kotlinx.android.synthetic.main.fragment_player_playback_controls.* import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.* import kotlinx.android.synthetic.main.media_button.*
import kotlinx.android.synthetic.main.player_time.*
class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() { class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() {

View file

@ -27,7 +27,6 @@ import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import kotlinx.android.synthetic.main.fragment_player_playback_controls.* import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.* import kotlinx.android.synthetic.main.media_button.*
import kotlinx.android.synthetic.main.player_time.*
class FitPlaybackControlsFragment : AbsPlayerControlsFragment() { class FitPlaybackControlsFragment : AbsPlayerControlsFragment() {

View file

@ -27,7 +27,6 @@ import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_flat_player_playback_controls.* import kotlinx.android.synthetic.main.fragment_flat_player_playback_controls.*
import kotlinx.android.synthetic.main.player_time.*
class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback { class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback {

View file

@ -1,22 +1,32 @@
package code.name.monkey.retromusic.ui.fragments.player.full package code.name.monkey.retromusic.ui.fragments.player.full
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.annotation.SuppressLint
import android.app.AlertDialog
import android.content.res.ColorStateList
import android.graphics.Color import android.graphics.Color
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.os.AsyncTask
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.MenuItem
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.animation.DecelerateInterpolator import android.view.animation.DecelerateInterpolator
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
import android.widget.PopupMenu
import android.widget.SeekBar import android.widget.SeekBar
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.service.MusicService import code.name.monkey.retromusic.service.MusicService
import code.name.monkey.retromusic.ui.fragments.VolumeFragment import code.name.monkey.retromusic.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
@ -24,13 +34,12 @@ import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_full_player_controls.* import kotlinx.android.synthetic.main.fragment_full_player_controls.*
import kotlinx.android.synthetic.main.player_time.*
/** /**
* Created by hemanths on 20/09/17. * Created by hemanths on 20/09/17.
*/ */
class FullPlaybackControlsFragment : AbsPlayerControlsFragment() { class FullPlaybackControlsFragment : AbsPlayerControlsFragment(), PopupMenu.OnMenuItemClickListener {
private var lastPlaybackControlsColor: Int = 0 private var lastPlaybackControlsColor: Int = 0
private var lastDisabledPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0
@ -107,7 +116,11 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
} else { } else {
ThemeStore.accentColor(context!!) ThemeStore.accentColor(context!!)
} }
setProgressBarColor(colorFinal) text.setTextColor(colorFinal)
ViewUtil.setProgressDrawable(progressSlider, colorFinal, true)
playPauseButton.backgroundTintList = ColorStateList.valueOf(colorFinal)
playPauseButton.imageTintList = ColorStateList.valueOf(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(colorFinal)))
updateRepeatState() updateRepeatState()
updateShuffleState() updateShuffleState()
@ -115,10 +128,6 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
} }
private fun setProgressBarColor(dark: Int) {
ViewUtil.setProgressDrawable(progressSlider, dark)
}
override fun onServiceConnected() { override fun onServiceConnected() {
updatePlayPauseDrawableState() updatePlayPauseDrawableState()
updateRepeatState() updateRepeatState()
@ -130,6 +139,7 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
val song = MusicPlayerRemote.currentSong val song = MusicPlayerRemote.currentSong
title.text = song.title title.text = song.title
text.text = song.artistName text.text = song.artistName
updateIsFavorite()
} }
override fun onPlayingMetaChanged() { override fun onPlayingMetaChanged() {
@ -166,6 +176,21 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
setUpRepeatButton() setUpRepeatButton()
setUpShuffleButton() setUpShuffleButton()
setUpProgressSlider() setUpProgressSlider()
setupFavourite()
setupMenu()
}
private fun setupMenu() {
playerMenu.setOnClickListener {
val popupMenu = PopupMenu(context!!, it)
popupMenu.setOnMenuItemClickListener(this)
popupMenu.inflate(R.menu.menu_player)
popupMenu.show()
}
}
override fun onMenuItemClick(item: MenuItem?): Boolean {
return (parentFragment as FullPlayerFragment).onMenuItemClick(item!!)
} }
private fun setUpPrevNext() { private fun setUpPrevNext() {
@ -231,4 +256,55 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
} }
} }
} }
private fun setupFavourite() {
songFavourite?.setOnClickListener {
toggleFavorite(MusicPlayerRemote.currentSong)
}
}
private fun toggleFavorite(song: Song) {
MusicUtil.toggleFavorite(activity!!, song)
if (song.id == MusicPlayerRemote.currentSong.id) {
updateIsFavorite()
}
}
private var updateIsFavoriteTask: AsyncTask<*, *, *>? = null
@SuppressLint("StaticFieldLeak")
fun updateIsFavorite() {
if (updateIsFavoriteTask != null) {
updateIsFavoriteTask!!.cancel(false)
}
updateIsFavoriteTask = object : AsyncTask<Song, Void, Boolean>() {
override fun doInBackground(vararg params: Song): Boolean? {
val activity = activity
return if (activity != null) {
MusicUtil.isFavorite(getActivity()!!, params[0])
} else {
cancel(false)
null
}
}
override fun onPostExecute(isFavorite: Boolean?) {
val activity = activity
if (activity != null) {
val res = if (isFavorite!!)
R.drawable.ic_favorite_white_24dp
else
R.drawable.ic_favorite_border_white_24dp
val drawable = TintHelper.createTintedDrawable(activity, res, Color.WHITE)
songFavourite?.setImageDrawable(drawable)
}
}
}.execute(MusicPlayerRemote.currentSong)
}
fun onFavoriteToggled() {
toggleFavorite(MusicPlayerRemote.currentSong)
}
} }

View file

@ -8,10 +8,20 @@ import android.view.ViewGroup
import androidx.appcompat.widget.Toolbar import androidx.appcompat.widget.Toolbar
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.extensions.hide
import code.name.monkey.retromusic.extensions.show
import code.name.monkey.retromusic.glide.GlideApp
import code.name.monkey.retromusic.glide.RetroGlideExtension
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.loaders.ArtistLoader
import code.name.monkey.retromusic.model.Song import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment
import code.name.monkey.retromusic.util.NavigationUtil
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.fragment_full.* import kotlinx.android.synthetic.main.fragment_full.*
class FullPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks { class FullPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks {
@ -26,10 +36,8 @@ class FullPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbac
private fun setUpPlayerToolbar() { private fun setUpPlayerToolbar() {
playerToolbar.apply { playerToolbar.apply {
inflateMenu(R.menu.menu_player)
setNavigationIcon(R.drawable.ic_close_white_24dp) setNavigationIcon(R.drawable.ic_close_white_24dp)
setNavigationOnClickListener { activity!!.onBackPressed() } setNavigationOnClickListener { activity!!.onBackPressed() }
setOnMenuItemClickListener(this@FullPlayerFragment)
} }
} }
@ -42,6 +50,13 @@ class FullPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbac
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
setUpSubFragments() setUpSubFragments()
setUpPlayerToolbar() setUpPlayerToolbar()
setupArtist()
}
private fun setupArtist() {
artistImage.setOnClickListener {
NavigationUtil.goToArtist(activity!!, MusicPlayerRemote.currentSong.artistId)
}
} }
private fun setUpSubFragments() { private fun setUpSubFragments() {
@ -77,6 +92,7 @@ class FullPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbac
override fun onFavoriteToggled() { override fun onFavoriteToggled() {
toggleFavorite(MusicPlayerRemote.currentSong) toggleFavorite(MusicPlayerRemote.currentSong)
fullPlaybackControlsFragment.onFavoriteToggled()
} }
override fun toggleFavorite(song: Song) { override fun toggleFavorite(song: Song) {
@ -85,4 +101,64 @@ class FullPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbac
updateIsFavorite() updateIsFavorite()
} }
} }
override fun onServiceConnected() {
super.onServiceConnected()
updateArtistImage()
updateLabel()
}
override fun onPlayingMetaChanged() {
super.onPlayingMetaChanged()
updateArtistImage()
updateLabel()
}
override fun onDestroyView() {
super.onDestroyView()
compositeDisposable.dispose()
}
private val compositeDisposable = CompositeDisposable()
private fun updateArtistImage() {
compositeDisposable.addAll(ArtistLoader.getArtist(context!!, MusicPlayerRemote.currentSong.artistId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
GlideApp.with(activity!!)
.asBitmapPalette()
.load(RetroGlideExtension.getArtistModel(it))
.transition(RetroGlideExtension.getDefaultTransition())
.artistOptions(it)
.dontAnimate()
.into(object : RetroMusicColoredTarget(artistImage) {
override fun onColorReady(color: Int) {
}
})
})
}
override fun onQueueChanged() {
super.onQueueChanged()
if (MusicPlayerRemote.playingQueue.isNotEmpty()) updateLabel()
}
private fun updateLabel() {
(MusicPlayerRemote.playingQueue.size - 1).apply {
println("Log Position $this ${MusicPlayerRemote.position}")
if (this == (MusicPlayerRemote.position)) {
nextSongLabel.setText(R.string.last_song)
nextSong.hide()
} else {
val title = MusicPlayerRemote.playingQueue[MusicPlayerRemote.position + 1].title
nextSongLabel.setText(R.string.next_song)
nextSong.apply {
text = title
show()
}
}
}
}
} }

View file

@ -24,7 +24,6 @@ import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_material_playback_controls.* import kotlinx.android.synthetic.main.fragment_material_playback_controls.*
import kotlinx.android.synthetic.main.player_time.*
/** /**
* @author Hemanth S (h4h13). * @author Hemanth S (h4h13).
@ -114,6 +113,7 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
} }
text.setTextColor(colorFinal) text.setTextColor(colorFinal)
ViewUtil.setProgressDrawable(progressSlider, ColorUtil.stripAlpha(colorFinal), true) ViewUtil.setProgressDrawable(progressSlider, ColorUtil.stripAlpha(colorFinal), true)
volumeFragment.setTintable(colorFinal) volumeFragment.setTintable(colorFinal)
updatePlayPauseColor() updatePlayPauseColor()

View file

@ -76,7 +76,6 @@ class PlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks {
} }
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
val display = activity?.windowManager?.defaultDisplay val display = activity?.windowManager?.defaultDisplay
val outMetrics = DisplayMetrics() val outMetrics = DisplayMetrics()
display?.getMetrics(outMetrics) display?.getMetrics(outMetrics)
@ -85,9 +84,11 @@ class PlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks {
val dpHeight = outMetrics.heightPixels / density val dpHeight = outMetrics.heightPixels / density
val dpWidth = outMetrics.widthPixels / density val dpWidth = outMetrics.widthPixels / density
playerAlbumCoverContainer?.layoutParams?.width = RetroUtil.convertDpToPixel(dpWidth - 20, context!!).toInt() playerAlbumCoverContainer?.layoutParams?.height = RetroUtil.convertDpToPixel((dpWidth - getCutOff()), context!!).toInt()
} }
private fun getCutOff(): Int {
return if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) 20 else 0
} }
override fun toggleFavorite(song: Song) { override fun toggleFavorite(song: Song) {

View file

@ -27,7 +27,6 @@ import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_player_playback_controls.* import kotlinx.android.synthetic.main.fragment_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.* import kotlinx.android.synthetic.main.media_button.*
import kotlinx.android.synthetic.main.player_time.*
class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() { class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
@ -79,11 +78,14 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
ThemeStore.accentColor(context!!) ThemeStore.accentColor(context!!)
} }
volumeFragment.setTintable(colorFinal)
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false) TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false)
TintHelper.setTintAuto(playPauseButton, colorFinal, true) TintHelper.setTintAuto(playPauseButton, colorFinal, true)
ViewUtil.setProgressDrawable(progressSlider, colorFinal) ViewUtil.setProgressDrawable(progressSlider, colorFinal)
volumeFragment.setTintable(colorFinal)
updateRepeatState() updateRepeatState()
updateShuffleState() updateShuffleState()
updatePrevNextColor() updatePrevNextColor()

View file

@ -12,7 +12,6 @@ import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import androidx.core.app.ActivityOptionsCompat; import androidx.core.app.ActivityOptionsCompat;
import androidx.core.util.Pair; import androidx.core.util.Pair;
import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.helper.MusicPlayerRemote; import code.name.monkey.retromusic.helper.MusicPlayerRemote;
import code.name.monkey.retromusic.model.Genre; import code.name.monkey.retromusic.model.Genre;
@ -57,6 +56,14 @@ public class NavigationUtil {
ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle()); ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle());
} }
public static void goToArtist(@NonNull Activity activity, int i) {
Intent intent = new Intent(activity, ArtistDetailActivity.class);
intent.putExtra(ArtistDetailActivity.EXTRA_ARTIST_ID, i);
//noinspection unchecked
ActivityCompat.startActivity(activity, intent,
ActivityOptionsCompat.makeSceneTransitionAnimation(activity, null).toBundle());
}
public static void goToPlaylistNew(@NonNull Activity activity, Playlist playlist) { public static void goToPlaylistNew(@NonNull Activity activity, Playlist playlist) {
Intent intent = new Intent(activity, PlaylistDetailActivity.class); Intent intent = new Intent(activity, PlaylistDetailActivity.class);
intent.putExtra(PlaylistDetailActivity.Companion.getEXTRA_PLAYLIST(), playlist); intent.putExtra(PlaylistDetailActivity.Companion.getEXTRA_PLAYLIST(), playlist);

View file

@ -40,7 +40,7 @@ class ColorIconsImageView : AppCompatImageView {
0.12f 0.12f
} }
val filterColor = if (ATHUtil.isWindowBackgroundDark(context)) { val filterColor = if (ATHUtil.isWindowBackgroundDark(context)) {
ThemeStore.textColorPrimary(context) ThemeStore.primaryColor(context)
} else { } else {
color color
} }

View file

@ -56,7 +56,7 @@ public class RoundedBottomSheetDialogFragment extends AppCompatDialogFragment {
@NonNull @NonNull
@Override @Override
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(@NonNull Bundle savedInstanceState) {
//noinspection ConstantConditions //noinspection ConstantConditions
return new CustomWidthBottomSheetDialog(getContext(), getTheme()); return new CustomWidthBottomSheetDialog(getContext(), getTheme());
} }

View file

@ -6,23 +6,26 @@ import android.util.AttributeSet;
import android.view.WindowInsets; import android.view.WindowInsets;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import androidx.annotation.NonNull;
public class StatusBarMarginFrameLayout extends FrameLayout { public class StatusBarMarginFrameLayout extends FrameLayout {
public StatusBarMarginFrameLayout(Context context) { public StatusBarMarginFrameLayout(@NonNull Context context) {
super(context); super(context);
} }
public StatusBarMarginFrameLayout(Context context, AttributeSet attrs) { public StatusBarMarginFrameLayout(@NonNull Context context, @NonNull AttributeSet attrs) {
super(context, attrs); super(context, attrs);
} }
public StatusBarMarginFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) { public StatusBarMarginFrameLayout(@NonNull Context context, @NonNull AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr); super(context, attrs, defStyleAttr);
} }
@NonNull
@Override @Override
public WindowInsets onApplyWindowInsets(WindowInsets insets) { public WindowInsets onApplyWindowInsets(@NonNull WindowInsets insets) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
MarginLayoutParams lp = (MarginLayoutParams) getLayoutParams(); MarginLayoutParams lp = (MarginLayoutParams) getLayoutParams();
lp.topMargin = insets.getSystemWindowInsetTop(); lp.topMargin = insets.getSystemWindowInsetTop();

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

View file

@ -1,81 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true">
<View
android:id="@+id/colorGradientBackground"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.jetradarmobile.snowfall.SnowfallView
android:id="@+id/snowfall"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include layout="@layout/shadow_statusbar_toolbar" />
<code.name.monkey.retromusic.views.FitSystemWindowsLayout
android:id="@+id/safeArea"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/status_bar" />
</FrameLayout>
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:id="@+id/playerAlbumCoverContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<fragment
android:id="@+id/playerAlbumCoverFragment"
android:name="code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_album_cover" />
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<fragment
android:id="@+id/playbackControlsFragment"
android:name="code.name.monkey.retromusic.ui.fragments.player.normal.PlayerPlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_player_playback_controls" />
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0">
<androidx.appcompat.widget.Toolbar
android:id="@+id/playerToolbar"
style="@style/Toolbar"
android:layout_gravity="bottom"
android:navigationIcon="@drawable/ic_close_white_24dp"
app:navigationIcon="@drawable/ic_close_white_24dp" />
</FrameLayout>
</LinearLayout>
</code.name.monkey.retromusic.views.FitSystemWindowsLayout>
</FrameLayout>

View file

@ -22,7 +22,7 @@
android:id="@+id/sectionTitle" android:id="@+id/sectionTitle"
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance"
android:text="@string/for_you" android:text="@string/for_you"
android:textStyle="bold" /> />
</LinearLayout> </LinearLayout>

View file

@ -143,6 +143,23 @@
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/songComposerText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_vertical"
android:hint="@string/composer"
android:inputType="text|textCapWords"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.AppCompat.Title" />
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -26,11 +26,6 @@
android:text="@string/whats_new" /> android:text="@string/whats_new" />
</androidx.appcompat.widget.Toolbar> </androidx.appcompat.widget.Toolbar>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?dividerColor" />
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<WebView <WebView

View file

@ -10,50 +10,56 @@
android:orientation="vertical" android:orientation="vertical"
tools:ignore="MissingPrefix"> tools:ignore="MissingPrefix">
<SeekBar
android:id="@+id/progressSlider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxHeight="3dp"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:progressDrawable="@drawable/color_progress_seek"
tools:progress="20" />
<LinearLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/progress_container_height"
android:gravity="center_vertical" android:layout_marginTop="8dp"
android:orientation="horizontal" android:layout_marginBottom="8dp"
android:paddingStart="16dp" android:paddingStart="12dp"
android:paddingEnd="16dp"> android:paddingEnd="12dp">
<TextView <TextView
android:id="@+id/songCurrentProgress" android:id="@+id/songCurrentProgress"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_weight="1" android:layout_alignParentLeft="true"
android:paddingStart="8dp" android:fontFamily="sans-serif-medium"
android:paddingEnd="8dp" android:gravity="center_vertical|left|end"
android:textColor="?android:attr/textColorSecondary" android:paddingLeft="8dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
android:textSize="12sp" android:textSize="12sp"
android:textStyle="bold" tools:ignore="RtlHardcoded,RtlSymmetry" />
tools:text="22.00" />
<TextView <TextView
android:id="@+id/songTotalTime" android:id="@+id/songTotalTime"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_weight="0" android:layout_alignParentRight="true"
android:paddingStart="8dp" android:fontFamily="sans-serif-medium"
android:paddingEnd="8dp" android:gravity="center_vertical|right|end"
android:textColor="?android:attr/textColorSecondary" android:paddingRight="8dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
android:textSize="12sp" android:textSize="12sp"
android:textStyle="bold" tools:ignore="RtlHardcoded,RtlSymmetry" />
tools:text="22.00" />
</LinearLayout> <SeekBar
android:id="@+id/progressSlider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/songTotalTime"
android:layout_toRightOf="@id/songCurrentProgress"
android:maxHeight="3dp"
android:progressDrawable="@drawable/color_progress_seek"
android:splitTrack="false"
tools:ignore="RtlHardcoded,UnusedAttribute"
tools:progress="20" />
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/playerMediaControllerContainer" android:id="@+id/playerMediaControllerContainer"

View file

@ -16,7 +16,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:cardCornerRadius="8dp" app:cardCornerRadius="8dp"
app:cardElevation="16dp" app:cardElevation="8dp"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="true">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView

View file

@ -89,7 +89,6 @@
android:id="@+id/playerPanel" android:id="@+id/playerPanel"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/status_bar_padding"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView

View file

@ -8,17 +8,55 @@
android:orientation="vertical" android:orientation="vertical"
tools:ignore="MissingPrefix"> tools:ignore="MissingPrefix">
<androidx.appcompat.widget.AppCompatSeekBar <RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/progress_container_height"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:paddingStart="12dp"
android:paddingEnd="12dp">
<TextView
android:id="@+id/songCurrentProgress"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical|left|end"
android:paddingLeft="8dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/songTotalTime"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical|right|end"
android:paddingRight="8dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<SeekBar
android:id="@+id/progressSlider" android:id="@+id/progressSlider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/songTotalTime"
android:layout_toRightOf="@id/songCurrentProgress"
android:maxHeight="3dp"
android:progressDrawable="@drawable/color_progress_seek"
android:splitTrack="false" android:splitTrack="false"
android:thumb="@drawable/slider_thumb" android:thumb="@drawable/switch_square"
tools:ignore="RtlHardcoded,UnusedAttribute" /> tools:ignore="RtlHardcoded,UnusedAttribute"
tools:progress="20" />
</RelativeLayout>
<include layout="@layout/player_time" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -16,7 +17,7 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#50000000" /> android:background="#90000000" />
<code.name.monkey.retromusic.views.FitSystemWindowsLayout <code.name.monkey.retromusic.views.FitSystemWindowsLayout
android:id="@+id/safeArea" android:id="@+id/safeArea"
@ -37,17 +38,80 @@
android:layout_gravity="bottom" android:layout_gravity="bottom"
tools:layout="@layout/fragment_full_player_controls" /> tools:layout="@layout/fragment_full_player_controls" />
<FrameLayout
</LinearLayout>
</code.name.monkey.retromusic.views.FitSystemWindowsLayout>
<LinearLayout
android:id="@+id/toolbar_container" android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<include layout="@layout/status_bar" />
</FrameLayout>
<androidx.appcompat.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:id="@+id/playerToolbar" android:id="@+id/playerToolbar"
style="@style/Toolbar" style="@style/Toolbar"
android:navigationIcon="@drawable/ic_close_white_24dp" /> android:navigationIcon="@drawable/ic_close_white_24dp">
</FrameLayout> <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/nextSongLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:alpha="0.75"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:text="@string/next_song"
android:textColor="@color/md_white_1000"
app:layout_constraintEnd_toStartOf="@+id/artistImage"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/nextSong"
style="@style/TextAppearance.MaterialComponents.Subtitle1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:maxLines="2"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="@color/md_white_1000"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/artistImage"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/nextSongLabel"
tools:text="@string/for_you" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/artistImage"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="end"
android:layout_marginEnd="8dp"
android:elevation="10dp"
app:civ_border="false"
app:civ_shadow="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/default_artist_art" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.Toolbar>
</LinearLayout> </LinearLayout>
</code.name.monkey.retromusic.views.FitSystemWindowsLayout>
</FrameLayout> </FrameLayout>

View file

@ -5,50 +5,127 @@
android:id="@+id/player_footer_frame" android:id="@+id/player_footer_frame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical"
tools:background="@color/md_grey_800">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/playerMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_more_vert_white_24dp" />
<TextView <TextView
android:id="@+id/title" android:id="@+id/title"
android:layout_width="match_parent" style="@style/TextAppearance.MaterialComponents.Subtitle1"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center" android:gravity="center"
android:maxLines="1"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:paddingBottom="8dp" android:textColor="@color/md_white_1000"
android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Title" app:layout_constraintEnd_toStartOf="@+id/songFavourite"
android:textColor="@color/md_white_1000" /> app:layout_constraintStart_toEndOf="@+id/playerMenu"
app:layout_constraintTop_toTopOf="parent"
tools:text="@string/for_you" />
<TextView <TextView
android:id="@+id/text" android:id="@+id/text"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:alpha="0.75" android:alpha="0.75"
android:ellipsize="end"
android:gravity="center" android:gravity="center"
android:maxLines="2"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:paddingBottom="16dp" android:textColor="@color/md_white_1000"
android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Subtitle" app:layout_constraintBottom_toBottomOf="parent"
android:textColor="@color/md_white_1000" /> app:layout_constraintEnd_toStartOf="@+id/songFavourite"
app:layout_constraintStart_toEndOf="@+id/playerMenu"
app:layout_constraintTop_toBottomOf="@+id/title"
tools:text="@string/for_you" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/songFavourite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/ic_favorite_border_white_24dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="28dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:paddingStart="12dp"
android:paddingEnd="12dp">
<TextView
android:id="@+id/songCurrentProgress"
style="@style/TextAppearance.MaterialComponents.Body1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical|left|end"
android:paddingLeft="8dp"
android:singleLine="true"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry"
tools:text="00:00" />
<TextView
android:id="@+id/songTotalTime"
style="@style/TextAppearance.MaterialComponents.Body1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical|right|end"
android:paddingRight="8dp"
android:singleLine="true"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry"
tools:text="00:00" />
<SeekBar <SeekBar
android:id="@+id/progressSlider" android:id="@+id/progressSlider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/songTotalTime"
android:layout_toRightOf="@id/songCurrentProgress"
android:maxHeight="3dp" android:maxHeight="3dp"
android:paddingStart="22dp"
android:paddingEnd="22dp"
android:paddingBottom="4dp"
android:progressDrawable="@drawable/color_progress_seek" android:progressDrawable="@drawable/color_progress_seek"
android:splitTrack="false" android:splitTrack="false"
android:thumb="@drawable/switch_thumb_material" tools:ignore="RtlHardcoded,UnusedAttribute"
tools:progress="20" /> tools:progress="20" />
</RelativeLayout>
<include layout="@layout/player_time" />
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layoutDirection="ltr" android:layoutDirection="ltr"
android:minHeight="96dp"
tools:ignore="ContentDescription,UnusedAttribute"> tools:ignore="ContentDescription,UnusedAttribute">
<ImageButton <ImageButton
@ -105,15 +182,22 @@
app:srcCompat="@drawable/ic_shuffle_white_24dp" app:srcCompat="@drawable/ic_shuffle_white_24dp"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<ImageButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/playPauseButton" android:id="@+id/playPauseButton"
android:layout_width="72dp" android:layout_width="wrap_content"
android:layout_height="72dp" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@drawable/line_button" android:background="@drawable/line_button"
android:foreground="?attr/roundSelector" android:foreground="?attr/roundSelector"
android:padding="20dp" android:padding="20dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:backgroundTint="@color/md_grey_200"
app:borderWidth="0dp"
app:elevation="0dp"
app:fabCustomSize="68dp"
app:fabSize="auto"
app:maxImageSize="32dp"
app:pressedTranslationZ="12dp"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:src="@drawable/ic_pause_white_24dp" /> tools:src="@drawable/ic_pause_white_24dp" />

View file

@ -9,17 +9,54 @@
android:orientation="vertical" android:orientation="vertical"
tools:ignore="MissingPrefix"> tools:ignore="MissingPrefix">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="28dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:paddingStart="12dp"
android:paddingEnd="12dp">
<TextView
android:id="@+id/songCurrentProgress"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical|left|end"
android:paddingLeft="8dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/songTotalTime"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical|right|end"
android:paddingRight="8dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<SeekBar <SeekBar
android:id="@+id/progressSlider" android:id="@+id/progressSlider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/songTotalTime"
android:layout_toRightOf="@id/songCurrentProgress"
android:maxHeight="3dp" android:maxHeight="3dp"
android:progressDrawable="@drawable/color_progress_seek" android:progressDrawable="@drawable/color_progress_seek"
android:paddingStart="24dp" android:splitTrack="false"
android:paddingEnd="24dp" tools:ignore="RtlHardcoded,UnusedAttribute"
tools:progress="20" /> tools:progress="20" />
</RelativeLayout>
<include layout="@layout/player_time" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -36,9 +36,11 @@
<include layout="@layout/status_bar" /> <include layout="@layout/status_bar" />
</FrameLayout> </FrameLayout>
<code.name.monkey.retromusic.views.WidthFitSquareLayout <FrameLayout
android:id="@+id/playerAlbumCoverContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_weight="0">
<fragment <fragment
android:id="@+id/playerAlbumCoverFragment" android:id="@+id/playerAlbumCoverFragment"
@ -46,11 +48,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:layout="@layout/fragment_album_cover" /> tools:layout="@layout/fragment_album_cover" />
</code.name.monkey.retromusic.views.WidthFitSquareLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="1"> android:layout_weight="1">
<fragment <fragment
@ -62,7 +64,6 @@
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0"> android:layout_weight="0">

View file

@ -8,19 +8,53 @@
android:orientation="vertical" android:orientation="vertical"
tools:ignore="MissingPrefix"> tools:ignore="MissingPrefix">
<RelativeLayout
android:paddingEnd="12dp"
android:paddingStart="12dp"
android:layout_width="match_parent"
android:layout_height="28dp">
<TextView
android:id="@+id/songCurrentProgress"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical|left|end"
android:paddingLeft="8dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/songTotalTime"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical|right|end"
android:paddingRight="8dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<SeekBar <SeekBar
android:id="@+id/progressSlider" android:id="@+id/progressSlider"
android:layout_width="match_parent" style="@style/MusicProgressSlider"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@id/songTotalTime"
android:layout_toRightOf="@id/songCurrentProgress"
android:maxHeight="3dp" android:maxHeight="3dp"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:progressDrawable="@drawable/color_progress_seek" android:progressDrawable="@drawable/color_progress_seek"
android:splitTrack="false" android:splitTrack="false"
android:thumb="@drawable/switch_thumb_material" android:thumb="@drawable/switch_thumb_material"
tools:ignore="RtlHardcoded,UnusedAttribute"
tools:progress="20" /> tools:progress="20" />
</RelativeLayout>
<include layout="@layout/player_time" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -13,7 +13,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0" android:layout_weight="0"
android:background="?roundSelector" android:background="?roundSelector"
android:padding="16dp" android:padding="12dp"
app:srcCompat="@drawable/ic_volume_down_white_24dp" /> app:srcCompat="@drawable/ic_volume_down_white_24dp" />
<androidx.appcompat.widget.AppCompatSeekBar <androidx.appcompat.widget.AppCompatSeekBar
@ -30,6 +30,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0" android:layout_weight="0"
android:background="?roundSelector" android:background="?roundSelector"
android:padding="16dp" android:padding="12dp"
app:srcCompat="@drawable/ic_volume_up_white_24dp" /> app:srcCompat="@drawable/ic_volume_up_white_24dp" />
</LinearLayout> </LinearLayout>

View file

@ -20,8 +20,7 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/sectionTitle" android:id="@+id/sectionTitle"
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance" />
android:textStyle="bold" />
</LinearLayout> </LinearLayout>

View file

@ -20,8 +20,7 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/sectionTitle" android:id="@+id/sectionTitle"
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance" />
android:textStyle="bold" />
</LinearLayout> </LinearLayout>

View file

@ -22,8 +22,7 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/sectionTitle" android:id="@+id/sectionTitle"
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance" />
android:textStyle="bold" />
</LinearLayout> </LinearLayout>

View file

@ -16,6 +16,7 @@
<item name="action_song_sort_order_album" type="id" /> <item name="action_song_sort_order_album" type="id" />
<item name="action_song_sort_order_year" type="id" /> <item name="action_song_sort_order_year" type="id" />
<item name="action_song_sort_order_date" type="id" /> <item name="action_song_sort_order_date" type="id" />
<item name="action_song_sort_order_composer" type="id" />
<item name="action_multi_select_adapter_check_all" type="id" /> <item name="action_multi_select_adapter_check_all" type="id" />
</resources> </resources>

View file

@ -598,5 +598,9 @@
<string name="md_error_label">Error</string> <string name="md_error_label">Error</string>
<string name="md_storage_perm_error">Permission error</string> <string name="md_storage_perm_error">Permission error</string>
<string name="classic">Classic</string> <string name="classic">Classic</string>
<string name="sort_order_composer">Composer</string>
<string name="composer">Composer</string>
<string name="next_song">Next Song</string>
<string name="last_song">Last song</string>
</resources> </resources>

View file

@ -1,4 +1,4 @@
#Fri Jan 18 19:55:16 IST 2019 #Sun Feb 24 22:42:48 IST 2019
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME