1.7.100
This commit is contained in:
parent
3d2adc1ca2
commit
c648dcb378
84 changed files with 6018 additions and 5405 deletions
|
@ -133,6 +133,7 @@
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-libraries" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-libraries" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/checkNormalDebugClasspath" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/compatible_screen_manifest" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/compatible_screen_manifest" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
|
||||||
|
@ -141,18 +142,14 @@
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-apk" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-apk" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_main_apk_resources" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_main_apk_resources" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_merged_manifests" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_merged_manifests" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_split_apk_resources" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javac" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javac" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/linked_res_for_bundle" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint_jar" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifest-checker" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifest-checker" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged-not-compiled-resources" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_assets" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_assets" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/module_bundle" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
|
||||||
|
|
|
@ -11,8 +11,8 @@ android {
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|
||||||
applicationId "code.name.monkey.retromusic"
|
applicationId "code.name.monkey.retromusic"
|
||||||
versionCode 207
|
versionCode 209
|
||||||
versionName '1.7.10'
|
versionName '1.7.100'
|
||||||
|
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ static def getProperty(Properties properties, String name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static def getDate() {
|
static def getDate() {
|
||||||
new Date().format('yyyyMMdd')
|
new Date().format('MMdd')
|
||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -26,7 +26,7 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body style="padding: 1.0rem 0.5rem 2.5rem 0.5rem;">
|
<body style="padding: 1.0rem 0.5rem 1.0rem 0.5rem;">
|
||||||
<p><b><a href="https://github.com/kabouzeid/Phonograph" title="Phonograph"> Phonograph</a></b> by Karim Abou Zeid</p>
|
<p><b><a href="https://github.com/kabouzeid/Phonograph" title="Phonograph"> Phonograph</a></b> by Karim Abou Zeid</p>
|
||||||
<p><b><a href="https://github.com/ReactiveX/RxAndroid" title="RxAndroid"> RxAndroid</a></b> by RxAndroid authors</p>
|
<p><b><a href="https://github.com/ReactiveX/RxAndroid" title="RxAndroid"> RxAndroid</a></b> by RxAndroid authors</p>
|
||||||
<p><b><a href="https://github.com/ReactiveX/RxAndroid" title="RxJava"> RxJava</a></b> by RxJava authors</p>
|
<p><b><a href="https://github.com/ReactiveX/RxAndroid" title="RxJava"> RxJava</a></b> by RxJava authors</p>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
<html>
<head>
<style type="text/css">
* {
word-wrap: break-word;
}
{style-placeholder}
a {
color: #{link-color};
}
a:active {
color: #{link-color-active};
}
ol {
list-style-position: inside;
padding-left: 0;
padding-right: 0;
}
li {
padding-top: 8px;
}
</style>
</head>
<body>
<p>You can view the changelog dialog again at any time from the <i>about</i> section.</p>
<h3>Version 1.7.50</h3>
<ol>
<li><b>Fix:</b> Playlist renaming</li>
<li><b>Improvement:</b> Version naming</li>
<li><b>Added:</b> Changelog dialog</li>
<li><b>Added:</b> Home banner toggle.</li>
<li><b>Improvement:</b> Grammatical mistakes</li>
</ol>
</body>
|
<html>
<head>
<style type="text/css">
* {
word-wrap: break-word;
}
{style-placeholder}
a {
color: #{link-color};
}
a:active {
color: #{link-color-active};
}
ol {
list-style-position: inside;
padding-left: 0;
padding-right: 0;
}
li {
padding-top: 8px;
}
</style>
</head>
<body>
<p>You can view the changelog dialog again at any time from the <i>about</i> section.</p>
<h3>Version 1.7.100</h3>
<ol>
<li><b>Fix:</b> same theme follows entire app </li>
<li><b>Added:</b> Volume toggle for lock screen to support small screen </li>
<li><b>Added:</b> Volume toggle for lock screen to support small screen </li>
</ol>
<h3>Version 1.7.50</h3>
<ol>
<li><b>Fix:</b> Playlist renaming</li>
<li><b>Improvement:</b> Version naming</li>
<li><b>Added:</b> Changelog dialog</li>
<li><b>Added:</b> Home banner toggle.</li>
<li><b>Improvement:</b> Grammatical mistakes</li>
</ol>
</body>
|
|
@ -110,7 +110,8 @@ public class HomeOptionDialog extends RoundedBottomSheetDialogFragment {
|
||||||
if (mainActivity == null) {
|
if (mainActivity == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mainActivity.setCurrentFragment(FoldersFragment.newInstance(getContext()), true);
|
mainActivity.setCurrentFragment(FoldersFragment.newInstance(getContext()), true,
|
||||||
|
FoldersFragment.TAG);
|
||||||
break;
|
break;
|
||||||
case R.id.action_settings:
|
case R.id.action_settings:
|
||||||
NavigationUtil.goToSettings(getActivity());
|
NavigationUtil.goToSettings(getActivity());
|
||||||
|
|
|
@ -1,60 +1,63 @@
|
||||||
package code.name.monkey.retromusic.loaders;
|
package code.name.monkey.retromusic.loaders;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import code.name.monkey.retromusic.model.Playlist;
|
import code.name.monkey.retromusic.model.Playlist;
|
||||||
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist;
|
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist;
|
||||||
import code.name.monkey.retromusic.model.smartplaylist.HistoryPlaylist;
|
import code.name.monkey.retromusic.model.smartplaylist.HistoryPlaylist;
|
||||||
import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist;
|
import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist;
|
||||||
import code.name.monkey.retromusic.model.smartplaylist.MyTopTracksPlaylist;
|
import code.name.monkey.retromusic.model.smartplaylist.MyTopTracksPlaylist;
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class HomeLoader {
|
public class HomeLoader {
|
||||||
|
|
||||||
public static Observable<ArrayList<AbsSmartPlaylist>> getRecentAndTopThings(
|
public static Observable<ArrayList<AbsSmartPlaylist>> getRecentAndTopThings(
|
||||||
@NonNull Context context) {
|
@NonNull Context context) {
|
||||||
ArrayList<AbsSmartPlaylist> objects = new ArrayList<>();
|
ArrayList<AbsSmartPlaylist> objects = new ArrayList<>();
|
||||||
return Observable.create(e -> {
|
return Observable.create(e -> {
|
||||||
|
|
||||||
new HistoryPlaylist(context).getSongs(context).subscribe(songs -> {
|
new HistoryPlaylist(context).getSongs(context).subscribe(songs -> {
|
||||||
if (!songs.isEmpty()) {
|
if (!songs.isEmpty()) {
|
||||||
objects.add(new HistoryPlaylist(context));
|
objects.add(new HistoryPlaylist(context));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
new LastAddedPlaylist(context).getSongs(context).subscribe(songs -> {
|
new LastAddedPlaylist(context).getSongs(context).subscribe(songs -> {
|
||||||
if (!songs.isEmpty()) {
|
if (!songs.isEmpty()) {
|
||||||
objects.add(new LastAddedPlaylist(context));
|
objects.add(new LastAddedPlaylist(context));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
new MyTopTracksPlaylist(context).getSongs(context).subscribe(songs -> {
|
new MyTopTracksPlaylist(context).getSongs(context).subscribe(songs -> {
|
||||||
if (!songs.isEmpty()) {
|
if (!songs.isEmpty()) {
|
||||||
objects.add(new MyTopTracksPlaylist(context));
|
objects.add(new MyTopTracksPlaylist(context));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
e.onNext(objects);
|
e.onNext(objects);
|
||||||
e.onComplete();
|
e.onComplete();
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Observable<ArrayList<Playlist>> getHomeLoader(@NonNull Context context) {
|
|
||||||
ArrayList<Playlist> playlists = new ArrayList<>();
|
|
||||||
PlaylistLoader.getAllPlaylists(context)
|
|
||||||
.subscribe(playlists1 -> {
|
|
||||||
if (playlists1.size() > 0) {
|
|
||||||
for (Playlist playlist : playlists1) {
|
|
||||||
PlaylistSongsLoader.getPlaylistSongList(context, playlist)
|
|
||||||
.subscribe(songs -> {
|
|
||||||
if (songs.size() > 0) {
|
|
||||||
playlists.add(playlist);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return Observable.just(playlists);
|
}
|
||||||
}
|
|
||||||
|
public static Observable<ArrayList<Playlist>> getHomeLoader(@NonNull Context context) {
|
||||||
|
ArrayList<Playlist> playlists = new ArrayList<>();
|
||||||
|
PlaylistLoader.getAllPlaylists(context)
|
||||||
|
.subscribe(playlists1 -> {
|
||||||
|
if (playlists1.size() > 0) {
|
||||||
|
for (Playlist playlist : playlists1) {
|
||||||
|
PlaylistSongsLoader.getPlaylistSongList(context, playlist)
|
||||||
|
.subscribe(songs -> {
|
||||||
|
if (songs.size() > 0) {
|
||||||
|
playlists.add(playlist);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return Observable.just(playlists);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package code.name.monkey.retromusic.model;
|
package code.name.monkey.retromusic.model;
|
||||||
|
|
||||||
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist;
|
import android.support.annotation.StringRes;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
@ -10,41 +10,20 @@ import java.util.ArrayList;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class Home {
|
public class Home {
|
||||||
public String sectionTitle;
|
|
||||||
public ArrayList<Object> list;
|
|
||||||
public AbsSmartPlaylist playlist;
|
|
||||||
|
|
||||||
public Home(String sectionTitle, AbsSmartPlaylist playlist) {
|
private int sectionTitle;
|
||||||
this.sectionTitle = sectionTitle;
|
private ArrayList list;
|
||||||
this.playlist = playlist;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Home(String sectionTitle, ArrayList<Object> list) {
|
public Home(@StringRes int sectionTitle, ArrayList list) {
|
||||||
this.sectionTitle = sectionTitle;
|
this.sectionTitle = sectionTitle;
|
||||||
this.list = list;
|
this.list = list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Home(AbsSmartPlaylist playlist) {
|
public int getSectionTitle() {
|
||||||
this.playlist = playlist;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AbsSmartPlaylist getPlaylist() {
|
|
||||||
return playlist;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "Home{" +
|
|
||||||
"sectionTitle='" + sectionTitle + '\'' +
|
|
||||||
", songs=" + list +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSectionTitle() {
|
|
||||||
return sectionTitle;
|
return sectionTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<Object> getList() {
|
public ArrayList getList() {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
package code.name.monkey.retromusic.mvp.contract;
|
package code.name.monkey.retromusic.mvp.contract;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import code.name.monkey.retromusic.model.Album;
|
import code.name.monkey.retromusic.model.Album;
|
||||||
import code.name.monkey.retromusic.model.Artist;
|
import code.name.monkey.retromusic.model.Artist;
|
||||||
import code.name.monkey.retromusic.model.Genre;
|
import code.name.monkey.retromusic.model.Genre;
|
||||||
import code.name.monkey.retromusic.model.Playlist;
|
import code.name.monkey.retromusic.model.Playlist;
|
||||||
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist;
|
|
||||||
import code.name.monkey.retromusic.mvp.BasePresenter;
|
import code.name.monkey.retromusic.mvp.BasePresenter;
|
||||||
import code.name.monkey.retromusic.mvp.BaseView;
|
import code.name.monkey.retromusic.mvp.BaseView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public interface HomeContract {
|
public interface HomeContract {
|
||||||
|
|
||||||
interface HomeView extends BaseView<ArrayList<Object>> {
|
interface HomeView extends BaseView<ArrayList<Object>> {
|
||||||
|
|
|
@ -2,12 +2,11 @@ package code.name.monkey.retromusic.providers;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import code.name.monkey.retromusic.RetroApplication;
|
|
||||||
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import code.name.monkey.retromusic.Injection;
|
import code.name.monkey.retromusic.Injection;
|
||||||
|
import code.name.monkey.retromusic.RetroApplication;
|
||||||
import code.name.monkey.retromusic.loaders.AlbumLoader;
|
import code.name.monkey.retromusic.loaders.AlbumLoader;
|
||||||
import code.name.monkey.retromusic.loaders.ArtistLoader;
|
import code.name.monkey.retromusic.loaders.ArtistLoader;
|
||||||
import code.name.monkey.retromusic.loaders.GenreLoader;
|
import code.name.monkey.retromusic.loaders.GenreLoader;
|
||||||
|
@ -23,6 +22,7 @@ import code.name.monkey.retromusic.model.Artist;
|
||||||
import code.name.monkey.retromusic.model.Genre;
|
import code.name.monkey.retromusic.model.Genre;
|
||||||
import code.name.monkey.retromusic.model.Playlist;
|
import code.name.monkey.retromusic.model.Playlist;
|
||||||
import code.name.monkey.retromusic.model.Song;
|
import code.name.monkey.retromusic.model.Song;
|
||||||
|
import code.name.monkey.retromusic.model.smartplaylist.AbsSmartPlaylist;
|
||||||
import code.name.monkey.retromusic.providers.interfaces.Repository;
|
import code.name.monkey.retromusic.providers.interfaces.Repository;
|
||||||
import code.name.monkey.retromusic.rest.model.KuGouRawLyric;
|
import code.name.monkey.retromusic.rest.model.KuGouRawLyric;
|
||||||
import code.name.monkey.retromusic.rest.model.KuGouSearchLyricResult;
|
import code.name.monkey.retromusic.rest.model.KuGouSearchLyricResult;
|
||||||
|
@ -39,7 +39,7 @@ public class RepositoryImpl implements Repository {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized RepositoryImpl getInstance( ) {
|
public static synchronized RepositoryImpl getInstance() {
|
||||||
if (INSTANCE == null) {
|
if (INSTANCE == null) {
|
||||||
INSTANCE = new RepositoryImpl(RetroApplication.getInstance());
|
INSTANCE = new RepositoryImpl(RetroApplication.getInstance());
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,45 +16,45 @@ import java.util.ArrayList;
|
||||||
|
|
||||||
public interface Repository {
|
public interface Repository {
|
||||||
|
|
||||||
Observable<ArrayList<Song>> getAllSongs();
|
Observable<ArrayList<Song>> getAllSongs();
|
||||||
|
|
||||||
Observable<ArrayList<AbsSmartPlaylist>> getSuggestionSongs();
|
Observable<ArrayList<AbsSmartPlaylist>> getSuggestionSongs();
|
||||||
|
|
||||||
Observable<Song> getSong(int id);
|
Observable<Song> getSong(int id);
|
||||||
|
|
||||||
Observable<ArrayList<Album>> getAllAlbums();
|
Observable<ArrayList<Album>> getAllAlbums();
|
||||||
|
|
||||||
Observable<ArrayList<Album>> getRecentAlbums();
|
Observable<ArrayList<Album>> getRecentAlbums();
|
||||||
|
|
||||||
Observable<ArrayList<Album>> getTopAlbums();
|
Observable<ArrayList<Album>> getTopAlbums();
|
||||||
|
|
||||||
Observable<Album> getAlbum(int albumId);
|
Observable<Album> getAlbum(int albumId);
|
||||||
|
|
||||||
Observable<ArrayList<Artist>> getAllArtists();
|
Observable<ArrayList<Artist>> getAllArtists();
|
||||||
|
|
||||||
Observable<ArrayList<Artist>> getRecentArtists();
|
Observable<ArrayList<Artist>> getRecentArtists();
|
||||||
|
|
||||||
Observable<ArrayList<Artist>> getTopArtists();
|
Observable<ArrayList<Artist>> getTopArtists();
|
||||||
|
|
||||||
|
|
||||||
Observable<Artist> getArtistById(long artistId);
|
Observable<Artist> getArtistById(long artistId);
|
||||||
|
|
||||||
Observable<ArrayList<Playlist>> getAllPlaylists();
|
Observable<ArrayList<Playlist>> getAllPlaylists();
|
||||||
|
|
||||||
Observable<ArrayList<Song>> getFavoriteSongs();
|
Observable<ArrayList<Song>> getFavoriteSongs();
|
||||||
|
|
||||||
Observable<ArrayList<Object>> search(String query);
|
Observable<ArrayList<Object>> search(String query);
|
||||||
|
|
||||||
Observable<ArrayList<Song>> getPlaylistSongs(Playlist playlist);
|
Observable<ArrayList<Song>> getPlaylistSongs(Playlist playlist);
|
||||||
|
|
||||||
Observable<ArrayList<Playlist>> getHomeList();
|
Observable<ArrayList<Playlist>> getHomeList();
|
||||||
|
|
||||||
Observable<ArrayList<AbsSmartPlaylist>> getAllThings();
|
Observable<ArrayList<AbsSmartPlaylist>> getAllThings();
|
||||||
|
|
||||||
Observable<ArrayList<Genre>> getAllGenres();
|
Observable<ArrayList<Genre>> getAllGenres();
|
||||||
|
|
||||||
Observable<ArrayList<Song>> getGenre(int genreId);
|
Observable<ArrayList<Song>> getGenre(int genreId);
|
||||||
|
|
||||||
Observable<File> downloadLrcFile(final String title, final String artist, final long duration);
|
Observable<File> downloadLrcFile(final String title, final String artist, final long duration);
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,7 +5,6 @@ import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
|
||||||
import android.support.v4.app.ShareCompat;
|
import android.support.v4.app.ShareCompat;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -40,11 +39,16 @@ public class AboutActivity extends AbsBaseActivity {
|
||||||
|
|
||||||
@BindView(R.id.toolbar)
|
@BindView(R.id.toolbar)
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
|
|
||||||
@BindView(R.id.app_bar)
|
@BindView(R.id.app_bar)
|
||||||
View background;
|
View background;
|
||||||
|
|
||||||
@BindView(R.id.app_version)
|
@BindView(R.id.app_version)
|
||||||
TextView appVersion;
|
TextView appVersion;
|
||||||
|
|
||||||
|
@BindView(R.id.title)
|
||||||
|
TextView title;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -62,7 +66,7 @@ public class AboutActivity extends AbsBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
if (item.getItemId() == android.R.id.home) {
|
if (item.getItemId() == android.R.id.home) {
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
return true;
|
return true;
|
||||||
|
@ -71,13 +75,13 @@ public class AboutActivity extends AbsBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpToolbar() {
|
private void setUpToolbar() {
|
||||||
|
title.setTextColor(ThemeStore.textColorPrimary(this));
|
||||||
int primaryColor = ThemeStore.primaryColor(this);
|
int primaryColor = ThemeStore.primaryColor(this);
|
||||||
toolbar.setBackgroundColor(primaryColor);
|
toolbar.setBackgroundColor(primaryColor);
|
||||||
|
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
||||||
|
toolbar.setNavigationOnClickListener(v -> onBackPressed());
|
||||||
setTitle(null);
|
setTitle(null);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
//noinspection ConstantConditions
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,7 +95,7 @@ public class AboutActivity extends AbsBaseActivity {
|
||||||
|
|
||||||
@OnClick({R.id.app_github, R.id.faq_link, R.id.app_google_plus, R.id.app_translation,
|
@OnClick({R.id.app_github, R.id.faq_link, R.id.app_google_plus, R.id.app_translation,
|
||||||
R.id.app_rate, R.id.app_share, R.id.instagram_link, R.id.twitter_link, R.id.changelog,
|
R.id.app_rate, R.id.app_share, R.id.instagram_link, R.id.twitter_link, R.id.changelog,
|
||||||
R.id.open_source, R.id.discord_link, R.id.telegram_link})
|
R.id.open_source, R.id.discord_link, R.id.telegram_link, R.id.donate_link})
|
||||||
public void onViewClicked(View view) {
|
public void onViewClicked(View view) {
|
||||||
switch (view.getId()) {
|
switch (view.getId()) {
|
||||||
case R.id.faq_link:
|
case R.id.faq_link:
|
||||||
|
|
|
@ -86,9 +86,6 @@ public class AlbumDetailsActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
@BindView(R.id.app_bar)
|
@BindView(R.id.app_bar)
|
||||||
@Nullable
|
@Nullable
|
||||||
AppBarLayout appBarLayout;
|
AppBarLayout appBarLayout;
|
||||||
@BindView(R.id.image_container)
|
|
||||||
@Nullable
|
|
||||||
View imageContainer;
|
|
||||||
@BindView(R.id.content)
|
@BindView(R.id.content)
|
||||||
View contentContainer;
|
View contentContainer;
|
||||||
@BindView(R.id.toolbar)
|
@BindView(R.id.toolbar)
|
||||||
|
|
|
@ -25,6 +25,12 @@ import android.view.ViewGroup.LayoutParams;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
|
@ -54,372 +60,370 @@ import code.name.monkey.retromusic.util.DensityUtil;
|
||||||
import code.name.monkey.retromusic.util.MusicUtil;
|
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.RetroUtil;
|
import code.name.monkey.retromusic.util.RetroUtil;
|
||||||
import com.bumptech.glide.Glide;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Locale;
|
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implements
|
public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implements
|
||||||
ArtistDetailContract.ArtistsDetailsView {
|
ArtistDetailContract.ArtistsDetailsView {
|
||||||
|
|
||||||
public static final String EXTRA_ARTIST_ID = "extra_artist_id";
|
public static final String EXTRA_ARTIST_ID = "extra_artist_id";
|
||||||
private static final int REQUEST_CODE_SELECT_IMAGE = 9003;
|
private static final int REQUEST_CODE_SELECT_IMAGE = 9003;
|
||||||
@BindView(R.id.image)
|
@BindView(R.id.app_bar)
|
||||||
ImageView image;
|
@Nullable
|
||||||
@BindView(R.id.biography)
|
AppBarLayout appBarLayout;
|
||||||
TextView biographyTextView;
|
@BindView(R.id.collapsing_toolbar)
|
||||||
@BindView(R.id.recycler_view)
|
@Nullable
|
||||||
RecyclerView recyclerView;
|
CollapsingToolbarLayout collapsingToolbarLayout;
|
||||||
@BindView(R.id.album_recycler_view)
|
|
||||||
RecyclerView albumRecyclerView;
|
|
||||||
@BindView(R.id.album_title)
|
|
||||||
AppCompatTextView albumTitle;
|
|
||||||
@BindView(R.id.song_title)
|
|
||||||
AppCompatTextView songTitle;
|
|
||||||
@BindView(R.id.biography_title)
|
|
||||||
AppCompatTextView biographyTitle;
|
|
||||||
@BindView(R.id.title)
|
|
||||||
TextView title;
|
|
||||||
@BindView(R.id.text)
|
|
||||||
TextView text;
|
|
||||||
@BindView(R.id.action_shuffle_all)
|
|
||||||
FloatingActionButton shuffleButton;
|
|
||||||
@BindView(R.id.collapsing_toolbar)
|
|
||||||
@Nullable
|
|
||||||
CollapsingToolbarLayout collapsingToolbarLayout;
|
|
||||||
@BindView(R.id.app_bar)
|
|
||||||
@Nullable
|
|
||||||
AppBarLayout appBarLayout;
|
|
||||||
@BindView(R.id.gradient_background)
|
|
||||||
@Nullable
|
|
||||||
View background;
|
|
||||||
@BindView(R.id.image_container)
|
|
||||||
@Nullable
|
|
||||||
View imageContainer;
|
|
||||||
@BindView(R.id.content)
|
|
||||||
View contentContainer;
|
|
||||||
@BindView(R.id.toolbar)
|
|
||||||
Toolbar toolbar;
|
|
||||||
@Nullable
|
|
||||||
private Spanned biography;
|
|
||||||
private Artist artist;
|
|
||||||
private LastFMRestClient lastFMRestClient;
|
|
||||||
private ArtistDetailsPresenter artistDetailsPresenter;
|
|
||||||
private SimpleSongAdapter songAdapter;
|
|
||||||
private AlbumAdapter albumAdapter;
|
|
||||||
private boolean forceDownload;
|
|
||||||
|
|
||||||
@Override
|
@BindView(R.id.image)
|
||||||
protected View createContentView() {
|
ImageView image;
|
||||||
return wrapSlidingMusicPanel(R.layout.activity_artist_details);
|
@BindView(R.id.biography)
|
||||||
}
|
TextView biographyTextView;
|
||||||
|
@BindView(R.id.recycler_view)
|
||||||
|
RecyclerView recyclerView;
|
||||||
|
@BindView(R.id.album_recycler_view)
|
||||||
|
RecyclerView albumRecyclerView;
|
||||||
|
@BindView(R.id.album_title)
|
||||||
|
AppCompatTextView albumTitle;
|
||||||
|
@BindView(R.id.song_title)
|
||||||
|
AppCompatTextView songTitle;
|
||||||
|
@BindView(R.id.biography_title)
|
||||||
|
AppCompatTextView biographyTitle;
|
||||||
|
@BindView(R.id.title)
|
||||||
|
TextView title;
|
||||||
|
@BindView(R.id.text)
|
||||||
|
TextView text;
|
||||||
|
@BindView(R.id.action_shuffle_all)
|
||||||
|
FloatingActionButton shuffleButton;
|
||||||
|
@BindView(R.id.gradient_background)
|
||||||
|
@Nullable
|
||||||
|
View background;
|
||||||
|
@BindView(R.id.image_container)
|
||||||
|
@Nullable
|
||||||
|
View imageContainer;
|
||||||
|
@BindView(R.id.content)
|
||||||
|
View contentContainer;
|
||||||
|
@BindView(R.id.toolbar)
|
||||||
|
Toolbar toolbar;
|
||||||
|
@Nullable
|
||||||
|
private Spanned biography;
|
||||||
|
private Artist artist;
|
||||||
|
private LastFMRestClient lastFMRestClient;
|
||||||
|
private ArtistDetailsPresenter artistDetailsPresenter;
|
||||||
|
private SimpleSongAdapter songAdapter;
|
||||||
|
private AlbumAdapter albumAdapter;
|
||||||
|
private boolean forceDownload;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle bundle) {
|
protected View createContentView() {
|
||||||
setDrawUnderStatusBar(true);
|
return wrapSlidingMusicPanel(R.layout.activity_artist_details);
|
||||||
super.onCreate(bundle);
|
|
||||||
ButterKnife.bind(this);
|
|
||||||
|
|
||||||
supportPostponeEnterTransition();
|
|
||||||
setBottomBarVisibility(View.GONE);
|
|
||||||
setNavigationbarColorAuto();
|
|
||||||
setLightNavigationBar(true);
|
|
||||||
|
|
||||||
lastFMRestClient = new LastFMRestClient(this);
|
|
||||||
|
|
||||||
setUpViews();
|
|
||||||
|
|
||||||
int artistID = getIntent().getIntExtra(EXTRA_ARTIST_ID, -1);
|
|
||||||
artistDetailsPresenter = new ArtistDetailsPresenter(this, artistID);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpViews() {
|
|
||||||
setupRecyclerView();
|
|
||||||
setupToolbar();
|
|
||||||
setupContainerHeight();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupContainerHeight() {
|
|
||||||
if (imageContainer != null) {
|
|
||||||
LayoutParams params = imageContainer.getLayoutParams();
|
|
||||||
params.width = DensityUtil.getScreenHeight(this) / 2;
|
|
||||||
imageContainer.setLayoutParams(params);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupToolbar() {
|
|
||||||
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
|
||||||
setSupportActionBar(toolbar);
|
|
||||||
//noinspection ConstantConditions
|
|
||||||
getSupportActionBar().setTitle(null);
|
|
||||||
|
|
||||||
if (toolbar != null && !PreferenceUtil.getInstance(this).getFullScreenMode()) {
|
|
||||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar
|
|
||||||
.getLayoutParams();
|
|
||||||
params.topMargin = RetroUtil.getStatusBarHeight(this);
|
|
||||||
toolbar.setLayoutParams(params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int primaryColor = ThemeStore.primaryColor(this);
|
@Override
|
||||||
TintHelper.setTintAuto(contentContainer, primaryColor, true);
|
protected void onCreate(Bundle bundle) {
|
||||||
|
setDrawUnderStatusBar(true);
|
||||||
|
super.onCreate(bundle);
|
||||||
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
if (appBarLayout != null) {
|
supportPostponeEnterTransition();
|
||||||
appBarLayout.setBackgroundColor(primaryColor);
|
setBottomBarVisibility(View.GONE);
|
||||||
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
setNavigationbarColorAuto();
|
||||||
@Override
|
setLightNavigationBar(true);
|
||||||
public void onStateChanged(AppBarLayout appBarLayout,
|
|
||||||
AppBarStateChangeListener.State state) {
|
lastFMRestClient = new LastFMRestClient(this);
|
||||||
int color;
|
|
||||||
switch (state) {
|
setUpViews();
|
||||||
case COLLAPSED:
|
|
||||||
setLightStatusbar(!ATHUtil.isWindowBackgroundDark(ArtistDetailActivity.this));
|
int artistID = getIntent().getIntExtra(EXTRA_ARTIST_ID, -1);
|
||||||
color = ATHUtil.resolveColor(ArtistDetailActivity.this, R.attr.iconColor);
|
artistDetailsPresenter = new ArtistDetailsPresenter(this, artistID);
|
||||||
break;
|
}
|
||||||
|
|
||||||
|
private void setUpViews() {
|
||||||
|
setupRecyclerView();
|
||||||
|
setupToolbar();
|
||||||
|
setupContainerHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupContainerHeight() {
|
||||||
|
if (imageContainer != null) {
|
||||||
|
LayoutParams params = imageContainer.getLayoutParams();
|
||||||
|
params.width = DensityUtil.getScreenHeight(this) / 2;
|
||||||
|
imageContainer.setLayoutParams(params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupToolbar() {
|
||||||
|
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
getSupportActionBar().setTitle(null);
|
||||||
|
|
||||||
|
if (toolbar != null && !PreferenceUtil.getInstance(this).getFullScreenMode()) {
|
||||||
|
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar
|
||||||
|
.getLayoutParams();
|
||||||
|
params.topMargin = RetroUtil.getStatusBarHeight(this);
|
||||||
|
toolbar.setLayoutParams(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
int primaryColor = ThemeStore.primaryColor(this);
|
||||||
|
TintHelper.setTintAuto(contentContainer, primaryColor, true);
|
||||||
|
|
||||||
|
if (appBarLayout != null) {
|
||||||
|
appBarLayout.setBackgroundColor(primaryColor);
|
||||||
|
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onStateChanged(AppBarLayout appBarLayout,
|
||||||
|
AppBarStateChangeListener.State state) {
|
||||||
|
int color;
|
||||||
|
switch (state) {
|
||||||
|
case COLLAPSED:
|
||||||
|
setLightStatusbar(!ATHUtil.isWindowBackgroundDark(ArtistDetailActivity.this));
|
||||||
|
color = ATHUtil.resolveColor(ArtistDetailActivity.this, R.attr.iconColor);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
case EXPANDED:
|
||||||
|
case IDLE:
|
||||||
|
setLightStatusbar(false);
|
||||||
|
color = ContextCompat.getColor(ArtistDetailActivity.this, R.color.md_white_1000);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ToolbarContentTintHelper.colorizeToolbar(toolbar, color, ArtistDetailActivity.this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (collapsingToolbarLayout != null) {
|
||||||
|
collapsingToolbarLayout.setContentScrimColor(primaryColor);
|
||||||
|
collapsingToolbarLayout.setStatusBarScrimColor(ColorUtil.darkenColor(primaryColor));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupRecyclerView() {
|
||||||
|
albumAdapter = new HorizontalAlbumAdapter(this, new ArrayList<>(), false, null);
|
||||||
|
albumRecyclerView.setItemAnimator(new DefaultItemAnimator());
|
||||||
|
albumRecyclerView
|
||||||
|
.setLayoutManager(new GridLayoutManager(this, 1, GridLayoutManager.HORIZONTAL, false));
|
||||||
|
albumRecyclerView.setAdapter(albumAdapter);
|
||||||
|
|
||||||
|
songAdapter = new SimpleSongAdapter(this, new ArrayList<>(), R.layout.item_song);
|
||||||
|
recyclerView.setItemAnimator(new DefaultItemAnimator());
|
||||||
|
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
recyclerView.setAdapter(songAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
switch (requestCode) {
|
||||||
|
case REQUEST_CODE_SELECT_IMAGE:
|
||||||
|
if (resultCode == RESULT_OK) {
|
||||||
|
CustomArtistImageUtil.getInstance(this).setCustomArtistImage(artist, data.getData());
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
case EXPANDED:
|
if (resultCode == RESULT_OK) {
|
||||||
case IDLE:
|
reload();
|
||||||
setLightStatusbar(false);
|
}
|
||||||
color = ContextCompat.getColor(ArtistDetailActivity.this, R.color.md_white_1000);
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
ToolbarContentTintHelper.colorizeToolbar(toolbar, color, ArtistDetailActivity.this);
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if (collapsingToolbarLayout != null) {
|
|
||||||
collapsingToolbarLayout.setContentScrimColor(primaryColor);
|
@Override
|
||||||
collapsingToolbarLayout.setStatusBarScrimColor(ColorUtil.darkenColor(primaryColor));
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
artistDetailsPresenter.subscribe();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void setupRecyclerView() {
|
@Override
|
||||||
albumAdapter = new HorizontalAlbumAdapter(this, new ArrayList<>(), false, null);
|
protected void onPause() {
|
||||||
albumRecyclerView.setItemAnimator(new DefaultItemAnimator());
|
super.onPause();
|
||||||
albumRecyclerView
|
artistDetailsPresenter.unsubscribe();
|
||||||
.setLayoutManager(new GridLayoutManager(this, 1, GridLayoutManager.HORIZONTAL, false));
|
}
|
||||||
albumRecyclerView.setAdapter(albumAdapter);
|
|
||||||
|
|
||||||
songAdapter = new SimpleSongAdapter(this, new ArrayList<>(), R.layout.item_song);
|
@Override
|
||||||
recyclerView.setItemAnimator(new DefaultItemAnimator());
|
public void loading() {
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
}
|
||||||
recyclerView.setAdapter(songAdapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showEmptyView() {
|
||||||
|
|
||||||
@Override
|
}
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
@Override
|
||||||
switch (requestCode) {
|
public void completed() {
|
||||||
case REQUEST_CODE_SELECT_IMAGE:
|
supportStartPostponedEnterTransition();
|
||||||
if (resultCode == RESULT_OK) {
|
}
|
||||||
CustomArtistImageUtil.getInstance(this).setCustomArtistImage(artist, data.getData());
|
|
||||||
|
@Override
|
||||||
|
public void showData(Artist artist) {
|
||||||
|
setArtist(artist);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Artist getArtist() {
|
||||||
|
if (artist == null) {
|
||||||
|
artist = new Artist();
|
||||||
}
|
}
|
||||||
break;
|
return artist;
|
||||||
default:
|
}
|
||||||
if (resultCode == RESULT_OK) {
|
|
||||||
reload();
|
private void setArtist(Artist artist) {
|
||||||
|
if (artist.getSongCount() <= 0) {
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
break;
|
this.artist = artist;
|
||||||
|
loadArtistImage();
|
||||||
|
|
||||||
|
if (RetroUtil.isAllowedToDownloadMetadata(this)) {
|
||||||
|
loadBiography();
|
||||||
|
}
|
||||||
|
title.setText(artist.getName());
|
||||||
|
text.setText(String.format("%s • %s", MusicUtil.getArtistInfoString(this, artist), MusicUtil
|
||||||
|
.getReadableDurationString(MusicUtil.getTotalDuration(this, artist.getSongs()))));
|
||||||
|
|
||||||
|
songAdapter.swapDataSet(artist.getSongs());
|
||||||
|
albumAdapter.swapDataSet(artist.albums);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
private void loadBiography() {
|
||||||
protected void onResume() {
|
loadBiography(Locale.getDefault().getLanguage());
|
||||||
super.onResume();
|
|
||||||
artistDetailsPresenter.subscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPause() {
|
|
||||||
super.onPause();
|
|
||||||
artistDetailsPresenter.unsubscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void loading() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void showEmptyView() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void completed() {
|
|
||||||
supportStartPostponedEnterTransition();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void showData(Artist artist) {
|
|
||||||
setArtist(artist);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Artist getArtist() {
|
|
||||||
if (artist == null) {
|
|
||||||
artist = new Artist();
|
|
||||||
}
|
}
|
||||||
return artist;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setArtist(Artist artist) {
|
private void loadBiography(@Nullable final String lang) {
|
||||||
if (artist.getSongCount() <= 0) {
|
biography = null;
|
||||||
finish();
|
|
||||||
|
lastFMRestClient.getApiService()
|
||||||
|
.getArtistInfo(getArtist().getName(), lang, null)
|
||||||
|
.enqueue(new Callback<LastFmArtist>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(@NonNull Call<LastFmArtist> call,
|
||||||
|
@NonNull Response<LastFmArtist> response) {
|
||||||
|
final LastFmArtist lastFmArtist = response.body();
|
||||||
|
if (lastFmArtist != null && lastFmArtist.getArtist() != null) {
|
||||||
|
final String bioContent = lastFmArtist.getArtist().getBio().getContent();
|
||||||
|
if (bioContent != null && !bioContent.trim().isEmpty()) {
|
||||||
|
//TransitionManager.beginDelayedTransition(titleContainer);
|
||||||
|
biographyTextView.setVisibility(View.VISIBLE);
|
||||||
|
biographyTitle.setVisibility(View.VISIBLE);
|
||||||
|
biography = Html.fromHtml(bioContent);
|
||||||
|
biographyTextView.setText(biography);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the "lang" parameter is set and no biography is given, retry with default language
|
||||||
|
if (biography == null && lang != null) {
|
||||||
|
loadBiography(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(@NonNull Call<LastFmArtist> call, @NonNull Throwable t) {
|
||||||
|
t.printStackTrace();
|
||||||
|
biography = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
this.artist = artist;
|
|
||||||
loadArtistImage();
|
|
||||||
|
|
||||||
if (RetroUtil.isAllowedToDownloadMetadata(this)) {
|
@OnClick(R.id.biography)
|
||||||
loadBiography();
|
void toggleArtistBiography() {
|
||||||
|
if (biographyTextView.getMaxLines() == 4) {
|
||||||
|
biographyTextView.setMaxLines(Integer.MAX_VALUE);
|
||||||
|
} else {
|
||||||
|
biographyTextView.setMaxLines(4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
title.setText(artist.getName());
|
|
||||||
text.setText(String.format("%s • %s", MusicUtil.getArtistInfoString(this, artist), MusicUtil
|
|
||||||
.getReadableDurationString(MusicUtil.getTotalDuration(this, artist.getSongs()))));
|
|
||||||
|
|
||||||
songAdapter.swapDataSet(artist.getSongs());
|
private void loadArtistImage() {
|
||||||
albumAdapter.swapDataSet(artist.albums);
|
ArtistGlideRequest.Builder.from(Glide.with(this), artist)
|
||||||
}
|
.forceDownload(forceDownload)
|
||||||
|
.generatePalette(this).build()
|
||||||
private void loadBiography() {
|
.dontAnimate()
|
||||||
loadBiography(Locale.getDefault().getLanguage());
|
.into(new RetroMusicColoredTarget(image) {
|
||||||
}
|
@Override
|
||||||
|
public void onColorReady(int color) {
|
||||||
private void loadBiography(@Nullable final String lang) {
|
setColors(color);
|
||||||
biography = null;
|
}
|
||||||
|
});
|
||||||
lastFMRestClient.getApiService()
|
forceDownload = false;
|
||||||
.getArtistInfo(getArtist().getName(), lang, null)
|
|
||||||
.enqueue(new Callback<LastFmArtist>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(@NonNull Call<LastFmArtist> call,
|
|
||||||
@NonNull Response<LastFmArtist> response) {
|
|
||||||
final LastFmArtist lastFmArtist = response.body();
|
|
||||||
if (lastFmArtist != null && lastFmArtist.getArtist() != null) {
|
|
||||||
final String bioContent = lastFmArtist.getArtist().getBio().getContent();
|
|
||||||
if (bioContent != null && !bioContent.trim().isEmpty()) {
|
|
||||||
//TransitionManager.beginDelayedTransition(titleContainer);
|
|
||||||
biographyTextView.setVisibility(View.VISIBLE);
|
|
||||||
biographyTitle.setVisibility(View.VISIBLE);
|
|
||||||
biography = Html.fromHtml(bioContent);
|
|
||||||
biographyTextView.setText(biography);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the "lang" parameter is set and no biography is given, retry with default language
|
|
||||||
if (biography == null && lang != null) {
|
|
||||||
loadBiography(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(@NonNull Call<LastFmArtist> call, @NonNull Throwable t) {
|
|
||||||
t.printStackTrace();
|
|
||||||
biography = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnClick(R.id.biography)
|
|
||||||
void toggleArtistBiography() {
|
|
||||||
if (biographyTextView.getMaxLines() == 4) {
|
|
||||||
biographyTextView.setMaxLines(Integer.MAX_VALUE);
|
|
||||||
} else {
|
|
||||||
biographyTextView.setMaxLines(4);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void loadArtistImage() {
|
private void setColors(int color) {
|
||||||
ArtistGlideRequest.Builder.from(Glide.with(this), artist)
|
|
||||||
.forceDownload(forceDownload)
|
|
||||||
.generatePalette(this).build()
|
|
||||||
.dontAnimate()
|
|
||||||
.into(new RetroMusicColoredTarget(image) {
|
|
||||||
@Override
|
|
||||||
public void onColorReady(int color) {
|
|
||||||
setColors(color);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
forceDownload = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setColors(int color) {
|
int textColor =
|
||||||
|
PreferenceUtil.getInstance(this).getAdaptiveColor() ? color : ThemeStore.accentColor(this);
|
||||||
|
|
||||||
int textColor =
|
albumTitle.setTextColor(textColor);
|
||||||
PreferenceUtil.getInstance(this).getAdaptiveColor() ? color : ThemeStore.accentColor(this);
|
songTitle.setTextColor(textColor);
|
||||||
|
biographyTitle.setTextColor(textColor);
|
||||||
|
|
||||||
albumTitle.setTextColor(textColor);
|
TintHelper.setTintAuto(shuffleButton, textColor, true);
|
||||||
songTitle.setTextColor(textColor);
|
|
||||||
biographyTitle.setTextColor(textColor);
|
|
||||||
|
|
||||||
TintHelper.setTintAuto(shuffleButton, textColor, true);
|
if (background != null) {
|
||||||
|
background.setBackgroundTintList(ColorStateList.valueOf(color));
|
||||||
if (background != null) {
|
}
|
||||||
background.setBackgroundTintList(ColorStateList.valueOf(color));
|
findViewById(R.id.root).setBackgroundColor(ThemeStore.primaryColor(this));
|
||||||
}
|
}
|
||||||
findViewById(R.id.root).setBackgroundColor(ThemeStore.primaryColor(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnClick({R.id.action_shuffle_all})
|
@OnClick({R.id.action_shuffle_all})
|
||||||
public void onViewClicked(View view) {
|
public void onViewClicked(View view) {
|
||||||
switch (view.getId()) {
|
switch (view.getId()) {
|
||||||
case R.id.action_shuffle_all:
|
case R.id.action_shuffle_all:
|
||||||
MusicPlayerRemote.openAndShuffleQueue(getArtist().getSongs(), true);
|
MusicPlayerRemote.openAndShuffleQueue(getArtist().getSongs(), true);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
return handleSortOrderMenuItem(item);
|
return handleSortOrderMenuItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean handleSortOrderMenuItem(@NonNull MenuItem item) {
|
private boolean handleSortOrderMenuItem(@NonNull MenuItem item) {
|
||||||
final ArrayList<Song> songs = getArtist().getSongs();
|
final ArrayList<Song> songs = getArtist().getSongs();
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_play_next:
|
case R.id.action_play_next:
|
||||||
MusicPlayerRemote.playNext(songs);
|
MusicPlayerRemote.playNext(songs);
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_add_to_current_playing:
|
case R.id.action_add_to_current_playing:
|
||||||
MusicPlayerRemote.enqueue(songs);
|
MusicPlayerRemote.enqueue(songs);
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_add_to_playlist:
|
case R.id.action_add_to_playlist:
|
||||||
AddToPlaylistDialog.create(songs).show(getSupportFragmentManager(), "ADD_PLAYLIST");
|
AddToPlaylistDialog.create(songs).show(getSupportFragmentManager(), "ADD_PLAYLIST");
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_set_artist_image:
|
case R.id.action_set_artist_image:
|
||||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||||
intent.setType("image/*");
|
intent.setType("image/*");
|
||||||
startActivityForResult(
|
startActivityForResult(
|
||||||
Intent.createChooser(intent, getString(R.string.pick_from_local_storage)),
|
Intent.createChooser(intent, getString(R.string.pick_from_local_storage)),
|
||||||
REQUEST_CODE_SELECT_IMAGE);
|
REQUEST_CODE_SELECT_IMAGE);
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_reset_artist_image:
|
case R.id.action_reset_artist_image:
|
||||||
Toast.makeText(ArtistDetailActivity.this, getResources().getString(R.string.updating),
|
Toast.makeText(ArtistDetailActivity.this, getResources().getString(R.string.updating),
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
CustomArtistImageUtil.getInstance(ArtistDetailActivity.this).resetCustomArtistImage(artist);
|
CustomArtistImageUtil.getInstance(ArtistDetailActivity.this).resetCustomArtistImage(artist);
|
||||||
forceDownload = true;
|
forceDownload = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
getMenuInflater().inflate(R.menu.menu_artist_detail, menu);
|
getMenuInflater().inflate(R.menu.menu_artist_detail, menu);
|
||||||
return super.onCreateOptionsMenu(menu);
|
return super.onCreateOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMediaStoreChanged() {
|
public void onMediaStoreChanged() {
|
||||||
super.onMediaStoreChanged();
|
super.onMediaStoreChanged();
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reload() {
|
private void reload() {
|
||||||
artistDetailsPresenter.unsubscribe();
|
artistDetailsPresenter.unsubscribe();
|
||||||
artistDetailsPresenter.subscribe();
|
artistDetailsPresenter.subscribe();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import android.widget.LinearLayout;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import code.name.monkey.appthemehelper.ThemeStore;
|
import code.name.monkey.appthemehelper.ThemeStore;
|
||||||
|
@ -27,197 +28,205 @@ import code.name.monkey.retromusic.ui.activities.base.AbsMusicServiceActivity;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class EqualizerActivity extends AbsMusicServiceActivity implements
|
public class EqualizerActivity extends AbsMusicServiceActivity implements
|
||||||
AdapterView.OnItemSelectedListener {
|
AdapterView.OnItemSelectedListener {
|
||||||
|
|
||||||
@BindView(R.id.equalizer)
|
@BindView(R.id.equalizer)
|
||||||
SwitchCompat mEnable;
|
SwitchCompat mEnable;
|
||||||
@BindView(R.id.content)
|
|
||||||
LinearLayout mContent;
|
|
||||||
@BindView(R.id.bands)
|
|
||||||
LinearLayout mLinearLayout;
|
|
||||||
|
|
||||||
@BindView(R.id.bass_boost_strength)
|
@BindView(R.id.content)
|
||||||
SeekBar mBassBoostStrength;
|
LinearLayout mContent;
|
||||||
@BindView(R.id.virtualizer_strength)
|
|
||||||
SeekBar mVirtualizerStrength;
|
|
||||||
|
|
||||||
@BindView(R.id.bass_boost)
|
@BindView(R.id.bands)
|
||||||
TextView mBassBoost;
|
LinearLayout mLinearLayout;
|
||||||
@BindView(R.id.virtualizer)
|
|
||||||
TextView mVirtualizer;
|
|
||||||
|
|
||||||
@BindView(R.id.toolbar)
|
@BindView(R.id.bass_boost_strength)
|
||||||
Toolbar mToolbar;
|
SeekBar mBassBoostStrength;
|
||||||
@BindView(R.id.app_bar)
|
|
||||||
AppBarLayout mAppBar;
|
|
||||||
@BindView(R.id.presets)
|
|
||||||
Spinner mPresets;
|
|
||||||
|
|
||||||
private CompoundButton.OnCheckedChangeListener mListener = (buttonView, isChecked) -> {
|
@BindView(R.id.virtualizer_strength)
|
||||||
switch (buttonView.getId()) {
|
SeekBar mVirtualizerStrength;
|
||||||
case R.id.equalizer:
|
|
||||||
EqualizerHelper.getInstance().getEqualizer().setEnabled(isChecked);
|
@BindView(R.id.bass_boost)
|
||||||
TransitionManager.beginDelayedTransition(mContent);
|
TextView mBassBoost;
|
||||||
mContent.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
|
||||||
break;
|
@BindView(R.id.virtualizer)
|
||||||
}
|
TextView mVirtualizer;
|
||||||
};
|
|
||||||
private SeekBar.OnSeekBarChangeListener mSeekBarChangeListener = new SeekBar.OnSeekBarChangeListener() {
|
@BindView(R.id.toolbar)
|
||||||
@Override
|
Toolbar mToolbar;
|
||||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
||||||
if (fromUser) {
|
@BindView(R.id.app_bar)
|
||||||
if (seekBar == mBassBoostStrength) {
|
AppBarLayout mAppBar;
|
||||||
mBassBoost.setEnabled(progress > 0);
|
|
||||||
EqualizerHelper.getInstance().setBassBoostStrength(progress);
|
@BindView(R.id.presets)
|
||||||
EqualizerHelper.getInstance().setBassBoostEnabled(progress > 0);
|
Spinner mPresets;
|
||||||
} else if (seekBar == mVirtualizerStrength) {
|
|
||||||
mVirtualizer.setEnabled(progress > 0);
|
@BindView(R.id.title)
|
||||||
EqualizerHelper.getInstance().setVirtualizerEnabled(progress > 0);
|
TextView mTitle;
|
||||||
EqualizerHelper.getInstance().setVirtualizerStrength(progress);
|
|
||||||
|
private CompoundButton.OnCheckedChangeListener mListener = (buttonView, isChecked) -> {
|
||||||
|
switch (buttonView.getId()) {
|
||||||
|
case R.id.equalizer:
|
||||||
|
EqualizerHelper.getInstance().getEqualizer().setEnabled(isChecked);
|
||||||
|
TransitionManager.beginDelayedTransition(mContent);
|
||||||
|
mContent.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
private SeekBar.OnSeekBarChangeListener mSeekBarChangeListener = new SeekBar.OnSeekBarChangeListener() {
|
||||||
|
@Override
|
||||||
@Override
|
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
private ArrayAdapter<String> mPresetsNamesAdapter;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_equalizer);
|
|
||||||
ButterKnife.bind(this);
|
|
||||||
|
|
||||||
setStatusbarColorAuto();
|
|
||||||
setNavigationbarColorAuto();
|
|
||||||
setTaskDescriptionColorAuto();
|
|
||||||
setLightNavigationBar(true);
|
|
||||||
|
|
||||||
int primaryColor = ThemeStore.primaryColor(this);
|
|
||||||
mToolbar.setBackgroundColor(primaryColor);
|
|
||||||
mAppBar.setBackgroundColor(primaryColor);
|
|
||||||
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
onBackPressed();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mToolbar.setTitle(R.string.equalizer);
|
|
||||||
setSupportActionBar(mToolbar);
|
|
||||||
//noinspection ConstantConditions
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
|
|
||||||
mEnable.setChecked(EqualizerHelper.getInstance().getEqualizer().getEnabled());
|
|
||||||
mEnable.setOnCheckedChangeListener(mListener);
|
|
||||||
|
|
||||||
mPresetsNamesAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
|
|
||||||
mPresets.setAdapter(mPresetsNamesAdapter);
|
|
||||||
mPresets.setOnItemSelectedListener(this);
|
|
||||||
|
|
||||||
mBassBoostStrength.setProgress(EqualizerHelper.getInstance().getBassBoostStrength());
|
|
||||||
mBassBoostStrength.setOnSeekBarChangeListener(mSeekBarChangeListener);
|
|
||||||
|
|
||||||
mVirtualizerStrength.setProgress(EqualizerHelper.getInstance().getVirtualizerStrength());
|
|
||||||
mVirtualizerStrength.setOnSeekBarChangeListener(mSeekBarChangeListener);
|
|
||||||
|
|
||||||
setupUI();
|
|
||||||
addPresets();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
if (item.getItemId() == android.R.id.home) {
|
|
||||||
onBackPressed();
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addPresets() {
|
|
||||||
mPresetsNamesAdapter.clear();
|
|
||||||
mPresetsNamesAdapter.add("Custom");
|
|
||||||
for (int j = 0; j < EqualizerHelper.getInstance().getEqualizer().getNumberOfPresets(); j++) {
|
|
||||||
mPresetsNamesAdapter
|
|
||||||
.add(EqualizerHelper.getInstance().getEqualizer().getPresetName((short) j));
|
|
||||||
mPresetsNamesAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
mPresets
|
|
||||||
.setSelection((int) EqualizerHelper.getInstance().getEqualizer().getCurrentPreset() + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupUI() {
|
|
||||||
mLinearLayout.removeAllViews();
|
|
||||||
short bands;
|
|
||||||
try {
|
|
||||||
// get number of supported bands
|
|
||||||
bands = (short) EqualizerHelper.getInstance().getNumberOfBands();
|
|
||||||
|
|
||||||
// for each of the supported bands, we will set up a slider from -10dB to 10dB boost/attenuation,
|
|
||||||
// as well as text labels to assist the user
|
|
||||||
for (short i = 0; i < bands; i++) {
|
|
||||||
final short band = i;
|
|
||||||
|
|
||||||
View view = LayoutInflater.from(this).inflate(R.layout.retro_seekbar, mLinearLayout, false);
|
|
||||||
TextView freqTextView = view.findViewById(R.id.hurtz);
|
|
||||||
freqTextView.setText(
|
|
||||||
String.format("%d Hz", EqualizerHelper.getInstance().getCenterFreq((int) band) / 1000));
|
|
||||||
|
|
||||||
TextView minDbTextView = view.findViewById(R.id.minus_db);
|
|
||||||
minDbTextView
|
|
||||||
.setText(String.format("%d dB", EqualizerHelper.getInstance().getBandLevelLow() / 100));
|
|
||||||
|
|
||||||
TextView maxDbTextView = view.findViewById(R.id.plus_db);
|
|
||||||
maxDbTextView.setText(
|
|
||||||
String.format("%d dB", EqualizerHelper.getInstance().getBandLevelHigh() / 100));
|
|
||||||
|
|
||||||
SeekBar bar = view.findViewById(R.id.seekbar);
|
|
||||||
bar.setMax(EqualizerHelper.getInstance().getBandLevelHigh() - EqualizerHelper.getInstance()
|
|
||||||
.getBandLevelLow());
|
|
||||||
bar.setProgress(
|
|
||||||
EqualizerHelper.getInstance().getBandLevel((int) band) - EqualizerHelper.getInstance()
|
|
||||||
.getBandLevelLow());
|
|
||||||
bar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
|
||||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
|
||||||
EqualizerHelper.getInstance().setBandLevel((int) band,
|
|
||||||
(int) (progress + EqualizerHelper.getInstance().getBandLevelLow()));
|
|
||||||
if (fromUser) {
|
if (fromUser) {
|
||||||
mPresets.setSelection(0);
|
if (seekBar == mBassBoostStrength) {
|
||||||
|
mBassBoost.setEnabled(progress > 0);
|
||||||
|
EqualizerHelper.getInstance().setBassBoostStrength(progress);
|
||||||
|
EqualizerHelper.getInstance().setBassBoostEnabled(progress > 0);
|
||||||
|
} else if (seekBar == mVirtualizerStrength) {
|
||||||
|
mVirtualizer.setEnabled(progress > 0);
|
||||||
|
EqualizerHelper.getInstance().setVirtualizerEnabled(progress > 0);
|
||||||
|
EqualizerHelper.getInstance().setVirtualizerStrength(progress);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
@Override
|
||||||
}
|
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||||
|
|
||||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mLinearLayout.addView(view);
|
@Override
|
||||||
}
|
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
}
|
||||||
|
};
|
||||||
|
private ArrayAdapter<String> mPresetsNamesAdapter;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_equalizer);
|
||||||
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
|
setStatusbarColorAuto();
|
||||||
|
setNavigationbarColorAuto();
|
||||||
|
setTaskDescriptionColorAuto();
|
||||||
|
setLightNavigationBar(true);
|
||||||
|
|
||||||
|
setupToolbar();
|
||||||
|
|
||||||
|
mEnable.setChecked(EqualizerHelper.getInstance().getEqualizer().getEnabled());
|
||||||
|
mEnable.setOnCheckedChangeListener(mListener);
|
||||||
|
|
||||||
|
mPresetsNamesAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
|
||||||
|
mPresets.setAdapter(mPresetsNamesAdapter);
|
||||||
|
mPresets.setOnItemSelectedListener(this);
|
||||||
|
|
||||||
|
mBassBoostStrength.setProgress(EqualizerHelper.getInstance().getBassBoostStrength());
|
||||||
|
mBassBoostStrength.setOnSeekBarChangeListener(mSeekBarChangeListener);
|
||||||
|
|
||||||
|
mVirtualizerStrength.setProgress(EqualizerHelper.getInstance().getVirtualizerStrength());
|
||||||
|
mVirtualizerStrength.setOnSeekBarChangeListener(mSeekBarChangeListener);
|
||||||
|
|
||||||
|
setupUI();
|
||||||
|
addPresets();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
if (position == 0) {
|
if (item.getItemId() == android.R.id.home) {
|
||||||
return;
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
EqualizerHelper.getInstance().getEqualizer().usePreset((short) (position - 1));
|
|
||||||
setupUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
private void setupToolbar() {
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
mTitle.setTextColor(ThemeStore.textColorPrimary(this));
|
||||||
|
int primaryColor = ThemeStore.primaryColor(this);
|
||||||
|
mToolbar.setBackgroundColor(primaryColor);
|
||||||
|
mAppBar.setBackgroundColor(primaryColor);
|
||||||
|
mToolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
||||||
|
mToolbar.setNavigationOnClickListener(v -> onBackPressed());
|
||||||
|
setSupportActionBar(mToolbar);
|
||||||
|
setTitle(null);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
private void addPresets() {
|
||||||
|
mPresetsNamesAdapter.clear();
|
||||||
|
mPresetsNamesAdapter.add("Custom");
|
||||||
|
for (int j = 0; j < EqualizerHelper.getInstance().getEqualizer().getNumberOfPresets(); j++) {
|
||||||
|
mPresetsNamesAdapter
|
||||||
|
.add(EqualizerHelper.getInstance().getEqualizer().getPresetName((short) j));
|
||||||
|
mPresetsNamesAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
mPresets
|
||||||
|
.setSelection((int) EqualizerHelper.getInstance().getEqualizer().getCurrentPreset() + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupUI() {
|
||||||
|
mLinearLayout.removeAllViews();
|
||||||
|
short bands;
|
||||||
|
try {
|
||||||
|
// get number of supported bands
|
||||||
|
bands = (short) EqualizerHelper.getInstance().getNumberOfBands();
|
||||||
|
|
||||||
|
// for each of the supported bands, we will set up a slider from -10dB to 10dB boost/attenuation,
|
||||||
|
// as well as text labels to assist the user
|
||||||
|
for (short i = 0; i < bands; i++) {
|
||||||
|
final short band = i;
|
||||||
|
|
||||||
|
View view = LayoutInflater.from(this).inflate(R.layout.retro_seekbar, mLinearLayout, false);
|
||||||
|
TextView freqTextView = view.findViewById(R.id.hurtz);
|
||||||
|
freqTextView.setText(
|
||||||
|
String.format("%d Hz", EqualizerHelper.getInstance().getCenterFreq((int) band) / 1000));
|
||||||
|
|
||||||
|
TextView minDbTextView = view.findViewById(R.id.minus_db);
|
||||||
|
minDbTextView
|
||||||
|
.setText(String.format("%d dB", EqualizerHelper.getInstance().getBandLevelLow() / 100));
|
||||||
|
|
||||||
|
TextView maxDbTextView = view.findViewById(R.id.plus_db);
|
||||||
|
maxDbTextView.setText(
|
||||||
|
String.format("%d dB", EqualizerHelper.getInstance().getBandLevelHigh() / 100));
|
||||||
|
|
||||||
|
SeekBar bar = view.findViewById(R.id.seekbar);
|
||||||
|
bar.setMax(EqualizerHelper.getInstance().getBandLevelHigh() - EqualizerHelper.getInstance()
|
||||||
|
.getBandLevelLow());
|
||||||
|
bar.setProgress(
|
||||||
|
EqualizerHelper.getInstance().getBandLevel((int) band) - EqualizerHelper.getInstance()
|
||||||
|
.getBandLevelLow());
|
||||||
|
bar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||||
|
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||||
|
EqualizerHelper.getInstance().setBandLevel((int) band,
|
||||||
|
(int) (progress + EqualizerHelper.getInstance().getBandLevelLow()));
|
||||||
|
if (fromUser) {
|
||||||
|
mPresets.setSelection(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mLinearLayout.addView(view);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
if (position == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
EqualizerHelper.getInstance().getEqualizer().usePreset((short) (position - 1));
|
||||||
|
setupUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package code.name.monkey.retromusic.ui.activities;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.design.widget.AppBarLayout;
|
import android.support.design.widget.AppBarLayout;
|
||||||
import android.support.design.widget.CollapsingToolbarLayout;
|
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.v7.widget.DefaultItemAnimator;
|
import android.support.v7.widget.DefaultItemAnimator;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
|
@ -18,7 +17,6 @@ import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.afollestad.materialcab.MaterialCab;
|
import com.afollestad.materialcab.MaterialCab;
|
||||||
import code.name.monkey.retromusic.ui.activities.base.AbsSlidingMusicPanelActivity;
|
|
||||||
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
|
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -39,6 +37,7 @@ import code.name.monkey.retromusic.model.Genre;
|
||||||
import code.name.monkey.retromusic.model.Song;
|
import code.name.monkey.retromusic.model.Song;
|
||||||
import code.name.monkey.retromusic.mvp.contract.GenreDetailsContract;
|
import code.name.monkey.retromusic.mvp.contract.GenreDetailsContract;
|
||||||
import code.name.monkey.retromusic.mvp.presenter.GenreDetailsPresenter;
|
import code.name.monkey.retromusic.mvp.presenter.GenreDetailsPresenter;
|
||||||
|
import code.name.monkey.retromusic.ui.activities.base.AbsSlidingMusicPanelActivity;
|
||||||
import code.name.monkey.retromusic.ui.adapter.song.SongAdapter;
|
import code.name.monkey.retromusic.ui.adapter.song.SongAdapter;
|
||||||
import code.name.monkey.retromusic.util.RetroColorUtil;
|
import code.name.monkey.retromusic.util.RetroColorUtil;
|
||||||
import code.name.monkey.retromusic.util.RetroUtil;
|
import code.name.monkey.retromusic.util.RetroUtil;
|
||||||
|
@ -72,8 +71,8 @@ public class GenreDetailsActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
@BindView(R.id.app_bar)
|
@BindView(R.id.app_bar)
|
||||||
AppBarLayout appBarLayout;
|
AppBarLayout appBarLayout;
|
||||||
|
|
||||||
@BindView(R.id.collapsing_toolbar)
|
@BindView(R.id.title)
|
||||||
CollapsingToolbarLayout toolbarLayout;
|
TextView title;
|
||||||
|
|
||||||
private Genre genre;
|
private Genre genre;
|
||||||
private GenreDetailsPresenter presenter;
|
private GenreDetailsPresenter presenter;
|
||||||
|
@ -99,8 +98,7 @@ public class GenreDetailsActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
|
|
||||||
setBottomBarVisibility(View.GONE);
|
setBottomBarVisibility(View.GONE);
|
||||||
|
|
||||||
RetroUtil.statusBarHeight(statusBar);
|
RetroUtil.statusBarHeight(statusBar);
|
||||||
|
|
||||||
|
|
||||||
genre = getIntent().getParcelableExtra(EXTRA_GENRE_ID);
|
genre = getIntent().getParcelableExtra(EXTRA_GENRE_ID);
|
||||||
presenter = new GenreDetailsPresenter(this, genre.id);
|
presenter = new GenreDetailsPresenter(this, genre.id);
|
||||||
|
@ -119,14 +117,14 @@ public class GenreDetailsActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpToolBar() {
|
private void setUpToolBar() {
|
||||||
|
title.setText(genre.name);
|
||||||
|
title.setTextColor(ThemeStore.textColorPrimary(this));
|
||||||
int primaryColor = ThemeStore.primaryColor(this);
|
int primaryColor = ThemeStore.primaryColor(this);
|
||||||
toolbar.setBackgroundColor(primaryColor);
|
toolbar.setBackgroundColor(primaryColor);
|
||||||
appBarLayout.setBackgroundColor(primaryColor);
|
appBarLayout.setBackgroundColor(primaryColor);
|
||||||
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
||||||
|
setTitle(null);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
//noinspection ConstantConditions
|
|
||||||
getSupportActionBar().setTitle(genre.name);
|
|
||||||
setTitle(R.string.app_name);
|
|
||||||
|
|
||||||
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -140,7 +138,6 @@ public class GenreDetailsActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
color = ATHUtil.resolveColor(GenreDetailsActivity.this, android.R.attr.textColorPrimary);
|
color = ATHUtil.resolveColor(GenreDetailsActivity.this, android.R.attr.textColorPrimary);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
toolbarLayout.setExpandedTitleColor(color);
|
|
||||||
ToolbarContentTintHelper.colorizeToolbar(toolbar, color, GenreDetailsActivity.this);
|
ToolbarContentTintHelper.colorizeToolbar(toolbar, color, GenreDetailsActivity.this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -267,6 +264,4 @@ public class GenreDetailsActivity extends AbsSlidingMusicPanelActivity implement
|
||||||
super.onMediaStoreChanged();
|
super.onMediaStoreChanged();
|
||||||
presenter.subscribe();
|
presenter.subscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ import android.support.design.widget.AppBarLayout;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import code.name.monkey.appthemehelper.ThemeStore;
|
import code.name.monkey.appthemehelper.ThemeStore;
|
||||||
|
@ -13,40 +15,46 @@ import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.ui.activities.base.AbsBaseActivity;
|
import code.name.monkey.retromusic.ui.activities.base.AbsBaseActivity;
|
||||||
|
|
||||||
public class LicenseActivity extends AbsBaseActivity {
|
public class LicenseActivity extends AbsBaseActivity {
|
||||||
@BindView(R.id.license)
|
@BindView(R.id.license)
|
||||||
WebView mLicense;
|
WebView mLicense;
|
||||||
@BindView(R.id.toolbar)
|
|
||||||
Toolbar mToolbar;
|
|
||||||
@BindView(R.id.appbar)
|
|
||||||
AppBarLayout mAppbar;
|
|
||||||
|
|
||||||
@Override
|
@BindView(R.id.toolbar)
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
Toolbar mToolbar;
|
||||||
if (item.getItemId() == android.R.id.home) {
|
|
||||||
onBackPressed();
|
@BindView(R.id.app_bar)
|
||||||
return true;
|
AppBarLayout mAppbar;
|
||||||
|
|
||||||
|
@BindView(R.id.title)
|
||||||
|
TextView title;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
|
if (item.getItemId() == android.R.id.home) {
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_license);
|
setContentView(R.layout.activity_license);
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
setStatusbarColorAuto();
|
setStatusbarColorAuto();
|
||||||
setNavigationbarColorAuto();
|
setNavigationbarColorAuto();
|
||||||
setTaskDescriptionColorAuto();
|
setTaskDescriptionColorAuto();
|
||||||
setLightNavigationBar(true);
|
setLightNavigationBar(true);
|
||||||
|
|
||||||
mLicense.loadUrl("file:///android_asset/index.html");
|
mLicense.loadUrl("file:///android_asset/index.html");
|
||||||
|
|
||||||
mToolbar.setTitle(R.string.licenses);
|
title.setTextColor(ThemeStore.textColorPrimary(this));
|
||||||
mToolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
mToolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
||||||
mToolbar.setNavigationOnClickListener(view -> onBackPressed());
|
mToolbar.setNavigationOnClickListener(view -> onBackPressed());
|
||||||
mToolbar.setBackgroundColor(ThemeStore.primaryColor(this));
|
mToolbar.setBackgroundColor(ThemeStore.primaryColor(this));
|
||||||
mAppbar.setBackgroundColor(ThemeStore.primaryColor(this));
|
mAppbar.setBackgroundColor(ThemeStore.primaryColor(this));
|
||||||
setSupportActionBar(mToolbar);
|
setTitle(null);
|
||||||
}
|
setSupportActionBar(mToolbar);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -155,14 +155,16 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements
|
||||||
PreferenceUtil.getInstance(this).unregisterOnSharedPreferenceChangedListener(this);
|
PreferenceUtil.getInstance(this).unregisterOnSharedPreferenceChangedListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCurrentFragment(@Nullable Fragment fragment, boolean isStackAdd) {
|
public void setCurrentFragment(@Nullable Fragment fragment, boolean isStackAdd, String tag) {
|
||||||
|
|
||||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||||
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
||||||
fragmentTransaction.replace(R.id.fragment_container, fragment, TAG);
|
fragmentTransaction.replace(R.id.fragment_container, fragment, tag);
|
||||||
if (isStackAdd) {
|
if (isStackAdd) {
|
||||||
fragmentTransaction.addToBackStack(TAG);
|
fragmentTransaction.addToBackStack(tag);
|
||||||
}
|
}
|
||||||
fragmentTransaction.commit();
|
fragmentTransaction.commit();
|
||||||
|
|
||||||
currentFragment = (MainActivityFragmentCallbacks) fragment;
|
currentFragment = (MainActivityFragmentCallbacks) fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,13 +188,13 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements
|
||||||
case R.id.action_album:
|
case R.id.action_album:
|
||||||
case R.id.action_artist:
|
case R.id.action_artist:
|
||||||
case R.id.action_playlist:
|
case R.id.action_playlist:
|
||||||
setCurrentFragment(LibraryFragment.newInstance(menuItem), false);
|
setCurrentFragment(LibraryFragment.newInstance(menuItem), false, LibraryFragment.TAG);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case R.id.action_home:
|
case R.id.action_home:
|
||||||
setCurrentFragment(PreferenceUtil.getInstance(this).toggleHomeBanner() ? BannerHomeFragment
|
setCurrentFragment(PreferenceUtil.getInstance(this).toggleHomeBanner() ?
|
||||||
.newInstance() : HomeFragment.newInstance(),
|
BannerHomeFragment.newInstance() : HomeFragment.newInstance(), false,
|
||||||
false);
|
HomeFragment.TAG);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||||
import android.support.design.widget.AppBarLayout;
|
import android.support.design.widget.AppBarLayout;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import butterknife.BindDrawable;
|
import butterknife.BindDrawable;
|
||||||
import butterknife.BindString;
|
import butterknife.BindString;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
|
@ -19,50 +20,56 @@ import code.name.monkey.retromusic.util.MusicUtil;
|
||||||
|
|
||||||
public class PlayingQueueActivity extends AbsMusicServiceActivity {
|
public class PlayingQueueActivity extends AbsMusicServiceActivity {
|
||||||
|
|
||||||
@BindView(R.id.toolbar)
|
@BindView(R.id.toolbar)
|
||||||
Toolbar mToolbar;
|
Toolbar mToolbar;
|
||||||
@BindDrawable(R.drawable.ic_close_white_24dp)
|
|
||||||
Drawable mClose;
|
|
||||||
@BindView(R.id.player_queue_sub_header)
|
|
||||||
TextView mPlayerQueueSubHeader;
|
|
||||||
@BindString(R.string.queue)
|
|
||||||
String queue;
|
|
||||||
@BindView(R.id.app_bar)
|
|
||||||
AppBarLayout mAppBarLayout;
|
|
||||||
|
|
||||||
@Override
|
@BindDrawable(R.drawable.ic_keyboard_backspace_black_24dp)
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
Drawable mClose;
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
setContentView(R.layout.activity_playing_queue);
|
|
||||||
ButterKnife.bind(this);
|
|
||||||
|
|
||||||
setStatusbarColorAuto();
|
@BindView(R.id.player_queue_sub_header)
|
||||||
setNavigationbarColorAuto();
|
TextView mPlayerQueueSubHeader;
|
||||||
setTaskDescriptionColorAuto();
|
|
||||||
setLightNavigationBar(true);
|
|
||||||
|
|
||||||
setupToolbar();
|
@BindString(R.string.queue)
|
||||||
if (savedInstanceState == null) {
|
String queue;
|
||||||
getSupportFragmentManager().beginTransaction()
|
|
||||||
.replace(R.id.fragment_container, new PlayingQueueFragment())
|
@BindView(R.id.app_bar)
|
||||||
.commit();
|
AppBarLayout mAppBarLayout;
|
||||||
|
|
||||||
|
@BindView(R.id.title)
|
||||||
|
TextView title;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_playing_queue);
|
||||||
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
|
setStatusbarColorAuto();
|
||||||
|
setNavigationbarColorAuto();
|
||||||
|
setTaskDescriptionColorAuto();
|
||||||
|
setLightNavigationBar(true);
|
||||||
|
|
||||||
|
setupToolbar();
|
||||||
|
if (savedInstanceState == null) {
|
||||||
|
getSupportFragmentManager().beginTransaction()
|
||||||
|
.replace(R.id.fragment_container, new PlayingQueueFragment())
|
||||||
|
.commit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected String getUpNextAndQueueTime() {
|
protected String getUpNextAndQueueTime() {
|
||||||
return getResources().getString(R.string.up_next) + " • " + MusicUtil
|
return getResources().getString(R.string.up_next) + " • " + MusicUtil.getReadableDurationString(MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.getPosition()));
|
||||||
.getReadableDurationString(
|
}
|
||||||
MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.getPosition()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupToolbar() {
|
private void setupToolbar() {
|
||||||
mPlayerQueueSubHeader.setText(getUpNextAndQueueTime());
|
title.setTextColor(ThemeStore.textColorPrimary(this));
|
||||||
mPlayerQueueSubHeader.setTextColor(ThemeStore.accentColor(this));
|
mPlayerQueueSubHeader.setText(getUpNextAndQueueTime());
|
||||||
mAppBarLayout.setBackgroundColor(ThemeStore.primaryColor(this));
|
mPlayerQueueSubHeader.setTextColor(ThemeStore.accentColor(this));
|
||||||
mToolbar.setBackgroundColor(ThemeStore.primaryColor(this));
|
mAppBarLayout.setBackgroundColor(ThemeStore.primaryColor(this));
|
||||||
mToolbar.setNavigationIcon(mClose);
|
mToolbar.setBackgroundColor(ThemeStore.primaryColor(this));
|
||||||
setSupportActionBar(mToolbar);
|
mToolbar.setNavigationIcon(mClose);
|
||||||
setTitle(queue);
|
setSupportActionBar(mToolbar);
|
||||||
mToolbar.setNavigationOnClickListener(v -> onBackPressed());
|
setTitle(null);
|
||||||
}
|
mToolbar.setNavigationOnClickListener(v -> onBackPressed());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package code.name.monkey.retromusic.ui.activities;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.design.widget.AppBarLayout;
|
import android.support.design.widget.AppBarLayout;
|
||||||
import android.support.design.widget.CollapsingToolbarLayout;
|
|
||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
@ -29,13 +28,11 @@ import butterknife.ButterKnife;
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
import code.name.monkey.appthemehelper.ThemeStore;
|
import code.name.monkey.appthemehelper.ThemeStore;
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper;
|
import code.name.monkey.appthemehelper.util.TintHelper;
|
||||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
|
||||||
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.menu.PlaylistMenuHelper;
|
import code.name.monkey.retromusic.helper.menu.PlaylistMenuHelper;
|
||||||
import code.name.monkey.retromusic.interfaces.CabHolder;
|
import code.name.monkey.retromusic.interfaces.CabHolder;
|
||||||
import code.name.monkey.retromusic.loaders.PlaylistLoader;
|
import code.name.monkey.retromusic.loaders.PlaylistLoader;
|
||||||
import code.name.monkey.retromusic.misc.AppBarStateChangeListener;
|
|
||||||
import code.name.monkey.retromusic.model.AbsCustomPlaylist;
|
import code.name.monkey.retromusic.model.AbsCustomPlaylist;
|
||||||
import code.name.monkey.retromusic.model.Playlist;
|
import code.name.monkey.retromusic.model.Playlist;
|
||||||
import code.name.monkey.retromusic.model.PlaylistSong;
|
import code.name.monkey.retromusic.model.PlaylistSong;
|
||||||
|
@ -72,8 +69,8 @@ public class PlaylistDetailActivity extends AbsSlidingMusicPanelActivity impleme
|
||||||
@BindView(R.id.app_bar)
|
@BindView(R.id.app_bar)
|
||||||
AppBarLayout appBarLayout;
|
AppBarLayout appBarLayout;
|
||||||
|
|
||||||
@BindView(R.id.collapsing_toolbar)
|
@BindView(R.id.title)
|
||||||
CollapsingToolbarLayout toolbarLayout;
|
TextView title;
|
||||||
|
|
||||||
@BindView(R.id.status_bar)
|
@BindView(R.id.status_bar)
|
||||||
View statusBar;
|
View statusBar;
|
||||||
|
@ -182,33 +179,17 @@ public class PlaylistDetailActivity extends AbsSlidingMusicPanelActivity impleme
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpToolBar() {
|
private void setUpToolBar() {
|
||||||
|
title.setTextColor(ThemeStore.textColorPrimary(this));
|
||||||
|
TintHelper.setTintAuto(shuffleButton, ThemeStore.accentColor(this), true);
|
||||||
|
|
||||||
int primaryColor = ThemeStore.primaryColor(this);
|
int primaryColor = ThemeStore.primaryColor(this);
|
||||||
toolbar.setBackgroundColor(primaryColor);
|
toolbar.setBackgroundColor(primaryColor);
|
||||||
appBarLayout.setBackgroundColor(primaryColor);
|
appBarLayout.setBackgroundColor(primaryColor);
|
||||||
|
|
||||||
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
||||||
|
title.setText(playlist.name);
|
||||||
|
|
||||||
|
setTitle(null);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
//noinspection ConstantConditions
|
|
||||||
getSupportActionBar().setTitle(playlist.name);
|
|
||||||
|
|
||||||
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onStateChanged(AppBarLayout appBarLayout, AppBarStateChangeListener.State state) {
|
|
||||||
int color;
|
|
||||||
switch (state) {
|
|
||||||
default:
|
|
||||||
case COLLAPSED:
|
|
||||||
case EXPANDED:
|
|
||||||
case IDLE:
|
|
||||||
color = ThemeStore.textColorPrimary(PlaylistDetailActivity.this);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
toolbarLayout.setExpandedTitleColor(color);
|
|
||||||
ToolbarContentTintHelper.colorizeToolbar(toolbar, color, PlaylistDetailActivity.this);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
TintHelper.setTintAuto(shuffleButton, ThemeStore.accentColor(this), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -44,28 +44,38 @@ public class SearchActivity extends AbsMusicServiceActivity implements OnQueryTe
|
||||||
public static final String TAG = SearchActivity.class.getSimpleName();
|
public static final String TAG = SearchActivity.class.getSimpleName();
|
||||||
public static final String QUERY = "query";
|
public static final String QUERY = "query";
|
||||||
private static final int REQ_CODE_SPEECH_INPUT = 9002;
|
private static final int REQ_CODE_SPEECH_INPUT = 9002;
|
||||||
|
|
||||||
@BindView(R.id.voice_search)
|
@BindView(R.id.voice_search)
|
||||||
View micIcon;
|
View micIcon;
|
||||||
|
|
||||||
@BindView(R.id.recycler_view)
|
@BindView(R.id.recycler_view)
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
|
|
||||||
@BindView(R.id.toolbar)
|
@BindView(R.id.toolbar)
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
|
|
||||||
@BindView(android.R.id.empty)
|
@BindView(android.R.id.empty)
|
||||||
TextView empty;
|
TextView empty;
|
||||||
|
|
||||||
|
@BindView(R.id.title)
|
||||||
|
TextView title;
|
||||||
|
|
||||||
@BindView(R.id.search_view)
|
@BindView(R.id.search_view)
|
||||||
EditText searchView;
|
EditText searchView;
|
||||||
|
|
||||||
@BindView(R.id.root)
|
@BindView(R.id.root)
|
||||||
CoordinatorLayout container;
|
CoordinatorLayout container;
|
||||||
@BindView(R.id.appbar)
|
|
||||||
|
@BindView(R.id.app_bar)
|
||||||
AppBarLayout appbar;
|
AppBarLayout appbar;
|
||||||
|
|
||||||
@BindView(R.id.status_bar)
|
@BindView(R.id.status_bar)
|
||||||
View statusBar;
|
View statusBar;
|
||||||
|
|
||||||
private SearchPresenter searchPresenter;
|
private SearchPresenter searchPresenter;
|
||||||
private SearchAdapter adapter;
|
private SearchAdapter adapter;
|
||||||
private String query;
|
private String query;
|
||||||
|
|
||||||
private boolean isMicSearch = false;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
setDrawUnderStatusBar(true);
|
setDrawUnderStatusBar(true);
|
||||||
|
@ -94,7 +104,7 @@ public class SearchActivity extends AbsMusicServiceActivity implements OnQueryTe
|
||||||
|
|
||||||
if (getIntent().getBooleanExtra("mic_search", false)) {
|
if (getIntent().getBooleanExtra("mic_search", false)) {
|
||||||
startMicSearch();
|
startMicSearch();
|
||||||
isMicSearch = true;
|
boolean isMicSearch = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,12 +155,13 @@ public class SearchActivity extends AbsMusicServiceActivity implements OnQueryTe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpToolBar() {
|
private void setUpToolBar() {
|
||||||
|
title.setTextColor(ThemeStore.textColorPrimary(this));
|
||||||
int primaryColor = ThemeStore.primaryColor(this);
|
int primaryColor = ThemeStore.primaryColor(this);
|
||||||
toolbar.setBackgroundColor(primaryColor);
|
toolbar.setBackgroundColor(primaryColor);
|
||||||
|
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
||||||
appbar.setBackgroundColor(primaryColor);
|
appbar.setBackgroundColor(primaryColor);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
//noinspection ConstantConditions
|
setTitle(null);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||||
import android.support.annotation.ColorInt;
|
import android.support.annotation.ColorInt;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.annotation.StringRes;
|
||||||
import android.support.design.widget.AppBarLayout;
|
import android.support.design.widget.AppBarLayout;
|
||||||
import android.support.transition.TransitionManager;
|
import android.support.transition.TransitionManager;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
|
@ -12,142 +13,131 @@ import android.support.v4.app.FragmentManager;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
import android.support.v4.app.FragmentTransaction;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.afollestad.materialdialogs.color.ColorChooserDialog;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
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.ColorUtil;
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper;
|
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager;
|
import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager;
|
||||||
import code.name.monkey.retromusic.ui.activities.base.AbsBaseActivity;
|
import code.name.monkey.retromusic.ui.activities.base.AbsBaseActivity;
|
||||||
import code.name.monkey.retromusic.ui.fragments.settings.MainSettingsFragment;
|
import code.name.monkey.retromusic.ui.fragments.settings.MainSettingsFragment;
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||||
import com.afollestad.materialdialogs.color.ColorChooserDialog;
|
|
||||||
|
|
||||||
public class SettingsActivity extends AbsBaseActivity implements ColorChooserDialog.ColorCallback {
|
public class SettingsActivity extends AbsBaseActivity implements ColorChooserDialog.ColorCallback {
|
||||||
|
|
||||||
@BindView(R.id.toolbar)
|
@BindView(R.id.toolbar)
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
@BindView(R.id.app_bar)
|
@BindView(R.id.app_bar)
|
||||||
AppBarLayout appBarLayout;
|
AppBarLayout appBarLayout;
|
||||||
@BindView(R.id.detail_content_frame)
|
@BindView(R.id.title)
|
||||||
@Nullable
|
TextView title;
|
||||||
FrameLayout detailsFrame;
|
@BindView(R.id.detail_content_frame)
|
||||||
private FragmentManager fragmentManager = getSupportFragmentManager();
|
@Nullable
|
||||||
|
FrameLayout detailsFrame;
|
||||||
|
private FragmentManager fragmentManager = getSupportFragmentManager();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
|
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
|
||||||
switch (dialog.getTitle()) {
|
switch (dialog.getTitle()) {
|
||||||
case R.string.primary_color:
|
case R.string.primary_color:
|
||||||
int theme = ColorUtil.isColorLight(selectedColor) ?
|
int theme = ColorUtil.isColorLight(selectedColor) ?
|
||||||
PreferenceUtil.getThemeResFromPrefValue("light") :
|
PreferenceUtil.getThemeResFromPrefValue("light") :
|
||||||
PreferenceUtil.getThemeResFromPrefValue("dark");
|
PreferenceUtil.getThemeResFromPrefValue("dark");
|
||||||
|
|
||||||
ThemeStore.editTheme(this).activityTheme(theme).primaryColor(selectedColor).commit();
|
ThemeStore.editTheme(this).activityTheme(theme).primaryColor(selectedColor).commit();
|
||||||
break;
|
break;
|
||||||
case R.string.accent_color:
|
case R.string.accent_color:
|
||||||
ThemeStore.editTheme(this).accentColor(selectedColor).commit();
|
ThemeStore.editTheme(this).accentColor(selectedColor).commit();
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
|
||||||
|
new DynamicShortcutManager(this).updateDynamicShortcuts();
|
||||||
|
}
|
||||||
|
recreate();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
|
@Override
|
||||||
new DynamicShortcutManager(this).updateDynamicShortcuts();
|
public void onColorChooserDismissed(@NonNull ColorChooserDialog dialog) {
|
||||||
}
|
|
||||||
recreate();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onColorChooserDismissed(@NonNull ColorChooserDialog dialog) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(@Nullable Bundle bundle) {
|
|
||||||
super.onCreate(bundle);
|
|
||||||
setContentView(R.layout.activity_settings);
|
|
||||||
ButterKnife.bind(this);
|
|
||||||
|
|
||||||
setStatusbarColorAuto();
|
|
||||||
setNavigationbarColorAuto();
|
|
||||||
setTaskDescriptionColorAuto();
|
|
||||||
setLightNavigationBar(true);
|
|
||||||
|
|
||||||
setupToolbar();
|
|
||||||
|
|
||||||
if (bundle == null) {
|
|
||||||
fragmentManager.beginTransaction().replace(R.id.content_frame, new MainSettingsFragment())
|
|
||||||
.commit();
|
|
||||||
} else {
|
|
||||||
restoreFragment();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupToolbar() {
|
|
||||||
int primaryColor = ThemeStore.primaryColor(this);
|
|
||||||
appBarLayout.setBackgroundColor(primaryColor);
|
|
||||||
toolbar.setBackgroundColor(primaryColor);
|
|
||||||
toolbar.setNavigationOnClickListener(v -> onBackPressed());
|
|
||||||
setTitle(R.string.app_name);
|
|
||||||
setSupportActionBar(toolbar);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void restoreFragment() {
|
|
||||||
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
|
||||||
if (fragmentManager.getBackStackEntryCount() > 0) {
|
|
||||||
appBarLayout.setExpanded(false, true);
|
|
||||||
} else {
|
|
||||||
appBarLayout.setExpanded(true, true);
|
|
||||||
}
|
|
||||||
setupToolbar();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setupFragment(Fragment fragment) {
|
|
||||||
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction()
|
|
||||||
.setCustomAnimations(R.animator.slide_up, 0, 0, R.animator.slide_down);
|
|
||||||
|
|
||||||
if (detailsFrame == null) {
|
|
||||||
fragmentTransaction.replace(R.id.content_frame, fragment, fragment.getTag());
|
|
||||||
fragmentTransaction.addToBackStack(null);
|
|
||||||
fragmentTransaction.commit();
|
|
||||||
} else {
|
|
||||||
fragmentTransaction.replace(R.id.detail_content_frame, fragment, fragment.getTag());
|
|
||||||
fragmentTransaction.commit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fragmentManager.addOnBackStackChangedListener(() -> {
|
@Override
|
||||||
if (fragmentManager.getBackStackEntryCount() > 0) {
|
protected void onCreate(@Nullable Bundle bundle) {
|
||||||
appBarLayout.setExpanded(false, true);
|
super.onCreate(bundle);
|
||||||
} else {
|
setContentView(R.layout.activity_settings);
|
||||||
appBarLayout.setExpanded(true, true);
|
ButterKnife.bind(this);
|
||||||
}
|
|
||||||
setupToolbar();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
setStatusbarColorAuto();
|
||||||
|
setNavigationbarColorAuto();
|
||||||
|
setTaskDescriptionColorAuto();
|
||||||
|
setLightNavigationBar(true);
|
||||||
|
|
||||||
@Override
|
setupToolbar();
|
||||||
public void onBackPressed() {
|
|
||||||
if (fragmentManager.getBackStackEntryCount() == 0) {
|
if (bundle == null) {
|
||||||
super.onBackPressed();
|
fragmentManager.beginTransaction().replace(R.id.content_frame, new MainSettingsFragment())
|
||||||
} else {
|
.commit();
|
||||||
fragmentManager.popBackStack();
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
private void setupToolbar() {
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
title.setTextColor(ThemeStore.textColorPrimary(this));
|
||||||
if (item.getItemId() == android.R.id.home) {
|
int primaryColor = ThemeStore.primaryColor(this);
|
||||||
onBackPressed();
|
appBarLayout.setBackgroundColor(primaryColor);
|
||||||
return true;
|
toolbar.setBackgroundColor(primaryColor);
|
||||||
|
toolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
||||||
|
toolbar.setNavigationOnClickListener(v -> onBackPressed());
|
||||||
|
setTitle(null);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addAppbarLayoutElevation(float v) {
|
|
||||||
TransitionManager.beginDelayedTransition(appBarLayout);
|
public void setupFragment(Fragment fragment, @StringRes int titleName) {
|
||||||
appBarLayout.setElevation(v);
|
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction()
|
||||||
}
|
.setCustomAnimations(R.animator.slide_up, 0, 0, R.animator.slide_down);
|
||||||
|
|
||||||
|
title.setText(titleName);
|
||||||
|
|
||||||
|
if (detailsFrame == null) {
|
||||||
|
fragmentTransaction.replace(R.id.content_frame, fragment, fragment.getTag());
|
||||||
|
fragmentTransaction.addToBackStack(null);
|
||||||
|
fragmentTransaction.commit();
|
||||||
|
} else {
|
||||||
|
fragmentTransaction.replace(R.id.detail_content_frame, fragment, fragment.getTag());
|
||||||
|
fragmentTransaction.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
if (fragmentManager.getBackStackEntryCount() == 0) {
|
||||||
|
super.onBackPressed();
|
||||||
|
} else {
|
||||||
|
title.setText(R.string.action_settings);
|
||||||
|
fragmentManager.popBackStack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == android.R.id.home) {
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addAppbarLayoutElevation(float v) {
|
||||||
|
TransitionManager.beginDelayedTransition(appBarLayout);
|
||||||
|
appBarLayout.setElevation(v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import android.support.v7.widget.RecyclerView;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
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.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
|
@ -53,18 +54,27 @@ import static code.name.monkey.retromusic.Constants.PAYPAL_ME_URL;
|
||||||
public class SupportDevelopmentActivity extends AbsBaseActivity implements BillingProcessor.IBillingHandler {
|
public class SupportDevelopmentActivity extends AbsBaseActivity implements BillingProcessor.IBillingHandler {
|
||||||
public static final String TAG = SupportDevelopmentActivity.class.getSimpleName();
|
public static final String TAG = SupportDevelopmentActivity.class.getSimpleName();
|
||||||
private static final int DONATION_PRODUCT_IDS = R.array.donation_ids;
|
private static final int DONATION_PRODUCT_IDS = R.array.donation_ids;
|
||||||
|
|
||||||
@BindView(R.id.progress)
|
@BindView(R.id.progress)
|
||||||
ProgressBar mProgressBar;
|
ProgressBar mProgressBar;
|
||||||
|
|
||||||
@BindView(R.id.progress_container)
|
@BindView(R.id.progress_container)
|
||||||
View mProgressContainer;
|
View mProgressContainer;
|
||||||
|
|
||||||
@BindView(R.id.list)
|
@BindView(R.id.list)
|
||||||
RecyclerView mListView;
|
RecyclerView mListView;
|
||||||
|
|
||||||
@BindView(R.id.toolbar)
|
@BindView(R.id.toolbar)
|
||||||
Toolbar mToolbar;
|
Toolbar mToolbar;
|
||||||
|
|
||||||
@BindView(R.id.app_bar)
|
@BindView(R.id.app_bar)
|
||||||
AppBarLayout mAppBarLayout;
|
AppBarLayout mAppBarLayout;
|
||||||
|
|
||||||
@BindView(R.id.root)
|
@BindView(R.id.root)
|
||||||
ViewGroup mViewGroup;
|
ViewGroup mViewGroup;
|
||||||
|
|
||||||
|
@BindView(R.id.title)
|
||||||
|
TextView title;
|
||||||
private BillingProcessor mBillingProcessor;
|
private BillingProcessor mBillingProcessor;
|
||||||
private AsyncTask skuDetailsLoadAsyncTask;
|
private AsyncTask skuDetailsLoadAsyncTask;
|
||||||
|
|
||||||
|
@ -86,6 +96,15 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
|
||||||
return skuDetails;
|
return skuDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == android.R.id.home) {
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
private void donate(int i) {
|
private void donate(int i) {
|
||||||
final String[] ids = getResources().getStringArray(DONATION_PRODUCT_IDS);
|
final String[] ids = getResources().getStringArray(DONATION_PRODUCT_IDS);
|
||||||
mBillingProcessor.purchase(this, ids[i]);
|
mBillingProcessor.purchase(this, ids[i]);
|
||||||
|
@ -107,13 +126,8 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
|
||||||
setTaskDescriptionColorAuto();
|
setTaskDescriptionColorAuto();
|
||||||
setLightNavigationBar(true);
|
setLightNavigationBar(true);
|
||||||
|
|
||||||
int primaryColor = ThemeStore.primaryColor(this);
|
|
||||||
mAppBarLayout.setBackgroundColor(primaryColor);
|
setupToolbar();
|
||||||
mToolbar.setBackgroundColor(primaryColor);
|
|
||||||
setSupportActionBar(mToolbar);
|
|
||||||
//noinspection ConstantConditions
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
mToolbar.setNavigationOnClickListener(view -> onBackPressed());
|
|
||||||
|
|
||||||
mBillingProcessor
|
mBillingProcessor
|
||||||
= new BillingProcessor(this, BuildConfig.GOOGLE_PLAY_LICENSE_KEY, this);
|
= new BillingProcessor(this, BuildConfig.GOOGLE_PLAY_LICENSE_KEY, this);
|
||||||
|
@ -122,6 +136,17 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
|
||||||
((TextView) findViewById(R.id.donation)).setTextColor(ThemeStore.accentColor(this));
|
((TextView) findViewById(R.id.donation)).setTextColor(ThemeStore.accentColor(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupToolbar() {
|
||||||
|
title.setTextColor(ThemeStore.textColorPrimary(this));
|
||||||
|
int primaryColor = ThemeStore.primaryColor(this);
|
||||||
|
mAppBarLayout.setBackgroundColor(primaryColor);
|
||||||
|
mToolbar.setBackgroundColor(primaryColor);
|
||||||
|
mToolbar.setNavigationOnClickListener(view -> onBackPressed());
|
||||||
|
mToolbar.setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp);
|
||||||
|
setSupportActionBar(mToolbar);
|
||||||
|
setTitle(null);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBillingInitialized() {
|
public void onBillingInitialized() {
|
||||||
loadSkuDetails();
|
loadSkuDetails();
|
||||||
|
@ -173,7 +198,7 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
|
||||||
private static class SkuDetailsLoadAsyncTask extends AsyncTask<Void, Void, List<SkuDetails>> {
|
private static class SkuDetailsLoadAsyncTask extends AsyncTask<Void, Void, List<SkuDetails>> {
|
||||||
private final WeakReference<SupportDevelopmentActivity> donationDialogWeakReference;
|
private final WeakReference<SupportDevelopmentActivity> donationDialogWeakReference;
|
||||||
|
|
||||||
public SkuDetailsLoadAsyncTask(SupportDevelopmentActivity donationsDialog) {
|
SkuDetailsLoadAsyncTask(SupportDevelopmentActivity donationsDialog) {
|
||||||
this.donationDialogWeakReference = new WeakReference<>(donationsDialog);
|
this.donationDialogWeakReference = new WeakReference<>(donationsDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,8 +230,6 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
|
||||||
if (dialog == null) return;
|
if (dialog == null) return;
|
||||||
|
|
||||||
if (skuDetails == null || skuDetails.isEmpty()) {
|
if (skuDetails == null || skuDetails.isEmpty()) {
|
||||||
//Toast.makeText(dialog, "Error loading items", Toast.LENGTH_SHORT).show();
|
|
||||||
//dialog.finish();
|
|
||||||
dialog.mProgressContainer.setVisibility(View.GONE);
|
dialog.mProgressContainer.setVisibility(View.GONE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -229,7 +252,7 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
|
||||||
SupportDevelopmentActivity donationsDialog;
|
SupportDevelopmentActivity donationsDialog;
|
||||||
List<SkuDetails> skuDetailsList = new ArrayList<>();
|
List<SkuDetails> skuDetailsList = new ArrayList<>();
|
||||||
|
|
||||||
public SkuDetailsAdapter(@NonNull SupportDevelopmentActivity donationsDialog, @NonNull List<SkuDetails> objects) {
|
SkuDetailsAdapter(@NonNull SupportDevelopmentActivity donationsDialog, @NonNull List<SkuDetails> objects) {
|
||||||
this.donationsDialog = donationsDialog;
|
this.donationsDialog = donationsDialog;
|
||||||
skuDetailsList = objects;
|
skuDetailsList = objects;
|
||||||
}
|
}
|
||||||
|
@ -260,14 +283,15 @@ public class SupportDevelopmentActivity extends AbsBaseActivity implements Billi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
|
||||||
return new ViewHolder(LayoutInflater.from(donationsDialog)
|
return new ViewHolder(LayoutInflater.from(donationsDialog)
|
||||||
.inflate(LAYOUT_RES_ID, viewGroup, false));
|
.inflate(LAYOUT_RES_ID, viewGroup, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(ViewHolder viewHolder, int i) {
|
public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) {
|
||||||
SkuDetails skuDetails = skuDetailsList.get(i);
|
SkuDetails skuDetails = skuDetailsList.get(i);
|
||||||
if (skuDetails != null) {
|
if (skuDetails != null) {
|
||||||
viewHolder.title.setText(skuDetails.title.replace("(Retro Music Player)", "").trim());
|
viewHolder.title.setText(skuDetails.title.replace("(Retro Music Player)", "").trim());
|
||||||
|
|
|
@ -1,96 +1,92 @@
|
||||||
package code.name.monkey.retromusic.ui.adapter;
|
package code.name.monkey.retromusic.ui.adapter;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import butterknife.BindViews;
|
import butterknife.BindViews;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.glide.SongGlideRequest;
|
import code.name.monkey.retromusic.glide.SongGlideRequest;
|
||||||
import code.name.monkey.retromusic.model.Album;
|
import code.name.monkey.retromusic.model.Song;
|
||||||
import code.name.monkey.retromusic.ui.adapter.CollageSongAdapter.CollageSongViewHolder;
|
import code.name.monkey.retromusic.ui.adapter.CollageSongAdapter.CollageSongViewHolder;
|
||||||
import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder;
|
import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder;
|
||||||
import code.name.monkey.retromusic.util.NavigationUtil;
|
|
||||||
import com.bumptech.glide.Glide;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Hemanth S (h4h13).
|
* @author Hemanth S (h4h13).
|
||||||
*/
|
*/
|
||||||
public class CollageSongAdapter extends RecyclerView.Adapter<CollageSongViewHolder> {
|
public class CollageSongAdapter extends RecyclerView.Adapter<CollageSongViewHolder> {
|
||||||
|
|
||||||
private AppCompatActivity activity;
|
private Activity activity;
|
||||||
private ArrayList<Album> dataSet;
|
private ArrayList<Song> dataSet;
|
||||||
private int itemLayoutRes;
|
|
||||||
|
|
||||||
public CollageSongAdapter(AppCompatActivity activity, ArrayList<Album> dataSet,
|
public CollageSongAdapter(Activity activity, ArrayList<Song> dataSet) {
|
||||||
int itemLayoutRes) {
|
this.activity = activity;
|
||||||
this.activity = activity;
|
this.dataSet = dataSet;
|
||||||
this.dataSet = dataSet;
|
|
||||||
this.itemLayoutRes = itemLayoutRes;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(@NonNull CollageSongViewHolder holder, int position) {
|
|
||||||
ArrayList<Album> albums = dataSet;
|
|
||||||
|
|
||||||
holder.bindSongs(albums);
|
|
||||||
|
|
||||||
if (albums.size() > 9) {
|
|
||||||
for (int i = 0; i < albums.subList(0, 9).size(); i++) {
|
|
||||||
if (holder.imageViews != null) {
|
|
||||||
SongGlideRequest.Builder.from(Glide.with(activity), albums.get(i).safeGetFirstSong())
|
|
||||||
.checkIgnoreMediaStore(activity).build().into(holder.imageViews.get(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public CollageSongViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
|
||||||
return new CollageSongViewHolder(
|
|
||||||
LayoutInflater.from(activity).inflate(itemLayoutRes, parent, false));
|
|
||||||
}
|
|
||||||
|
|
||||||
class CollageSongViewHolder extends MediaEntryViewHolder {
|
|
||||||
|
|
||||||
@BindViews({R.id.image_1, R.id.image_2, R.id.image_3, R.id.image_4, R.id.image_5, R.id.image_6,
|
|
||||||
R.id.image_7, R.id.image_8, R.id.image_9})
|
|
||||||
@Nullable
|
|
||||||
List<ImageView> imageViews;
|
|
||||||
|
|
||||||
CollageSongViewHolder(View itemView) {
|
|
||||||
super(itemView);
|
|
||||||
ButterKnife.bind(this, itemView);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onBindViewHolder(@NonNull CollageSongViewHolder holder, int position) {
|
||||||
super.onClick(v);
|
|
||||||
NavigationUtil.goToAlbum(activity, dataSet.get(getAdapterPosition() + 1).getId());
|
|
||||||
|
holder.bindSongs();
|
||||||
|
|
||||||
|
if (dataSet.size() > 9) {
|
||||||
|
for (int i = 0; i < dataSet.subList(0, 9).size(); i++) {
|
||||||
|
if (holder.imageViews != null) {
|
||||||
|
SongGlideRequest.Builder.from(Glide.with(activity), dataSet.get(i))
|
||||||
|
.checkIgnoreMediaStore(activity)
|
||||||
|
.build()
|
||||||
|
.into(holder.imageViews.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void bindSongs(ArrayList<Album> albums) {
|
@Override
|
||||||
if (imageViews != null) {
|
public int getItemCount() {
|
||||||
for (int i = 0; i < imageViews.size(); i++) {
|
return 1;
|
||||||
final int startPosition = i;
|
}
|
||||||
ImageView imageView = imageViews.get(i);
|
|
||||||
imageView.setOnClickListener(
|
@NonNull
|
||||||
v -> NavigationUtil.goToAlbum(activity, albums.get(startPosition).getId()));
|
@Override
|
||||||
}
|
public CollageSongViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
}
|
return new CollageSongViewHolder(
|
||||||
|
LayoutInflater.from(activity).inflate(R.layout.item_collage, parent, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
class CollageSongViewHolder extends MediaEntryViewHolder {
|
||||||
|
|
||||||
|
@BindViews({R.id.image_1, R.id.image_2, R.id.image_3, R.id.image_4, R.id.image_5, R.id.image_6,
|
||||||
|
R.id.image_7, R.id.image_8, R.id.image_9})
|
||||||
|
@Nullable
|
||||||
|
List<ImageView> imageViews;
|
||||||
|
|
||||||
|
CollageSongViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
ButterKnife.bind(this, itemView);
|
||||||
|
}
|
||||||
|
|
||||||
|
void bindSongs() {
|
||||||
|
if (imageViews != null) {
|
||||||
|
for (int i = 0; i < imageViews.size(); i++) {
|
||||||
|
final int startPosition = i;
|
||||||
|
ImageView imageView = imageViews.get(i);
|
||||||
|
imageView.setOnClickListener(view -> {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,8 +60,11 @@ public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder,
|
||||||
this.usePalette = usePalette;
|
this.usePalette = usePalette;
|
||||||
setHasStableIds(true);
|
setHasStableIds(true);
|
||||||
this.textColor = ThemeStore.textColorPrimary(activity);
|
this.textColor = ThemeStore.textColorPrimary(activity);
|
||||||
Typeface mTypeface = Typeface
|
}
|
||||||
.createFromAsset(activity.getAssets(), activity.getString(R.string.sans_regular));
|
|
||||||
|
public AlbumAdapter(@NonNull AppCompatActivity activity, ArrayList<Album> dataSet,
|
||||||
|
@LayoutRes int itemLayoutRes) {
|
||||||
|
this(activity, dataSet, itemLayoutRes, false, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void useItemLayout(int itemLayoutRes) {
|
public void useItemLayout(int itemLayoutRes) {
|
||||||
|
|
|
@ -25,6 +25,12 @@ import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget;
|
import code.name.monkey.retromusic.glide.RetroMusicColoredTarget;
|
||||||
import code.name.monkey.retromusic.glide.SongGlideRequest;
|
import code.name.monkey.retromusic.glide.SongGlideRequest;
|
||||||
|
@ -32,116 +38,114 @@ import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||||
import code.name.monkey.retromusic.model.Album;
|
import code.name.monkey.retromusic.model.Album;
|
||||||
import code.name.monkey.retromusic.util.NavigationUtil;
|
import code.name.monkey.retromusic.util.NavigationUtil;
|
||||||
import code.name.monkey.retromusic.views.MetalRecyclerViewPager;
|
import code.name.monkey.retromusic.views.MetalRecyclerViewPager;
|
||||||
import com.bumptech.glide.Glide;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class AlbumFullWithAdapter extends
|
public class AlbumFullWithAdapter extends
|
||||||
MetalRecyclerViewPager.MetalAdapter<AlbumFullWithAdapter.FullMetalViewHolder> {
|
MetalRecyclerViewPager.MetalAdapter<AlbumFullWithAdapter.FullMetalViewHolder> {
|
||||||
|
|
||||||
private Activity activity;
|
private Activity activity;
|
||||||
private List<Album> dataSet = new ArrayList<>();
|
private List<Album> dataSet = new ArrayList<>();
|
||||||
|
|
||||||
public AlbumFullWithAdapter(@NonNull Activity activity,
|
public AlbumFullWithAdapter(@NonNull Activity activity,
|
||||||
@NonNull DisplayMetrics metrics) {
|
@NonNull DisplayMetrics metrics) {
|
||||||
super(metrics);
|
super(metrics);
|
||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
}
|
|
||||||
|
|
||||||
public void swapData(ArrayList<Album> list) {
|
|
||||||
dataSet = list;
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public FullMetalViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
|
||||||
View viewItem = LayoutInflater.from(parent.getContext())
|
|
||||||
.inflate(R.layout.pager_item, parent, false);
|
|
||||||
return new FullMetalViewHolder(viewItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Bitmap combineImageIntoOne(ArrayList<Bitmap> bitmap) {
|
|
||||||
int w = 0, h = 0;
|
|
||||||
for (int i = 0; i < bitmap.size(); i++) {
|
|
||||||
if (i < bitmap.size() - 1) {
|
|
||||||
h = bitmap.get(i).getWidth() > bitmap.get(i + 1).getWidth() ? bitmap.get(i).getWidth()
|
|
||||||
: bitmap.get(i + 1).getWidth();
|
|
||||||
}
|
|
||||||
w += bitmap.get(i).getHeight();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Bitmap temp = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
|
public void swapData(ArrayList<Album> list) {
|
||||||
Canvas canvas = new Canvas(temp);
|
dataSet = list;
|
||||||
int top = 0, left = 0;
|
notifyDataSetChanged();
|
||||||
for (int i = 0; i < bitmap.size(); i++) {
|
|
||||||
Log.d("HTML", "Combine: " + i + "/" + bitmap.size() + 1);
|
|
||||||
|
|
||||||
top = (i == 0 ? 0 : top + bitmap.get(i).getHeight());
|
|
||||||
left = (i == 0 ? 0 : top + bitmap.get(i).getWidth());
|
|
||||||
canvas.drawBitmap(bitmap.get(i), left, 0f, null);
|
|
||||||
}
|
|
||||||
return temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(FullMetalViewHolder holder, int position) {
|
|
||||||
// don't forget about calling supper.onBindViewHolder!
|
|
||||||
super.onBindViewHolder(holder, position);
|
|
||||||
|
|
||||||
final Album album = dataSet.get(position);
|
|
||||||
|
|
||||||
if (holder.title != null) {
|
|
||||||
holder.title.setText(getAlbumTitle(album));
|
|
||||||
}
|
|
||||||
if (holder.text != null) {
|
|
||||||
holder.text.setText(getAlbumText(album));
|
|
||||||
}
|
|
||||||
if (holder.playSongs != null) {
|
|
||||||
holder.playSongs.setOnClickListener(v -> MusicPlayerRemote.openQueue(album.songs, 0, true));
|
|
||||||
}
|
|
||||||
loadAlbumCover(album, holder);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getAlbumTitle(Album album) {
|
|
||||||
return album.getTitle();
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getAlbumText(Album album) {
|
|
||||||
return album.getArtistName();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadAlbumCover(Album album, FullMetalViewHolder holder) {
|
|
||||||
if (holder.image == null) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SongGlideRequest.Builder.from(Glide.with(activity), album.safeGetFirstSong())
|
@NonNull
|
||||||
.checkIgnoreMediaStore(activity)
|
@Override
|
||||||
.generatePalette(activity).build()
|
public FullMetalViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
.into(new RetroMusicColoredTarget(holder.image) {
|
View viewItem = LayoutInflater.from(parent.getContext())
|
||||||
@Override
|
.inflate(R.layout.pager_item, parent, false);
|
||||||
public void onColorReady(int color) {
|
return new FullMetalViewHolder(viewItem);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
private Bitmap combineImageIntoOne(ArrayList<Bitmap> bitmap) {
|
||||||
});
|
int w = 0, h = 0;
|
||||||
}
|
for (int i = 0; i < bitmap.size(); i++) {
|
||||||
|
if (i < bitmap.size() - 1) {
|
||||||
|
h = bitmap.get(i).getWidth() > bitmap.get(i + 1).getWidth() ? bitmap.get(i).getWidth()
|
||||||
|
: bitmap.get(i + 1).getWidth();
|
||||||
|
}
|
||||||
|
w += bitmap.get(i).getHeight();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
Bitmap temp = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
|
||||||
public int getItemCount() {
|
Canvas canvas = new Canvas(temp);
|
||||||
return dataSet.size();
|
int top = 0, left = 0;
|
||||||
}
|
for (int i = 0; i < bitmap.size(); i++) {
|
||||||
|
Log.d("HTML", "Combine: " + i + "/" + bitmap.size() + 1);
|
||||||
|
|
||||||
class FullMetalViewHolder extends MetalRecyclerViewPager.MetalViewHolder {
|
top = (i == 0 ? 0 : top + bitmap.get(i).getHeight());
|
||||||
|
left = (i == 0 ? 0 : top + bitmap.get(i).getWidth());
|
||||||
FullMetalViewHolder(View itemView) {
|
canvas.drawBitmap(bitmap.get(i), left, 0f, null);
|
||||||
super(itemView);
|
}
|
||||||
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onBindViewHolder(@NonNull FullMetalViewHolder holder, int position) {
|
||||||
Pair[] albumPairs = new Pair[]{
|
// don't forget about calling supper.onBindViewHolder!
|
||||||
Pair.create(image, activity.getResources().getString(R.string.transition_album_art))};
|
super.onBindViewHolder(holder, position);
|
||||||
NavigationUtil.goToAlbum(activity, dataSet.get(getAdapterPosition()).getId(), albumPairs);
|
|
||||||
|
final Album album = dataSet.get(position);
|
||||||
|
|
||||||
|
if (holder.title != null) {
|
||||||
|
holder.title.setText(getAlbumTitle(album));
|
||||||
|
}
|
||||||
|
if (holder.text != null) {
|
||||||
|
holder.text.setText(getAlbumText(album));
|
||||||
|
}
|
||||||
|
if (holder.playSongs != null) {
|
||||||
|
holder.playSongs.setOnClickListener(v -> MusicPlayerRemote.openQueue(album.songs, 0, true));
|
||||||
|
}
|
||||||
|
loadAlbumCover(album, holder);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getAlbumTitle(Album album) {
|
||||||
|
return album.getTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getAlbumText(Album album) {
|
||||||
|
return album.getArtistName();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadAlbumCover(Album album, FullMetalViewHolder holder) {
|
||||||
|
if (holder.image == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SongGlideRequest.Builder.from(Glide.with(activity), album.safeGetFirstSong())
|
||||||
|
.checkIgnoreMediaStore(activity)
|
||||||
|
.generatePalette(activity).build()
|
||||||
|
.into(new RetroMusicColoredTarget(holder.image) {
|
||||||
|
@Override
|
||||||
|
public void onColorReady(int color) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return dataSet.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
class FullMetalViewHolder extends MetalRecyclerViewPager.MetalViewHolder {
|
||||||
|
|
||||||
|
FullMetalViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Pair[] albumPairs = new Pair[]{
|
||||||
|
Pair.create(image, activity.getResources().getString(R.string.transition_album_art))};
|
||||||
|
NavigationUtil.goToAlbum(activity, dataSet.get(getAdapterPosition()).getId(), albumPairs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -9,6 +9,13 @@ import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil;
|
import code.name.monkey.appthemehelper.util.ColorUtil;
|
||||||
import code.name.monkey.appthemehelper.util.MaterialValueHelper;
|
import code.name.monkey.appthemehelper.util.MaterialValueHelper;
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
|
@ -22,167 +29,171 @@ import code.name.monkey.retromusic.ui.adapter.base.AbsMultiSelectAdapter;
|
||||||
import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder;
|
import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder;
|
||||||
import code.name.monkey.retromusic.util.MusicUtil;
|
import code.name.monkey.retromusic.util.MusicUtil;
|
||||||
import code.name.monkey.retromusic.util.NavigationUtil;
|
import code.name.monkey.retromusic.util.NavigationUtil;
|
||||||
import com.bumptech.glide.Glide;
|
|
||||||
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
public class ArtistAdapter extends
|
public class ArtistAdapter extends
|
||||||
AbsMultiSelectAdapter<ArtistAdapter.ViewHolder, Artist> implements
|
AbsMultiSelectAdapter<ArtistAdapter.ViewHolder, Artist> implements
|
||||||
FastScrollRecyclerView.SectionedAdapter {
|
FastScrollRecyclerView.SectionedAdapter {
|
||||||
|
|
||||||
protected final AppCompatActivity activity;
|
protected final AppCompatActivity activity;
|
||||||
protected ArrayList<Artist> dataSet;
|
protected ArrayList<Artist> dataSet;
|
||||||
|
|
||||||
protected int itemLayoutRes;
|
protected int itemLayoutRes;
|
||||||
|
|
||||||
protected boolean usePalette = false;
|
protected boolean usePalette = false;
|
||||||
|
|
||||||
|
|
||||||
public ArtistAdapter(@NonNull AppCompatActivity activity, ArrayList<Artist> dataSet,
|
public ArtistAdapter(@NonNull AppCompatActivity activity, ArrayList<Artist> dataSet,
|
||||||
@LayoutRes int itemLayoutRes, boolean usePalette, @Nullable CabHolder cabHolder) {
|
@LayoutRes int itemLayoutRes, boolean usePalette, @Nullable CabHolder cabHolder) {
|
||||||
super(activity, cabHolder, R.menu.menu_media_selection);
|
super(activity, cabHolder, R.menu.menu_media_selection);
|
||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
this.dataSet = dataSet;
|
this.dataSet = dataSet;
|
||||||
this.itemLayoutRes = itemLayoutRes;
|
this.itemLayoutRes = itemLayoutRes;
|
||||||
this.usePalette = usePalette;
|
this.usePalette = usePalette;
|
||||||
//setHasStableIds(true);
|
//setHasStableIds(true);
|
||||||
}
|
|
||||||
|
|
||||||
public void swapDataSet(ArrayList<Artist> dataSet) {
|
|
||||||
this.dataSet = dataSet;
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<Artist> getDataSet() {
|
|
||||||
return dataSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void usePalette(boolean usePalette) {
|
|
||||||
this.usePalette = usePalette;
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getItemId(int position) {
|
|
||||||
return dataSet.get(position).getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
|
||||||
View view = LayoutInflater.from(activity).inflate(itemLayoutRes, parent, false);
|
|
||||||
return createViewHolder(view);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected ViewHolder createViewHolder(View view) {
|
|
||||||
return new ViewHolder(view);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {
|
|
||||||
final Artist artist = dataSet.get(position);
|
|
||||||
|
|
||||||
boolean isChecked = isChecked(artist);
|
|
||||||
holder.itemView.setActivated(isChecked);
|
|
||||||
|
|
||||||
if (holder.title != null) {
|
|
||||||
holder.title.setText(artist.getName());
|
|
||||||
}
|
}
|
||||||
if (holder.text != null) {
|
|
||||||
holder.text.setVisibility(View.GONE);
|
public ArtistAdapter(@NonNull AppCompatActivity activity, ArrayList<Artist> dataSet,
|
||||||
|
@LayoutRes int itemLayoutRes ) {
|
||||||
|
super(activity, null, R.menu.menu_media_selection);
|
||||||
|
this.activity = activity;
|
||||||
|
this.dataSet = dataSet;
|
||||||
|
this.itemLayoutRes = itemLayoutRes;
|
||||||
}
|
}
|
||||||
if (holder.shortSeparator != null) {
|
|
||||||
holder.shortSeparator.setVisibility(View.VISIBLE);
|
public void swapDataSet(ArrayList<Artist> dataSet) {
|
||||||
|
this.dataSet = dataSet;
|
||||||
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
loadArtistImage(artist, holder);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setColors(int color, ViewHolder holder) {
|
public ArrayList<Artist> getDataSet() {
|
||||||
if (holder.paletteColorContainer != null) {
|
return dataSet;
|
||||||
holder.paletteColorContainer.setBackgroundColor(color);
|
|
||||||
if (holder.title != null) {
|
|
||||||
holder.title.setTextColor(
|
|
||||||
MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void loadArtistImage(Artist artist, final ViewHolder holder) {
|
public void usePalette(boolean usePalette) {
|
||||||
if (holder.image == null) {
|
this.usePalette = usePalette;
|
||||||
return;
|
notifyDataSetChanged();
|
||||||
}
|
|
||||||
ArtistGlideRequest.Builder.from(Glide.with(activity), artist)
|
|
||||||
.generatePalette(activity).build()
|
|
||||||
.into(new RetroMusicColoredTarget(holder.image) {
|
|
||||||
@Override
|
|
||||||
public void onColorReady(int color) {
|
|
||||||
setColors(color, holder);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return dataSet.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Artist getIdentifier(int position) {
|
|
||||||
return dataSet.get(position);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getName(Artist artist) {
|
|
||||||
return artist.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onMultipleItemAction(@NonNull MenuItem menuItem,
|
|
||||||
@NonNull ArrayList<Artist> selection) {
|
|
||||||
SongsMenuHelper.handleMenuClick(activity, getSongList(selection), menuItem.getItemId());
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
private ArrayList<Song> getSongList(@NonNull List<Artist> artists) {
|
|
||||||
final ArrayList<Song> songs = new ArrayList<>();
|
|
||||||
for (Artist artist : artists) {
|
|
||||||
songs.addAll(artist.getSongs()); // maybe async in future?
|
|
||||||
}
|
|
||||||
return songs;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public String getSectionName(int position) {
|
|
||||||
return MusicUtil.getSectionName(dataSet.get(position).getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ViewHolder extends MediaEntryViewHolder {
|
|
||||||
|
|
||||||
public ViewHolder(@NonNull View itemView) {
|
|
||||||
super(itemView);
|
|
||||||
setImageTransitionName(activity.getString(R.string.transition_artist_image));
|
|
||||||
if (menu != null) {
|
|
||||||
menu.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public long getItemId(int position) {
|
||||||
if (isInQuickSelectMode()) {
|
return dataSet.get(position).getId();
|
||||||
toggleChecked(getAdapterPosition());
|
|
||||||
} else {
|
|
||||||
Pair[] artistPairs = new Pair[]{Pair.create(image,
|
|
||||||
activity.getResources().getString(R.string.transition_artist_image))};
|
|
||||||
NavigationUtil.goToArtist(activity, dataSet.get(getAdapterPosition()).getId(), artistPairs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View view) {
|
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
toggleChecked(getAdapterPosition());
|
View view = LayoutInflater.from(activity).inflate(itemLayoutRes, parent, false);
|
||||||
return true;
|
return createViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ViewHolder createViewHolder(View view) {
|
||||||
|
return new ViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull final ViewHolder holder, int position) {
|
||||||
|
final Artist artist = dataSet.get(position);
|
||||||
|
|
||||||
|
boolean isChecked = isChecked(artist);
|
||||||
|
holder.itemView.setActivated(isChecked);
|
||||||
|
|
||||||
|
if (holder.title != null) {
|
||||||
|
holder.title.setText(artist.getName());
|
||||||
|
}
|
||||||
|
if (holder.text != null) {
|
||||||
|
holder.text.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
if (holder.shortSeparator != null) {
|
||||||
|
holder.shortSeparator.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
loadArtistImage(artist, holder);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setColors(int color, ViewHolder holder) {
|
||||||
|
if (holder.paletteColorContainer != null) {
|
||||||
|
holder.paletteColorContainer.setBackgroundColor(color);
|
||||||
|
if (holder.title != null) {
|
||||||
|
holder.title.setTextColor(
|
||||||
|
MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadArtistImage(Artist artist, final ViewHolder holder) {
|
||||||
|
if (holder.image == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ArtistGlideRequest.Builder.from(Glide.with(activity), artist)
|
||||||
|
.generatePalette(activity).build()
|
||||||
|
.into(new RetroMusicColoredTarget(holder.image) {
|
||||||
|
@Override
|
||||||
|
public void onColorReady(int color) {
|
||||||
|
setColors(color, holder);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return dataSet.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Artist getIdentifier(int position) {
|
||||||
|
return dataSet.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getName(Artist artist) {
|
||||||
|
return artist.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onMultipleItemAction(@NonNull MenuItem menuItem,
|
||||||
|
@NonNull ArrayList<Artist> selection) {
|
||||||
|
SongsMenuHelper.handleMenuClick(activity, getSongList(selection), menuItem.getItemId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
private ArrayList<Song> getSongList(@NonNull List<Artist> artists) {
|
||||||
|
final ArrayList<Song> songs = new ArrayList<>();
|
||||||
|
for (Artist artist : artists) {
|
||||||
|
songs.addAll(artist.getSongs()); // maybe async in future?
|
||||||
|
}
|
||||||
|
return songs;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String getSectionName(int position) {
|
||||||
|
return MusicUtil.getSectionName(dataSet.get(position).getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ViewHolder extends MediaEntryViewHolder {
|
||||||
|
|
||||||
|
public ViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
setImageTransitionName(activity.getString(R.string.transition_artist_image));
|
||||||
|
if (menu != null) {
|
||||||
|
menu.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (isInQuickSelectMode()) {
|
||||||
|
toggleChecked(getAdapterPosition());
|
||||||
|
} else {
|
||||||
|
Pair[] artistPairs = new Pair[]{Pair.create(image,
|
||||||
|
activity.getResources().getString(R.string.transition_artist_image))};
|
||||||
|
NavigationUtil.goToArtist(activity, dataSet.get(getAdapterPosition()).getId(), artistPairs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onLongClick(View view) {
|
||||||
|
toggleChecked(getAdapterPosition());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import android.view.ViewGroup;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import code.name.monkey.appthemehelper.ThemeStore;
|
import code.name.monkey.appthemehelper.ThemeStore;
|
||||||
|
@ -17,82 +18,82 @@ import code.name.monkey.retromusic.R;
|
||||||
|
|
||||||
|
|
||||||
public class MediaEntryViewHolder extends RecyclerView.ViewHolder
|
public class MediaEntryViewHolder extends RecyclerView.ViewHolder
|
||||||
implements View.OnClickListener, View.OnLongClickListener {
|
implements View.OnClickListener, View.OnLongClickListener {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@BindView(R.id.image)
|
@BindView(R.id.image)
|
||||||
public ImageView image;
|
public ImageView image;
|
||||||
@Nullable
|
@Nullable
|
||||||
@BindView(R.id.image_text)
|
@BindView(R.id.image_text)
|
||||||
public TextView imageText;
|
public TextView imageText;
|
||||||
@Nullable
|
@Nullable
|
||||||
@BindView(R.id.title)
|
@BindView(R.id.title)
|
||||||
public TextView title;
|
public TextView title;
|
||||||
@Nullable
|
@Nullable
|
||||||
@BindView(R.id.text)
|
@BindView(R.id.text)
|
||||||
public TextView text;
|
public TextView text;
|
||||||
@Nullable
|
@Nullable
|
||||||
@BindView(R.id.image_container)
|
@BindView(R.id.image_container)
|
||||||
public ViewGroup imageContainer;
|
public ViewGroup imageContainer;
|
||||||
@Nullable
|
@Nullable
|
||||||
@BindView(R.id.image_container_card)
|
@BindView(R.id.image_container_card)
|
||||||
public CardView imageContainerCard;
|
public CardView imageContainerCard;
|
||||||
@Nullable
|
@Nullable
|
||||||
@BindView(R.id.menu)
|
@BindView(R.id.menu)
|
||||||
public View menu;
|
public View menu;
|
||||||
@Nullable
|
@Nullable
|
||||||
@BindView(R.id.separator)
|
@BindView(R.id.separator)
|
||||||
public View separator;
|
public View separator;
|
||||||
@Nullable
|
@Nullable
|
||||||
@BindView(R.id.short_separator)
|
@BindView(R.id.short_separator)
|
||||||
public View shortSeparator;
|
public View shortSeparator;
|
||||||
@Nullable
|
@Nullable
|
||||||
@BindView(R.id.drag_view)
|
@BindView(R.id.drag_view)
|
||||||
public View dragView;
|
public View dragView;
|
||||||
@Nullable
|
@Nullable
|
||||||
@BindView(R.id.palette_color_container)
|
@BindView(R.id.palette_color_container)
|
||||||
public View paletteColorContainer;
|
public View paletteColorContainer;
|
||||||
@BindView(R.id.time)
|
@BindView(R.id.time)
|
||||||
@Nullable
|
@Nullable
|
||||||
public TextView time;
|
public TextView time;
|
||||||
@BindView(R.id.recycler_view)
|
@BindView(R.id.recycler_view)
|
||||||
@Nullable
|
@Nullable
|
||||||
public RecyclerView recyclerView;
|
public RecyclerView recyclerView;
|
||||||
@BindView(R.id.play_songs)
|
@BindView(R.id.play_songs)
|
||||||
@Nullable
|
@Nullable
|
||||||
public ImageButton playSongs;
|
public ImageButton playSongs;
|
||||||
@BindView(R.id.image_text_container)
|
@BindView(R.id.image_text_container)
|
||||||
@Nullable
|
@Nullable
|
||||||
public CardView imageTextContainer;
|
public CardView imageTextContainer;
|
||||||
|
|
||||||
|
|
||||||
public MediaEntryViewHolder(View itemView) {
|
public MediaEntryViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
ButterKnife.bind(this, itemView);
|
ButterKnife.bind(this, itemView);
|
||||||
|
|
||||||
itemView.setOnClickListener(this);
|
itemView.setOnClickListener(this);
|
||||||
itemView.setOnLongClickListener(this);
|
itemView.setOnLongClickListener(this);
|
||||||
|
|
||||||
if (imageTextContainer != null) {
|
if (imageTextContainer != null) {
|
||||||
imageTextContainer.setCardBackgroundColor(ThemeStore.primaryColor(itemView.getContext()));
|
imageTextContainer.setCardBackgroundColor(ThemeStore.primaryColor(itemView.getContext()));
|
||||||
|
}
|
||||||
|
if (imageContainerCard != null) {
|
||||||
|
imageContainerCard.setCardBackgroundColor(ThemeStore.primaryColor(itemView.getContext()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (imageContainerCard != null) {
|
|
||||||
imageContainerCard.setCardBackgroundColor(ThemeStore.primaryColor(itemView.getContext()));
|
protected void setImageTransitionName(@NonNull String transitionName) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && image != null) {
|
||||||
|
image.setTransitionName(transitionName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected void setImageTransitionName(@NonNull String transitionName) {
|
@Override
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && image != null) {
|
public boolean onLongClick(View v) {
|
||||||
image.setTransitionName(transitionName);
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(View v) {
|
public void onClick(View v) {
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,169 +1,128 @@
|
||||||
package code.name.monkey.retromusic.ui.adapter.home;
|
package code.name.monkey.retromusic.ui.adapter.home;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.DefaultItemAnimator;
|
|
||||||
import android.support.v7.widget.GridLayoutManager;
|
import android.support.v7.widget.GridLayoutManager;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
|
import android.view.Display;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import butterknife.BindView;
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
|
||||||
import code.name.monkey.retromusic.loaders.SongLoader;
|
|
||||||
import code.name.monkey.retromusic.model.Album;
|
import code.name.monkey.retromusic.model.Album;
|
||||||
import code.name.monkey.retromusic.model.Artist;
|
import code.name.monkey.retromusic.model.Artist;
|
||||||
|
import code.name.monkey.retromusic.model.Genre;
|
||||||
|
import code.name.monkey.retromusic.model.Home;
|
||||||
import code.name.monkey.retromusic.model.Song;
|
import code.name.monkey.retromusic.model.Song;
|
||||||
import code.name.monkey.retromusic.model.smartplaylist.HistoryPlaylist;
|
import code.name.monkey.retromusic.ui.adapter.CollageSongAdapter;
|
||||||
import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist;
|
import code.name.monkey.retromusic.ui.adapter.GenreAdapter;
|
||||||
import code.name.monkey.retromusic.model.smartplaylist.MyTopTracksPlaylist;
|
|
||||||
import code.name.monkey.retromusic.ui.adapter.album.AlbumAdapter;
|
import code.name.monkey.retromusic.ui.adapter.album.AlbumAdapter;
|
||||||
import code.name.monkey.retromusic.ui.adapter.artist.ArtistAdapter;
|
import code.name.monkey.retromusic.ui.adapter.artist.ArtistAdapter;
|
||||||
import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder;
|
import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder;
|
||||||
import code.name.monkey.retromusic.ui.adapter.song.SongAdapter;
|
|
||||||
import code.name.monkey.retromusic.util.NavigationUtil;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class HomeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class HomeAdapter extends RecyclerView.Adapter<HomeAdapter.ViewHolder> {
|
||||||
|
|
||||||
private static final int SUB_HEADER = 0;
|
private static final int ALBUMS = 0;
|
||||||
private static final int ABS_PLAYLITS = 1;
|
private static final int ARTISTS = 1;
|
||||||
private static final int DATA = 2;
|
private static final int GENERS = 2;
|
||||||
private ArrayList<Object> dataSet = new ArrayList<>();
|
private static final int SUGGESTIONS = 3;
|
||||||
private AppCompatActivity activity;
|
private Activity activity;
|
||||||
|
private ArrayList<Home> sections = new ArrayList<>();
|
||||||
|
|
||||||
public HomeAdapter(@NonNull AppCompatActivity activity) {
|
|
||||||
this.activity = activity;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public HomeAdapter(Activity activity) {
|
||||||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
|
this.activity = activity;
|
||||||
switch (i) {
|
|
||||||
|
|
||||||
case ABS_PLAYLITS:
|
|
||||||
return new ViewHolder(LayoutInflater.from(activity)
|
|
||||||
.inflate(R.layout.abs_playlists, viewGroup, false));
|
|
||||||
default:
|
|
||||||
case DATA:
|
|
||||||
return new ViewHolder(LayoutInflater.from(activity)
|
|
||||||
.inflate(R.layout.recycler_view_sec, viewGroup, false));
|
|
||||||
case SUB_HEADER:
|
|
||||||
return new ViewHolder(LayoutInflater.from(activity)
|
|
||||||
.inflate(R.layout.sub_header, viewGroup, false));
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@NonNull
|
||||||
public int getItemViewType(int position) {
|
@Override
|
||||||
if (dataSet.get(position) instanceof String) {
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
return SUB_HEADER;
|
Context context = parent.getContext();
|
||||||
} else if (dataSet.get(position) instanceof Integer) {
|
return new ViewHolder(LayoutInflater.from(context).inflate(R.layout.home_section_recycler_view,
|
||||||
return ABS_PLAYLITS;
|
parent, false));
|
||||||
} else if (dataSet.get(position) instanceof ArrayList) {
|
|
||||||
return DATA;
|
|
||||||
}
|
}
|
||||||
return super.getItemViewType(position);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(RecyclerView.ViewHolder holder, int i) {
|
public int getItemViewType(int position) {
|
||||||
ViewHolder viewholder = (ViewHolder) holder;
|
Home home = sections.get(position);
|
||||||
switch (getItemViewType(i)) {
|
ArrayList arrayList = home.getList();
|
||||||
case ABS_PLAYLITS:
|
if (arrayList.get(0) instanceof Album) {
|
||||||
bindAbsActions(viewholder);
|
return ALBUMS;
|
||||||
break;
|
} else if (arrayList.get(0) instanceof Artist) {
|
||||||
case SUB_HEADER:
|
return ARTISTS;
|
||||||
String title = (String) dataSet.get(i);
|
} else if (arrayList.get(0) instanceof Genre) {
|
||||||
if (viewholder.title != null) {
|
return GENERS;
|
||||||
viewholder.title.setText(title);
|
} else {
|
||||||
|
return SUGGESTIONS;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case DATA:
|
|
||||||
parseAllSections(i, viewholder);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void bindAbsActions(ViewHolder viewholder) {
|
private DisplayMetrics getDisplayMetrics() {
|
||||||
|
Display display = activity.getWindowManager().getDefaultDisplay();
|
||||||
|
DisplayMetrics metrics = new DisplayMetrics();
|
||||||
if (viewholder.shuffle != null) {
|
display.getMetrics(metrics);
|
||||||
viewholder.shuffle.setOnClickListener(view -> MusicPlayerRemote
|
return metrics;
|
||||||
.openAndShuffleQueue(SongLoader.getAllSongs(activity).blockingFirst(), true));
|
|
||||||
}
|
}
|
||||||
/*if (viewholder.search != null) {
|
|
||||||
viewholder.search.setBackgroundTintList(ColorStateList.valueOf(ColorUtil.withAlpha(ThemeStore.textColorPrimary(activity), 0.2f)));
|
|
||||||
viewholder.search.setOnClickListener(view -> {
|
|
||||||
activity.startActivity(new Intent(activity, SearchActivity.class));
|
|
||||||
});
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@Override
|
||||||
private void parseAllSections(int i, ViewHolder viewholder) {
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
if (viewholder.recyclerView != null) {
|
Home home = sections.get(position);
|
||||||
ArrayList arrayList = (ArrayList) dataSet.get(i);
|
|
||||||
if (arrayList.isEmpty()) {
|
if (holder.title != null) {
|
||||||
return;
|
holder.title.setText(home.getSectionTitle());
|
||||||
}
|
}
|
||||||
Object something = arrayList.get(0);
|
ArrayList arrayList = home.getList();
|
||||||
if (something instanceof Artist) {
|
if (arrayList.get(0) instanceof Album) {
|
||||||
layoutManager(viewholder);
|
AlbumAdapter albumAdapter = new AlbumAdapter((AppCompatActivity) activity,
|
||||||
viewholder.recyclerView.setAdapter(
|
(ArrayList<Album>) arrayList, R.layout.item_image);
|
||||||
new ArtistAdapter(activity, (ArrayList<Artist>) arrayList, R.layout.item_artist, false,
|
if (holder.recyclerView != null) {
|
||||||
null));
|
holder.recyclerView.setLayoutManager(new GridLayoutManager(activity, 1, GridLayoutManager.HORIZONTAL, false));
|
||||||
} else if (something instanceof Album) {
|
holder.recyclerView.setAdapter(albumAdapter);
|
||||||
layoutManager(viewholder);
|
}
|
||||||
viewholder.recyclerView.setItemAnimator(new DefaultItemAnimator());
|
} else if (arrayList.get(0) instanceof Artist) {
|
||||||
viewholder.recyclerView.setAdapter(
|
ArtistAdapter artistAdapter = new ArtistAdapter((AppCompatActivity) activity, (ArrayList<Artist>) arrayList, R.layout.item_artist);
|
||||||
new AlbumAdapter(activity, (ArrayList<Album>) arrayList, R.layout.item_image, false,
|
GridLayoutManager layoutManager = new GridLayoutManager(activity, 1, GridLayoutManager.HORIZONTAL, false);
|
||||||
null));
|
if (holder.recyclerView != null) {
|
||||||
} else if (something instanceof Song) {
|
holder.recyclerView.setLayoutManager(layoutManager);
|
||||||
GridLayoutManager layoutManager = new GridLayoutManager(activity, 1,
|
holder.recyclerView.setAdapter(artistAdapter);
|
||||||
LinearLayoutManager.HORIZONTAL, false);
|
}
|
||||||
viewholder.recyclerView.setLayoutManager(layoutManager);
|
} else if (arrayList.get(0) instanceof Genre) {
|
||||||
viewholder.recyclerView.setAdapter(
|
GenreAdapter genreAdapter = new GenreAdapter(activity, (ArrayList<Genre>) arrayList, R.layout.item_list);
|
||||||
new SongAdapter(activity, (ArrayList<Song>) arrayList, R.layout.item_image, false,
|
if (holder.recyclerView != null) {
|
||||||
null));
|
holder.recyclerView.setLayoutManager(new LinearLayoutManager(activity));
|
||||||
}
|
holder.recyclerView.setAdapter(genreAdapter);
|
||||||
|
}
|
||||||
|
} else if (arrayList.get(0) instanceof Song) {
|
||||||
|
CollageSongAdapter collageSongAdapter = new CollageSongAdapter(activity, (ArrayList<Song>) arrayList);
|
||||||
|
if (holder.recyclerView != null) {
|
||||||
|
holder.recyclerView.setLayoutManager(new LinearLayoutManager(activity));
|
||||||
|
holder.recyclerView.setAdapter(collageSongAdapter);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void layoutManager(ViewHolder viewholder) {
|
@Override
|
||||||
if (viewholder.recyclerView != null) {
|
public int getItemCount() {
|
||||||
viewholder.recyclerView.setLayoutManager(
|
return sections.size();
|
||||||
new GridLayoutManager(activity, 1, GridLayoutManager.HORIZONTAL, false));
|
|
||||||
viewholder.recyclerView.setItemAnimator(new DefaultItemAnimator());
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
public void swapData(ArrayList<Home> sections) {
|
||||||
@Override
|
this.sections = sections;
|
||||||
public int getItemCount() {
|
notifyDataSetChanged();
|
||||||
return dataSet.size();
|
}
|
||||||
}
|
|
||||||
|
public class ViewHolder extends MediaEntryViewHolder {
|
||||||
public void swapDataSet(@NonNull ArrayList<Object> data) {
|
|
||||||
dataSet = data;
|
|
||||||
notifyDataSetChanged();
|
public ViewHolder(View itemView) {
|
||||||
}
|
super(itemView);
|
||||||
|
}
|
||||||
public ArrayList<Object> getDataset() {
|
|
||||||
return dataSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ViewHolder extends MediaEntryViewHolder {
|
|
||||||
|
|
||||||
|
|
||||||
@BindView(R.id.action_shuffle)
|
|
||||||
@Nullable
|
|
||||||
View shuffle;
|
|
||||||
|
|
||||||
public ViewHolder(View itemView) {
|
|
||||||
super(itemView);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,11 +35,11 @@ public abstract class AbsMainActivityFragment extends AbsMusicServiceFragment {
|
||||||
final View statusBar = view.findViewById(R.id.status_bar);
|
final View statusBar = view.findViewById(R.id.status_bar);
|
||||||
if (statusBar != null) {
|
if (statusBar != null) {
|
||||||
RetroUtil.statusBarHeight(statusBar);
|
RetroUtil.statusBarHeight(statusBar);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
statusBar.setBackgroundColor(ColorUtil.darkenColor(color));
|
statusBar.setBackgroundColor(color);
|
||||||
getMainActivity().setLightStatusbarAuto(color);
|
getMainActivity().setLightStatusbarAuto(color);
|
||||||
} else {
|
} else {
|
||||||
statusBar.setBackgroundColor(color);
|
statusBar.setBackgroundColor(ColorUtil.darkenColor(color));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@ public abstract class AbsMainActivityFragment extends AbsMusicServiceFragment {
|
||||||
|
|
||||||
public void setStatusbarColorAuto(View view) {
|
public void setStatusbarColorAuto(View view) {
|
||||||
// we don't want to use statusbar color because we are doing the color darkening on our own to support KitKat
|
// we don't want to use statusbar color because we are doing the color darkening on our own to support KitKat
|
||||||
|
//noinspection ConstantConditions
|
||||||
setStatusbarColor(view, ThemeStore.primaryColor(getContext()));
|
setStatusbarColor(view, ThemeStore.primaryColor(getContext()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,9 @@ import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v7.widget.GridLayoutManager;
|
import android.support.v7.widget.GridLayoutManager;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.model.Album;
|
import code.name.monkey.retromusic.model.Album;
|
||||||
import code.name.monkey.retromusic.mvp.contract.AlbumContract;
|
import code.name.monkey.retromusic.mvp.contract.AlbumContract;
|
||||||
|
@ -11,156 +14,166 @@ import code.name.monkey.retromusic.mvp.presenter.AlbumPresenter;
|
||||||
import code.name.monkey.retromusic.ui.adapter.album.AlbumAdapter;
|
import code.name.monkey.retromusic.ui.adapter.album.AlbumAdapter;
|
||||||
import code.name.monkey.retromusic.ui.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment;
|
import code.name.monkey.retromusic.ui.fragments.base.AbsLibraryPagerRecyclerViewCustomGridSizeFragment;
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class AlbumsFragment extends
|
public class AlbumsFragment extends
|
||||||
AbsLibraryPagerRecyclerViewCustomGridSizeFragment<AlbumAdapter, GridLayoutManager> implements
|
AbsLibraryPagerRecyclerViewCustomGridSizeFragment<AlbumAdapter, GridLayoutManager> implements
|
||||||
AlbumContract.AlbumView {
|
AlbumContract.AlbumView {
|
||||||
|
|
||||||
public static final String TAG = AlbumsFragment.class.getSimpleName();
|
public static final String TAG = AlbumsFragment.class.getSimpleName();
|
||||||
|
|
||||||
private AlbumPresenter presenter;
|
private AlbumPresenter presenter;
|
||||||
|
|
||||||
public static AlbumsFragment newInstance() {
|
public static AlbumsFragment newInstance() {
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
AlbumsFragment fragment = new AlbumsFragment();
|
AlbumsFragment fragment = new AlbumsFragment();
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected GridLayoutManager createLayoutManager() {
|
|
||||||
return new GridLayoutManager(getActivity(), getGridSize());
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
protected AlbumAdapter createAdapter() {
|
|
||||||
int itemLayoutRes = getItemLayoutRes();
|
|
||||||
notifyLayoutResChanged(itemLayoutRes);
|
|
||||||
if (itemLayoutRes != R.layout.item_list) {
|
|
||||||
itemLayoutRes = PreferenceUtil.getInstance(getContext()).getAlbumGridStyle(getContext());
|
|
||||||
}
|
}
|
||||||
ArrayList<Album> dataSet =
|
|
||||||
getAdapter() == null ? new ArrayList<>() : getAdapter().getDataSet();
|
|
||||||
return new AlbumAdapter(getLibraryFragment().getMainActivity(), dataSet, itemLayoutRes,
|
|
||||||
loadUsePalette(), getLibraryFragment());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getEmptyMessage() {
|
protected GridLayoutManager createLayoutManager() {
|
||||||
return R.string.no_albums;
|
return new GridLayoutManager(getActivity(), getGridSize());
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean loadUsePalette() {
|
|
||||||
return PreferenceUtil.getInstance(getActivity()).albumColoredFooters();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUsePalette(boolean usePalette) {
|
|
||||||
getAdapter().usePalette(usePalette);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setGridSize(int gridSize) {
|
|
||||||
getLayoutManager().setSpanCount(gridSize);
|
|
||||||
getAdapter().notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setSortOrder(String sortOrder) {
|
|
||||||
presenter.loadAlbums();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String loadSortOrder() {
|
|
||||||
return PreferenceUtil.getInstance(getActivity()).getAlbumSortOrder();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void saveSortOrder(String sortOrder) {
|
|
||||||
PreferenceUtil.getInstance(getActivity()).setAlbumSortOrder(sortOrder);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int loadGridSize() {
|
|
||||||
return PreferenceUtil.getInstance(getActivity()).getAlbumGridSize(getActivity());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void saveGridSize(int gridSize) {
|
|
||||||
PreferenceUtil.getInstance(getActivity()).setAlbumGridSize(gridSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int loadGridSizeLand() {
|
|
||||||
return PreferenceUtil.getInstance(getActivity()).getAlbumGridSizeLand(getActivity());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void saveGridSizeLand(int gridSize) {
|
|
||||||
PreferenceUtil.getInstance(getActivity()).setAlbumGridSizeLand(gridSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void saveUsePalette(boolean usePalette) {
|
|
||||||
PreferenceUtil.getInstance(getActivity()).setAlbumColoredFooters(usePalette);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onMediaStoreChanged() {
|
|
||||||
presenter.loadAlbums();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
presenter = new AlbumPresenter(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setMenuVisibility(boolean menuVisible) {
|
|
||||||
super.setMenuVisibility(menuVisible);
|
|
||||||
if (menuVisible) {
|
|
||||||
getLibraryFragment().setTitle(
|
|
||||||
PreferenceUtil.getInstance(getContext()).tabTitles() ? R.string.library
|
|
||||||
: R.string.albums);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@NonNull
|
||||||
public void onResume() {
|
@Override
|
||||||
super.onResume();
|
protected AlbumAdapter createAdapter() {
|
||||||
getLibraryFragment().setTitle(
|
int itemLayoutRes = getItemLayoutRes();
|
||||||
PreferenceUtil.getInstance(getContext()).tabTitles() ? R.string.library : R.string.albums);
|
notifyLayoutResChanged(itemLayoutRes);
|
||||||
if (getAdapter().getDataSet().isEmpty()) {
|
if (itemLayoutRes != R.layout.item_list) {
|
||||||
presenter.subscribe();
|
//noinspection ConstantConditions
|
||||||
|
itemLayoutRes = PreferenceUtil.getInstance(getContext()).getAlbumGridStyle(getContext());
|
||||||
|
}
|
||||||
|
ArrayList<Album> dataSet =
|
||||||
|
getAdapter() == null ? new ArrayList<>() : getAdapter().getDataSet();
|
||||||
|
return new AlbumAdapter(getLibraryFragment().getMainActivity(), dataSet, itemLayoutRes,
|
||||||
|
loadUsePalette(), getLibraryFragment());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
protected int getEmptyMessage() {
|
||||||
super.onDestroy();
|
return R.string.no_albums;
|
||||||
presenter.unsubscribe();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loading() {
|
public boolean loadUsePalette() {
|
||||||
}
|
//noinspection ConstantConditions
|
||||||
|
return PreferenceUtil.getInstance(getActivity()).albumColoredFooters();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showEmptyView() {
|
protected void setUsePalette(boolean usePalette) {
|
||||||
getAdapter().swapDataSet(new ArrayList<>());
|
getAdapter().usePalette(usePalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void completed() {
|
protected void setGridSize(int gridSize) {
|
||||||
}
|
getLayoutManager().setSpanCount(gridSize);
|
||||||
|
getAdapter().notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showData(ArrayList<Album> albums) {
|
protected void setSortOrder(String sortOrder) {
|
||||||
getAdapter().swapDataSet(albums);
|
presenter.loadAlbums();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String loadSortOrder() {
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
return PreferenceUtil.getInstance(getActivity()).getAlbumSortOrder();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void saveSortOrder(String sortOrder) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
PreferenceUtil.getInstance(getActivity()).setAlbumSortOrder(sortOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int loadGridSize() {
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
return PreferenceUtil.getInstance(getActivity()).getAlbumGridSize(getActivity());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void saveGridSize(int gridSize) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
PreferenceUtil.getInstance(getActivity()).setAlbumGridSize(gridSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int loadGridSizeLand() {
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
return PreferenceUtil.getInstance(getActivity()).getAlbumGridSizeLand(getActivity());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void saveGridSizeLand(int gridSize) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
PreferenceUtil.getInstance(getActivity()).setAlbumGridSizeLand(gridSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void saveUsePalette(boolean usePalette) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
PreferenceUtil.getInstance(getActivity()).setAlbumColoredFooters(usePalette);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMediaStoreChanged() {
|
||||||
|
presenter.loadAlbums();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
presenter = new AlbumPresenter(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMenuVisibility(boolean menuVisible) {
|
||||||
|
super.setMenuVisibility(menuVisible);
|
||||||
|
if (menuVisible) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
getLibraryFragment().setTitle(
|
||||||
|
PreferenceUtil.getInstance(getContext()).tabTitles() ? R.string.library
|
||||||
|
: R.string.albums);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
getLibraryFragment().setTitle(
|
||||||
|
PreferenceUtil.getInstance(getContext()).tabTitles() ? R.string.library : R.string.albums);
|
||||||
|
if (getAdapter().getDataSet().isEmpty()) {
|
||||||
|
presenter.subscribe();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
presenter.unsubscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loading() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showEmptyView() {
|
||||||
|
getAdapter().swapDataSet(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void completed() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showData(ArrayList<Album> albums) {
|
||||||
|
getAdapter().swapDataSet(albums);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.annotation.StringRes;
|
import android.support.annotation.StringRes;
|
||||||
import android.support.design.widget.AppBarLayout;
|
import android.support.design.widget.AppBarLayout;
|
||||||
import android.support.design.widget.CollapsingToolbarLayout;
|
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
import android.support.v4.app.FragmentTransaction;
|
||||||
|
@ -19,12 +18,18 @@ import android.view.MenuItem;
|
||||||
import android.view.SubMenu;
|
import android.view.SubMenu;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.afollestad.materialcab.MaterialCab;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
import butterknife.OnClick;
|
||||||
import butterknife.Unbinder;
|
import butterknife.Unbinder;
|
||||||
import code.name.monkey.appthemehelper.ThemeStore;
|
import code.name.monkey.appthemehelper.ThemeStore;
|
||||||
import code.name.monkey.appthemehelper.common.ATHToolbarActivity;
|
import code.name.monkey.appthemehelper.common.ATHToolbarActivity;
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||||
|
import code.name.monkey.appthemehelper.util.TintHelper;
|
||||||
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.dialogs.CreatePlaylistDialog;
|
import code.name.monkey.retromusic.dialogs.CreatePlaylistDialog;
|
||||||
|
@ -40,416 +45,424 @@ import code.name.monkey.retromusic.ui.fragments.base.AbsMainActivityFragment;
|
||||||
import code.name.monkey.retromusic.util.NavigationUtil;
|
import code.name.monkey.retromusic.util.NavigationUtil;
|
||||||
import code.name.monkey.retromusic.util.RetroColorUtil;
|
import code.name.monkey.retromusic.util.RetroColorUtil;
|
||||||
import code.name.monkey.retromusic.util.RetroUtil;
|
import code.name.monkey.retromusic.util.RetroUtil;
|
||||||
import com.afollestad.materialcab.MaterialCab;
|
import code.name.monkey.retromusic.views.IconImageView;
|
||||||
|
|
||||||
public class LibraryFragment extends AbsMainActivityFragment implements CabHolder,
|
public class LibraryFragment extends AbsMainActivityFragment implements CabHolder,
|
||||||
MainActivityFragmentCallbacks {
|
MainActivityFragmentCallbacks {
|
||||||
|
|
||||||
private static final String TAG = "LibraryFragment";
|
public static final String TAG = "LibraryFragment";
|
||||||
private static final String CURRENT_TAB_ID = "current_tab_id";
|
private static final String CURRENT_TAB_ID = "current_tab_id";
|
||||||
@BindView(R.id.toolbar)
|
|
||||||
Toolbar toolbar;
|
|
||||||
@BindView(R.id.app_bar)
|
|
||||||
AppBarLayout appbar;
|
|
||||||
@BindView(R.id.collapsing_toolbar)
|
|
||||||
CollapsingToolbarLayout collapsingToolbarLayout;
|
|
||||||
|
|
||||||
|
@BindView(R.id.toolbar)
|
||||||
|
Toolbar toolbar;
|
||||||
|
@BindView(R.id.app_bar)
|
||||||
|
AppBarLayout appbar;
|
||||||
|
@BindView(R.id.title)
|
||||||
|
TextView title;
|
||||||
|
@BindView(R.id.search)
|
||||||
|
IconImageView search;
|
||||||
|
|
||||||
private Unbinder unBinder;
|
private Unbinder unBinder;
|
||||||
private MaterialCab cab;
|
private MaterialCab cab;
|
||||||
private FragmentManager fragmentManager;
|
private FragmentManager fragmentManager;
|
||||||
|
|
||||||
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);
|
||||||
LibraryFragment fragment = new LibraryFragment();
|
LibraryFragment fragment = new LibraryFragment();
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
|
||||||
|
|
||||||
public void setTitle(@StringRes int name) {
|
|
||||||
collapsingToolbarLayout.setTitle(getString(name));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addOnAppBarOffsetChangedListener(
|
|
||||||
AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
|
||||||
appbar.addOnOffsetChangedListener(onOffsetChangedListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeOnAppBarOffsetChangedListener(
|
|
||||||
AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
|
||||||
appbar.removeOnOffsetChangedListener(onOffsetChangedListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTotalAppBarScrollingRange() {
|
|
||||||
return appbar.getTotalScrollRange();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
|
||||||
@Nullable Bundle savedInstanceState) {
|
|
||||||
View view = inflater.inflate(R.layout.fragment_library, container, false);
|
|
||||||
unBinder = ButterKnife.bind(this, view);
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
||||||
super.onViewCreated(view, savedInstanceState);
|
|
||||||
|
|
||||||
setStatusbarColorAuto(view);
|
|
||||||
getMainActivity().setBottomBarVisibility(View.VISIBLE);
|
|
||||||
setupToolbar();
|
|
||||||
|
|
||||||
inflateFragment();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void inflateFragment() {
|
|
||||||
if (getArguments() == null) {
|
|
||||||
selectedFragment(SongsFragment.newInstance());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
switch (getArguments().getInt(CURRENT_TAB_ID)) {
|
|
||||||
default:
|
|
||||||
case R.id.action_song:
|
|
||||||
selectedFragment(SongsFragment.newInstance());
|
|
||||||
break;
|
|
||||||
case R.id.action_album:
|
|
||||||
selectedFragment(AlbumsFragment.newInstance());
|
|
||||||
break;
|
|
||||||
case R.id.action_artist:
|
|
||||||
selectedFragment(ArtistsFragment.newInstance());
|
|
||||||
break;
|
|
||||||
case R.id.action_playlist:
|
|
||||||
selectedFragment(PlaylistsFragment.newInstance());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("ConstantConditions")
|
|
||||||
private void setupToolbar() {
|
|
||||||
int primaryColor = ThemeStore.primaryColor(getContext());
|
|
||||||
appbar.setBackgroundColor(primaryColor);
|
|
||||||
toolbar.setBackgroundColor(primaryColor);
|
|
||||||
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
|
||||||
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
|
|
||||||
getMainActivity().setTitle(R.string.app_name);
|
|
||||||
getMainActivity().setSupportActionBar(toolbar);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Fragment getCurrentFragment() {
|
|
||||||
if (fragmentManager == null) {
|
|
||||||
return SongsFragment.newInstance();
|
|
||||||
}
|
|
||||||
return fragmentManager.findFragmentByTag(LibraryFragment.TAG);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroyView() {
|
|
||||||
super.onDestroyView();
|
|
||||||
unBinder.unbind();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handleBackPress() {
|
|
||||||
if (cab != null && cab.isActive()) {
|
|
||||||
cab.finish();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void selectedFragment(Fragment fragment) {
|
|
||||||
fragmentManager = getChildFragmentManager();
|
|
||||||
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
|
||||||
|
|
||||||
fragmentTransaction
|
|
||||||
.replace(R.id.fragment_container, fragment, TAG)
|
|
||||||
.commit();
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public MaterialCab openCab(int menuRes, MaterialCab.Callback callback) {
|
|
||||||
if (cab != null && cab.isActive()) {
|
|
||||||
cab.finish();
|
|
||||||
}
|
|
||||||
//noinspection ConstantConditions
|
|
||||||
cab = new MaterialCab(getMainActivity(), R.id.cab_stub)
|
|
||||||
.setMenu(menuRes)
|
|
||||||
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
|
||||||
.setBackgroundColor(
|
|
||||||
RetroColorUtil.shiftBackgroundColorForLightText(ThemeStore.primaryColor(getActivity())))
|
|
||||||
.start(callback);
|
|
||||||
return cab;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
|
||||||
inflater.inflate(R.menu.menu_main, menu);
|
|
||||||
|
|
||||||
Fragment currentFragment = getCurrentFragment();
|
|
||||||
if (currentFragment instanceof AbsLibraryPagerRecyclerViewCustomGridSizeFragment
|
|
||||||
&& currentFragment.isAdded()) {
|
|
||||||
AbsLibraryPagerRecyclerViewCustomGridSizeFragment fragment = (AbsLibraryPagerRecyclerViewCustomGridSizeFragment) currentFragment;
|
|
||||||
|
|
||||||
MenuItem gridSizeItem = menu.findItem(R.id.action_grid_size);
|
|
||||||
if (RetroUtil.isLandscape(getResources())) {
|
|
||||||
gridSizeItem.setTitle(R.string.action_grid_size_land);
|
|
||||||
}
|
|
||||||
setUpGridSizeMenu(fragment, gridSizeItem.getSubMenu());
|
|
||||||
|
|
||||||
setUpSortOrderMenu(fragment, menu.findItem(R.id.action_sort_order).getSubMenu());
|
|
||||||
|
|
||||||
} else {
|
|
||||||
menu.add(0, R.id.action_new_playlist, 0, R.string.new_playlist_title);
|
|
||||||
menu.removeItem(R.id.action_grid_size);
|
|
||||||
}
|
|
||||||
Activity activity = getActivity();
|
|
||||||
if (activity == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ToolbarContentTintHelper.handleOnCreateOptionsMenu(getActivity(), toolbar, menu,
|
|
||||||
ATHToolbarActivity.getToolbarBackgroundColor(toolbar));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpSortOrderMenu(
|
|
||||||
@NonNull AbsLibraryPagerRecyclerViewCustomGridSizeFragment fragment,
|
|
||||||
@NonNull SubMenu sortOrderMenu) {
|
|
||||||
String currentSortOrder = fragment.getSortOrder();
|
|
||||||
sortOrderMenu.clear();
|
|
||||||
|
|
||||||
if (fragment instanceof AlbumsFragment) {
|
|
||||||
sortOrderMenu.add(0, R.id.action_album_sort_order_asc, 0, R.string.sort_order_a_z)
|
|
||||||
.setChecked(currentSortOrder.equals(SortOrder.AlbumSortOrder.ALBUM_A_Z));
|
|
||||||
sortOrderMenu.add(0, R.id.action_album_sort_order_desc, 1, R.string.sort_order_z_a)
|
|
||||||
.setChecked(currentSortOrder.equals(SortOrder.AlbumSortOrder.ALBUM_Z_A));
|
|
||||||
sortOrderMenu.add(0, R.id.action_album_sort_order_artist, 2, R.string.sort_order_artist)
|
|
||||||
.setChecked(currentSortOrder.equals(SortOrder.AlbumSortOrder.ALBUM_ARTIST));
|
|
||||||
sortOrderMenu.add(0, R.id.action_album_sort_order_year, 3, R.string.sort_order_year)
|
|
||||||
.setChecked(currentSortOrder.equals(SortOrder.AlbumSortOrder.ALBUM_YEAR));
|
|
||||||
} else if (fragment instanceof ArtistsFragment) {
|
|
||||||
sortOrderMenu.add(0, R.id.action_artist_sort_order_asc, 0, R.string.sort_order_a_z)
|
|
||||||
.setChecked(currentSortOrder.equals(SortOrder.ArtistSortOrder.ARTIST_A_Z));
|
|
||||||
sortOrderMenu.add(0, R.id.action_artist_sort_order_desc, 1, R.string.sort_order_z_a)
|
|
||||||
.setChecked(currentSortOrder.equals(SortOrder.ArtistSortOrder.ARTIST_Z_A));
|
|
||||||
} else if (fragment instanceof SongsFragment) {
|
|
||||||
sortOrderMenu.add(0, R.id.action_song_sort_order_asc, 0, R.string.sort_order_a_z)
|
|
||||||
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_A_Z));
|
|
||||||
sortOrderMenu.add(0, R.id.action_song_sort_order_desc, 1, R.string.sort_order_z_a)
|
|
||||||
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_Z_A));
|
|
||||||
sortOrderMenu.add(0, R.id.action_song_sort_order_artist, 2, R.string.sort_order_artist)
|
|
||||||
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_ARTIST));
|
|
||||||
sortOrderMenu.add(0, R.id.action_song_sort_order_album, 3, R.string.sort_order_album)
|
|
||||||
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_ALBUM));
|
|
||||||
sortOrderMenu.add(0, R.id.action_song_sort_order_year, 4, R.string.sort_order_year)
|
|
||||||
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_YEAR));
|
|
||||||
sortOrderMenu.add(0, R.id.action_song_sort_order_date, 4, R.string.sort_order_date)
|
|
||||||
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_DATE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sortOrderMenu.setGroupCheckable(0, true, true);
|
public void setTitle(@StringRes int name) {
|
||||||
}
|
title.setText(getString(name));
|
||||||
|
|
||||||
private boolean handleSortOrderMenuItem(
|
|
||||||
@NonNull AbsLibraryPagerRecyclerViewCustomGridSizeFragment fragment, @NonNull MenuItem item) {
|
|
||||||
String sortOrder = null;
|
|
||||||
if (fragment instanceof AlbumsFragment) {
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
case R.id.action_album_sort_order_asc:
|
|
||||||
sortOrder = SortOrder.AlbumSortOrder.ALBUM_A_Z;
|
|
||||||
break;
|
|
||||||
case R.id.action_album_sort_order_desc:
|
|
||||||
sortOrder = SortOrder.AlbumSortOrder.ALBUM_Z_A;
|
|
||||||
break;
|
|
||||||
case R.id.action_album_sort_order_artist:
|
|
||||||
sortOrder = SortOrder.AlbumSortOrder.ALBUM_ARTIST;
|
|
||||||
break;
|
|
||||||
case R.id.action_album_sort_order_year:
|
|
||||||
sortOrder = SortOrder.AlbumSortOrder.ALBUM_YEAR;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else if (fragment instanceof ArtistsFragment) {
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
case R.id.action_artist_sort_order_asc:
|
|
||||||
sortOrder = SortOrder.ArtistSortOrder.ARTIST_A_Z;
|
|
||||||
break;
|
|
||||||
case R.id.action_artist_sort_order_desc:
|
|
||||||
sortOrder = SortOrder.ArtistSortOrder.ARTIST_Z_A;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else if (fragment instanceof SongsFragment) {
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
case R.id.action_song_sort_order_asc:
|
|
||||||
sortOrder = SortOrder.SongSortOrder.SONG_A_Z;
|
|
||||||
break;
|
|
||||||
case R.id.action_song_sort_order_desc:
|
|
||||||
sortOrder = SortOrder.SongSortOrder.SONG_Z_A;
|
|
||||||
break;
|
|
||||||
case R.id.action_song_sort_order_artist:
|
|
||||||
sortOrder = SortOrder.SongSortOrder.SONG_ARTIST;
|
|
||||||
break;
|
|
||||||
case R.id.action_song_sort_order_album:
|
|
||||||
sortOrder = SortOrder.SongSortOrder.SONG_ALBUM;
|
|
||||||
break;
|
|
||||||
case R.id.action_song_sort_order_year:
|
|
||||||
sortOrder = SortOrder.SongSortOrder.SONG_YEAR;
|
|
||||||
break;
|
|
||||||
case R.id.action_song_sort_order_date:
|
|
||||||
sortOrder = SortOrder.SongSortOrder.SONG_DATE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sortOrder != null) {
|
public void addOnAppBarOffsetChangedListener(
|
||||||
item.setChecked(true);
|
AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
||||||
fragment.setAndSaveSortOrder(sortOrder);
|
appbar.addOnOffsetChangedListener(onOffsetChangedListener);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
public void removeOnAppBarOffsetChangedListener(
|
||||||
}
|
AppBarLayout.OnOffsetChangedListener onOffsetChangedListener) {
|
||||||
|
appbar.removeOnOffsetChangedListener(onOffsetChangedListener);
|
||||||
@Override
|
|
||||||
public void onPrepareOptionsMenu(Menu menu) {
|
|
||||||
super.onPrepareOptionsMenu(menu);
|
|
||||||
Activity activity = getActivity();
|
|
||||||
if (activity == null) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
ToolbarContentTintHelper.handleOnPrepareOptionsMenu(activity, toolbar);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("ConstantConditions")
|
public int getTotalAppBarScrollingRange() {
|
||||||
@Override
|
return appbar.getTotalScrollRange();
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
|
||||||
//if (pager == null) return false;
|
|
||||||
Fragment currentFragment = getCurrentFragment();
|
|
||||||
if (currentFragment instanceof AbsLibraryPagerRecyclerViewCustomGridSizeFragment) {
|
|
||||||
AbsLibraryPagerRecyclerViewCustomGridSizeFragment fragment = (AbsLibraryPagerRecyclerViewCustomGridSizeFragment) currentFragment;
|
|
||||||
if (handleGridSizeMenuItem(fragment, item)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (handleSortOrderMenuItem(fragment, item)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
int id = item.getItemId();
|
|
||||||
switch (id) {
|
@Nullable
|
||||||
case R.id.action_new_playlist:
|
@Override
|
||||||
CreatePlaylistDialog.create().show(getChildFragmentManager(), "CREATE_PLAYLIST");
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||||
return true;
|
@Nullable Bundle savedInstanceState) {
|
||||||
case R.id.action_shuffle_all:
|
View view = inflater.inflate(R.layout.fragment_library, container, false);
|
||||||
MusicPlayerRemote.openAndShuffleQueue(SongLoader.getAllSongs(getContext())
|
unBinder = ButterKnife.bind(this, view);
|
||||||
.blockingFirst(), true);
|
return view;
|
||||||
return true;
|
}
|
||||||
case R.id.action_search:
|
|
||||||
NavigationUtil.goToSearch(getMainActivity());
|
@Override
|
||||||
break;
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
case R.id.action_equalizer:
|
super.onViewCreated(view, savedInstanceState);
|
||||||
NavigationUtil.openEqualizer(getActivity());
|
setStatusbarColorAuto(view);
|
||||||
return true;
|
getMainActivity().setBottomBarVisibility(View.VISIBLE);
|
||||||
case R.id.action_sleep_timer:
|
setupToolbar();
|
||||||
if (getFragmentManager() != null) {
|
inflateFragment();
|
||||||
new SleepTimerDialog().show(getFragmentManager(), TAG);
|
}
|
||||||
|
|
||||||
|
private void inflateFragment() {
|
||||||
|
if (getArguments() == null) {
|
||||||
|
selectedFragment(SongsFragment.newInstance());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch (getArguments().getInt(CURRENT_TAB_ID)) {
|
||||||
|
default:
|
||||||
|
case R.id.action_song:
|
||||||
|
selectedFragment(SongsFragment.newInstance());
|
||||||
|
break;
|
||||||
|
case R.id.action_album:
|
||||||
|
selectedFragment(AlbumsFragment.newInstance());
|
||||||
|
break;
|
||||||
|
case R.id.action_artist:
|
||||||
|
selectedFragment(ArtistsFragment.newInstance());
|
||||||
|
break;
|
||||||
|
case R.id.action_playlist:
|
||||||
|
selectedFragment(PlaylistsFragment.newInstance());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
case R.id.action_settings:
|
|
||||||
startActivity(new Intent(getContext(), SettingsActivity.class));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void setUpGridSizeMenu(
|
|
||||||
@NonNull AbsLibraryPagerRecyclerViewCustomGridSizeFragment fragment,
|
|
||||||
@NonNull SubMenu gridSizeMenu) {
|
|
||||||
switch (fragment.getGridSize()) {
|
|
||||||
case 1:
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_1).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_2).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_3).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_4).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_5).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_6).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_7).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_8).setChecked(true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
int maxGridSize = fragment.getMaxGridSize();
|
|
||||||
if (maxGridSize < 8) {
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_8).setVisible(false);
|
|
||||||
}
|
|
||||||
if (maxGridSize < 7) {
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_7).setVisible(false);
|
|
||||||
}
|
|
||||||
if (maxGridSize < 6) {
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_6).setVisible(false);
|
|
||||||
}
|
|
||||||
if (maxGridSize < 5) {
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_5).setVisible(false);
|
|
||||||
}
|
|
||||||
if (maxGridSize < 4) {
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_4).setVisible(false);
|
|
||||||
}
|
|
||||||
if (maxGridSize < 3) {
|
|
||||||
gridSizeMenu.findItem(R.id.action_grid_size_3).setVisible(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private boolean handleGridSizeMenuItem(
|
|
||||||
@NonNull AbsLibraryPagerRecyclerViewCustomGridSizeFragment fragment, @NonNull MenuItem item) {
|
|
||||||
int gridSize = 0;
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
case R.id.action_grid_size_1:
|
|
||||||
gridSize = 1;
|
|
||||||
break;
|
|
||||||
case R.id.action_grid_size_2:
|
|
||||||
gridSize = 2;
|
|
||||||
break;
|
|
||||||
case R.id.action_grid_size_3:
|
|
||||||
gridSize = 3;
|
|
||||||
break;
|
|
||||||
case R.id.action_grid_size_4:
|
|
||||||
gridSize = 4;
|
|
||||||
break;
|
|
||||||
case R.id.action_grid_size_5:
|
|
||||||
gridSize = 5;
|
|
||||||
break;
|
|
||||||
case R.id.action_grid_size_6:
|
|
||||||
gridSize = 6;
|
|
||||||
break;
|
|
||||||
case R.id.action_grid_size_7:
|
|
||||||
gridSize = 7;
|
|
||||||
break;
|
|
||||||
case R.id.action_grid_size_8:
|
|
||||||
gridSize = 8;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gridSize > 0) {
|
@SuppressWarnings("ConstantConditions")
|
||||||
item.setChecked(true);
|
private void setupToolbar() {
|
||||||
fragment.setAndSaveGridSize(gridSize);
|
title.setTextColor(ThemeStore.textColorPrimary(getContext()));
|
||||||
return true;
|
TintHelper.setTintAuto(search, ThemeStore.textColorSecondary(getContext()), false);
|
||||||
|
|
||||||
|
int primaryColor = ThemeStore.primaryColor(getContext());
|
||||||
|
appbar.setBackgroundColor(primaryColor);
|
||||||
|
toolbar.setBackgroundColor(primaryColor);
|
||||||
|
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
||||||
|
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
|
||||||
|
getMainActivity().setTitle(null);
|
||||||
|
getMainActivity().setSupportActionBar(toolbar);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Fragment getCurrentFragment() {
|
||||||
|
if (fragmentManager == null) {
|
||||||
|
return SongsFragment.newInstance();
|
||||||
|
}
|
||||||
|
return fragmentManager.findFragmentByTag(LibraryFragment.TAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
super.onDestroyView();
|
||||||
|
unBinder.unbind();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean handleBackPress() {
|
||||||
|
if (cab != null && cab.isActive()) {
|
||||||
|
cab.finish();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void selectedFragment(Fragment fragment) {
|
||||||
|
fragmentManager = getChildFragmentManager();
|
||||||
|
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
||||||
|
|
||||||
|
fragmentTransaction
|
||||||
|
.replace(R.id.fragment_container, fragment, TAG)
|
||||||
|
.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public MaterialCab openCab(int menuRes, MaterialCab.Callback callback) {
|
||||||
|
if (cab != null && cab.isActive()) {
|
||||||
|
cab.finish();
|
||||||
|
}
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
cab = new MaterialCab(getMainActivity(), R.id.cab_stub)
|
||||||
|
.setMenu(menuRes)
|
||||||
|
.setCloseDrawableRes(R.drawable.ic_close_white_24dp)
|
||||||
|
.setBackgroundColor(
|
||||||
|
RetroColorUtil.shiftBackgroundColorForLightText(ThemeStore.primaryColor(getActivity())))
|
||||||
|
.start(callback);
|
||||||
|
return cab;
|
||||||
|
}
|
||||||
|
|
||||||
|
@OnClick(R.id.search)
|
||||||
|
void search() {
|
||||||
|
NavigationUtil.goToSearch(getActivity());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||||
|
super.onCreateOptionsMenu(menu, inflater);
|
||||||
|
inflater.inflate(R.menu.menu_main, menu);
|
||||||
|
|
||||||
|
Fragment currentFragment = getCurrentFragment();
|
||||||
|
if (currentFragment instanceof AbsLibraryPagerRecyclerViewCustomGridSizeFragment
|
||||||
|
&& currentFragment.isAdded()) {
|
||||||
|
AbsLibraryPagerRecyclerViewCustomGridSizeFragment fragment = (AbsLibraryPagerRecyclerViewCustomGridSizeFragment) currentFragment;
|
||||||
|
|
||||||
|
MenuItem gridSizeItem = menu.findItem(R.id.action_grid_size);
|
||||||
|
if (RetroUtil.isLandscape(getResources())) {
|
||||||
|
gridSizeItem.setTitle(R.string.action_grid_size_land);
|
||||||
|
}
|
||||||
|
setUpGridSizeMenu(fragment, gridSizeItem.getSubMenu());
|
||||||
|
|
||||||
|
setUpSortOrderMenu(fragment, menu.findItem(R.id.action_sort_order).getSubMenu());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
menu.add(0, R.id.action_new_playlist, 0, R.string.new_playlist_title);
|
||||||
|
menu.removeItem(R.id.action_grid_size);
|
||||||
|
}
|
||||||
|
Activity activity = getActivity();
|
||||||
|
if (activity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ToolbarContentTintHelper.handleOnCreateOptionsMenu(getActivity(), toolbar, menu,
|
||||||
|
ATHToolbarActivity.getToolbarBackgroundColor(toolbar));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setUpSortOrderMenu(
|
||||||
|
@NonNull AbsLibraryPagerRecyclerViewCustomGridSizeFragment fragment,
|
||||||
|
@NonNull SubMenu sortOrderMenu) {
|
||||||
|
String currentSortOrder = fragment.getSortOrder();
|
||||||
|
sortOrderMenu.clear();
|
||||||
|
|
||||||
|
if (fragment instanceof AlbumsFragment) {
|
||||||
|
sortOrderMenu.add(0, R.id.action_album_sort_order_asc, 0, R.string.sort_order_a_z)
|
||||||
|
.setChecked(currentSortOrder.equals(SortOrder.AlbumSortOrder.ALBUM_A_Z));
|
||||||
|
sortOrderMenu.add(0, R.id.action_album_sort_order_desc, 1, R.string.sort_order_z_a)
|
||||||
|
.setChecked(currentSortOrder.equals(SortOrder.AlbumSortOrder.ALBUM_Z_A));
|
||||||
|
sortOrderMenu.add(0, R.id.action_album_sort_order_artist, 2, R.string.sort_order_artist)
|
||||||
|
.setChecked(currentSortOrder.equals(SortOrder.AlbumSortOrder.ALBUM_ARTIST));
|
||||||
|
sortOrderMenu.add(0, R.id.action_album_sort_order_year, 3, R.string.sort_order_year)
|
||||||
|
.setChecked(currentSortOrder.equals(SortOrder.AlbumSortOrder.ALBUM_YEAR));
|
||||||
|
} else if (fragment instanceof ArtistsFragment) {
|
||||||
|
sortOrderMenu.add(0, R.id.action_artist_sort_order_asc, 0, R.string.sort_order_a_z)
|
||||||
|
.setChecked(currentSortOrder.equals(SortOrder.ArtistSortOrder.ARTIST_A_Z));
|
||||||
|
sortOrderMenu.add(0, R.id.action_artist_sort_order_desc, 1, R.string.sort_order_z_a)
|
||||||
|
.setChecked(currentSortOrder.equals(SortOrder.ArtistSortOrder.ARTIST_Z_A));
|
||||||
|
} else if (fragment instanceof SongsFragment) {
|
||||||
|
sortOrderMenu.add(0, R.id.action_song_sort_order_asc, 0, R.string.sort_order_a_z)
|
||||||
|
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_A_Z));
|
||||||
|
sortOrderMenu.add(0, R.id.action_song_sort_order_desc, 1, R.string.sort_order_z_a)
|
||||||
|
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_Z_A));
|
||||||
|
sortOrderMenu.add(0, R.id.action_song_sort_order_artist, 2, R.string.sort_order_artist)
|
||||||
|
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_ARTIST));
|
||||||
|
sortOrderMenu.add(0, R.id.action_song_sort_order_album, 3, R.string.sort_order_album)
|
||||||
|
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_ALBUM));
|
||||||
|
sortOrderMenu.add(0, R.id.action_song_sort_order_year, 4, R.string.sort_order_year)
|
||||||
|
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_YEAR));
|
||||||
|
sortOrderMenu.add(0, R.id.action_song_sort_order_date, 4, R.string.sort_order_date)
|
||||||
|
.setChecked(currentSortOrder.equals(SortOrder.SongSortOrder.SONG_DATE));
|
||||||
|
}
|
||||||
|
|
||||||
|
sortOrderMenu.setGroupCheckable(0, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean handleSortOrderMenuItem(
|
||||||
|
@NonNull AbsLibraryPagerRecyclerViewCustomGridSizeFragment fragment, @NonNull MenuItem item) {
|
||||||
|
String sortOrder = null;
|
||||||
|
if (fragment instanceof AlbumsFragment) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case R.id.action_album_sort_order_asc:
|
||||||
|
sortOrder = SortOrder.AlbumSortOrder.ALBUM_A_Z;
|
||||||
|
break;
|
||||||
|
case R.id.action_album_sort_order_desc:
|
||||||
|
sortOrder = SortOrder.AlbumSortOrder.ALBUM_Z_A;
|
||||||
|
break;
|
||||||
|
case R.id.action_album_sort_order_artist:
|
||||||
|
sortOrder = SortOrder.AlbumSortOrder.ALBUM_ARTIST;
|
||||||
|
break;
|
||||||
|
case R.id.action_album_sort_order_year:
|
||||||
|
sortOrder = SortOrder.AlbumSortOrder.ALBUM_YEAR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (fragment instanceof ArtistsFragment) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case R.id.action_artist_sort_order_asc:
|
||||||
|
sortOrder = SortOrder.ArtistSortOrder.ARTIST_A_Z;
|
||||||
|
break;
|
||||||
|
case R.id.action_artist_sort_order_desc:
|
||||||
|
sortOrder = SortOrder.ArtistSortOrder.ARTIST_Z_A;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (fragment instanceof SongsFragment) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case R.id.action_song_sort_order_asc:
|
||||||
|
sortOrder = SortOrder.SongSortOrder.SONG_A_Z;
|
||||||
|
break;
|
||||||
|
case R.id.action_song_sort_order_desc:
|
||||||
|
sortOrder = SortOrder.SongSortOrder.SONG_Z_A;
|
||||||
|
break;
|
||||||
|
case R.id.action_song_sort_order_artist:
|
||||||
|
sortOrder = SortOrder.SongSortOrder.SONG_ARTIST;
|
||||||
|
break;
|
||||||
|
case R.id.action_song_sort_order_album:
|
||||||
|
sortOrder = SortOrder.SongSortOrder.SONG_ALBUM;
|
||||||
|
break;
|
||||||
|
case R.id.action_song_sort_order_year:
|
||||||
|
sortOrder = SortOrder.SongSortOrder.SONG_YEAR;
|
||||||
|
break;
|
||||||
|
case R.id.action_song_sort_order_date:
|
||||||
|
sortOrder = SortOrder.SongSortOrder.SONG_DATE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sortOrder != null) {
|
||||||
|
item.setChecked(true);
|
||||||
|
fragment.setAndSaveSortOrder(sortOrder);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPrepareOptionsMenu(Menu menu) {
|
||||||
|
super.onPrepareOptionsMenu(menu);
|
||||||
|
Activity activity = getActivity();
|
||||||
|
if (activity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ToolbarContentTintHelper.handleOnPrepareOptionsMenu(activity, toolbar);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("ConstantConditions")
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
|
//if (pager == null) return false;
|
||||||
|
Fragment currentFragment = getCurrentFragment();
|
||||||
|
if (currentFragment instanceof AbsLibraryPagerRecyclerViewCustomGridSizeFragment) {
|
||||||
|
AbsLibraryPagerRecyclerViewCustomGridSizeFragment fragment = (AbsLibraryPagerRecyclerViewCustomGridSizeFragment) currentFragment;
|
||||||
|
if (handleGridSizeMenuItem(fragment, item)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (handleSortOrderMenuItem(fragment, item)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int id = item.getItemId();
|
||||||
|
switch (id) {
|
||||||
|
case R.id.action_new_playlist:
|
||||||
|
CreatePlaylistDialog.create().show(getChildFragmentManager(), "CREATE_PLAYLIST");
|
||||||
|
return true;
|
||||||
|
case R.id.action_shuffle_all:
|
||||||
|
MusicPlayerRemote.openAndShuffleQueue(SongLoader.getAllSongs(getContext())
|
||||||
|
.blockingFirst(), true);
|
||||||
|
return true;
|
||||||
|
case R.id.action_search:
|
||||||
|
NavigationUtil.goToSearch(getMainActivity());
|
||||||
|
break;
|
||||||
|
case R.id.action_equalizer:
|
||||||
|
NavigationUtil.openEqualizer(getActivity());
|
||||||
|
return true;
|
||||||
|
case R.id.action_sleep_timer:
|
||||||
|
if (getFragmentManager() != null) {
|
||||||
|
new SleepTimerDialog().show(getFragmentManager(), TAG);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
case R.id.action_settings:
|
||||||
|
startActivity(new Intent(getContext(), SettingsActivity.class));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void setUpGridSizeMenu(
|
||||||
|
@NonNull AbsLibraryPagerRecyclerViewCustomGridSizeFragment fragment,
|
||||||
|
@NonNull SubMenu gridSizeMenu) {
|
||||||
|
switch (fragment.getGridSize()) {
|
||||||
|
case 1:
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_1).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_2).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_3).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_4).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_5).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_6).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_7).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_8).setChecked(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
int maxGridSize = fragment.getMaxGridSize();
|
||||||
|
if (maxGridSize < 8) {
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_8).setVisible(false);
|
||||||
|
}
|
||||||
|
if (maxGridSize < 7) {
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_7).setVisible(false);
|
||||||
|
}
|
||||||
|
if (maxGridSize < 6) {
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_6).setVisible(false);
|
||||||
|
}
|
||||||
|
if (maxGridSize < 5) {
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_5).setVisible(false);
|
||||||
|
}
|
||||||
|
if (maxGridSize < 4) {
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_4).setVisible(false);
|
||||||
|
}
|
||||||
|
if (maxGridSize < 3) {
|
||||||
|
gridSizeMenu.findItem(R.id.action_grid_size_3).setVisible(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private boolean handleGridSizeMenuItem(
|
||||||
|
@NonNull AbsLibraryPagerRecyclerViewCustomGridSizeFragment fragment, @NonNull MenuItem item) {
|
||||||
|
int gridSize = 0;
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case R.id.action_grid_size_1:
|
||||||
|
gridSize = 1;
|
||||||
|
break;
|
||||||
|
case R.id.action_grid_size_2:
|
||||||
|
gridSize = 2;
|
||||||
|
break;
|
||||||
|
case R.id.action_grid_size_3:
|
||||||
|
gridSize = 3;
|
||||||
|
break;
|
||||||
|
case R.id.action_grid_size_4:
|
||||||
|
gridSize = 4;
|
||||||
|
break;
|
||||||
|
case R.id.action_grid_size_5:
|
||||||
|
gridSize = 5;
|
||||||
|
break;
|
||||||
|
case R.id.action_grid_size_6:
|
||||||
|
gridSize = 6;
|
||||||
|
break;
|
||||||
|
case R.id.action_grid_size_7:
|
||||||
|
gridSize = 7;
|
||||||
|
break;
|
||||||
|
case R.id.action_grid_size_8:
|
||||||
|
gridSize = 8;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gridSize > 0) {
|
||||||
|
item.setChecked(true);
|
||||||
|
fragment.setAndSaveGridSize(gridSize);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,14 +1,11 @@
|
||||||
package code.name.monkey.retromusic.ui.fragments.mainactivity.home;
|
package code.name.monkey.retromusic.ui.fragments.mainactivity.home;
|
||||||
|
|
||||||
import static code.name.monkey.retromusic.Constants.USER_PROFILE;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.design.widget.AppBarLayout;
|
import android.support.design.widget.AppBarLayout;
|
||||||
import android.support.design.widget.CollapsingToolbarLayout;
|
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v7.widget.GridLayoutManager;
|
import android.support.v7.widget.GridLayoutManager;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
|
@ -22,13 +19,16 @@ import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
import butterknife.Unbinder;
|
import butterknife.Unbinder;
|
||||||
import code.name.monkey.appthemehelper.ThemeStore;
|
import code.name.monkey.appthemehelper.ThemeStore;
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil;
|
|
||||||
import code.name.monkey.appthemehelper.util.TintHelper;
|
import code.name.monkey.appthemehelper.util.TintHelper;
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.dialogs.HomeOptionDialog;
|
import code.name.monkey.retromusic.dialogs.HomeOptionDialog;
|
||||||
|
@ -56,276 +56,276 @@ import code.name.monkey.retromusic.views.MetalRecyclerViewPager;
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.disposables.CompositeDisposable;
|
import io.reactivex.disposables.CompositeDisposable;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
import static code.name.monkey.retromusic.Constants.USER_PROFILE;
|
||||||
|
|
||||||
public class BannerHomeFragment extends AbsMainActivityFragment implements
|
public class BannerHomeFragment extends AbsMainActivityFragment implements
|
||||||
MainActivityFragmentCallbacks,
|
MainActivityFragmentCallbacks,
|
||||||
HomeContract.HomeView {
|
HomeContract.HomeView {
|
||||||
|
|
||||||
private static final String TAG = "HomeFragment";
|
private static final String TAG = "HomeFragment";
|
||||||
Unbinder unbinder;
|
Unbinder unbinder;
|
||||||
@BindView(R.id.home_toolbar)
|
@BindView(R.id.home_toolbar)
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
@BindView(R.id.appbar)
|
@BindView(R.id.appbar)
|
||||||
AppBarLayout appbar;
|
AppBarLayout appbar;
|
||||||
@BindView(R.id.user_image)
|
@BindView(R.id.user_image)
|
||||||
CircularImageView userImage;
|
CircularImageView userImage;
|
||||||
@BindView(R.id.recycler_view)
|
@BindView(R.id.recycler_view)
|
||||||
RecyclerView recentArtistRV;
|
RecyclerView recentArtistRV;
|
||||||
@BindView(R.id.recent_album)
|
@BindView(R.id.recent_album)
|
||||||
RecyclerView recentAlbumRV;
|
RecyclerView recentAlbumRV;
|
||||||
@BindView(R.id.top_artist)
|
@BindView(R.id.top_artist)
|
||||||
RecyclerView topArtistRV;
|
RecyclerView topArtistRV;
|
||||||
@BindView(R.id.top_album)
|
@BindView(R.id.top_album)
|
||||||
MetalRecyclerViewPager topAlbumRV;
|
MetalRecyclerViewPager topAlbumRV;
|
||||||
@BindView(R.id.recent_artist_container)
|
@BindView(R.id.recent_artist_container)
|
||||||
View recentArtistContainer;
|
View recentArtistContainer;
|
||||||
@BindView(R.id.recent_albums_container)
|
@BindView(R.id.recent_albums_container)
|
||||||
View recentAlbumsContainer;
|
View recentAlbumsContainer;
|
||||||
@BindView(R.id.top_artist_container)
|
@BindView(R.id.top_artist_container)
|
||||||
View topArtistContainer;
|
View topArtistContainer;
|
||||||
@BindView(R.id.top_albums_container)
|
@BindView(R.id.top_albums_container)
|
||||||
View topAlbumContainer;
|
View topAlbumContainer;
|
||||||
@BindView(R.id.genres)
|
@BindView(R.id.genres)
|
||||||
RecyclerView genresRecyclerView;
|
RecyclerView genresRecyclerView;
|
||||||
@BindView(R.id.genre_container)
|
@BindView(R.id.genre_container)
|
||||||
LinearLayout genreContainer;
|
LinearLayout genreContainer;
|
||||||
@BindView(R.id.container)
|
@BindView(R.id.container)
|
||||||
View container;
|
View container;
|
||||||
@BindView(R.id.title)
|
@BindView(R.id.title)
|
||||||
TextView title;
|
TextView title;
|
||||||
@BindView(R.id.search)
|
@BindView(R.id.search)
|
||||||
ImageView search;
|
ImageView search;
|
||||||
|
|
||||||
|
|
||||||
private HomePresenter homePresenter;
|
private HomePresenter homePresenter;
|
||||||
private CompositeDisposable disposable;
|
private CompositeDisposable disposable;
|
||||||
|
|
||||||
public static BannerHomeFragment newInstance() {
|
public static BannerHomeFragment newInstance() {
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
BannerHomeFragment fragment = new BannerHomeFragment();
|
BannerHomeFragment fragment = new BannerHomeFragment();
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void loadImageFromStorage(ImageView imageView) {
|
|
||||||
//noinspection ConstantConditions
|
|
||||||
disposable.add(new Compressor(getContext())
|
|
||||||
.setMaxHeight(300)
|
|
||||||
.setMaxWidth(300)
|
|
||||||
.setQuality(75)
|
|
||||||
.setCompressFormat(Bitmap.CompressFormat.WEBP)
|
|
||||||
.compressToBitmapAsFlowable(
|
|
||||||
new File(PreferenceUtil.getInstance(getContext()).getProfileImage(), USER_PROFILE))
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(imageView::setImageBitmap,
|
|
||||||
throwable -> imageView.setImageDrawable(ContextCompat
|
|
||||||
.getDrawable(getContext(), R.drawable.ic_person_flat))));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
disposable = new CompositeDisposable();
|
|
||||||
//noinspection ConstantConditions
|
|
||||||
homePresenter = new HomePresenter(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
|
||||||
@Nullable Bundle savedInstanceState) {
|
|
||||||
View view = inflater.inflate(R.layout.fragment_banner_home, container, false);
|
|
||||||
unbinder = ButterKnife.bind(this, view);
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
|
|
||||||
super.onViewCreated(view, savedInstanceState);
|
|
||||||
setStatusbarColorAuto(view);
|
|
||||||
getMainActivity().getSlidingUpPanelLayout().setShadowHeight(8);
|
|
||||||
getMainActivity().setBottomBarVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
setupToolbar();
|
|
||||||
loadImageFromStorage(userImage);
|
|
||||||
|
|
||||||
homePresenter.subscribe();
|
|
||||||
checkPadding();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("ConstantConditions")
|
|
||||||
private void setupToolbar() {
|
|
||||||
//noinspection ConstantConditions
|
|
||||||
int primaryColor = ThemeStore.primaryColor(getContext());
|
|
||||||
appbar.setBackgroundColor(ColorUtil.darkenColor(primaryColor));
|
|
||||||
toolbar.setBackgroundColor(ColorUtil.darkenColor(primaryColor));
|
|
||||||
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
|
||||||
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
|
|
||||||
|
|
||||||
getActivity().setTitle(R.string.app_name);
|
|
||||||
getMainActivity().setSupportActionBar(toolbar);
|
|
||||||
|
|
||||||
title.setTextColor(ThemeStore.textColorPrimary(getContext()));
|
|
||||||
TintHelper.setTintAuto(search, ThemeStore.textColorPrimary(getContext()), false);
|
|
||||||
TintHelper.setTintAuto(container, primaryColor, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handleBackPress() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroyView() {
|
|
||||||
super.onDestroyView();
|
|
||||||
unbinder.unbind();
|
|
||||||
disposable.clear();
|
|
||||||
homePresenter.unsubscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void loading() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void showEmptyView() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void completed() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void showData(ArrayList<Object> homes) {
|
|
||||||
//homeAdapter.swapDataSet(homes);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onMediaStoreChanged() {
|
|
||||||
super.onMediaStoreChanged();
|
|
||||||
homePresenter.subscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onServiceConnected() {
|
|
||||||
super.onServiceConnected();
|
|
||||||
checkPadding();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onQueueChanged() {
|
|
||||||
super.onQueueChanged();
|
|
||||||
checkPadding();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkPadding() {
|
|
||||||
int height = getResources().getDimensionPixelSize(R.dimen.mini_player_height);
|
|
||||||
container.setPadding(0, 0, 0, MusicPlayerRemote.getPlayingQueue().isEmpty() ? height * 2 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void recentArtist(ArrayList<Artist> artists) {
|
|
||||||
recentArtistContainer.setVisibility(View.VISIBLE);
|
|
||||||
recentArtistRV.setLayoutManager(new GridLayoutManager(getMainActivity(),
|
|
||||||
1, GridLayoutManager.HORIZONTAL, false));
|
|
||||||
ArtistAdapter artistAdapter = new ArtistAdapter(getMainActivity(), artists,
|
|
||||||
R.layout.item_artist, false, null);
|
|
||||||
recentArtistRV.setAdapter(artistAdapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void recentAlbum(ArrayList<Album> albums) {
|
|
||||||
recentAlbumsContainer.setVisibility(View.VISIBLE);
|
|
||||||
AlbumFullWithAdapter artistAdapter = new AlbumFullWithAdapter(getMainActivity(),
|
|
||||||
getDisplayMetrics());
|
|
||||||
artistAdapter.swapData(albums);
|
|
||||||
recentAlbumRV.setAdapter(artistAdapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void topArtists(ArrayList<Artist> artists) {
|
|
||||||
topArtistContainer.setVisibility(View.VISIBLE);
|
|
||||||
topArtistRV.setLayoutManager(new GridLayoutManager(getMainActivity(),
|
|
||||||
1, GridLayoutManager.HORIZONTAL, false));
|
|
||||||
ArtistAdapter artistAdapter = new ArtistAdapter(getMainActivity(), artists,
|
|
||||||
R.layout.item_artist, false, null);
|
|
||||||
topArtistRV.setAdapter(artistAdapter);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void topAlbums(ArrayList<Album> albums) {
|
|
||||||
topAlbumContainer.setVisibility(View.VISIBLE);
|
|
||||||
AlbumFullWithAdapter artistAdapter = new AlbumFullWithAdapter(getMainActivity(),
|
|
||||||
getDisplayMetrics());
|
|
||||||
artistAdapter.swapData(albums);
|
|
||||||
topAlbumRV.setAdapter(artistAdapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
private DisplayMetrics getDisplayMetrics() {
|
|
||||||
Display display = getMainActivity().getWindowManager().getDefaultDisplay();
|
|
||||||
DisplayMetrics metrics = new DisplayMetrics();
|
|
||||||
display.getMetrics(metrics);
|
|
||||||
|
|
||||||
return metrics;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void suggestions(ArrayList<Playlist> playlists) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void geners(ArrayList<Genre> genres) {
|
|
||||||
genreContainer.setVisibility(View.VISIBLE);
|
|
||||||
genresRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
|
||||||
//noinspection ConstantConditions
|
|
||||||
GenreAdapter genreAdapter = new GenreAdapter(getActivity(), genres, R.layout.item_list);
|
|
||||||
genresRecyclerView.setAdapter(genreAdapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@OnClick({R.id.last_added, R.id.top_played, R.id.action_shuffle, R.id.history,
|
|
||||||
R.id.user_image, R.id.search})
|
|
||||||
void startUserInfo(View view) {
|
|
||||||
Activity activity = getActivity();
|
|
||||||
if (activity != null) {
|
|
||||||
switch (view.getId()) {
|
|
||||||
case R.id.action_shuffle:
|
|
||||||
MusicPlayerRemote
|
|
||||||
.openAndShuffleQueue(SongLoader.getAllSongs(activity).blockingFirst(), true);
|
|
||||||
break;
|
|
||||||
case R.id.last_added:
|
|
||||||
NavigationUtil.goToPlaylistNew(activity, new LastAddedPlaylist(activity));
|
|
||||||
break;
|
|
||||||
case R.id.top_played:
|
|
||||||
NavigationUtil.goToPlaylistNew(activity, new MyTopTracksPlaylist(activity));
|
|
||||||
break;
|
|
||||||
case R.id.history:
|
|
||||||
NavigationUtil.goToPlaylistNew(activity, new HistoryPlaylist(activity));
|
|
||||||
break;
|
|
||||||
case R.id.search:
|
|
||||||
NavigationUtil.goToSearch(activity);
|
|
||||||
break;
|
|
||||||
case R.id.user_image:
|
|
||||||
new HomeOptionDialog().show(getFragmentManager(), TAG);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlayingMetaChanged() {
|
private void loadImageFromStorage(ImageView imageView) {
|
||||||
super.onPlayingMetaChanged();
|
//noinspection ConstantConditions
|
||||||
homePresenter.loadRecentArtists();
|
disposable.add(new Compressor(getContext())
|
||||||
homePresenter.loadRecentAlbums();
|
.setMaxHeight(300)
|
||||||
}
|
.setMaxWidth(300)
|
||||||
|
.setQuality(75)
|
||||||
|
.setCompressFormat(Bitmap.CompressFormat.WEBP)
|
||||||
|
.compressToBitmapAsFlowable(
|
||||||
|
new File(PreferenceUtil.getInstance(getContext()).getProfileImage(), USER_PROFILE))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(imageView::setImageBitmap,
|
||||||
|
throwable -> imageView.setImageDrawable(ContextCompat
|
||||||
|
.getDrawable(getContext(), R.drawable.ic_person_flat))));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
disposable = new CompositeDisposable();
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
homePresenter = new HomePresenter(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||||
|
@Nullable Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_banner_home, container, false);
|
||||||
|
unbinder = ButterKnife.bind(this, view);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
setStatusbarColorAuto(view);
|
||||||
|
getMainActivity().getSlidingUpPanelLayout().setShadowHeight(8);
|
||||||
|
getMainActivity().setBottomBarVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
setupToolbar();
|
||||||
|
loadImageFromStorage(userImage);
|
||||||
|
|
||||||
|
homePresenter.subscribe();
|
||||||
|
checkPadding();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("ConstantConditions")
|
||||||
|
private void setupToolbar() {
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
int primaryColor = ThemeStore.primaryColor(getContext());
|
||||||
|
appbar.setBackgroundColor(primaryColor);
|
||||||
|
toolbar.setBackgroundColor(primaryColor);
|
||||||
|
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
||||||
|
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
|
||||||
|
|
||||||
|
getActivity().setTitle(R.string.app_name);
|
||||||
|
getMainActivity().setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
title.setTextColor(ThemeStore.textColorPrimary(getContext()));
|
||||||
|
TintHelper.setTintAuto(search, ThemeStore.textColorPrimary(getContext()), false);
|
||||||
|
TintHelper.setTintAuto(container, primaryColor, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean handleBackPress() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
super.onDestroyView();
|
||||||
|
unbinder.unbind();
|
||||||
|
disposable.clear();
|
||||||
|
homePresenter.unsubscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loading() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showEmptyView() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void completed() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showData(ArrayList<Object> homes) {
|
||||||
|
//homeAdapter.swapDataSet(homes);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMediaStoreChanged() {
|
||||||
|
super.onMediaStoreChanged();
|
||||||
|
homePresenter.subscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onServiceConnected() {
|
||||||
|
super.onServiceConnected();
|
||||||
|
checkPadding();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onQueueChanged() {
|
||||||
|
super.onQueueChanged();
|
||||||
|
checkPadding();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkPadding() {
|
||||||
|
int height = getResources().getDimensionPixelSize(R.dimen.mini_player_height);
|
||||||
|
container.setPadding(0, 0, 0, MusicPlayerRemote.getPlayingQueue().isEmpty() ? height * 2 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void recentArtist(ArrayList<Artist> artists) {
|
||||||
|
recentArtistContainer.setVisibility(View.VISIBLE);
|
||||||
|
recentArtistRV.setLayoutManager(new GridLayoutManager(getMainActivity(),
|
||||||
|
1, GridLayoutManager.HORIZONTAL, false));
|
||||||
|
ArtistAdapter artistAdapter = new ArtistAdapter(getMainActivity(), artists,
|
||||||
|
R.layout.item_artist, false, null);
|
||||||
|
recentArtistRV.setAdapter(artistAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void recentAlbum(ArrayList<Album> albums) {
|
||||||
|
recentAlbumsContainer.setVisibility(View.VISIBLE);
|
||||||
|
AlbumFullWithAdapter artistAdapter = new AlbumFullWithAdapter(getMainActivity(),
|
||||||
|
getDisplayMetrics());
|
||||||
|
artistAdapter.swapData(albums);
|
||||||
|
recentAlbumRV.setAdapter(artistAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void topArtists(ArrayList<Artist> artists) {
|
||||||
|
topArtistContainer.setVisibility(View.VISIBLE);
|
||||||
|
topArtistRV.setLayoutManager(new GridLayoutManager(getMainActivity(),
|
||||||
|
1, GridLayoutManager.HORIZONTAL, false));
|
||||||
|
ArtistAdapter artistAdapter = new ArtistAdapter(getMainActivity(), artists,
|
||||||
|
R.layout.item_artist, false, null);
|
||||||
|
topArtistRV.setAdapter(artistAdapter);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void topAlbums(ArrayList<Album> albums) {
|
||||||
|
topAlbumContainer.setVisibility(View.VISIBLE);
|
||||||
|
AlbumFullWithAdapter artistAdapter = new AlbumFullWithAdapter(getMainActivity(),
|
||||||
|
getDisplayMetrics());
|
||||||
|
artistAdapter.swapData(albums);
|
||||||
|
topAlbumRV.setAdapter(artistAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private DisplayMetrics getDisplayMetrics() {
|
||||||
|
Display display = getMainActivity().getWindowManager().getDefaultDisplay();
|
||||||
|
DisplayMetrics metrics = new DisplayMetrics();
|
||||||
|
display.getMetrics(metrics);
|
||||||
|
|
||||||
|
return metrics;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void suggestions(ArrayList<Playlist> playlists) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void geners(ArrayList<Genre> genres) {
|
||||||
|
genreContainer.setVisibility(View.VISIBLE);
|
||||||
|
genresRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
GenreAdapter genreAdapter = new GenreAdapter(getActivity(), genres, R.layout.item_list);
|
||||||
|
genresRecyclerView.setAdapter(genreAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OnClick({R.id.last_added, R.id.top_played, R.id.action_shuffle, R.id.history,
|
||||||
|
R.id.user_image, R.id.search})
|
||||||
|
void startUserInfo(View view) {
|
||||||
|
Activity activity = getActivity();
|
||||||
|
if (activity != null) {
|
||||||
|
switch (view.getId()) {
|
||||||
|
case R.id.action_shuffle:
|
||||||
|
MusicPlayerRemote
|
||||||
|
.openAndShuffleQueue(SongLoader.getAllSongs(activity).blockingFirst(), true);
|
||||||
|
break;
|
||||||
|
case R.id.last_added:
|
||||||
|
NavigationUtil.goToPlaylistNew(activity, new LastAddedPlaylist(activity));
|
||||||
|
break;
|
||||||
|
case R.id.top_played:
|
||||||
|
NavigationUtil.goToPlaylistNew(activity, new MyTopTracksPlaylist(activity));
|
||||||
|
break;
|
||||||
|
case R.id.history:
|
||||||
|
NavigationUtil.goToPlaylistNew(activity, new HistoryPlaylist(activity));
|
||||||
|
break;
|
||||||
|
case R.id.search:
|
||||||
|
NavigationUtil.goToSearch(activity);
|
||||||
|
break;
|
||||||
|
case R.id.user_image:
|
||||||
|
new HomeOptionDialog().show(getFragmentManager(), TAG);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPlayingMetaChanged() {
|
||||||
|
super.onPlayingMetaChanged();
|
||||||
|
homePresenter.loadRecentArtists();
|
||||||
|
homePresenter.loadRecentAlbums();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -71,7 +71,7 @@ import static code.name.monkey.retromusic.Constants.USER_PROFILE;
|
||||||
public class HomeFragment extends AbsMainActivityFragment implements MainActivityFragmentCallbacks,
|
public class HomeFragment extends AbsMainActivityFragment implements MainActivityFragmentCallbacks,
|
||||||
HomeContract.HomeView {
|
HomeContract.HomeView {
|
||||||
|
|
||||||
private static final String TAG = "HomeFragment";
|
public static final String TAG = "HomeFragment";
|
||||||
Unbinder unbinder;
|
Unbinder unbinder;
|
||||||
@BindView(R.id.home_toolbar)
|
@BindView(R.id.home_toolbar)
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
|
@ -412,3 +412,412 @@ public class HomeFragment extends AbsMainActivityFragment implements MainActivit
|
||||||
homePresenter.loadRecentAlbums();
|
homePresenter.loadRecentAlbums();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.design.widget.AppBarLayout;
|
||||||
|
import android.support.design.widget.CollapsingToolbarLayout;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
|
import android.support.v7.widget.DefaultItemAnimator;
|
||||||
|
import android.support.v7.widget.GridLayoutManager;
|
||||||
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
|
import android.view.Display;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import butterknife.BindView;
|
||||||
|
import butterknife.BindViews;
|
||||||
|
import butterknife.ButterKnife;
|
||||||
|
import butterknife.OnClick;
|
||||||
|
import butterknife.Unbinder;
|
||||||
|
import code.name.monkey.appthemehelper.ThemeStore;
|
||||||
|
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||||
|
import code.name.monkey.appthemehelper.util.TintHelper;
|
||||||
|
import code.name.monkey.retromusic.R;
|
||||||
|
import code.name.monkey.retromusic.dialogs.HomeOptionDialog;
|
||||||
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||||
|
import code.name.monkey.retromusic.interfaces.MainActivityFragmentCallbacks;
|
||||||
|
import code.name.monkey.retromusic.loaders.SongLoader;
|
||||||
|
import code.name.monkey.retromusic.misc.AppBarStateChangeListener;
|
||||||
|
import code.name.monkey.retromusic.model.Album;
|
||||||
|
import code.name.monkey.retromusic.model.Artist;
|
||||||
|
import code.name.monkey.retromusic.model.Genre;
|
||||||
|
import code.name.monkey.retromusic.model.Home;
|
||||||
|
import code.name.monkey.retromusic.model.Song;
|
||||||
|
import code.name.monkey.retromusic.model.smartplaylist.HistoryPlaylist;
|
||||||
|
import code.name.monkey.retromusic.model.smartplaylist.LastAddedPlaylist;
|
||||||
|
import code.name.monkey.retromusic.model.smartplaylist.MyTopTracksPlaylist;
|
||||||
|
import code.name.monkey.retromusic.mvp.contract.HomeContract;
|
||||||
|
import code.name.monkey.retromusic.mvp.presenter.HomePresenter;
|
||||||
|
import code.name.monkey.retromusic.ui.adapter.CollageSongAdapter;
|
||||||
|
import code.name.monkey.retromusic.ui.adapter.GenreAdapter;
|
||||||
|
import code.name.monkey.retromusic.ui.adapter.album.AlbumFullWithAdapter;
|
||||||
|
import code.name.monkey.retromusic.ui.adapter.artist.ArtistAdapter;
|
||||||
|
import code.name.monkey.retromusic.ui.adapter.home.HomeAdapter;
|
||||||
|
import code.name.monkey.retromusic.ui.fragments.base.AbsMainActivityFragment;
|
||||||
|
import code.name.monkey.retromusic.util.Compressor;
|
||||||
|
import code.name.monkey.retromusic.util.NavigationUtil;
|
||||||
|
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||||
|
import code.name.monkey.retromusic.util.RetroUtil;
|
||||||
|
import code.name.monkey.retromusic.views.CircularImageView;
|
||||||
|
import code.name.monkey.retromusic.views.MetalRecyclerViewPager;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.disposables.CompositeDisposable;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
import static code.name.monkey.retromusic.Constants.USER_BANNER;
|
||||||
|
import static code.name.monkey.retromusic.Constants.USER_PROFILE;
|
||||||
|
|
||||||
|
public class HomeFragment extends AbsMainActivityFragment implements MainActivityFragmentCallbacks,
|
||||||
|
HomeContract.HomeView {
|
||||||
|
|
||||||
|
public static final String TAG = "HomeFragment";
|
||||||
|
Unbinder unbinder;
|
||||||
|
|
||||||
|
@BindView(R.id.home_toolbar)
|
||||||
|
Toolbar toolbar;
|
||||||
|
|
||||||
|
@BindView(R.id.appbar)
|
||||||
|
AppBarLayout appbar;
|
||||||
|
|
||||||
|
@BindView(R.id.image)
|
||||||
|
ImageView imageView;
|
||||||
|
|
||||||
|
@BindView(R.id.user_image)
|
||||||
|
CircularImageView userImage;
|
||||||
|
|
||||||
|
@BindView(R.id.collapsing_toolbar)
|
||||||
|
CollapsingToolbarLayout toolbarLayout;
|
||||||
|
|
||||||
|
@BindView(R.id.container)
|
||||||
|
View container;
|
||||||
|
|
||||||
|
@BindView(R.id.title)
|
||||||
|
TextView title;
|
||||||
|
|
||||||
|
@BindView(R.id.search)
|
||||||
|
ImageView search;
|
||||||
|
|
||||||
|
@BindViews({R.id.recent_artist_container, R.id.recent_albums_container,
|
||||||
|
R.id.top_artist_container, R.id.top_albums_container,
|
||||||
|
R.id.genre_container})
|
||||||
|
List<View> sectionContainers;
|
||||||
|
|
||||||
|
@BindViews({R.id.recent_artist_recycler_view, R.id.top_artist_recycler_view,
|
||||||
|
R.id.genres_recycler_view})
|
||||||
|
List<RecyclerView> sectionRecyclerViews;
|
||||||
|
|
||||||
|
@BindViews({R.id.recent_albums_recycler_view, R.id.top_album_recycler_view})
|
||||||
|
List<MetalRecyclerViewPager> metalRecyclerViewPagers;
|
||||||
|
|
||||||
|
private HomePresenter homePresenter;
|
||||||
|
private CompositeDisposable disposable;
|
||||||
|
|
||||||
|
public static HomeFragment newInstance() {
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
HomeFragment fragment = new HomeFragment();
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getTimeOfTheDay() {
|
||||||
|
Calendar c = Calendar.getInstance();
|
||||||
|
int timeOfDay = c.get(Calendar.HOUR_OF_DAY);
|
||||||
|
|
||||||
|
String[] images = new String[]{};
|
||||||
|
if (timeOfDay >= 0 && timeOfDay < 6) {
|
||||||
|
images = getResources().getStringArray(R.array.night);
|
||||||
|
} else if (timeOfDay >= 6 && timeOfDay < 12) {
|
||||||
|
images = getResources().getStringArray(R.array.morning);
|
||||||
|
} else if (timeOfDay >= 12 && timeOfDay < 16) {
|
||||||
|
images = getResources().getStringArray(R.array.after_noon);
|
||||||
|
} else if (timeOfDay >= 16 && timeOfDay < 20) {
|
||||||
|
images = getResources().getStringArray(R.array.evening);
|
||||||
|
} else if (timeOfDay >= 20 && timeOfDay < 24) {
|
||||||
|
images = getResources().getStringArray(R.array.night);
|
||||||
|
}
|
||||||
|
String day = images[new Random().nextInt(images.length)];
|
||||||
|
loadTimeImage(day);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadTimeImage(String day) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
if (PreferenceUtil.getInstance(getActivity()).getBannerImage().isEmpty()) {
|
||||||
|
if (imageView != null) {
|
||||||
|
Glide.with(getActivity()).load(day)
|
||||||
|
.asBitmap()
|
||||||
|
.placeholder(R.drawable.material_design_default)
|
||||||
|
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
|
||||||
|
.into(imageView);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
loadBannerFromStorage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadBannerFromStorage() {
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
disposable.add(new Compressor(getContext())
|
||||||
|
.setQuality(100)
|
||||||
|
.setCompressFormat(Bitmap.CompressFormat.WEBP)
|
||||||
|
.compressToBitmapAsFlowable(
|
||||||
|
new File(PreferenceUtil.getInstance(getContext()).getBannerImage(), USER_BANNER))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(imageView::setImageBitmap));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadImageFromStorage(ImageView imageView) {
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
disposable.add(new Compressor(getContext())
|
||||||
|
.setMaxHeight(300)
|
||||||
|
.setMaxWidth(300)
|
||||||
|
.setQuality(75)
|
||||||
|
.setCompressFormat(Bitmap.CompressFormat.WEBP)
|
||||||
|
.compressToBitmapAsFlowable(
|
||||||
|
new File(PreferenceUtil.getInstance(getContext()).getProfileImage(), USER_PROFILE))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(imageView::setImageBitmap,
|
||||||
|
throwable -> imageView.setImageDrawable(ContextCompat
|
||||||
|
.getDrawable(getContext(), R.drawable.ic_person_flat))));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
disposable = new CompositeDisposable();
|
||||||
|
homePresenter = new HomePresenter(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||||
|
@Nullable Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_home, container, false);
|
||||||
|
unbinder = ButterKnife.bind(this, view);
|
||||||
|
setRetainInstance(true);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
getMainActivity().getSlidingUpPanelLayout().setShadowHeight(8);
|
||||||
|
getMainActivity().setBottomBarVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
setupToolbar();
|
||||||
|
loadImageFromStorage(userImage);
|
||||||
|
|
||||||
|
homePresenter.subscribe();
|
||||||
|
checkPadding();
|
||||||
|
getTimeOfTheDay();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("ConstantConditions")
|
||||||
|
private void setupToolbar() {
|
||||||
|
if (!PreferenceUtil.getInstance(getContext()).getFullScreenMode()) {
|
||||||
|
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar
|
||||||
|
.getLayoutParams();
|
||||||
|
params.topMargin = RetroUtil.getStatusBarHeight(getContext());
|
||||||
|
toolbar.setLayoutParams(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
appbar.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onStateChanged(AppBarLayout appBarLayout, State state) {
|
||||||
|
int color;
|
||||||
|
switch (state) {
|
||||||
|
case COLLAPSED:
|
||||||
|
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext()));
|
||||||
|
color = ThemeStore.textColorPrimary(getContext());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
case EXPANDED:
|
||||||
|
case IDLE:
|
||||||
|
getMainActivity().setLightStatusbar(false);
|
||||||
|
color = Color.WHITE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
TintHelper.setTintAuto(search, color, false);
|
||||||
|
title.setTextColor(color);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
int primaryColor = ThemeStore.primaryColor(getContext());
|
||||||
|
|
||||||
|
TintHelper.setTintAuto(container, primaryColor, true);
|
||||||
|
toolbarLayout.setStatusBarScrimColor(primaryColor);
|
||||||
|
toolbarLayout.setContentScrimColor(primaryColor);
|
||||||
|
|
||||||
|
toolbar.setTitle(R.string.home);
|
||||||
|
getMainActivity().setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean handleBackPress() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
super.onDestroyView();
|
||||||
|
unbinder.unbind();
|
||||||
|
disposable.clear();
|
||||||
|
homePresenter.unsubscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loading() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showEmptyView() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void completed() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showData(ArrayList<Home> homes) {
|
||||||
|
HomeAdapter homeAdapter = new HomeAdapter(getMainActivity());
|
||||||
|
homeAdapter.swapData(homes);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onServiceConnected() {
|
||||||
|
super.onServiceConnected();
|
||||||
|
checkPadding();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onQueueChanged() {
|
||||||
|
super.onQueueChanged();
|
||||||
|
checkPadding();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkPadding() {
|
||||||
|
int height = getResources().getDimensionPixelSize(R.dimen.mini_player_height);
|
||||||
|
container.setPadding(0, 0, 0, MusicPlayerRemote.getPlayingQueue().isEmpty() ? height * 2 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private DisplayMetrics getDisplayMetrics() {
|
||||||
|
Display display = getMainActivity().getWindowManager().getDefaultDisplay();
|
||||||
|
DisplayMetrics metrics = new DisplayMetrics();
|
||||||
|
display.getMetrics(metrics);
|
||||||
|
return metrics;
|
||||||
|
}
|
||||||
|
|
||||||
|
@OnClick({R.id.last_added, R.id.top_played, R.id.action_shuffle,
|
||||||
|
R.id.history, R.id.user_image, R.id.search})
|
||||||
|
void startUserInfo(View view) {
|
||||||
|
Activity activity = getActivity();
|
||||||
|
if (activity != null) {
|
||||||
|
switch (view.getId()) {
|
||||||
|
case R.id.action_shuffle:
|
||||||
|
MusicPlayerRemote
|
||||||
|
.openAndShuffleQueue(SongLoader.getAllSongs(activity).blockingFirst(), true);
|
||||||
|
break;
|
||||||
|
case R.id.last_added:
|
||||||
|
NavigationUtil.goToPlaylistNew(activity, new LastAddedPlaylist(activity));
|
||||||
|
break;
|
||||||
|
case R.id.top_played:
|
||||||
|
NavigationUtil.goToPlaylistNew(activity, new MyTopTracksPlaylist(activity));
|
||||||
|
break;
|
||||||
|
case R.id.history:
|
||||||
|
NavigationUtil.goToPlaylistNew(activity, new HistoryPlaylist(activity));
|
||||||
|
break;
|
||||||
|
case R.id.search:
|
||||||
|
NavigationUtil.goToSearch(activity);
|
||||||
|
break;
|
||||||
|
case R.id.user_image:
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
new HomeOptionDialog().show(getFragmentManager(), TAG);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showRecentAlbums(ArrayList<Album> albums) {
|
||||||
|
sectionContainers.get(1).setVisibility(View.VISIBLE);
|
||||||
|
AlbumFullWithAdapter albumFullWithAdapter = new AlbumFullWithAdapter(getMainActivity(),
|
||||||
|
getDisplayMetrics());
|
||||||
|
albumFullWithAdapter.swapData(albums);
|
||||||
|
|
||||||
|
MetalRecyclerViewPager recyclerView = metalRecyclerViewPagers.get(0);
|
||||||
|
recyclerView.setAdapter(albumFullWithAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showTopAlbums(ArrayList<Album> albums) {
|
||||||
|
sectionContainers.get(3).setVisibility(View.VISIBLE);
|
||||||
|
AlbumFullWithAdapter albumFullWithAdapter = new AlbumFullWithAdapter(getMainActivity(),
|
||||||
|
getDisplayMetrics());
|
||||||
|
albumFullWithAdapter.swapData(albums);
|
||||||
|
|
||||||
|
MetalRecyclerViewPager recyclerView = metalRecyclerViewPagers.get(1);
|
||||||
|
recyclerView.setAdapter(albumFullWithAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showRecentArtist(ArrayList<Artist> artists) {
|
||||||
|
sectionContainers.get(0).setVisibility(View.VISIBLE);
|
||||||
|
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 1,
|
||||||
|
GridLayoutManager.HORIZONTAL, false);
|
||||||
|
ArtistAdapter artistAdapter = new ArtistAdapter(getMainActivity(), artists, R.layout.item_artist);
|
||||||
|
|
||||||
|
RecyclerView recyclerView = sectionRecyclerViews.get(0);
|
||||||
|
recyclerView.setLayoutManager(layoutManager);
|
||||||
|
recyclerView.setItemAnimator(new DefaultItemAnimator());
|
||||||
|
recyclerView.setAdapter(artistAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showTopArtist(ArrayList<Artist> artists) {
|
||||||
|
sectionContainers.get(2).setVisibility(View.VISIBLE);
|
||||||
|
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 1,
|
||||||
|
GridLayoutManager.HORIZONTAL, false);
|
||||||
|
ArtistAdapter artistAdapter = new ArtistAdapter(getMainActivity(), artists, R.layout.item_artist);
|
||||||
|
|
||||||
|
RecyclerView recyclerView = sectionRecyclerViews.get(1);
|
||||||
|
recyclerView.setLayoutManager(layoutManager);
|
||||||
|
recyclerView.setItemAnimator(new DefaultItemAnimator());
|
||||||
|
recyclerView.setAdapter(artistAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showGenres(ArrayList<Genre> genres) {
|
||||||
|
sectionContainers.get(4).setVisibility(View.VISIBLE);
|
||||||
|
RecyclerView recyclerView = sectionRecyclerViews.get(2);
|
||||||
|
recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()));
|
||||||
|
recyclerView.setItemAnimator(new DefaultItemAnimator());
|
||||||
|
recyclerView.setAdapter(new GenreAdapter(getMainActivity(), genres, R.layout.item_list));
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
|
@ -31,9 +31,9 @@ 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.misc.SimpleOnSeekbarChangeListener;
|
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener;
|
||||||
import code.name.monkey.retromusic.model.Song;
|
import code.name.monkey.retromusic.model.Song;
|
||||||
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;
|
||||||
import code.name.monkey.retromusic.util.MusicUtil;
|
import code.name.monkey.retromusic.util.MusicUtil;
|
||||||
|
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Hemanth S (h4h13).
|
* @author Hemanth S (h4h13).
|
||||||
|
@ -41,21 +41,31 @@ import code.name.monkey.retromusic.util.MusicUtil;
|
||||||
public class LockScreenPlayerControlsFragment extends AbsPlayerControlsFragment {
|
public class LockScreenPlayerControlsFragment extends AbsPlayerControlsFragment {
|
||||||
@BindView(R.id.player_play_pause_button)
|
@BindView(R.id.player_play_pause_button)
|
||||||
AppCompatImageButton playPauseFab;
|
AppCompatImageButton playPauseFab;
|
||||||
|
|
||||||
@BindView(R.id.player_prev_button)
|
@BindView(R.id.player_prev_button)
|
||||||
ImageButton prevButton;
|
ImageButton prevButton;
|
||||||
|
|
||||||
@BindView(R.id.player_next_button)
|
@BindView(R.id.player_next_button)
|
||||||
ImageButton nextButton;
|
ImageButton nextButton;
|
||||||
|
|
||||||
@BindView(R.id.player_progress_slider)
|
@BindView(R.id.player_progress_slider)
|
||||||
AppCompatSeekBar progressSlider;
|
AppCompatSeekBar progressSlider;
|
||||||
|
|
||||||
@BindView(R.id.player_song_total_time)
|
@BindView(R.id.player_song_total_time)
|
||||||
TextView songTotalTime;
|
TextView songTotalTime;
|
||||||
|
|
||||||
@BindView(R.id.player_song_current_progress)
|
@BindView(R.id.player_song_current_progress)
|
||||||
TextView songCurrentProgress;
|
TextView songCurrentProgress;
|
||||||
|
|
||||||
@BindView(R.id.title)
|
@BindView(R.id.title)
|
||||||
AppCompatTextView title;
|
AppCompatTextView title;
|
||||||
|
|
||||||
@BindView(R.id.text)
|
@BindView(R.id.text)
|
||||||
AppCompatTextView text;
|
AppCompatTextView text;
|
||||||
|
|
||||||
|
@BindView(R.id.volume_fragment_container)
|
||||||
|
View volumeContainer;
|
||||||
|
|
||||||
private Unbinder unbinder;
|
private Unbinder unbinder;
|
||||||
private MusicProgressViewUpdateHelper progressViewUpdateHelper;
|
private MusicProgressViewUpdateHelper progressViewUpdateHelper;
|
||||||
private int lastPlaybackControlsColor;
|
private int lastPlaybackControlsColor;
|
||||||
|
@ -82,7 +92,9 @@ public class LockScreenPlayerControlsFragment extends AbsPlayerControlsFragment
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
setUpMusicControllers();
|
setUpMusicControllers();
|
||||||
|
|
||||||
VolumeFragment volumeFragment = (VolumeFragment) getChildFragmentManager().findFragmentById(R.id.volume_fragment);
|
//noinspection ConstantConditions
|
||||||
|
volumeContainer.setVisibility(PreferenceUtil.getInstance(getContext()).getVolumeToggle()
|
||||||
|
? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@ package code.name.monkey.retromusic.ui.fragments.player.plain;
|
||||||
|
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.drawable.ClipDrawable;
|
|
||||||
import android.graphics.drawable.LayerDrawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
@ -16,6 +14,7 @@ import android.view.animation.LinearInterpolator;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
|
@ -41,296 +40,288 @@ import code.name.monkey.retromusic.views.PlayPauseDrawable;
|
||||||
|
|
||||||
public class PlainPlaybackControlsFragment extends AbsPlayerControlsFragment {
|
public class PlainPlaybackControlsFragment extends AbsPlayerControlsFragment {
|
||||||
|
|
||||||
@BindView(R.id.player_play_pause_button)
|
@BindView(R.id.player_play_pause_button)
|
||||||
ImageButton playPauseFab;
|
ImageButton playPauseFab;
|
||||||
@BindView(R.id.player_prev_button)
|
@BindView(R.id.player_prev_button)
|
||||||
ImageButton prevButton;
|
ImageButton prevButton;
|
||||||
@BindView(R.id.player_next_button)
|
@BindView(R.id.player_next_button)
|
||||||
ImageButton nextButton;
|
ImageButton nextButton;
|
||||||
@BindView(R.id.player_repeat_button)
|
@BindView(R.id.player_repeat_button)
|
||||||
ImageButton repeatButton;
|
ImageButton repeatButton;
|
||||||
@BindView(R.id.player_shuffle_button)
|
@BindView(R.id.player_shuffle_button)
|
||||||
ImageButton shuffleButton;
|
ImageButton shuffleButton;
|
||||||
@BindView(R.id.player_progress_slider)
|
@BindView(R.id.player_progress_slider)
|
||||||
SeekBar progressSlider;
|
SeekBar progressSlider;
|
||||||
@BindView(R.id.player_song_total_time)
|
@BindView(R.id.player_song_total_time)
|
||||||
TextView songTotalTime;
|
TextView songTotalTime;
|
||||||
@BindView(R.id.player_song_current_progress)
|
@BindView(R.id.player_song_current_progress)
|
||||||
TextView songCurrentProgress;
|
TextView songCurrentProgress;
|
||||||
@BindView(R.id.volume_fragment_container)
|
@BindView(R.id.volume_fragment_container)
|
||||||
View volumeContainer;
|
View volumeContainer;
|
||||||
private Unbinder unbinder;
|
|
||||||
private PlayPauseDrawable playerFabPlayPauseDrawable;
|
|
||||||
private int lastPlaybackControlsColor;
|
|
||||||
private int lastDisabledPlaybackControlsColor;
|
|
||||||
private MusicProgressViewUpdateHelper progressViewUpdateHelper;
|
|
||||||
|
|
||||||
@Override
|
private Unbinder unbinder;
|
||||||
public void onPlayStateChanged() {
|
private PlayPauseDrawable playerFabPlayPauseDrawable;
|
||||||
updatePlayPauseDrawableState(true);
|
private int lastPlaybackControlsColor;
|
||||||
}
|
private int lastDisabledPlaybackControlsColor;
|
||||||
|
private MusicProgressViewUpdateHelper progressViewUpdateHelper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRepeatModeChanged() {
|
public void onPlayStateChanged() {
|
||||||
updateRepeatState();
|
updatePlayPauseDrawableState(true);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onShuffleModeChanged() {
|
|
||||||
updateShuffleState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onServiceConnected() {
|
|
||||||
updatePlayPauseDrawableState(false);
|
|
||||||
updateRepeatState();
|
|
||||||
updateShuffleState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
progressViewUpdateHelper = new MusicProgressViewUpdateHelper(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroyView() {
|
|
||||||
super.onDestroyView();
|
|
||||||
unbinder.unbind();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
|
||||||
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
||||||
View view = inflater.inflate(R.layout.fragment_plain_controls_fragment, container, false);
|
|
||||||
unbinder = ButterKnife.bind(this, view);
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
progressViewUpdateHelper.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPause() {
|
|
||||||
super.onPause();
|
|
||||||
progressViewUpdateHelper.stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
|
||||||
super.onViewCreated(view, savedInstanceState);
|
|
||||||
setUpMusicControllers();
|
|
||||||
if (PreferenceUtil.getInstance(getContext()).getVolumeToggle()) {
|
|
||||||
volumeContainer.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
volumeContainer.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpMusicControllers() {
|
@Override
|
||||||
setUpPlayPauseFab();
|
public void onRepeatModeChanged() {
|
||||||
setUpPrevNext();
|
updateRepeatState();
|
||||||
setUpRepeatButton();
|
|
||||||
setUpShuffleButton();
|
|
||||||
setUpProgressSlider();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpPrevNext() {
|
|
||||||
updatePrevNextColor();
|
|
||||||
nextButton.setOnClickListener(v -> MusicPlayerRemote.playNextSong());
|
|
||||||
prevButton.setOnClickListener(v -> MusicPlayerRemote.back());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updatePrevNextColor() {
|
|
||||||
nextButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
|
||||||
prevButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpShuffleButton() {
|
|
||||||
shuffleButton.setOnClickListener(v -> MusicPlayerRemote.toggleShuffleMode());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void updateShuffleState() {
|
|
||||||
switch (MusicPlayerRemote.getShuffleMode()) {
|
|
||||||
case MusicService.SHUFFLE_MODE_SHUFFLE:
|
|
||||||
shuffleButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
shuffleButton.setColorFilter(lastDisabledPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void setUpRepeatButton() {
|
@Override
|
||||||
repeatButton.setOnClickListener(v -> MusicPlayerRemote.cycleRepeatMode());
|
public void onShuffleModeChanged() {
|
||||||
}
|
updateShuffleState();
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void updateRepeatState() {
|
|
||||||
switch (MusicPlayerRemote.getRepeatMode()) {
|
|
||||||
case MusicService.REPEAT_MODE_NONE:
|
|
||||||
repeatButton.setImageResource(R.drawable.ic_repeat_white_24dp);
|
|
||||||
repeatButton.setColorFilter(lastDisabledPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
|
||||||
break;
|
|
||||||
case MusicService.REPEAT_MODE_ALL:
|
|
||||||
repeatButton.setImageResource(R.drawable.ic_repeat_white_24dp);
|
|
||||||
repeatButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
|
||||||
break;
|
|
||||||
case MusicService.REPEAT_MODE_THIS:
|
|
||||||
repeatButton.setImageResource(R.drawable.ic_repeat_one_white_24dp);
|
|
||||||
repeatButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
@Override
|
||||||
@Override
|
public void onServiceConnected() {
|
||||||
protected void show() {
|
updatePlayPauseDrawableState(false);
|
||||||
playPauseFab.animate()
|
updateRepeatState();
|
||||||
.scaleX(1f)
|
updateShuffleState();
|
||||||
.scaleY(1f)
|
|
||||||
.rotation(360f)
|
|
||||||
.setInterpolator(new DecelerateInterpolator())
|
|
||||||
.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void hide() {
|
|
||||||
if (playPauseFab != null) {
|
|
||||||
playPauseFab.setScaleX(0f);
|
|
||||||
playPauseFab.setScaleY(0f);
|
|
||||||
playPauseFab.setRotation(0f);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUpProgressSlider() {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
progressSlider.setOnSeekBarChangeListener(new SimpleOnSeekbarChangeListener() {
|
super.onCreate(savedInstanceState);
|
||||||
@Override
|
progressViewUpdateHelper = new MusicProgressViewUpdateHelper(this);
|
||||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
}
|
||||||
if (fromUser) {
|
|
||||||
MusicPlayerRemote.seekTo(progress);
|
@Override
|
||||||
onUpdateProgressViews(MusicPlayerRemote.getSongProgressMillis(),
|
public void onDestroyView() {
|
||||||
MusicPlayerRemote.getSongDurationMillis());
|
super.onDestroyView();
|
||||||
|
unbinder.unbind();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||||
|
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_plain_controls_fragment, container, false);
|
||||||
|
unbinder = ButterKnife.bind(this, view);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
progressViewUpdateHelper.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
progressViewUpdateHelper.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
setUpMusicControllers();
|
||||||
|
if (PreferenceUtil.getInstance(getContext()).getVolumeToggle()) {
|
||||||
|
volumeContainer.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
volumeContainer.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showBouceAnimation() {
|
|
||||||
playPauseFab.clearAnimation();
|
|
||||||
|
|
||||||
playPauseFab.setScaleX(0.9f);
|
|
||||||
playPauseFab.setScaleY(0.9f);
|
|
||||||
playPauseFab.setVisibility(View.VISIBLE);
|
|
||||||
playPauseFab.setPivotX(playPauseFab.getWidth() / 2);
|
|
||||||
playPauseFab.setPivotY(playPauseFab.getHeight() / 2);
|
|
||||||
|
|
||||||
playPauseFab.animate()
|
|
||||||
.setDuration(200)
|
|
||||||
.setInterpolator(new DecelerateInterpolator())
|
|
||||||
.scaleX(1.1f)
|
|
||||||
.scaleY(1.1f)
|
|
||||||
.withEndAction(() -> playPauseFab.animate()
|
|
||||||
.setDuration(200)
|
|
||||||
.setInterpolator(new AccelerateInterpolator())
|
|
||||||
.scaleX(1f)
|
|
||||||
.scaleY(1f)
|
|
||||||
.alpha(1f)
|
|
||||||
.start())
|
|
||||||
.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnClick(R.id.player_play_pause_button)
|
|
||||||
void showAnimation() {
|
|
||||||
if (MusicPlayerRemote.isPlaying()) {
|
|
||||||
MusicPlayerRemote.pauseSong();
|
|
||||||
} else {
|
|
||||||
MusicPlayerRemote.resumePlaying();
|
|
||||||
}
|
|
||||||
showBouceAnimation();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onUpdateProgressViews(int progress, int total) {
|
|
||||||
progressSlider.setMax(total);
|
|
||||||
|
|
||||||
ObjectAnimator animator = ObjectAnimator.ofInt(progressSlider, "progress", progress);
|
|
||||||
animator.setDuration(1500);
|
|
||||||
animator.setInterpolator(new LinearInterpolator());
|
|
||||||
animator.start();
|
|
||||||
|
|
||||||
songTotalTime.setText(MusicUtil.getReadableDurationString(total));
|
|
||||||
songCurrentProgress.setText(MusicUtil.getReadableDurationString(progress));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setDark(int dark) {
|
|
||||||
int color = ATHUtil.resolveColor(getActivity(), android.R.attr.colorBackground);
|
|
||||||
if (ColorUtil.isColorLight(color)) {
|
|
||||||
lastPlaybackControlsColor =
|
|
||||||
MaterialValueHelper.getSecondaryTextColor(getActivity(), true);
|
|
||||||
lastDisabledPlaybackControlsColor =
|
|
||||||
MaterialValueHelper.getSecondaryDisabledTextColor(getActivity(), true);
|
|
||||||
} else {
|
|
||||||
lastPlaybackControlsColor =
|
|
||||||
MaterialValueHelper.getPrimaryTextColor(getActivity(), false);
|
|
||||||
lastDisabledPlaybackControlsColor =
|
|
||||||
MaterialValueHelper.getPrimaryDisabledTextColor(getActivity(), false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PreferenceUtil.getInstance(getContext()).getAdaptiveColor()) {
|
private void setUpMusicControllers() {
|
||||||
TintHelper.setTintAuto(playPauseFab,
|
setUpPlayPauseFab();
|
||||||
MaterialValueHelper.getPrimaryTextColor(getContext(), ColorUtil.isColorLight(dark)),
|
setUpPrevNext();
|
||||||
false);
|
setUpRepeatButton();
|
||||||
TintHelper.setTintAuto(playPauseFab, dark, true);
|
setUpShuffleButton();
|
||||||
setProgressBarColor(dark);
|
setUpProgressSlider();
|
||||||
} else {
|
|
||||||
int accentColor = ThemeStore.accentColor(getContext());
|
|
||||||
setProgressBarColor(accentColor);
|
|
||||||
TintHelper.setTintAuto(playPauseFab,
|
|
||||||
MaterialValueHelper
|
|
||||||
.getPrimaryTextColor(getContext(), ColorUtil.isColorLight(accentColor)),
|
|
||||||
false);
|
|
||||||
TintHelper.setTintAuto(playPauseFab, accentColor, true);
|
|
||||||
}
|
}
|
||||||
updateRepeatState();
|
|
||||||
updateShuffleState();
|
|
||||||
updatePrevNextColor();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProgressBarColor(int newColor) {
|
private void setUpPrevNext() {
|
||||||
LayerDrawable ld = (LayerDrawable) progressSlider.getProgressDrawable();
|
updatePrevNextColor();
|
||||||
ClipDrawable clipDrawable = (ClipDrawable) ld.findDrawableByLayerId(android.R.id.progress);
|
nextButton.setOnClickListener(v -> MusicPlayerRemote.playNextSong());
|
||||||
clipDrawable.setColorFilter(newColor, PorterDuff.Mode.SRC_IN);
|
prevButton.setOnClickListener(v -> MusicPlayerRemote.back());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUpPlayPauseFab() {
|
private void updatePrevNextColor() {
|
||||||
playerFabPlayPauseDrawable = new PlayPauseDrawable(getActivity());
|
nextButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
prevButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
}
|
||||||
|
|
||||||
playPauseFab.setImageDrawable(
|
private void setUpShuffleButton() {
|
||||||
playerFabPlayPauseDrawable); // Note: set the drawable AFTER TintHelper.setTintAuto() was called
|
shuffleButton.setOnClickListener(v -> MusicPlayerRemote.toggleShuffleMode());
|
||||||
//playPauseFab.setColorFilter(MaterialValueHelper.getPrimaryTextColor(getContext(), ColorUtil.isColorLight(fabColor)), PorterDuff.Mode.SRC_IN);
|
}
|
||||||
//playPauseFab.setOnClickListener(new PlayPauseButtonOnClickHandler());
|
|
||||||
playPauseFab.post(() -> {
|
@Override
|
||||||
if (playPauseFab != null) {
|
protected void updateShuffleState() {
|
||||||
|
switch (MusicPlayerRemote.getShuffleMode()) {
|
||||||
|
case MusicService.SHUFFLE_MODE_SHUFFLE:
|
||||||
|
shuffleButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
shuffleButton.setColorFilter(lastDisabledPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setUpRepeatButton() {
|
||||||
|
repeatButton.setOnClickListener(v -> MusicPlayerRemote.cycleRepeatMode());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void updateRepeatState() {
|
||||||
|
switch (MusicPlayerRemote.getRepeatMode()) {
|
||||||
|
case MusicService.REPEAT_MODE_NONE:
|
||||||
|
repeatButton.setImageResource(R.drawable.ic_repeat_white_24dp);
|
||||||
|
repeatButton.setColorFilter(lastDisabledPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
break;
|
||||||
|
case MusicService.REPEAT_MODE_ALL:
|
||||||
|
repeatButton.setImageResource(R.drawable.ic_repeat_white_24dp);
|
||||||
|
repeatButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
break;
|
||||||
|
case MusicService.REPEAT_MODE_THIS:
|
||||||
|
repeatButton.setImageResource(R.drawable.ic_repeat_one_white_24dp);
|
||||||
|
repeatButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void show() {
|
||||||
|
playPauseFab.animate()
|
||||||
|
.scaleX(1f)
|
||||||
|
.scaleY(1f)
|
||||||
|
.rotation(360f)
|
||||||
|
.setInterpolator(new DecelerateInterpolator())
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void hide() {
|
||||||
|
if (playPauseFab != null) {
|
||||||
|
playPauseFab.setScaleX(0f);
|
||||||
|
playPauseFab.setScaleY(0f);
|
||||||
|
playPauseFab.setRotation(0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpProgressSlider() {
|
||||||
|
progressSlider.setOnSeekBarChangeListener(new SimpleOnSeekbarChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||||
|
if (fromUser) {
|
||||||
|
MusicPlayerRemote.seekTo(progress);
|
||||||
|
onUpdateProgressViews(MusicPlayerRemote.getSongProgressMillis(),
|
||||||
|
MusicPlayerRemote.getSongDurationMillis());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showBouceAnimation() {
|
||||||
|
playPauseFab.clearAnimation();
|
||||||
|
|
||||||
|
playPauseFab.setScaleX(0.9f);
|
||||||
|
playPauseFab.setScaleY(0.9f);
|
||||||
|
playPauseFab.setVisibility(View.VISIBLE);
|
||||||
playPauseFab.setPivotX(playPauseFab.getWidth() / 2);
|
playPauseFab.setPivotX(playPauseFab.getWidth() / 2);
|
||||||
playPauseFab.setPivotY(playPauseFab.getHeight() / 2);
|
playPauseFab.setPivotY(playPauseFab.getHeight() / 2);
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void updatePlayPauseDrawableState(boolean animate) {
|
playPauseFab.animate()
|
||||||
if (MusicPlayerRemote.isPlaying()) {
|
.setDuration(200)
|
||||||
playerFabPlayPauseDrawable.setPause(animate);
|
.setInterpolator(new DecelerateInterpolator())
|
||||||
} else {
|
.scaleX(1.1f)
|
||||||
playerFabPlayPauseDrawable.setPlay(animate);
|
.scaleY(1.1f)
|
||||||
|
.withEndAction(() -> playPauseFab.animate()
|
||||||
|
.setDuration(200)
|
||||||
|
.setInterpolator(new AccelerateInterpolator())
|
||||||
|
.scaleX(1f)
|
||||||
|
.scaleY(1f)
|
||||||
|
.alpha(1f)
|
||||||
|
.start())
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@OnClick(R.id.player_play_pause_button)
|
||||||
|
void showAnimation() {
|
||||||
|
if (MusicPlayerRemote.isPlaying()) {
|
||||||
|
MusicPlayerRemote.pauseSong();
|
||||||
|
} else {
|
||||||
|
MusicPlayerRemote.resumePlaying();
|
||||||
|
}
|
||||||
|
showBouceAnimation();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdateProgressViews(int progress, int total) {
|
||||||
|
progressSlider.setMax(total);
|
||||||
|
|
||||||
|
ObjectAnimator animator = ObjectAnimator.ofInt(progressSlider, "progress", progress);
|
||||||
|
animator.setDuration(1500);
|
||||||
|
animator.setInterpolator(new LinearInterpolator());
|
||||||
|
animator.start();
|
||||||
|
|
||||||
|
songTotalTime.setText(MusicUtil.getReadableDurationString(total));
|
||||||
|
songCurrentProgress.setText(MusicUtil.getReadableDurationString(progress));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDark(int dark) {
|
||||||
|
int color = ATHUtil.resolveColor(getActivity(), android.R.attr.colorBackground);
|
||||||
|
if (ColorUtil.isColorLight(color)) {
|
||||||
|
lastPlaybackControlsColor =
|
||||||
|
MaterialValueHelper.getSecondaryTextColor(getActivity(), true);
|
||||||
|
lastDisabledPlaybackControlsColor =
|
||||||
|
MaterialValueHelper.getSecondaryDisabledTextColor(getActivity(), true);
|
||||||
|
} else {
|
||||||
|
lastPlaybackControlsColor =
|
||||||
|
MaterialValueHelper.getPrimaryTextColor(getActivity(), false);
|
||||||
|
lastDisabledPlaybackControlsColor =
|
||||||
|
MaterialValueHelper.getPrimaryDisabledTextColor(getActivity(), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
int finalColor = PreferenceUtil.getInstance(getContext()).getAdaptiveColor()
|
||||||
|
? dark : ThemeStore.accentColor(getContext());
|
||||||
|
|
||||||
|
|
||||||
|
setProgressBarColor(dark);
|
||||||
|
TintHelper.setTintAuto(playPauseFab, MaterialValueHelper.getPrimaryTextColor(getContext(), ColorUtil.isColorLight(finalColor)), false);
|
||||||
|
TintHelper.setTintAuto(playPauseFab, finalColor, true);
|
||||||
|
|
||||||
|
updateRepeatState();
|
||||||
|
updateShuffleState();
|
||||||
|
updatePrevNextColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProgressBarColor(int newColor) {
|
||||||
|
TintHelper.setTintAuto(progressSlider, newColor, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setUpPlayPauseFab() {
|
||||||
|
playerFabPlayPauseDrawable = new PlayPauseDrawable(getActivity());
|
||||||
|
|
||||||
|
playPauseFab.setImageDrawable(
|
||||||
|
playerFabPlayPauseDrawable); // Note: set the drawable AFTER TintHelper.setTintAuto() was called
|
||||||
|
//playPauseFab.setColorFilter(MaterialValueHelper.getPrimaryTextColor(getContext(), ColorUtil.isColorLight(fabColor)), PorterDuff.Mode.SRC_IN);
|
||||||
|
//playPauseFab.setOnClickListener(new PlayPauseButtonOnClickHandler());
|
||||||
|
playPauseFab.post(() -> {
|
||||||
|
if (playPauseFab != null) {
|
||||||
|
playPauseFab.setPivotX(playPauseFab.getWidth() / 2);
|
||||||
|
playPauseFab.setPivotY(playPauseFab.getHeight() / 2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void updatePlayPauseDrawableState(boolean animate) {
|
||||||
|
if (MusicPlayerRemote.isPlaying()) {
|
||||||
|
playerFabPlayPauseDrawable.setPause(animate);
|
||||||
|
} else {
|
||||||
|
playerFabPlayPauseDrawable.setPlay(animate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,18 +59,17 @@ public abstract class AbsSettingsFragment extends ATEPreferenceFragmentCompat {
|
||||||
setDividerHeight(0);
|
setDividerHeight(0);
|
||||||
setDivider(new ColorDrawable(Color.TRANSPARENT));
|
setDivider(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
|
||||||
|
//noinspection ConstantConditions
|
||||||
getListView().setPadding(DensityUtil.dip2px(getContext(), 0), 0, 0, 0);
|
getListView().setPadding(DensityUtil.dip2px(getContext(), 0), 0, 0, 0);
|
||||||
getListView().addOnScrollListener(new RecyclerView.OnScrollListener() {
|
getListView().addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
|
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
|
||||||
super.onScrolled(recyclerView, dx, dy);
|
super.onScrolled(recyclerView, dx, dy);
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
((SettingsActivity) getActivity())
|
((SettingsActivity) getActivity()).addAppbarLayoutElevation(recyclerView.canScrollVertically(RecyclerView.NO_POSITION) ? 8f : 0f);
|
||||||
.addAppbarLayoutElevation(recyclerView.canScrollVertically(RecyclerView.NO_POSITION) ? 8f : 0f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//noinspection ConstantConditions
|
|
||||||
getListView().setBackgroundColor(ThemeStore.primaryColor(getContext()));
|
getListView().setBackgroundColor(ThemeStore.primaryColor(getContext()));
|
||||||
getListView().setOverScrollMode(View.OVER_SCROLL_NEVER);
|
getListView().setOverScrollMode(View.OVER_SCROLL_NEVER);
|
||||||
invalidateSettings();
|
invalidateSettings();
|
||||||
|
|
|
@ -4,6 +4,7 @@ import android.graphics.PorterDuff;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.annotation.StringRes;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -57,29 +58,29 @@ public class MainSettingsFragment extends Fragment {
|
||||||
public void onViewClicked(View view) {
|
public void onViewClicked(View view) {
|
||||||
switch (view.getId()) {
|
switch (view.getId()) {
|
||||||
case R.id.general_settings:
|
case R.id.general_settings:
|
||||||
inflateFragment(new ThemeSettingsFragment());
|
inflateFragment(new ThemeSettingsFragment(), R.string.general_settings_title);
|
||||||
break;
|
break;
|
||||||
case R.id.audio_settings:
|
case R.id.audio_settings:
|
||||||
inflateFragment(new AudioSettings());
|
inflateFragment(new AudioSettings(), R.string.pref_header_audio);
|
||||||
break;
|
break;
|
||||||
case R.id.now_playing_settings:
|
case R.id.now_playing_settings:
|
||||||
inflateFragment(new NowPlayingSettingsFragment());
|
inflateFragment(new NowPlayingSettingsFragment(), R.string.personalize);
|
||||||
break;
|
break;
|
||||||
case R.id.image_settings:
|
case R.id.image_settings:
|
||||||
inflateFragment(new ImageSettingFragment());
|
inflateFragment(new ImageSettingFragment(), R.string.pref_header_images);
|
||||||
break;
|
break;
|
||||||
case R.id.notification_settings:
|
case R.id.notification_settings:
|
||||||
inflateFragment(new NotificationSettingsFragment());
|
inflateFragment(new NotificationSettingsFragment(), R.string.notification);
|
||||||
break;
|
break;
|
||||||
case R.id.other_settings:
|
case R.id.other_settings:
|
||||||
inflateFragment(new OtherSettingsFragment());
|
inflateFragment(new OtherSettingsFragment(), R.string.others);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void inflateFragment(Fragment fragment) {
|
private void inflateFragment(Fragment fragment, @StringRes int title) {
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
((SettingsActivity) getActivity()).setupFragment(fragment);
|
((SettingsActivity) getActivity()).setupFragment(fragment, title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,5 @@
|
||||||
package code.name.monkey.retromusic.util;
|
package code.name.monkey.retromusic.util;
|
||||||
|
|
||||||
import static code.name.monkey.retromusic.ui.activities.GenreDetailsActivity.EXTRA_GENRE_ID;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -12,6 +10,7 @@ import android.support.v4.app.ActivityCompat;
|
||||||
import android.support.v4.app.ActivityOptionsCompat;
|
import android.support.v4.app.ActivityOptionsCompat;
|
||||||
import android.support.v4.util.Pair;
|
import android.support.v4.util.Pair;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
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;
|
||||||
|
@ -31,100 +30,108 @@ import code.name.monkey.retromusic.ui.activities.SettingsActivity;
|
||||||
import code.name.monkey.retromusic.ui.activities.SupportDevelopmentActivity;
|
import code.name.monkey.retromusic.ui.activities.SupportDevelopmentActivity;
|
||||||
import code.name.monkey.retromusic.ui.activities.UserInfoActivity;
|
import code.name.monkey.retromusic.ui.activities.UserInfoActivity;
|
||||||
|
|
||||||
|
import static code.name.monkey.retromusic.Constants.RATE_ON_GOOGLE_PLAY;
|
||||||
|
import static code.name.monkey.retromusic.ui.activities.GenreDetailsActivity.EXTRA_GENRE_ID;
|
||||||
|
import static code.name.monkey.retromusic.util.RetroUtil.openUrl;
|
||||||
|
|
||||||
|
|
||||||
public class NavigationUtil {
|
public class NavigationUtil {
|
||||||
|
|
||||||
public static void goToAlbum(@NonNull Activity activity, int i,
|
public static void goToAlbum(@NonNull Activity activity, int i,
|
||||||
@Nullable Pair... sharedElements) {
|
@Nullable Pair... sharedElements) {
|
||||||
Intent intent = new Intent(activity, AlbumDetailsActivity.class);
|
Intent intent = new Intent(activity, AlbumDetailsActivity.class);
|
||||||
intent.putExtra(AlbumDetailsActivity.EXTRA_ALBUM_ID, i);
|
intent.putExtra(AlbumDetailsActivity.EXTRA_ALBUM_ID, i);
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
ActivityCompat.startActivity(activity, intent,
|
ActivityCompat.startActivity(activity, intent,
|
||||||
ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle());
|
ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle());
|
||||||
}
|
|
||||||
|
|
||||||
public static void goToArtist(@NonNull Activity activity, int i,
|
|
||||||
@Nullable Pair... sharedElements) {
|
|
||||||
Intent intent = new Intent(activity, ArtistDetailActivity.class);
|
|
||||||
intent.putExtra(ArtistDetailActivity.EXTRA_ARTIST_ID, i);
|
|
||||||
//noinspection unchecked
|
|
||||||
ActivityCompat.startActivity(activity, intent,
|
|
||||||
ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void goToPlaylistNew(@NonNull Activity activity, Playlist playlist) {
|
|
||||||
Intent intent = new Intent(activity, PlaylistDetailActivity.class);
|
|
||||||
intent.putExtra(PlaylistDetailActivity.EXTRA_PLAYLIST, playlist);
|
|
||||||
ActivityCompat.startActivity(activity, intent, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void openEqualizer(@NonNull final Activity activity) {
|
|
||||||
if (PreferenceUtil.getInstance(activity).getSelectedEqualizer().equals("system")) {
|
|
||||||
stockEqalizer(activity);
|
|
||||||
} else {
|
|
||||||
ActivityCompat.startActivity(activity, new Intent(activity, EqualizerActivity.class), null);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private static void stockEqalizer(@NonNull Activity activity) {
|
public static void goToArtist(@NonNull Activity activity, int i,
|
||||||
final int sessionId = MusicPlayerRemote.getAudioSessionId();
|
@Nullable Pair... sharedElements) {
|
||||||
if (sessionId == AudioEffect.ERROR_BAD_VALUE) {
|
Intent intent = new Intent(activity, ArtistDetailActivity.class);
|
||||||
Toast.makeText(activity, activity.getResources().getString(R.string.no_audio_ID),
|
intent.putExtra(ArtistDetailActivity.EXTRA_ARTIST_ID, i);
|
||||||
Toast.LENGTH_LONG).show();
|
//noinspection unchecked
|
||||||
} else {
|
ActivityCompat.startActivity(activity, intent,
|
||||||
try {
|
ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElements).toBundle());
|
||||||
final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
|
|
||||||
effects.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, sessionId);
|
|
||||||
effects.putExtra(AudioEffect.EXTRA_CONTENT_TYPE, AudioEffect.CONTENT_TYPE_MUSIC);
|
|
||||||
activity.startActivityForResult(effects, 0);
|
|
||||||
} catch (@NonNull final ActivityNotFoundException notFound) {
|
|
||||||
Toast.makeText(activity, activity.getResources().getString(R.string.no_equalizer),
|
|
||||||
Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static void goToPlayingQueue(@NonNull Activity activity) {
|
public static void goToPlaylistNew(@NonNull Activity activity, Playlist playlist) {
|
||||||
Intent intent = new Intent(activity, PlayingQueueActivity.class);
|
Intent intent = new Intent(activity, PlaylistDetailActivity.class);
|
||||||
ActivityCompat.startActivity(activity, intent, null);
|
intent.putExtra(PlaylistDetailActivity.EXTRA_PLAYLIST, playlist);
|
||||||
}
|
ActivityCompat.startActivity(activity, intent, null);
|
||||||
|
}
|
||||||
|
|
||||||
public static void goToLyrics(@NonNull Activity activity) {
|
public static void openEqualizer(@NonNull final Activity activity) {
|
||||||
Intent intent = new Intent(activity, LyricsActivity.class);
|
if (PreferenceUtil.getInstance(activity).getSelectedEqualizer().equals("system")) {
|
||||||
ActivityCompat.startActivity(activity, intent, null);
|
stockEqalizer(activity);
|
||||||
}
|
} else {
|
||||||
|
ActivityCompat.startActivity(activity, new Intent(activity, EqualizerActivity.class), null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void goToGenre(@NonNull Activity activity, @NonNull Genre genre) {
|
private static void stockEqalizer(@NonNull Activity activity) {
|
||||||
Intent intent = new Intent(activity, GenreDetailsActivity.class);
|
final int sessionId = MusicPlayerRemote.getAudioSessionId();
|
||||||
intent.putExtra(EXTRA_GENRE_ID, genre);
|
if (sessionId == AudioEffect.ERROR_BAD_VALUE) {
|
||||||
ActivityCompat.startActivity(activity, intent, null);
|
Toast.makeText(activity, activity.getResources().getString(R.string.no_audio_ID),
|
||||||
}
|
Toast.LENGTH_LONG).show();
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
final Intent effects = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
|
||||||
|
effects.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, sessionId);
|
||||||
|
effects.putExtra(AudioEffect.EXTRA_CONTENT_TYPE, AudioEffect.CONTENT_TYPE_MUSIC);
|
||||||
|
activity.startActivityForResult(effects, 0);
|
||||||
|
} catch (@NonNull final ActivityNotFoundException notFound) {
|
||||||
|
Toast.makeText(activity, activity.getResources().getString(R.string.no_equalizer),
|
||||||
|
Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void goToProVersion(@NonNull Activity activity) {
|
public static void goToPlayingQueue(@NonNull Activity activity) {
|
||||||
ActivityCompat.startActivity(activity, new Intent(activity, ProVersionActivity.class), null);
|
Intent intent = new Intent(activity, PlayingQueueActivity.class);
|
||||||
}
|
ActivityCompat.startActivity(activity, intent, null);
|
||||||
|
}
|
||||||
|
|
||||||
public static void goToSettings(@NonNull Activity activity) {
|
public static void goToLyrics(@NonNull Activity activity) {
|
||||||
ActivityCompat.startActivity(activity, new Intent(activity, SettingsActivity.class), null);
|
Intent intent = new Intent(activity, LyricsActivity.class);
|
||||||
}
|
ActivityCompat.startActivity(activity, intent, null);
|
||||||
|
}
|
||||||
|
|
||||||
public static void goToAbout(@NonNull Activity activity) {
|
public static void goToGenre(@NonNull Activity activity, @NonNull Genre genre) {
|
||||||
ActivityCompat.startActivity(activity, new Intent(activity, AboutActivity.class), null);
|
Intent intent = new Intent(activity, GenreDetailsActivity.class);
|
||||||
}
|
intent.putExtra(EXTRA_GENRE_ID, genre);
|
||||||
|
ActivityCompat.startActivity(activity, intent, null);
|
||||||
|
}
|
||||||
|
|
||||||
public static void goToUserInfo(@NonNull Activity activity) {
|
public static void goToProVersion(@NonNull Activity activity) {
|
||||||
ActivityCompat.startActivity(activity, new Intent(activity, UserInfoActivity.class), null);
|
ActivityCompat.startActivity(activity, new Intent(activity, ProVersionActivity.class), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void goToOpenSource(@NonNull Activity activity) {
|
public static void goToSettings(@NonNull Activity activity) {
|
||||||
ActivityCompat.startActivity(activity, new Intent(activity, LicenseActivity.class), null);
|
ActivityCompat.startActivity(activity, new Intent(activity, SettingsActivity.class), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void goToSearch(Activity activity) {
|
public static void goToAbout(@NonNull Activity activity) {
|
||||||
ActivityCompat.startActivity(activity, new Intent(activity, SearchActivity.class), null);
|
ActivityCompat.startActivity(activity, new Intent(activity, AboutActivity.class), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void goToSupportDevelopment(Activity activity) {
|
public static void goToUserInfo(@NonNull Activity activity) {
|
||||||
ActivityCompat
|
ActivityCompat.startActivity(activity, new Intent(activity, UserInfoActivity.class), null);
|
||||||
.startActivity(activity, new Intent(activity, SupportDevelopmentActivity.class), null);
|
}
|
||||||
}
|
|
||||||
|
public static void goToOpenSource(@NonNull Activity activity) {
|
||||||
|
ActivityCompat.startActivity(activity, new Intent(activity, LicenseActivity.class), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void goToSearch(Activity activity) {
|
||||||
|
ActivityCompat.startActivity(activity, new Intent(activity, SearchActivity.class), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void goToSupportDevelopment(Activity activity) {
|
||||||
|
ActivityCompat.startActivity(activity, new Intent(activity, SupportDevelopmentActivity.class), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void goToPlayStore(Activity activity) {
|
||||||
|
openUrl(activity, RATE_ON_GOOGLE_PLAY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class RetroUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void openUrl(AppCompatActivity context, String str) {
|
public static void openUrl(Activity context, String str) {
|
||||||
Intent intent = new Intent("android.intent.action.VIEW");
|
Intent intent = new Intent("android.intent.action.VIEW");
|
||||||
intent.setData(Uri.parse(str));
|
intent.setData(Uri.parse(str));
|
||||||
intent.setFlags(268435456);
|
intent.setFlags(268435456);
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class MetalRecyclerViewPager extends RecyclerView {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(VH holder, int position) {
|
public void onBindViewHolder(@NonNull VH holder, int position) {
|
||||||
int currentItemWidth = itemWidth;
|
int currentItemWidth = itemWidth;
|
||||||
|
|
||||||
if (position == 0) {
|
if (position == 0) {
|
||||||
|
|
|
@ -1,70 +0,0 @@
|
||||||
package code.name.monkey.retromusic.views;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.res.TypedArray;
|
|
||||||
import android.graphics.Canvas;
|
|
||||||
import android.graphics.Path;
|
|
||||||
import android.graphics.RectF;
|
|
||||||
import android.graphics.Region;
|
|
||||||
import android.util.AttributeSet;
|
|
||||||
import android.widget.FrameLayout;
|
|
||||||
import code.name.monkey.retromusic.R;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Frame layout that has rounded corners (it clips content too).
|
|
||||||
*
|
|
||||||
* @author Anton Chekulaev
|
|
||||||
*/
|
|
||||||
public class RoundCornerFrameLayout extends FrameLayout {
|
|
||||||
|
|
||||||
private final Path stencilPath = new Path();
|
|
||||||
private float cornerRadius = 0;
|
|
||||||
|
|
||||||
public RoundCornerFrameLayout(Context context) {
|
|
||||||
this(context, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public RoundCornerFrameLayout(Context context, AttributeSet attrs) {
|
|
||||||
this(context, attrs, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public RoundCornerFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
|
||||||
super(context, attrs, defStyleAttr);
|
|
||||||
|
|
||||||
TypedArray attrArray = context
|
|
||||||
.obtainStyledAttributes(attrs, R.styleable.RoundCornerFrameLayout, 0, 0);
|
|
||||||
try {
|
|
||||||
cornerRadius = attrArray.getDimension(R.styleable.RoundCornerFrameLayout_corner_radius, 0f);
|
|
||||||
} finally {
|
|
||||||
attrArray.recycle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*@Override
|
|
||||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
|
||||||
super.onSizeChanged(w, h, oldw, oldh);
|
|
||||||
|
|
||||||
// compute the path
|
|
||||||
stencilPath.reset();
|
|
||||||
stencilPath.addRoundRect(0, 0, w, h, cornerRadius, cornerRadius, Path.Direction.CW);
|
|
||||||
stencilPath.close();
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected void dispatchDraw(Canvas canvas) {
|
|
||||||
final int count = canvas.save();
|
|
||||||
final Path path = new Path();
|
|
||||||
final RectF rect = new RectF(0, 0, canvas.getWidth(), canvas.getHeight());
|
|
||||||
final float[] arrayRadius = {cornerRadius, cornerRadius, cornerRadius, cornerRadius,
|
|
||||||
cornerRadius, cornerRadius, cornerRadius, cornerRadius};
|
|
||||||
|
|
||||||
path.addRoundRect(rect, arrayRadius, Path.Direction.CW);
|
|
||||||
canvas.clipPath(path, Region.Op.REPLACE);
|
|
||||||
canvas.clipPath(path);
|
|
||||||
|
|
||||||
super.dispatchDraw(canvas);
|
|
||||||
|
|
||||||
canvas.restoreToCount(count);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,6 +6,9 @@ import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.design.widget.BottomSheetDialog;
|
import android.support.design.widget.BottomSheetDialog;
|
||||||
import android.support.design.widget.BottomSheetDialogFragment;
|
import android.support.design.widget.BottomSheetDialogFragment;
|
||||||
|
|
||||||
|
import code.name.monkey.appthemehelper.ThemeStore;
|
||||||
|
import code.name.monkey.appthemehelper.util.ColorUtil;
|
||||||
import code.name.monkey.retromusic.R;
|
import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.ui.activities.base.AbsThemeActivity;
|
import code.name.monkey.retromusic.ui.activities.base.AbsThemeActivity;
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||||
|
@ -16,24 +19,31 @@ import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||||
@SuppressLint("RestrictedApi")
|
@SuppressLint("RestrictedApi")
|
||||||
public class RoundedBottomSheetDialogFragment extends BottomSheetDialogFragment {
|
public class RoundedBottomSheetDialogFragment extends BottomSheetDialogFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getTheme() {
|
public int getTheme() {
|
||||||
//noinspection ConstantConditions
|
//noinspection ConstantConditions
|
||||||
return
|
if (PreferenceUtil.getInstance(getContext()).getGeneralTheme() == R.style.Theme_RetroMusic_Light) {
|
||||||
PreferenceUtil.getInstance(getContext()).getGeneralTheme() == R.style.Theme_RetroMusic_Light
|
return R.style.BottomSheetDialogTheme;
|
||||||
? R.style.BottomSheetDialogTheme : R.style.BottomSheetDialogThemeDark;
|
} else if (PreferenceUtil.getInstance(getContext()).getGeneralTheme() == R.style.Theme_RetroMusic_Color) {
|
||||||
}
|
int color = ThemeStore.primaryColor(getContext());
|
||||||
|
if (ColorUtil.isColorLight(color)) {
|
||||||
@NonNull
|
return R.style.BottomSheetDialogTheme;
|
||||||
@Override
|
} else {
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
return R.style.BottomSheetDialogThemeDark;
|
||||||
AbsThemeActivity absThemeActivity = (AbsThemeActivity) getActivity();
|
}
|
||||||
if (absThemeActivity != null) {
|
} else {
|
||||||
absThemeActivity.setLightNavigationBar(true);
|
return R.style.BottomSheetDialogTheme;
|
||||||
Dialog dialog = new BottomSheetDialog(getContext(), getTheme());
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
|
AbsThemeActivity absThemeActivity = (AbsThemeActivity) getActivity();
|
||||||
|
if (absThemeActivity != null) {
|
||||||
|
absThemeActivity.setLightNavigationBar(true);
|
||||||
|
}
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
return new BottomSheetDialog(getContext(), getTheme());
|
||||||
}
|
}
|
||||||
//noinspection ConstantConditions
|
|
||||||
return new BottomSheetDialog(getContext(), getTheme());
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -29,7 +29,7 @@ public class SansFontCollapsingToolbarLayout extends CollapsingToolbarLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(Context context) {
|
private void init(Context context) {
|
||||||
Typeface typefaceBold = TypefaceHelper.get(context, getResources().getString(R.string.sans_bold));
|
Typeface typefaceBold = TypefaceHelper.get(context, getResources().getString(R.string.circular_std_black));
|
||||||
setExpandedTitleTypeface(typefaceBold);
|
setExpandedTitleTypeface(typefaceBold);
|
||||||
setCollapsedTitleTypeface(typefaceBold);
|
setCollapsedTitleTypeface(typefaceBold);
|
||||||
|
|
||||||
|
|
1
app/src/main/res/drawable/bg_card_line.xml
Normal file
1
app/src/main/res/drawable/bg_card_line.xml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="2dp"
android:color="?attr/dividerColor" />
<corners
android:topLeftRadius="12dp"
android:topRightRadius="12dp" />
<solid android:color="@android:color/transparent" />
<padding android:bottom="8dp" />
</shape>
|
|
@ -1,8 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<corners
|
<corners
|
||||||
android:topLeftRadius="12dp"
|
android:topLeftRadius="12dp"
|
||||||
android:topRightRadius="12dp"/>
|
android:topRightRadius="12dp" />
|
||||||
<solid android:color="?attr/cardBackgroundColor"/>
|
<solid android:color="?attr/cardBackgroundColor" />
|
||||||
|
<padding android:top="8dp" />
|
||||||
</shape>
|
</shape>
|
|
@ -1,56 +1,63 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:id="@+id/app_bar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="96dp"
|
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
|
||||||
app:expandedTitleGravity="top"
|
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
|
||||||
app:title="@string/action_settings">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
style="@style/Toolbar48"
|
|
||||||
app:layout_collapseMode="pin"
|
|
||||||
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
|
|
||||||
app:title="@string/support_development"/>
|
|
||||||
|
|
||||||
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/background"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<FrameLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:id="@+id/content_frame"
|
android:id="@+id/app_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"/>
|
android:elevation="0dp"
|
||||||
|
app:elevation="0dp">
|
||||||
|
|
||||||
<FrameLayout
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
android:id="@+id/detail_content_frame"
|
android:id="@+id/collapsing_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"/>
|
app:titleEnabled="false">
|
||||||
</LinearLayout>
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/Toolbar48"
|
||||||
|
tools:ignore="UnusedAttribute"
|
||||||
|
app:layout_collapseMode="pin"
|
||||||
|
app:title="">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
tools:ignore="MissingPrefix"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/action_settings"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/background"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/content_frame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/detail_content_frame"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
</LinearLayout>
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
|
||||||
|
|
|
@ -1,116 +1,113 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
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_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
tools:ignore="UnusedAttribute">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<include layout="@layout/status_bar"/>
|
<FrameLayout
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<android.support.design.widget.CoordinatorLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:id="@+id/appbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:focusable="true"
|
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
|
||||||
android:id="@+id/collapsing_toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="96dp"
|
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
|
||||||
app:expandedTitleGravity="top"
|
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
app:layout_collapseMode="parallax"
|
|
||||||
app:layout_collapseParallaxMultiplier="0.7"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/home_toolbar"
|
|
||||||
style="@style/Toolbar"
|
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.IconImageView
|
|
||||||
android:id="@+id/search"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:padding="16dp"
|
|
||||||
android:src="@drawable/ic_search_white_24dp"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/title"
|
|
||||||
fontPath="@string/circular_std_black"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
|
||||||
tools:ignore="MissingPrefix"/>
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.CircularImageView
|
|
||||||
android:id="@+id/user_image"
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
app:civ_border="false"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</android.support.v7.widget.Toolbar>
|
|
||||||
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView
|
|
||||||
android:id="@+id/nested_scroll"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="60dp"
|
|
||||||
android:layout_marginEnd="60dp"
|
|
||||||
app:behavior_overlapTop="24dp"
|
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/container"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
|
tools:ignore="UnusedAttribute">
|
||||||
android:descendantFocusability="blocksDescendants"
|
|
||||||
android:elevation="@dimen/card_elevation"
|
|
||||||
android:layout_margin="4dp"
|
|
||||||
android:focusable="true"
|
|
||||||
android:focusableInTouchMode="true"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<include layout="@layout/abs_playlists"/>
|
<include layout="@layout/status_bar" />
|
||||||
|
|
||||||
<include layout="@layout/home_section_content"/>
|
</FrameLayout>
|
||||||
</LinearLayout>
|
|
||||||
</android.support.v4.widget.NestedScrollView>
|
<android.support.design.widget.CoordinatorLayout
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:id="@+id/appbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:focusable="true"
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
||||||
|
app:expandedTitleGravity="top"
|
||||||
|
app:expandedTitleMarginStart="16dp"
|
||||||
|
app:expandedTitleMarginTop="48dp"
|
||||||
|
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
||||||
|
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
app:layout_collapseMode="parallax"
|
||||||
|
app:layout_collapseParallaxMultiplier="0.7" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/home_toolbar"
|
||||||
|
style="@style/Toolbar"
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.IconImageView
|
||||||
|
android:id="@+id/search"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:src="@drawable/ic_search_white_24dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
|
android:id="@+id/user_image"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_weight="0"
|
||||||
|
app:civ_border="false" />
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<android.support.v4.widget.NestedScrollView
|
||||||
|
android:id="@+id/nested_scroll"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="60dp"
|
||||||
|
android:layout_marginEnd="60dp"
|
||||||
|
app:behavior_overlapTop="24dp"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:descendantFocusability="blocksDescendants"
|
||||||
|
android:focusable="true"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include layout="@layout/abs_playlists" />
|
||||||
|
|
||||||
|
<include layout="@layout/home_section_content" />
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v4.widget.NestedScrollView>
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -82,21 +82,20 @@
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView
|
<android.support.v4.widget.NestedScrollView
|
||||||
android:id="@+id/nested_scroll"
|
android:id="@+id/container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="64dp"
|
||||||
|
android:layout_marginEnd="64dp"
|
||||||
|
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
|
||||||
|
android:elevation="@dimen/card_elevation"
|
||||||
app:behavior_overlapTop="96dp"
|
app:behavior_overlapTop="96dp"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/container"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="64dp"
|
|
||||||
android:layout_marginStart="64dp"
|
|
||||||
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
|
|
||||||
android:descendantFocusability="blocksDescendants"
|
android:descendantFocusability="blocksDescendants"
|
||||||
android:elevation="@dimen/card_elevation"
|
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
|
@ -49,10 +49,10 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingBottom="16dp"
|
|
||||||
android:paddingEnd="16dp"
|
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingTop="8dp">
|
android:paddingTop="8dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:paddingBottom="16dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
|
@ -64,8 +64,6 @@
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:freezesText="true"
|
android:freezesText="true"
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
android:marqueeRepeatLimit="marquee_forever"
|
||||||
android:paddingLeft="15dip"
|
|
||||||
android:paddingRight="15dip"
|
|
||||||
android:scrollHorizontally="true"
|
android:scrollHorizontally="true"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
|
113
app/src/main/res/layout-sw600dp/fragment_banner_home.xml
Normal file
113
app/src/main/res/layout-sw600dp/fragment_banner_home.xml
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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:orientation="vertical">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<include layout="@layout/status_bar"/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.CoordinatorLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:id="@+id/appbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:focusable="true"
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="96dp"
|
||||||
|
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
||||||
|
app:expandedTitleGravity="top"
|
||||||
|
app:expandedTitleMarginStart="16dp"
|
||||||
|
app:expandedTitleMarginTop="48dp"
|
||||||
|
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
||||||
|
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
app:layout_collapseMode="parallax"
|
||||||
|
app:layout_collapseParallaxMultiplier="0.7"/>
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/home_toolbar"
|
||||||
|
style="@style/Toolbar"
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.IconImageView
|
||||||
|
android:id="@+id/search"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:src="@drawable/ic_search_white_24dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
tools:ignore="MissingPrefix"/>
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
|
android:id="@+id/user_image"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
app:civ_border="false"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<android.support.v4.widget.NestedScrollView
|
||||||
|
android:id="@+id/nested_scroll"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:behavior_overlapTop="24dp"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
|
||||||
|
android:descendantFocusability="blocksDescendants"
|
||||||
|
android:elevation="@dimen/card_elevation"
|
||||||
|
android:focusable="true"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include layout="@layout/abs_playlists"/>
|
||||||
|
|
||||||
|
<include layout="@layout/home_section_content"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v4.widget.NestedScrollView>
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
</LinearLayout>
|
|
@ -79,20 +79,19 @@
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView
|
<android.support.v4.widget.NestedScrollView
|
||||||
android:id="@+id/nested_scroll"
|
android:id="@+id/container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="96dp"
|
||||||
|
android:layout_marginEnd="96dp"
|
||||||
|
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
|
||||||
app:behavior_overlapTop="112dp"
|
app:behavior_overlapTop="112dp"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:elevation="@dimen/card_elevation"
|
|
||||||
android:id="@+id/container"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="64dp"
|
android:background="@drawable/bg_card_line"
|
||||||
android:layout_marginStart="64dp"
|
|
||||||
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
|
|
||||||
android:descendantFocusability="blocksDescendants"
|
android:descendantFocusability="blocksDescendants"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
|
|
|
@ -1,36 +1,45 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
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">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:id="@+id/app_bar"
|
android:id="@+id/app_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:elevation="0dp"
|
||||||
|
app:elevation="0dp">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="96dp"
|
android:layout_height="wrap_content"
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
|
||||||
app:expandedTitleGravity="top"
|
app:titleEnabled="false">
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
|
||||||
app:title="@string/action_settings">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar48"
|
style="@style/Toolbar48"
|
||||||
android:title="@string/action_settings"
|
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:title="@string/action_settings" />
|
app:title=""
|
||||||
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/action_settings"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
@ -79,21 +79,20 @@
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView
|
<android.support.v4.widget.NestedScrollView
|
||||||
android:id="@+id/nested_scroll"
|
android:id="@+id/container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="64dp"
|
||||||
|
android:layout_marginEnd="64dp"
|
||||||
|
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
|
||||||
app:behavior_overlapTop="96dp"
|
app:behavior_overlapTop="96dp"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/container"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="64dp"
|
android:background="@drawable/bg_card_line"
|
||||||
android:layout_marginStart="64dp"
|
|
||||||
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
|
|
||||||
android:descendantFocusability="blocksDescendants"
|
android:descendantFocusability="blocksDescendants"
|
||||||
android:elevation="@dimen/card_elevation"
|
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
|
@ -1,69 +1,92 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
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_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:elevation="0dp"
|
android:orientation="vertical">
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
|
|
||||||
<include layout="@layout/status_bar"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<android.support.design.widget.CoordinatorLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:id="@+id/appbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?colorPrimary"
|
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
|
|
||||||
<android.support.design.widget.CollapsingToolbarLayout
|
|
||||||
android:id="@+id/collapsing_toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="62dp"
|
|
||||||
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
|
|
||||||
app:titleEnabled="false">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
app:layout_collapseMode="parallax"
|
|
||||||
app:layout_collapseParallaxMultiplier="0.7"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
style="@style/Toolbar48"
|
|
||||||
android:background="?colorPrimary"
|
|
||||||
tools:ignore="UnusedAttribute"/>
|
|
||||||
|
|
||||||
|
|
||||||
</android.support.design.widget.CollapsingToolbarLayout>
|
|
||||||
|
|
||||||
<ViewStub
|
|
||||||
android:id="@+id/cab_stub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
app:layout_collapseMode="parallax"
|
|
||||||
app:layout_collapseParallaxMultiplier="0.7"/>
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/fragment_container"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:elevation="0dp"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
<include layout="@layout/status_bar" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.CoordinatorLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:id="@+id/app_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
|
||||||
|
app:titleEnabled="false">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_collapseMode="pin">
|
||||||
|
|
||||||
|
<ViewStub
|
||||||
|
android:id="@+id/cab_stub"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/Toolbar48"
|
||||||
|
app:title=""
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.IconImageView
|
||||||
|
android:id="@+id/search"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:background="?roundSelector"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:src="@drawable/ic_search_white_24dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</FrameLayout>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fragment_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -1,45 +1,53 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/root"
|
android:id="@+id/root"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:id="@+id/app_bar"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/app_bar"
|
||||||
android:layout_height="96dp"
|
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
|
||||||
app:expandedTitleGravity="top"
|
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
|
||||||
app:title="@string/action_about">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"
|
||||||
|
android:elevation="0dp"
|
||||||
|
app:elevation="0dp">
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.design.widget.CollapsingToolbarLayout xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/collapsing_toolbar"
|
||||||
style="@style/Toolbar48"
|
android:layout_width="match_parent"
|
||||||
app:layout_collapseMode="pin"
|
android:layout_height="wrap_content"
|
||||||
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
|
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
|
||||||
app:title="@string/support_development"/>
|
app:titleEnabled="false">
|
||||||
|
|
||||||
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
<android.support.v7.widget.Toolbar
|
||||||
</android.support.design.widget.AppBarLayout>
|
android:id="@+id/toolbar"
|
||||||
<android.support.v4.widget.NestedScrollView
|
style="@style/Toolbar48"
|
||||||
android:layout_width="match_parent"
|
app:layout_collapseMode="pin"
|
||||||
android:layout_height="match_parent"
|
app:title=""
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
<include layout="@layout/activity_about_content"/>
|
|
||||||
|
|
||||||
</android.support.v4.widget.NestedScrollView>
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/action_about"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<android.support.v4.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
<include layout="@layout/activity_about_content" />
|
||||||
|
|
||||||
|
</android.support.v4.widget.NestedScrollView>
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
|
@ -1,170 +1,167 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/root"
|
android:id="@+id/root"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:id="@+id/app_bar"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<android.support.design.widget.CollapsingToolbarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:id="@+id/collapsing_toolbar"
|
android:id="@+id/app_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
|
||||||
app:titleEnabled="false">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
||||||
|
app:titleEnabled="false">
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
app:layout_collapseMode="parallax">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:transitionName="@string/transition_album_art"
|
||||||
|
tools:src="@drawable/hemanth_s" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="72dp"
|
||||||
|
android:background="@drawable/shadow_down_strong" />
|
||||||
|
|
||||||
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/Toolbar48"
|
||||||
|
app:layout_collapseMode="pin"
|
||||||
|
app:title="" />
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<android.support.v4.widget.NestedScrollView
|
||||||
|
android:id="@+id/content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@android:color/transparent"
|
android:background="@drawable/bg_circular_top_corners"
|
||||||
app:layout_collapseMode="parallax">
|
app:behavior_overlapTop="24dp"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
<android.support.v7.widget.AppCompatImageView
|
|
||||||
android:id="@+id/image"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:transitionName="@string/transition_album_art"
|
|
||||||
tools:src="@drawable/hemanth_s"/>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="72dp"
|
|
||||||
android:background="@drawable/shadow_down_strong"/>
|
|
||||||
|
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
style="@style/Toolbar48"
|
|
||||||
app:layout_collapseMode="pin"
|
|
||||||
app:title=""/>
|
|
||||||
</android.support.design.widget.CollapsingToolbarLayout>
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:overScrollMode="never"
|
|
||||||
app:behavior_overlapTop="24dp"
|
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/content"
|
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/bg_circular_top_corners"
|
|
||||||
android:elevation="@dimen/card_elevation"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingTop="8dp"
|
|
||||||
android:paddingStart="8dp"
|
|
||||||
android:paddingEnd="8dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.CircularImageView
|
|
||||||
android:id="@+id/artist_image"
|
|
||||||
android:layout_width="52dp"
|
|
||||||
android:layout_height="52dp"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
app:civ_border="false"
|
|
||||||
app:civ_shadow="false"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="16dp"
|
|
||||||
android:paddingEnd="0dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
|
||||||
android:id="@+id/title"
|
|
||||||
fontPath="@string/circular_std_black"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxLines="2"
|
android:orientation="vertical">
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
|
||||||
tools:ignore="MissingPrefix"/>
|
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
|
<LinearLayout
|
||||||
android:id="@+id/text"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:orientation="horizontal"
|
||||||
android:layout_gravity="center"
|
android:paddingStart="8dp"
|
||||||
android:paddingTop="4dp"
|
android:paddingTop="8dp"
|
||||||
android:ellipsize="marquee"
|
android:paddingEnd="8dp">
|
||||||
android:focusable="true"
|
|
||||||
android:focusableInTouchMode="true"
|
|
||||||
android:freezesText="true"
|
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
|
||||||
android:scrollHorizontally="true"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
|
||||||
tools:ignore="MissingPrefix"
|
|
||||||
tools:text="Title"/>
|
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
|
android:id="@+id/artist_image"
|
||||||
|
android:layout_width="52dp"
|
||||||
|
android:layout_height="52dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_weight="0"
|
||||||
|
app:civ_border="false"
|
||||||
|
app:civ_shadow="false" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="0dp">
|
||||||
|
|
||||||
|
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
|
||||||
|
android:id="@+id/text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:ellipsize="marquee"
|
||||||
|
android:focusable="true"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:freezesText="true"
|
||||||
|
android:marqueeRepeatLimit="marquee_forever"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:scrollHorizontally="true"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
|
tools:ignore="MissingPrefix"
|
||||||
|
tools:text="Title" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||||
|
android:id="@+id/song_title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:text="@string/songs"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:nestedScrollingEnabled="false" />
|
||||||
|
|
||||||
|
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
||||||
|
android:id="@+id/more_title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:text="@string/songs"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/more_recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:nestedScrollingEnabled="false"
|
||||||
|
android:visibility="gone" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</android.support.v4.widget.NestedScrollView>
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
<android.support.design.widget.FloatingActionButton
|
||||||
android:id="@+id/song_title"
|
android:id="@+id/action_shuffle_all"
|
||||||
fontPath="@string/circular_std_black"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="12dp"
|
android:layout_gravity="bottom|end"
|
||||||
android:paddingBottom="12dp"
|
android:layout_margin="16dp"
|
||||||
android:paddingStart="16dp"
|
app:layout_behavior="code.name.monkey.retromusic.misc.ScrollAwareFABBehavior"
|
||||||
android:paddingEnd="16dp"
|
app:srcCompat="@drawable/ic_shuffle_white_24dp" />
|
||||||
android:text="@string/songs"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
|
||||||
tools:ignore="MissingPrefix"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
|
||||||
android:id="@+id/recycler_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:nestedScrollingEnabled="false"/>
|
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
|
|
||||||
android:id="@+id/more_title"
|
|
||||||
fontPath="@string/circular_std_black"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:paddingBottom="12dp"
|
|
||||||
android:paddingStart="16dp"
|
|
||||||
android:paddingEnd="16dp"
|
|
||||||
android:text="@string/songs"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:ignore="MissingPrefix"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
|
||||||
android:id="@+id/more_recycler_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:nestedScrollingEnabled="false"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</android.support.v4.widget.NestedScrollView>
|
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
|
||||||
android:id="@+id/action_shuffle_all"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="16dp"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
app:layout_behavior="code.name.monkey.retromusic.misc.ScrollAwareFABBehavior"
|
|
||||||
app:srcCompat="@drawable/ic_shuffle_white_24dp"/>
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
|
@ -1,178 +1,177 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/root"
|
android:id="@+id/root"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:id="@+id/app_bar"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<android.support.design.widget.CollapsingToolbarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:id="@+id/collapsing_toolbar"
|
android:id="@+id/app_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
app:contentScrim="@android:color/transparent"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
|
||||||
app:titleEnabled="false">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:contentScrim="@android:color/transparent"
|
||||||
|
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
||||||
|
app:titleEnabled="false">
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
app:layout_collapseMode="parallax">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:transitionName="@string/transition_artist_image" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="72dp"
|
||||||
|
android:background="@drawable/shadow_down_strong" />
|
||||||
|
|
||||||
|
|
||||||
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/Toolbar48"
|
||||||
|
app:layout_collapseMode="pin" />
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<android.support.v4.widget.NestedScrollView
|
||||||
|
android:id="@+id/content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@android:color/transparent"
|
android:background="@drawable/bg_circular_top_corners"
|
||||||
app:layout_collapseMode="parallax">
|
android:overScrollMode="never"
|
||||||
|
app:behavior_overlapTop="24dp"
|
||||||
<android.support.v7.widget.AppCompatImageView
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
android:id="@+id/image"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:transitionName="@string/transition_artist_image"/>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="72dp"
|
|
||||||
android:background="@drawable/shadow_down_strong"/>
|
|
||||||
|
|
||||||
|
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
style="@style/Toolbar48"
|
|
||||||
app:layout_collapseMode="pin"/>
|
|
||||||
</android.support.design.widget.CollapsingToolbarLayout>
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:overScrollMode="never"
|
|
||||||
app:behavior_overlapTop="24dp"
|
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/content"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/bg_circular_top_corners"
|
|
||||||
android:elevation="@dimen/card_elevation"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingStart="16dp"
|
|
||||||
android:paddingEnd="0dp"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatTextView
|
|
||||||
android:id="@+id/title"
|
|
||||||
fontPath="@string/circular_std_black"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxLines="2"
|
android:orientation="vertical">
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
|
||||||
tools:ignore="MissingPrefix"
|
|
||||||
tools:text="Title"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatTextView
|
<LinearLayout
|
||||||
android:id="@+id/text"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:gravity="center_vertical"
|
||||||
android:layout_gravity="center"
|
android:orientation="horizontal">
|
||||||
android:ellipsize="marquee"
|
|
||||||
android:focusable="true"
|
|
||||||
android:focusableInTouchMode="true"
|
|
||||||
android:freezesText="true"
|
|
||||||
android:marqueeRepeatLimit="marquee_forever"
|
|
||||||
android:scrollHorizontally="true"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
|
||||||
tools:ignore="MissingPrefix"
|
|
||||||
tools:text="Title"/>
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="0dp">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||||
|
tools:ignore="MissingPrefix"
|
||||||
|
tools:text="Title" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:id="@+id/text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:ellipsize="marquee"
|
||||||
|
android:focusable="true"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:freezesText="true"
|
||||||
|
android:marqueeRepeatLimit="marquee_forever"
|
||||||
|
android:scrollHorizontally="true"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
|
tools:ignore="MissingPrefix"
|
||||||
|
tools:text="Title" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/action_shuffle_all"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:src="@drawable/ic_shuffle_white_24dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:id="@+id/biography_title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:text="@string/biography"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:id="@+id/biography"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="4"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:id="@+id/album_title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:text="@string/albums"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
|
android:textColor="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/album_recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:nestedScrollingEnabled="false" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:id="@+id/song_title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:text="@string/songs"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||||
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:nestedScrollingEnabled="false" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</android.support.v4.widget.NestedScrollView>
|
||||||
<android.support.design.widget.FloatingActionButton
|
|
||||||
android:id="@+id/action_shuffle_all"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:src="@drawable/ic_shuffle_white_24dp"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatTextView
|
|
||||||
android:id="@+id/biography_title"
|
|
||||||
fontPath="@string/circular_std_black"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="12dp"
|
|
||||||
android:text="@string/biography"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:ignore="MissingPrefix"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatTextView
|
|
||||||
android:id="@+id/biography"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="16dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="4"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatTextView
|
|
||||||
android:id="@+id/album_title"
|
|
||||||
fontPath="@string/circular_std_black"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="12dp"
|
|
||||||
android:text="@string/albums"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
|
||||||
android:textColor="?android:attr/textColorPrimary"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
|
||||||
android:id="@+id/album_recycler_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:nestedScrollingEnabled="false"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatTextView
|
|
||||||
android:id="@+id/song_title"
|
|
||||||
fontPath="@string/circular_std_black"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="12dp"
|
|
||||||
android:text="@string/songs"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
|
||||||
tools:ignore="MissingPrefix"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
|
||||||
android:id="@+id/recycler_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:nestedScrollingEnabled="false"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</android.support.v4.widget.NestedScrollView>
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
|
|
@ -9,31 +9,41 @@
|
||||||
<android.support.design.widget.AppBarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:id="@+id/app_bar"
|
android:id="@+id/app_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:elevation="0dp"
|
||||||
|
app:elevation="0dp">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="96dp"
|
android:layout_height="wrap_content"
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
app:titleEnabled="false">
|
||||||
app:expandedTitleGravity="top"
|
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
|
||||||
app:title="@string/support_development">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar48"
|
style="@style/Toolbar48"
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
|
app:title=""
|
||||||
app:title="@string/support_development" />
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/support_development"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="?dividerColor" />
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView
|
<android.support.v4.widget.NestedScrollView
|
||||||
|
@ -61,10 +71,10 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="end|center_vertical"
|
android:gravity="end|center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingBottom="@dimen/md_content_padding_top"
|
|
||||||
android:paddingLeft="@dimen/md_dialog_frame_margin"
|
android:paddingLeft="@dimen/md_dialog_frame_margin"
|
||||||
|
android:paddingTop="@dimen/md_content_padding_top"
|
||||||
android:paddingRight="@dimen/md_dialog_frame_margin"
|
android:paddingRight="@dimen/md_dialog_frame_margin"
|
||||||
android:paddingTop="@dimen/md_content_padding_top">
|
android:paddingBottom="@dimen/md_content_padding_top">
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progress"
|
android:id="@+id/progress"
|
||||||
|
@ -88,8 +98,8 @@
|
||||||
android:id="@+id/list"
|
android:id="@+id/list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingEnd="6dp"
|
|
||||||
android:paddingStart="6dp"
|
android:paddingStart="6dp"
|
||||||
|
android:paddingEnd="6dp"
|
||||||
android:scrollbarStyle="outsideOverlay" />
|
android:scrollbarStyle="outsideOverlay" />
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<android.support.v7.widget.CardView
|
||||||
|
@ -118,11 +128,10 @@
|
||||||
tools:ignore="MissingPrefix" />
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatTextView
|
<android.support.v7.widget.AppCompatTextView
|
||||||
android:id="@+id/title"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingEnd="16dp"
|
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
android:text="@string/paypal_summary"
|
android:text="@string/paypal_summary"
|
||||||
android:textColor="@color/md_white_1000" />
|
android:textColor="@color/md_white_1000" />
|
||||||
|
|
||||||
|
|
|
@ -1,151 +1,160 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
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_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:id="@+id/app_bar"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/app_bar"
|
||||||
android:layout_height="96dp"
|
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
|
||||||
app:expandedTitleGravity="top"
|
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
style="@style/Toolbar48"
|
|
||||||
app:layout_collapseMode="pin"
|
|
||||||
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp">
|
|
||||||
|
|
||||||
<android.support.v7.widget.SwitchCompat
|
|
||||||
android:id="@+id/equalizer"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:layout_gravity="end"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/>
|
|
||||||
</android.support.v7.widget.Toolbar>
|
|
||||||
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
|
||||||
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/content"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:elevation="0dp"
|
||||||
android:orientation="horizontal">
|
app:elevation="0dp">
|
||||||
|
|
||||||
<TextView
|
<android.support.design.widget.CollapsingToolbarLayout xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/collapsing_toolbar"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_weight="0"
|
android:layout_height="wrap_content"
|
||||||
android:padding="16dp"
|
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
|
||||||
android:text="Select preset"
|
app:titleEnabled="false">
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/>
|
|
||||||
|
|
||||||
<Spinner
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/presets"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
style="@style/Toolbar48"
|
||||||
android:layout_height="wrap_content"
|
app:layout_collapseMode="pin"
|
||||||
android:layout_weight="1"
|
app:title=""
|
||||||
android:background="@android:color/transparent"/>
|
tools:ignore="UnusedAttribute">
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/equalizer"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.SwitchCompat
|
||||||
|
android:id="@+id/equalizer"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.v4.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/bass_boost"
|
android:id="@+id/content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0"
|
android:orientation="vertical">
|
||||||
android:padding="16dp"
|
|
||||||
android:text="@string/bass_boost"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/>
|
|
||||||
|
|
||||||
<SeekBar
|
<LinearLayout
|
||||||
android:id="@+id/bass_boost_strength"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:gravity="center_vertical"
|
||||||
android:layout_weight="1"
|
android:orientation="horizontal">
|
||||||
android:padding="16dp"
|
|
||||||
android:max="1000"
|
|
||||||
android:maxHeight="3dp"
|
|
||||||
android:progressDrawable="@drawable/color_progress_seek"
|
|
||||||
android:splitTrack="false"
|
|
||||||
android:thumb="@drawable/switch_thumb_material"
|
|
||||||
tools:progress="20"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:layout_weight="0"
|
||||||
android:orientation="horizontal">
|
android:padding="16dp"
|
||||||
|
android:text="Select preset"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||||
|
|
||||||
<TextView
|
<Spinner
|
||||||
android:id="@+id/virtualizer"
|
android:id="@+id/presets"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0"
|
android:layout_weight="1"
|
||||||
android:padding="16dp"
|
android:background="@android:color/transparent" />
|
||||||
android:text="@string/virtualizer"
|
</LinearLayout>
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/>
|
|
||||||
|
|
||||||
<SeekBar
|
<LinearLayout
|
||||||
android:id="@+id/virtualizer_strength"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:gravity="center_vertical"
|
||||||
android:layout_weight="1"
|
android:orientation="horizontal">
|
||||||
android:padding="16dp"
|
|
||||||
android:max="1000"
|
|
||||||
android:maxHeight="3dp"
|
|
||||||
android:progressDrawable="@drawable/color_progress_seek"
|
|
||||||
android:splitTrack="false"
|
|
||||||
android:thumb="@drawable/switch_thumb_material"
|
|
||||||
tools:progress="20"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:id="@+id/bands"
|
android:id="@+id/bass_boost"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="8dp"
|
android:layout_weight="0"
|
||||||
android:paddingEnd="8dp"
|
android:padding="16dp"
|
||||||
android:orientation="vertical"/>
|
android:text="@string/bass_boost"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||||
|
|
||||||
<TextView
|
<SeekBar
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/bass_boost_strength"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:padding="16dp"
|
android:layout_height="wrap_content"
|
||||||
android:text="*Warning: It's alpha version. We don't recommend to use Equalizer, We believe without using Equalizer songs has better sound quality."/>
|
android:layout_weight="1"
|
||||||
</LinearLayout>
|
android:max="1000"
|
||||||
</android.support.v4.widget.NestedScrollView>
|
android:maxHeight="3dp"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:progressDrawable="@drawable/color_progress_seek"
|
||||||
|
android:splitTrack="false"
|
||||||
|
android:thumb="@drawable/switch_thumb_material"
|
||||||
|
tools:progress="20" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/virtualizer"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:text="@string/virtualizer"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||||
|
|
||||||
|
<SeekBar
|
||||||
|
android:id="@+id/virtualizer_strength"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:max="1000"
|
||||||
|
android:maxHeight="3dp"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:progressDrawable="@drawable/color_progress_seek"
|
||||||
|
android:splitTrack="false"
|
||||||
|
android:thumb="@drawable/switch_thumb_material"
|
||||||
|
tools:progress="20" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/bands"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:text="*Warning: It's alpha version. We don't recommend to use Equalizer, We believe without using Equalizer songs has better sound quality." />
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v4.widget.NestedScrollView>
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
|
@ -7,31 +7,43 @@
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/app_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:focusable="true"
|
android:elevation="0dp"
|
||||||
tools:ignore="UnusedAttribute">
|
app:elevation="0dp">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="96dp"
|
android:layout_height="wrap_content"
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
app:layout_scrollFlags="scroll|enterAlways"
|
||||||
app:expandedTitleGravity="top"
|
app:titleEnabled="false">
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar48"
|
style="@style/Toolbar48"
|
||||||
tools:ignore="UnusedAttribute" />
|
app:layout_collapseMode="pin"
|
||||||
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
app:title=""
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/licenses"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.v4.widget.NestedScrollView
|
||||||
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:layout_gravity="fill_vertical"
|
android:layout_gravity="fill_vertical"
|
||||||
|
|
|
@ -1,55 +1,76 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
android:id="@+id/root"
|
||||||
android:id="@+id/root"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:id="@+id/app_bar"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:background="?colorPrimary">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/app_bar"
|
||||||
android:layout_height="96dp"
|
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
|
||||||
app:expandedTitleGravity="top"
|
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="wrap_content"
|
||||||
app:layout_collapseMode="parallax"
|
android:elevation="0dp"
|
||||||
app:layout_collapseParallaxMultiplier="0.7"/>
|
app:elevation="0dp">
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/collapsing_toolbar"
|
||||||
style="@style/Toolbar48"
|
android:layout_width="match_parent"
|
||||||
tools:ignore="UnusedAttribute"/>
|
android:layout_height="wrap_content"
|
||||||
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
app:layout_scrollFlags="scroll|enterAlways"
|
||||||
|
app:titleEnabled="false">
|
||||||
|
|
||||||
<TextView
|
<FrameLayout
|
||||||
android:id="@+id/player_queue_sub_header"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content">
|
||||||
android:layout_height="48dp"
|
|
||||||
android:paddingLeft="16dp"
|
|
||||||
android:paddingRight="16dp"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="@string/up_next"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"/>
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
<FrameLayout
|
<View
|
||||||
android:id="@+id/fragment_container"
|
android:id="@+id/cab_stub"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="48dp" />
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/Toolbar48"
|
||||||
|
app:layout_collapseMode="pin"
|
||||||
|
app:title=""
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/queue"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</FrameLayout>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/player_queue_sub_header"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:text="@string/up_next"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body2" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="?dividerColor" />
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fragment_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
|
@ -23,31 +23,51 @@
|
||||||
android:id="@+id/app_bar"
|
android:id="@+id/app_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:focusable="true"
|
android:elevation="0dp"
|
||||||
tools:ignore="UnusedAttribute">
|
app:elevation="0dp">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
android:id="@+id/collapsing_toolbar"
|
android:id="@+id/collapsing_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="96dp"
|
android:layout_height="wrap_content"
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
app:layout_scrollFlags="scroll|enterAlways"
|
||||||
app:expandedTitleGravity="top"
|
app:titleEnabled="false">
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<FrameLayout
|
||||||
android:id="@+id/toolbar"
|
android:layout_width="match_parent"
|
||||||
style="@style/Toolbar48"
|
android:layout_height="wrap_content">
|
||||||
tools:ignore="UnusedAttribute" />
|
|
||||||
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
|
||||||
|
|
||||||
<ViewStub
|
<View
|
||||||
android:id="@+id/cab_stub"
|
android:id="@+id/cab_stub"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/Toolbar48"
|
||||||
|
app:layout_collapseMode="pin"
|
||||||
|
app:title=""
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/queue"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</FrameLayout>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp" />
|
android:layout_height="1dp"
|
||||||
|
android:background="?dividerColor" />
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
|
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
|
||||||
|
|
|
@ -1,124 +1,130 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout 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:orientation="vertical">
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<include layout="@layout/status_bar"/>
|
|
||||||
</FrameLayout>
|
|
||||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/root"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
>
|
android:orientation="vertical">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:id="@+id/appbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="96dp"
|
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
|
||||||
app:expandedTitleGravity="top"
|
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
|
||||||
app:title="@string/action_search">
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
style="@style/Toolbar48"
|
|
||||||
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
|
|
||||||
app:title="@string/action_search"
|
|
||||||
tools:ignore="UnusedAttribute"/>
|
|
||||||
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
|
||||||
android:id="@+id/search"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
app:cardCornerRadius="25dp">
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingStart="8dp"
|
|
||||||
android:paddingEnd="8dp"
|
|
||||||
android:gravity="center_vertical">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.IconImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:padding="12dp"
|
|
||||||
app:srcCompat="@drawable/ic_search_white_24dp"/>
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/search_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@null"
|
|
||||||
android:hint="@string/search_hint"
|
|
||||||
android:inputType="text|textAutoComplete"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.IconImageView
|
|
||||||
android:id="@+id/voice_search"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:background="?roundSelector"
|
|
||||||
app:srcCompat="@drawable/ic_mic_white_24dp"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/search_toolbar"
|
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatTextView
|
|
||||||
android:id="@android:id/empty"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:paddingTop="48dp"
|
|
||||||
android:paddingBottom="48dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/no_results"
|
|
||||||
android:textColor="?android:attr/textColorPrimary"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:visibility="gone"
|
|
||||||
tools:visibility="visible"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
<include layout="@layout/status_bar" />
|
||||||
android:id="@+id/recycler_view"
|
|
||||||
android:scrollbarStyle="outsideOverlay"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:scrollbars="vertical"
|
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
|
||||||
|
<android.support.design.widget.CoordinatorLayout
|
||||||
|
android:id="@+id/root"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:id="@+id/app_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:elevation="0dp"
|
||||||
|
app:elevation="0dp">
|
||||||
|
|
||||||
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:titleEnabled="false">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/Toolbar48"
|
||||||
|
app:layout_collapseMode="pin">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/action_search"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/search"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:cardCornerRadius="25dp">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp">
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.IconImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:padding="12dp"
|
||||||
|
app:srcCompat="@drawable/ic_search_white_24dp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/search_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:hint="@string/search_hint"
|
||||||
|
android:inputType="text|textAutoComplete" />
|
||||||
|
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.IconImageView
|
||||||
|
android:id="@+id/voice_search"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:background="?roundSelector"
|
||||||
|
android:padding="8dp"
|
||||||
|
app:srcCompat="@drawable/ic_mic_white_24dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/search_toolbar"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:id="@android:id/empty"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingTop="48dp"
|
||||||
|
android:paddingBottom="48dp"
|
||||||
|
android:text="@string/no_results"
|
||||||
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:scrollbarStyle="outsideOverlay"
|
||||||
|
android:scrollbars="vertical"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
</FrameLayout>
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -1,37 +1,43 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
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">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:id="@+id/app_bar"
|
android:id="@+id/app_bar"
|
||||||
|
app:elevation="0dp"
|
||||||
|
android:elevation="0dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="96dp"
|
android:layout_height="wrap_content"
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
app:titleEnabled="false">
|
||||||
app:expandedTitleGravity="top"
|
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
|
||||||
app:title="@string/action_settings">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar48"
|
style="@style/Toolbar48"
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
|
app:title=""
|
||||||
app:title="@string/support_development" />
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/action_settings"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
1
app/src/main/res/layout/dialog_changelog.xml
Normal file
1
app/src/main/res/layout/dialog_changelog.xml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<WebView
android:id="@+id/web_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none" />
</FrameLayout>
|
|
@ -1,107 +1,106 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
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_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
tools:ignore="UnusedAttribute">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<include layout="@layout/status_bar"/>
|
<FrameLayout
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<android.support.design.widget.CoordinatorLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:id="@+id/appbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
|
|
||||||
<android.support.design.widget.CollapsingToolbarLayout
|
|
||||||
android:id="@+id/collapsing_toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="62dp"
|
|
||||||
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
|
|
||||||
app:titleEnabled="false">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
app:layout_collapseMode="parallax"
|
|
||||||
app:layout_collapseParallaxMultiplier="0.7"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/home_toolbar"
|
|
||||||
style="@style/Toolbar48"
|
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.IconImageView
|
|
||||||
android:id="@+id/search"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:padding="12dp"
|
|
||||||
android:src="@drawable/ic_search_white_24dp"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/title"
|
|
||||||
fontPath="@string/circular_std_black"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/app_name"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
|
||||||
tools:ignore="MissingPrefix"/>
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.CircularImageView
|
|
||||||
android:id="@+id/user_image"
|
|
||||||
android:layout_width="32dp"
|
|
||||||
android:layout_height="32dp"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
app:civ_border="false"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</android.support.v7.widget.Toolbar>
|
|
||||||
</android.support.design.widget.CollapsingToolbarLayout>
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView
|
|
||||||
android:id="@+id/nested_scroll"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="@dimen/overlap_toolbar_height"
|
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/container"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/bg_bottom_sheet_dialog_fragment"
|
tools:ignore="UnusedAttribute">
|
||||||
android:descendantFocusability="blocksDescendants"
|
|
||||||
android:elevation="4dp"
|
|
||||||
android:focusable="true"
|
|
||||||
android:focusableInTouchMode="true"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<include layout="@layout/abs_playlists"/>
|
<include layout="@layout/status_bar" />
|
||||||
|
|
||||||
<include layout="@layout/home_section_content"/>
|
</FrameLayout>
|
||||||
</LinearLayout>
|
|
||||||
</android.support.v4.widget.NestedScrollView>
|
<android.support.design.widget.CoordinatorLayout
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:id="@+id/appbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:elevation="0dp"
|
||||||
|
app:elevation="0dp"
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_scrollFlags="scroll|enterAlways"
|
||||||
|
app:titleEnabled="false">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/home_toolbar"
|
||||||
|
style="@style/Toolbar48"
|
||||||
|
app:layout_collapseMode="pin"
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.IconImageView
|
||||||
|
android:id="@+id/search"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:background="?roundSelector"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:src="@drawable/ic_search_white_24dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
|
android:id="@+id/user_image"
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_weight="0"
|
||||||
|
app:civ_border="false" />
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="?dividerColor" />
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<android.support.v4.widget.NestedScrollView
|
||||||
|
android:id="@+id/container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:descendantFocusability="blocksDescendants"
|
||||||
|
android:focusable="true"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include layout="@layout/abs_playlists" />
|
||||||
|
|
||||||
|
<include layout="@layout/home_section_content" />
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v4.widget.NestedScrollView>
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -1,120 +1,121 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
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_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:elevation="0dp"
|
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
|
|
||||||
<include layout="@layout/status_bar"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<android.support.design.widget.CoordinatorLayout
|
|
||||||
android:id="@+id/coordinator_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:id="@+id/appbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
|
|
||||||
<android.support.design.widget.CollapsingToolbarLayout
|
|
||||||
android:id="@+id/collapsing_toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="62dp"
|
|
||||||
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
|
|
||||||
app:titleEnabled="false">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
app:layout_collapseMode="parallax"
|
|
||||||
app:layout_collapseParallaxMultiplier="0.7"/>
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<ViewStub
|
|
||||||
android:id="@+id/cab_stub"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
app:layout_collapseMode="parallax"
|
|
||||||
app:layout_collapseParallaxMultiplier="0.7"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
style="@style/Toolbar48"
|
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/title"
|
|
||||||
fontPath="@string/circular_std_black"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:text="@string/folders"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
|
||||||
tools:ignore="MissingPrefix"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</android.support.v7.widget.Toolbar>
|
|
||||||
</FrameLayout>
|
|
||||||
</android.support.design.widget.CollapsingToolbarLayout>
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/container"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginTop="@dimen/overlap_toolbar_height"
|
|
||||||
android:background="@drawable/bg_circular_top_corners"
|
|
||||||
android:elevation="@dimen/card_elevation"
|
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
|
||||||
|
|
||||||
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
|
|
||||||
android:id="@+id/recycler_view"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:clipToPadding="false"
|
|
||||||
android:layoutAnimation="@anim/layout_animation_fall_down"
|
|
||||||
android:scrollbars="none"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@android:id/empty"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:elevation="0dp"
|
||||||
android:text="@string/empty"
|
tools:ignore="UnusedAttribute">
|
||||||
android:textColor="?android:textColorSecondary"
|
|
||||||
android:textSize="@dimen/empty_text_size"/>
|
<include layout="@layout/status_bar" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
<android.support.design.widget.CoordinatorLayout
|
||||||
|
android:id="@+id/coordinator_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.BreadCrumbLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:id="@+id/bread_crumbs"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/tab_height"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0"
|
tools:ignore="UnusedAttribute">
|
||||||
android:paddingStart="60dp"
|
|
||||||
android:paddingEnd="8dp"
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
android:elevation="6dp"/>
|
android:id="@+id/collapsing_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
|
||||||
|
app:titleEnabled="false">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
app:layout_collapseMode="parallax"
|
||||||
|
app:layout_collapseParallaxMultiplier="0.7" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_collapseMode="pin">
|
||||||
|
|
||||||
|
<ViewStub
|
||||||
|
android:id="@+id/cab_stub"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/Toolbar48"
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/folders"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</FrameLayout>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
|
||||||
|
android:id="@+id/recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:layoutAnimation="@anim/layout_animation_fall_down"
|
||||||
|
android:scrollbars="none" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@android:id/empty"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:text="@string/empty"
|
||||||
|
android:textColor="?android:textColorSecondary"
|
||||||
|
android:textSize="@dimen/empty_text_size" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="?dividerColor" />
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.BreadCrumbLayout
|
||||||
|
android:id="@+id/bread_crumbs"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/tab_height"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:elevation="6dp"
|
||||||
|
android:paddingStart="60dp"
|
||||||
|
android:paddingEnd="8dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -15,13 +15,8 @@
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
||||||
android:id="@+id/collapsing_toolbar"
|
android:id="@+id/collapsing_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="228dp"
|
android:layout_height="196dp"
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
|
||||||
app:contentScrim="?attr/colorPrimary"
|
app:contentScrim="?attr/colorPrimary"
|
||||||
app:expandedTitleGravity="top"
|
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
||||||
app:statusBarScrim="?attr/colorPrimary"
|
app:statusBarScrim="?attr/colorPrimary"
|
||||||
app:titleEnabled="false">
|
app:titleEnabled="false">
|
||||||
|
@ -50,7 +45,8 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
android:padding="16dp"
|
android:background="?roundSelector"
|
||||||
|
android:padding="12dp"
|
||||||
android:src="@drawable/ic_search_white_24dp" />
|
android:src="@drawable/ic_search_white_24dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
@ -1,58 +1,89 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
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_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
tools:ignore="UnusedAttribute">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<include layout="@layout/status_bar"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<android.support.design.widget.CoordinatorLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
|
||||||
android:id="@+id/app_bar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout
|
|
||||||
android:id="@+id/collapsing_toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="96dp"
|
|
||||||
app:collapsedTitleTextAppearance="@style/CollapsedTitleAppearance"
|
|
||||||
app:expandedTitleGravity="top"
|
|
||||||
app:expandedTitleMarginStart="16dp"
|
|
||||||
app:expandedTitleMarginTop="48dp"
|
|
||||||
app:expandedTitleTextAppearance="@style/ExpandedTitleAppearance"
|
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
|
||||||
app:title="@string/action_settings">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"/>
|
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
style="@style/Toolbar48"
|
|
||||||
app:layout_collapseMode="pin"/>
|
|
||||||
|
|
||||||
</code.name.monkey.retromusic.views.SansFontCollapsingToolbarLayout>
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/fragment_container"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="match_parent"
|
tools:ignore="UnusedAttribute">
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
|
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
<include layout="@layout/status_bar" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.CoordinatorLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:id="@+id/app_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<android.support.design.widget.CollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
|
||||||
|
app:titleEnabled="false">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_collapseMode="pin">
|
||||||
|
|
||||||
|
<ViewStub
|
||||||
|
android:id="@+id/cab_stub"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
style="@style/Toolbar48"
|
||||||
|
app:title=""
|
||||||
|
tools:ignore="UnusedAttribute">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.IconImageView
|
||||||
|
android:id="@+id/search"
|
||||||
|
android:background="?roundSelector"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:src="@drawable/ic_search_white_24dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||||
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
</FrameLayout>
|
||||||
|
</android.support.design.widget.CollapsingToolbarLayout>
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/fragment_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
1
app/src/main/res/layout/home_section_recycler_view.xml
Normal file
1
app/src/main/res/layout/home_section_recycler_view.xml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp"
android:text="@string/recent_artists"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:attr/textColorPrimary"
tools:ignore="MissingPrefix"
tools:text="@string/rate_app"
tools:textColor="@color/md_black_1000" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="12dp"
android:background="?attr/dividerColor" />
</LinearLayout>
|
|
@ -1,209 +1,211 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="2">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:cardCornerRadius="6dp"
|
|
||||||
app:cardUseCompatPadding="true">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/image_1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:scaleType="centerCrop"/>
|
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="2.68"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
<android.support.v7.widget.CardView
|
android:orientation="horizontal">
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:cardCornerRadius="6dp"
|
|
||||||
app:cardUseCompatPadding="true">
|
|
||||||
|
|
||||||
<ImageView
|
<FrameLayout
|
||||||
android:id="@+id/image_2"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="2">
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"/>
|
android:layout_weight="2.68"
|
||||||
</android.support.v7.widget.CardView>
|
android:gravity="center"
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
android:orientation="vertical">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<android.support.v7.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:cardCornerRadius="6dp"
|
app:cardCornerRadius="8dp"
|
||||||
app:cardUseCompatPadding="true">
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/image_3"
|
android:id="@+id/image_2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_3"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:scaleType="centerCrop"/>
|
android:layout_weight="2"
|
||||||
</android.support.v7.widget.CardView>
|
android:minHeight="100dp">
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
||||||
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image_4"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
</FrameLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="2"
|
|
||||||
android:minHeight="100dp">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
<android.support.v7.widget.CardView
|
android:orientation="horizontal">
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:cardCornerRadius="6dp"
|
|
||||||
app:cardUseCompatPadding="true">
|
|
||||||
|
|
||||||
<ImageView
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
android:id="@+id/image_4"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:scaleType="centerCrop"/>
|
android:layout_weight="1">
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
||||||
</FrameLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<android.support.v7.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/image_5"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_weight="1">
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
app:cardCornerRadius="6dp"
|
android:layout_weight="1">
|
||||||
app:cardUseCompatPadding="true">
|
|
||||||
|
|
||||||
<ImageView
|
<android.support.v7.widget.CardView
|
||||||
android:id="@+id/image_5"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="match_parent"
|
app:cardCornerRadius="8dp"
|
||||||
android:scaleType="centerCrop"/>
|
app:cardUseCompatPadding="true">
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/image_6"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_weight="1">
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
app:cardCornerRadius="6dp"
|
android:layout_weight="1">
|
||||||
app:cardUseCompatPadding="true">
|
|
||||||
|
|
||||||
<ImageView
|
<android.support.v7.widget.CardView
|
||||||
android:id="@+id/image_6"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="match_parent"
|
app:cardCornerRadius="8dp"
|
||||||
android:scaleType="centerCrop"/>
|
app:cardUseCompatPadding="true">
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1">
|
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/image_7"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="match_parent"
|
||||||
app:cardCornerRadius="6dp"
|
android:layout_height="match_parent"
|
||||||
app:cardUseCompatPadding="true">
|
android:scaleType="centerCrop" />
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
|
||||||
<ImageView
|
<Space
|
||||||
android:id="@+id/image_7"
|
android:layout_width="1dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="match_parent" />
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:scaleType="centerCrop"/>
|
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
||||||
|
|
||||||
<Space
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
android:layout_width="1dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
<android.support.v7.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1">
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/image_8"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="match_parent"
|
||||||
app:cardCornerRadius="6dp"
|
android:layout_height="match_parent"
|
||||||
app:cardUseCompatPadding="true">
|
android:scaleType="centerCrop" />
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
|
||||||
<ImageView
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
android:id="@+id/image_8"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_weight="1">
|
||||||
android:scaleType="centerCrop"/>
|
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
<android.support.v7.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1">
|
app:cardCornerRadius="6dp"
|
||||||
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/image_9"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="match_parent"
|
||||||
app:cardCornerRadius="6dp"
|
android:layout_height="match_parent"
|
||||||
app:cardUseCompatPadding="true">
|
android:scaleType="centerCrop" />
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
<ImageView
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
android:id="@+id/image_9"
|
</LinearLayout>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:scaleType="centerCrop"/>
|
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -8,8 +8,9 @@
|
||||||
<android.support.v7.widget.CardView
|
<android.support.v7.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="4dp"
|
app:cardCornerRadius="8dp"
|
||||||
app:contentPadding="16dp">
|
app:cardUseCompatPadding="true"
|
||||||
|
app:contentPadding="12dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -29,8 +30,8 @@
|
||||||
tools:ignore="MissingPrefix" />
|
tools:ignore="MissingPrefix" />
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
android:layout_width="40dp"
|
android:layout_width="36dp"
|
||||||
android:layout_height="40dp">
|
android:layout_height="36dp">
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.IconImageView
|
<code.name.monkey.retromusic.views.IconImageView
|
||||||
android:id="@+id/image"
|
android:id="@+id/image"
|
||||||
|
|
|
@ -1,69 +1,67 @@
|
||||||
<?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: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_height="wrap_content"
|
|
||||||
android:background="?rectSelector"
|
|
||||||
tools:ignore="MissingPrefix">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:background="?rectSelector"
|
||||||
android:orientation="vertical"
|
tools:ignore="MissingPrefix">
|
||||||
tools:ignore="UnusedAttribute,UselessParent">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
|
||||||
android:id="@+id/image_container"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_margin="4dp">
|
|
||||||
<code.name.monkey.retromusic.views.RoundCornerFrameLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:corner_radius="200dp"
|
|
||||||
>
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/image"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
tools:background="@color/md_red_400"
|
|
||||||
tools:ignore="ContentDescription"/>
|
|
||||||
</code.name.monkey.retromusic.views.RoundCornerFrameLayout>
|
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:paddingTop="8dp"
|
|
||||||
android:paddingBottom="8dp"
|
|
||||||
android:paddingStart="4dp"
|
|
||||||
android:paddingEnd="4dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/title"
|
|
||||||
fontPath="@string/circular_std_black"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:singleLine="true"
|
android:orientation="vertical"
|
||||||
android:textColor="?android:attr/textColorPrimary"/>
|
tools:ignore="UnusedAttribute,UselessParent">
|
||||||
|
|
||||||
<TextView
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
android:id="@+id/text"
|
android:id="@+id/image_container"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:paddingTop="4dp"
|
android:layout_margin="4dp">
|
||||||
android:gravity="center"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
|
||||||
android:textSize="12sp"/>
|
|
||||||
|
|
||||||
|
<code.name.monkey.retromusic.views.CircularImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
app:civ_border="false"
|
||||||
|
app:civ_shadow="false"
|
||||||
|
tools:background="@color/md_red_400"
|
||||||
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="4dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingEnd="4dp"
|
||||||
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
fontPath="@string/circular_std_black"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="?android:attr/textColorPrimary" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
|
@ -1,40 +1,38 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
|
||||||
android:layout_width="128dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<code.name.monkey.retromusic.views.WidthFitSquareLayout
|
||||||
android:id="@+id/image_container_card"
|
android:layout_width="136dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:orientation="vertical">
|
||||||
android:layout_margin="8dp"
|
|
||||||
app:cardCornerRadius="6dp"
|
|
||||||
app:cardElevation="4dp"
|
|
||||||
app:cardPreventCornerOverlap="true">
|
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatImageView
|
<android.support.v7.widget.CardView
|
||||||
android:id="@+id/image"
|
android:id="@+id/image_container_card"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardPreventCornerOverlap="true">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop" />
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:scaleType="centerCrop"
|
android:ellipsize="end"
|
||||||
/>
|
android:maxLines="1"
|
||||||
</android.support.v7.widget.CardView>
|
android:padding="12dp"
|
||||||
|
android:textColor="?android:attr/textColorPrimary" />
|
||||||
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/title"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textColor="?android:attr/textColorPrimary"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -11,8 +11,7 @@
|
||||||
android:id="@+id/image_container"
|
android:id="@+id/image_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="182dp"
|
android:layout_height="182dp"
|
||||||
app:cardCornerRadius="8dp"
|
app:cardCornerRadius="12dp"
|
||||||
app:cardElevation="6dp"
|
|
||||||
app:cardUseCompatPadding="true">
|
app:cardUseCompatPadding="true">
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatImageView
|
<android.support.v7.widget.AppCompatImageView
|
||||||
|
@ -39,9 +38,9 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:paddingEnd="8dp"
|
|
||||||
android:paddingStart="8dp"
|
android:paddingStart="8dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
tools:ignore="MissingPrefix"
|
tools:ignore="MissingPrefix"
|
||||||
tools:text="My top tracks" />
|
tools:text="My top tracks" />
|
||||||
|
|
|
@ -1,78 +1,71 @@
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:context=".DrawerActivity">
|
tools:context=".DrawerActivity">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_search"
|
android:id="@+id/action_shuffle_all"
|
||||||
android:icon="@drawable/ic_search_white_24dp"
|
android:icon="@drawable/ic_shuffle_white_24dp"
|
||||||
android:title="@string/action_search"
|
android:title="@string/action_shuffle_all"
|
||||||
app:showAsAction="ifRoom"/>
|
app:showAsAction="never" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_shuffle_all"
|
android:id="@+id/action_grid_size"
|
||||||
android:icon="@drawable/ic_shuffle_white_24dp"
|
android:title="@string/action_grid_size">
|
||||||
android:title="@string/action_shuffle_all"
|
<menu>
|
||||||
app:showAsAction="never"/>
|
<group
|
||||||
|
android:id="@+id/group_grid_size"
|
||||||
|
android:checkableBehavior="single"
|
||||||
|
tools:ignore="HardcodedText">
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_grid_size_1"
|
||||||
|
android:title="@string/grid_size_1" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_grid_size_2"
|
||||||
|
android:title="@string/grid_size_2" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_grid_size_3"
|
||||||
|
android:title="@string/grid_size_3" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_grid_size_4"
|
||||||
|
android:title="@string/grid_size_4" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_grid_size_5"
|
||||||
|
android:title="@string/grid_size_5" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_grid_size_6"
|
||||||
|
android:title="@string/grid_size_6" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_grid_size_7"
|
||||||
|
android:title="@string/grid_size_7" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_grid_size_8"
|
||||||
|
android:title="@string/grid_size_8" />
|
||||||
|
</group>
|
||||||
|
</menu>
|
||||||
|
</item>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_grid_size"
|
android:id="@+id/action_sort_order"
|
||||||
android:title="@string/action_grid_size">
|
android:title="@string/action_sort_order">
|
||||||
<menu>
|
<menu></menu>
|
||||||
<group
|
</item>
|
||||||
android:id="@+id/group_grid_size"
|
|
||||||
android:checkableBehavior="single"
|
|
||||||
tools:ignore="HardcodedText">
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_grid_size_1"
|
|
||||||
android:title="@string/grid_size_1"/>
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_grid_size_2"
|
|
||||||
android:title="@string/grid_size_2"/>
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_grid_size_3"
|
|
||||||
android:title="@string/grid_size_3"/>
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_grid_size_4"
|
|
||||||
android:title="@string/grid_size_4"/>
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_grid_size_5"
|
|
||||||
android:title="@string/grid_size_5"/>
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_grid_size_6"
|
|
||||||
android:title="@string/grid_size_6"/>
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_grid_size_7"
|
|
||||||
android:title="@string/grid_size_7"/>
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_grid_size_8"
|
|
||||||
android:title="@string/grid_size_8"/>
|
|
||||||
</group>
|
|
||||||
</menu>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_sort_order"
|
android:id="@+id/action_sleep_timer"
|
||||||
android:title="@string/action_sort_order">
|
android:orderInCategory="98"
|
||||||
<menu>
|
android:title="@string/action_sleep_timer"
|
||||||
</menu>
|
app:showAsAction="never" />
|
||||||
</item>
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_sleep_timer"
|
android:id="@+id/action_equalizer"
|
||||||
android:orderInCategory="98"
|
android:orderInCategory="99"
|
||||||
android:title="@string/action_sleep_timer"
|
android:title="@string/equalizer"
|
||||||
app:showAsAction="never"/>
|
app:showAsAction="never" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_equalizer"
|
android:id="@+id/action_settings"
|
||||||
android:orderInCategory="99"
|
android:orderInCategory="100"
|
||||||
android:title="@string/equalizer"
|
android:title="@string/action_settings"
|
||||||
app:showAsAction="never"/>
|
app:showAsAction="never" />
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/action_settings"
|
|
||||||
android:orderInCategory="100"
|
|
||||||
android:title="@string/action_settings"
|
|
||||||
app:showAsAction="never"/>
|
|
||||||
</menu>
|
</menu>
|
|
@ -5,6 +5,7 @@
|
||||||
<item>@string/only_on_wifi</item>
|
<item>@string/only_on_wifi</item>
|
||||||
<item>@string/never</item>
|
<item>@string/never</item>
|
||||||
</array>
|
</array>
|
||||||
|
|
||||||
<string-array name="pref_general_theme_list_titles">
|
<string-array name="pref_general_theme_list_titles">
|
||||||
<item>@string/light_theme_name</item>
|
<item>@string/light_theme_name</item>
|
||||||
<item>@string/dark_theme_name</item>
|
<item>@string/dark_theme_name</item>
|
||||||
|
@ -16,19 +17,23 @@
|
||||||
<item>@string/normal_style</item>
|
<item>@string/normal_style</item>
|
||||||
<item>@string/card_style</item>
|
<item>@string/card_style</item>
|
||||||
<item>@string/card_color_style</item>
|
<item>@string/card_color_style</item>
|
||||||
|
<item>@string/card_circular_style</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="pref_grid_style_list_values">
|
<string-array name="pref_grid_style_list_values">
|
||||||
<item>0</item>
|
<item>0</item>
|
||||||
<item>1</item>
|
<item>1</item>
|
||||||
<item>2</item>
|
<item>2</item>
|
||||||
|
<item>3</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<array name="pref_grid_style_layout">
|
<array name="pref_grid_style_layout">
|
||||||
<item>@layout/item_grid</item>
|
<item>@layout/item_grid</item>
|
||||||
<item>@layout/item_card</item>
|
<item>@layout/item_card</item>
|
||||||
<item>@layout/item_card_color</item>
|
<item>@layout/item_card_color</item>
|
||||||
|
<item>@layout/item_grid_circle</item>
|
||||||
</array>
|
</array>
|
||||||
|
|
||||||
<string-array name="pref_general_theme_list_values">
|
<string-array name="pref_general_theme_list_values">
|
||||||
<item>light</item>
|
<item>light</item>
|
||||||
<item>dark</item>
|
<item>dark</item>
|
||||||
|
|
|
@ -12,9 +12,6 @@
|
||||||
<attr format="color" name="iconColor"/>
|
<attr format="color" name="iconColor"/>
|
||||||
<attr format="color" name="dividerColor"/>
|
<attr format="color" name="dividerColor"/>
|
||||||
|
|
||||||
<declare-styleable name="RoundCornerFrameLayout">
|
|
||||||
<attr format="dimension" name="corner_radius"/>
|
|
||||||
</declare-styleable>
|
|
||||||
|
|
||||||
<declare-styleable name="BlurLayout">
|
<declare-styleable name="BlurLayout">
|
||||||
<attr format="float" name="blk_downscaleFactor"/>
|
<attr format="float" name="blk_downscaleFactor"/>
|
||||||
|
@ -26,6 +23,7 @@
|
||||||
<declare-styleable name="NetworkImageView">
|
<declare-styleable name="NetworkImageView">
|
||||||
<attr format="string" name="url_link"/>
|
<attr format="string" name="url_link"/>
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
<declare-styleable name="LyricView">
|
<declare-styleable name="LyricView">
|
||||||
<attr format="string" name="hint"/>
|
<attr format="string" name="hint"/>
|
||||||
<attr format="color" name="hintColor"/>
|
<attr format="color" name="hintColor"/>
|
||||||
|
|
|
@ -36,8 +36,6 @@
|
||||||
<string name="hosur_india" translatable="false">Hosur, India</string>
|
<string name="hosur_india" translatable="false">Hosur, India</string>
|
||||||
<string name="circular_std_black" translatable="false">fonts/circular_std_black.otf</string>
|
<string name="circular_std_black" translatable="false">fonts/circular_std_black.otf</string>
|
||||||
<string name="circular_std_book" translatable="false">fonts/circular_std_book.otf</string>
|
<string name="circular_std_book" translatable="false">fonts/circular_std_book.otf</string>
|
||||||
<string name="sans_regular" translatable="false">fonts/product_sans_regular.ttf</string>
|
|
||||||
<string name="sans_bold" translatable="false">fonts/product_sans_bold.ttf</string>
|
|
||||||
<string name="marko_name" translatable="false">Marko Ivanović </string>
|
<string name="marko_name" translatable="false">Marko Ivanović </string>
|
||||||
<string name="marko_summary" translatable="false">Contributor</string>
|
<string name="marko_summary" translatable="false">Contributor</string>
|
||||||
<string name="yt_gaming_name" translatable="false">Gaming Inc</string>
|
<string name="yt_gaming_name" translatable="false">Gaming Inc</string>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,10 +0,0 @@
|
||||||
package code.name.monkey.retromusic.ui.fragments.settings;
|
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Hemanth S (h4h13).
|
|
||||||
*/
|
|
||||||
public class PersonaliseSettingsFragmentTest extends TestCase {
|
|
||||||
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue