backup with notch problem

This commit is contained in:
h4h13 2018-11-20 20:57:59 +05:30
parent f31831ea7f
commit 62b12da2ad
70 changed files with 1131 additions and 990 deletions

View file

@ -158,6 +158,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" /> <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/res_stripped" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shader_assets" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/shader_assets" />
@ -168,72 +169,74 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" /> <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" /> <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content> </content>
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" /> <orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Gradle: com.github.bumptech.glide:okhttp3-integration:1.5.0@jar" level="project" /> <orderEntry type="library" name="Gradle: com.github.bumptech.glide:okhttp3-integration:1.5.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.slidingpanelayout:slidingpanelayout-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.slidingpanelayout:slidingpanelayout-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-basement-15.0.1" level="project" />
<orderEntry type="library" name="Gradle: com.sothree.slidinguppanel:library-3.4.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-livedata-2.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-livedata-2.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-tasks-16.0.1" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.retrofit2:retrofit:2.4.0@jar" level="project" /> <orderEntry type="library" name="Gradle: com.squareup.retrofit2:retrofit:2.4.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-flags-16.0.1" level="project" />
<orderEntry type="library" name="Gradle: androidx.cardview:cardview-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.cardview:cardview-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.appcompat:appcompat-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: com.github.hannesa2:AndroidSlidingUpPanel-3.5.0" level="project" />
<orderEntry type="library" name="Gradle: com.afollestad:material-cab-0.1.12" level="project" /> <orderEntry type="library" name="Gradle: com.afollestad:material-cab-0.1.12" level="project" />
<orderEntry type="library" name="Gradle: androidx.appcompat:appcompat-1.0.2" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.material:material-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: com.google.android.material:material-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-basement-16.0.1" level="project" />
<orderEntry type="library" name="Gradle: androidx.versionedparcelable:versionedparcelable-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.versionedparcelable:versionedparcelable-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.h6ah4i.android.widget.advrecyclerview:advrecyclerview-0.11.0" level="project" /> <orderEntry type="library" name="Gradle: com.h6ah4i.android.widget.advrecyclerview:advrecyclerview-0.11.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.fragment:fragment-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.fragment:fragment-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.jakewharton:butterknife-annotations:9.0.0-rc1@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.swiperefreshlayout:swiperefreshlayout-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.swiperefreshlayout:swiperefreshlayout-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-viewmodel-2.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-viewmodel-2.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.coordinatorlayout:coordinatorlayout-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.coordinatorlayout:coordinatorlayout-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-base-16.0.1" level="project" />
<orderEntry type="library" name="Gradle: com.github.kabouzeid:RecyclerView-FastScroll-1.0.16-kmod" level="project" /> <orderEntry type="library" name="Gradle: com.github.kabouzeid:RecyclerView-FastScroll-1.0.16-kmod" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.14.0@jar" level="project" /> <orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.14.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.documentfile:documentfile-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.documentfile:documentfile-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.github.ksoichiro:android-observablescrollview-1.6.0" level="project" /> <orderEntry type="library" name="Gradle: com.github.ksoichiro:android-observablescrollview-1.6.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-cast-framework-16.0.2" level="project" /> <orderEntry type="library" name="Gradle: com.google.android.gms:play-services-cast-16.1.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.recyclerview:recyclerview-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.recyclerview:recyclerview-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:logging-interceptor:3.11.0@jar" level="project" /> <orderEntry type="library" name="Gradle: com.squareup.okhttp3:logging-interceptor:3.11.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.interpolator:interpolator-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.interpolator:interpolator-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.afollestad.material-dialogs:core-0.9.6.0" level="project" /> <orderEntry type="library" name="Gradle: com.afollestad.material-dialogs:core-0.9.6.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.vectordrawable:vectordrawable-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.vectordrawable:vectordrawable-1.0.1" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.retrofit2:adapter-rxjava2:2.4.0@jar" level="project" /> <orderEntry type="library" name="Gradle: com.squareup.retrofit2:adapter-rxjava2:2.4.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.anjlab.android.iab.v3:library:1.0.44@jar" level="project" /> <orderEntry type="library" name="Gradle: com.anjlab.android.iab.v3:library:1.0.44@jar" level="project" />
<orderEntry type="library" name="Gradle: uk.co.chrisjenx:calligraphy-2.3.0" level="project" /> <orderEntry type="library" name="Gradle: uk.co.chrisjenx:calligraphy-2.3.0" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.retrofit2:converter-gson:2.4.0@jar" level="project" /> <orderEntry type="library" name="Gradle: com.squareup.retrofit2:converter-gson:2.4.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.legacy:legacy-support-v4-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.legacy:legacy-support-v4-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.jakewharton:butterknife-runtime-9.0.0-rc1" level="project" />
<orderEntry type="library" name="Gradle: androidx.palette:palette-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.palette:palette-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-tasks-15.0.1" level="project" />
<orderEntry type="library" name="Gradle: androidx.asynclayoutinflater:asynclayoutinflater-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.asynclayoutinflater:asynclayoutinflater-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.jakewharton:butterknife-annotations:9.0.0-SNAPSHOT@jar" level="project" />
<orderEntry type="library" name="Gradle: __local_aars__:/Users/hemanths/Desktop/KeepSafe/RetroMusicPlayer/app/libs/juniversalchardet-1.0.3.jar:unspecified@jar" level="project" /> <orderEntry type="library" name="Gradle: __local_aars__:/Users/hemanths/Desktop/KeepSafe/RetroMusicPlayer/app/libs/juniversalchardet-1.0.3.jar:unspecified@jar" level="project" />
<orderEntry type="library" name="Gradle: io.reactivex.rxjava2:rxjava:2.1.17@jar" level="project" /> <orderEntry type="library" name="Gradle: io.reactivex.rxjava2:rxjava:2.1.17@jar" level="project" />
<orderEntry type="library" name="Gradle: com.jakewharton:butterknife-runtime-9.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Gradle: androidx.gridlayout:gridlayout-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.gridlayout:gridlayout-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.multidex:multidex-2.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.multidex:multidex-2.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-runtime-2.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-runtime-2.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.jakewharton:butterknife-9.0.0-rc1" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp:3.11.0@jar" level="project" /> <orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp:3.11.0@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.drawerlayout:drawerlayout-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.drawerlayout:drawerlayout-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.media:media-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.media:media-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.r0adkll:slidableactivity-2.0.6" level="project" /> <orderEntry type="library" name="Gradle: com.r0adkll:slidableactivity-2.0.6" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-livedata-core-2.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-livedata-core-2.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.core:core-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.core:core-1.0.1" level="project" />
<orderEntry type="library" name="Gradle: org.reactivestreams:reactive-streams:1.0.2@jar" level="project" /> <orderEntry type="library" name="Gradle: org.reactivestreams:reactive-streams:1.0.2@jar" level="project" />
<orderEntry type="library" name="Gradle: me.zhanghai.android.materialprogressbar:library-1.4.2" level="project" /> <orderEntry type="library" name="Gradle: me.zhanghai.android.materialprogressbar:library-1.4.2" level="project" />
<orderEntry type="library" name="Gradle: com.github.bumptech.glide:glide:3.8.0@jar" level="project" /> <orderEntry type="library" name="Gradle: com.github.bumptech.glide:glide:3.8.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-base-15.0.1" level="project" />
<orderEntry type="library" name="Gradle: org.nanohttpd:nanohttpd:2.3.1@jar" level="project" /> <orderEntry type="library" name="Gradle: org.nanohttpd:nanohttpd:2.3.1@jar" level="project" />
<orderEntry type="library" name="Gradle: androidx.mediarouter:mediarouter-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.mediarouter:mediarouter-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.jakewharton:butterknife-9.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Gradle: androidx.transition:transition-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.transition:transition-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.legacy:legacy-support-core-utils-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.legacy:legacy-support-core-utils-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-common:2.0.0@jar" level="project" /> <orderEntry type="library" name="Gradle: androidx.lifecycle:lifecycle-common:2.0.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.afollestad.material-dialogs:commons-0.9.6.0" level="project" /> <orderEntry type="library" name="Gradle: com.afollestad.material-dialogs:commons-0.9.6.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.legacy:legacy-preference-v14-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.legacy:legacy-preference-v14-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-cast-16.0.2" level="project" />
<orderEntry type="library" name="Gradle: androidx.legacy:legacy-support-v13-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.legacy:legacy-support-v13-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.arch.core:core-common:2.0.0@jar" level="project" /> <orderEntry type="library" name="Gradle: androidx.arch.core:core-common:2.0.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-cast-framework-16.1.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.viewpager:viewpager-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.viewpager:viewpager-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: io.reactivex.rxjava2:rxandroid-2.0.2" level="project" /> <orderEntry type="library" name="Gradle: io.reactivex.rxjava2:rxandroid-2.0.2" level="project" />
<orderEntry type="library" name="Gradle: androidx.arch.core:core-runtime-2.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.arch.core:core-runtime-2.0.0" level="project" />
@ -246,7 +249,6 @@
<orderEntry type="library" name="Gradle: androidx.loader:loader-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.loader:loader-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.customview:customview-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.customview:customview-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.localbroadcastmanager:localbroadcastmanager-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.localbroadcastmanager:localbroadcastmanager-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.android.gms:play-services-flags-15.0.1" level="project" />
<orderEntry type="library" name="Gradle: androidx.cursoradapter:cursoradapter-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.cursoradapter:cursoradapter-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.print:print-1.0.0" level="project" /> <orderEntry type="library" name="Gradle: androidx.print:print-1.0.0" level="project" />
<orderEntry type="library" name="Gradle: androidx.collection:collection:1.0.0@jar" level="project" /> <orderEntry type="library" name="Gradle: androidx.collection:collection:1.0.0@jar" level="project" />

View file

@ -11,8 +11,8 @@ android {
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic" applicationId "code.name.monkey.retromusic"
versionCode 246 versionCode 252
versionName '2.2.000' versionName '2.2.100'
multiDexEnabled true multiDexEnabled true
@ -99,7 +99,7 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.multidex:multidex:2.0.0' implementation 'androidx.multidex:multidex:2.0.0'
implementation "androidx.fragment:fragment:$supportLibVersion" implementation "androidx.fragment:fragment:$supportLibVersion"
implementation "androidx.appcompat:appcompat:$supportLibVersion" implementation "androidx.appcompat:appcompat:1.0.2"
implementation "androidx.recyclerview:recyclerview:$supportLibVersion" implementation "androidx.recyclerview:recyclerview:$supportLibVersion"
implementation "androidx.gridlayout:gridlayout:$supportLibVersion" implementation "androidx.gridlayout:gridlayout:$supportLibVersion"
implementation "androidx.cardview:cardview:$supportLibVersion" implementation "androidx.cardview:cardview:$supportLibVersion"
@ -112,7 +112,7 @@ dependencies {
//For casting //For casting
implementation 'androidx.mediarouter:mediarouter:1.0.0' implementation 'androidx.mediarouter:mediarouter:1.0.0'
implementation 'com.google.android.gms:play-services-cast-framework:16.0.2' implementation 'com.google.android.gms:play-services-cast-framework:16.1.0'
implementation "com.squareup.retrofit2:retrofit:2.4.0" implementation "com.squareup.retrofit2:retrofit:2.4.0"
implementation "com.squareup.retrofit2:converter-gson:2.4.0" implementation "com.squareup.retrofit2:converter-gson:2.4.0"
@ -143,7 +143,7 @@ dependencies {
implementation 'com.r0adkll:slidableactivity:2.0.6' implementation 'com.r0adkll:slidableactivity:2.0.6'
/*Backend all*/ /*Backend all*/
implementation project(':appthemehelper') implementation project(':appthemehelper')
implementation 'com.sothree.slidinguppanel:library:3.4.0' implementation 'com.github.hannesa2:AndroidSlidingUpPanel:3.5.0'
implementation 'com.github.AdrienPoupa:jaudiotagger:2.2.3' implementation 'com.github.AdrienPoupa:jaudiotagger:2.2.3'
implementation 'org.nanohttpd:nanohttpd:2.3.1' implementation 'org.nanohttpd:nanohttpd:2.3.1'

View file

@ -1 +1 @@
<html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <p style="line-height:150%">You can view the changelog dialog again at any time from the <i>about</i> section.</p> <h3>Version 2.2.00</h3> <ul style="line-height:150%"> <li>Sorry for late update, Bottom navigation bar again at the bottom because it should according to Android Material Design guideline.</li> <li>BottomSheetDialogue is now adaptable to screens, background colour and text size consistency.</li> <li>Removed coloured navigation bar option to making app adapt the primary colour</li> <li>Swipe up gesture for now playing removed, replaced with "tap to open", To achieve transparent navigation bar for desired themes.</li> <li>Improved tablet UI and home screen by adding suggestions toggle banner issues.</li> <li>Improving lyrics page</li> </ul> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a></p> </style> <h3>Version 2.2.00</h3> not working try to uninstall and install again. </p> </body> <html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h1 style="text-align:center;">Are you subscribe to <a href="https://www.youtube.com/user/PewDiePie">PewDiePie</a></h1> <p style="line-height:150%">You can view the changelog dialog again at any time from the <i>about</i> section.</p> <h3>Version 2.2.100</h3> <ul style="line-height:150%"> <li>On library click on toolbar for accessing main menu </li> <li>On home click on toolbar for accessing search </li> <li>BottomSheetDialogue is now adaptable to screens, background colour and text size consistency. </li> <li>Removed coloured navigation bar option to making app adapt the primary colour</li> <li>Swipe up gesture for now playing removed, replaced with "tap to open", To achieve transparent navigation bar for desired themes. </li> <li>Improved tablet UI and home screen by adding suggestions toggle banner issues.</li> <li>Improving lyrics page</li> </ul> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <body> </style> not working try to uninstall and install again. </p> </body>

View file

@ -3,6 +3,7 @@ package code.name.monkey.retromusic.cast;
import android.net.Uri; import android.net.Uri;
import com.google.android.gms.cast.MediaInfo; import com.google.android.gms.cast.MediaInfo;
import com.google.android.gms.cast.MediaLoadOptions;
import com.google.android.gms.cast.MediaMetadata; import com.google.android.gms.cast.MediaMetadata;
import com.google.android.gms.cast.framework.CastSession; import com.google.android.gms.cast.framework.CastSession;
import com.google.android.gms.cast.framework.media.RemoteMediaClient; import com.google.android.gms.cast.framework.media.RemoteMediaClient;
@ -22,7 +23,7 @@ public class CastHelper {
String ipAddress = RetroUtil.getIPAddress(true); String ipAddress = RetroUtil.getIPAddress(true);
URL baseUrl; URL baseUrl;
try { try {
baseUrl = new URL("http", ipAddress, Constants.CAST_SERVER_PORT, ""); baseUrl = new URL("https", ipAddress, Constants.CAST_SERVER_PORT, "");
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
e.printStackTrace(); e.printStackTrace();
return; return;
@ -48,7 +49,9 @@ public class CastHelper {
.setStreamDuration(song.duration) .setStreamDuration(song.duration)
.build(); .build();
RemoteMediaClient remoteMediaClient = castSession.getRemoteMediaClient(); RemoteMediaClient remoteMediaClient = castSession.getRemoteMediaClient();
remoteMediaClient.load(mediaInfo, true, 0); remoteMediaClient.load(mediaInfo, new MediaLoadOptions.Builder()
.build());
//remoteMediaClient.load(mediaInfo, true, 0);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View file

@ -455,10 +455,6 @@ public class MusicPlayerRemote {
return musicService != null; return musicService != null;
} }
public static void setZeroVolume() {
}
@interface PlaybackLocation { @interface PlaybackLocation {
int REMOTE = 0; int REMOTE = 0;
int LOCAL = 1; int LOCAL = 1;

View file

@ -305,6 +305,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
registerHeadsetEvents(); registerHeadsetEvents();
} }
private AudioManager getAudioManager() { private AudioManager getAudioManager() {
@ -1209,6 +1210,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
playerHandler.sendEmptyMessage(TRACK_ENDED); playerHandler.sendEmptyMessage(TRACK_ENDED);
} }
private static final class QueueSaveHandler extends Handler { private static final class QueueSaveHandler extends Handler {
@NonNull @NonNull
private final WeakReference<MusicService> mService; private final WeakReference<MusicService> mService;

View file

@ -186,7 +186,7 @@ public class AlbumDetailsActivity extends AbsSlidingMusicPanelActivity implement
if (toolbar != null && !PreferenceUtil.getInstance().getFullScreenMode()) { if (toolbar != null && !PreferenceUtil.getInstance().getFullScreenMode()) {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams(); ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
params.topMargin = RetroUtil.getStatusBarHeight(this); params.topMargin = RetroUtil.getStatusBarHeight( );
toolbar.setLayoutParams(params); toolbar.setLayoutParams(params);
} }

View file

@ -208,7 +208,7 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
if (toolbar != null && !PreferenceUtil.getInstance().getFullScreenMode()) { if (toolbar != null && !PreferenceUtil.getInstance().getFullScreenMode()) {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams(); ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
params.topMargin = RetroUtil.getStatusBarHeight(this); params.topMargin = RetroUtil.getStatusBarHeight( );
toolbar.setLayoutParams(params); toolbar.setLayoutParams(params);
} }

View file

@ -84,7 +84,7 @@ public class LyricsActivity extends AbsMusicServiceActivity implements
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
setDrawUnderStatusBar(); setDrawUnderStatusBar();
setDrawUnderNavigationBar(); //setDrawUnderNavigationBar();
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lyrics); setContentView(R.layout.activity_lyrics);

View file

@ -97,8 +97,6 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements Shared
getBottomNavigationView().setOnNavigationItemSelectedListener(this); getBottomNavigationView().setOnNavigationItemSelectedListener(this);
drawerLayout.setOnApplyWindowInsetsListener((view, windowInsets) -> windowInsets.replaceSystemWindowInsets(0, 0, 0, 0));
if (savedInstanceState == null) { if (savedInstanceState == null) {
selectedFragment(PreferenceUtil.getInstance().getLastPage()); selectedFragment(PreferenceUtil.getInstance().getLastPage());
//setCurrentFragment(new LibraryFragment(), false, LibraryFragment.TAG); //setCurrentFragment(new LibraryFragment(), false, LibraryFragment.TAG);
@ -277,11 +275,6 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements Shared
} }
} }
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
return super.onOptionsItemSelected(item);
}
@Override @Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key.equals(PreferenceUtil.GENERAL_THEME) || if (key.equals(PreferenceUtil.GENERAL_THEME) ||
@ -325,11 +318,11 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements Shared
.show(); .show();
} }
@Override @Override
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) { public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
PreferenceUtil.getInstance().setLastPage(menuItem.getItemId()); PreferenceUtil.getInstance().setLastPage(menuItem.getItemId());
selectedFragment(menuItem.getItemId()); selectedFragment(menuItem.getItemId());
applyInsets();
return true; return true;
} }

View file

@ -2,7 +2,9 @@ package code.name.monkey.retromusic.ui.activities.base;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.Menu;
import com.google.android.gms.cast.framework.CastButtonFactory;
import com.google.android.gms.cast.framework.CastContext; import com.google.android.gms.cast.framework.CastContext;
import com.google.android.gms.cast.framework.CastSession; import com.google.android.gms.cast.framework.CastSession;
import com.google.android.gms.cast.framework.SessionManagerListener; import com.google.android.gms.cast.framework.SessionManagerListener;
@ -11,6 +13,7 @@ import com.google.android.gms.common.GoogleApiAvailability;
import java.io.IOException; import java.io.IOException;
import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.cast.WebServer; import code.name.monkey.retromusic.cast.WebServer;
public abstract class AbsCastActivity extends AbsBaseActivity { public abstract class AbsCastActivity extends AbsBaseActivity {

View file

@ -1,73 +1,99 @@
package code.name.monkey.retromusic.ui.activities.base; package code.name.monkey.retromusic.ui.activities.base;
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.view.animation.PathInterpolator;
import android.widget.FrameLayout;
import com.google.android.gms.cast.framework.CastSession; import com.google.android.gms.cast.framework.CastSession;
import com.google.android.material.bottomnavigation.BottomNavigationView; import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState;
import androidx.annotation.FloatRange;
import androidx.annotation.LayoutRes; import androidx.annotation.LayoutRes;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment;
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.ATHUtil;
import code.name.monkey.appthemehelper.util.ColorUtil; import code.name.monkey.appthemehelper.util.ColorUtil;
import code.name.monkey.appthemehelper.util.NavigationViewUtil;
import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.R;
import code.name.monkey.retromusic.cast.CastHelper;
import code.name.monkey.retromusic.helper.MusicPlayerRemote; import code.name.monkey.retromusic.helper.MusicPlayerRemote;
import code.name.monkey.retromusic.ui.fragments.MiniPlayerFragment; import code.name.monkey.retromusic.ui.fragments.MiniPlayerFragment;
import code.name.monkey.retromusic.ui.fragments.NowPlayingScreen;
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerFragment;
import code.name.monkey.retromusic.ui.fragments.player.adaptive.AdaptiveFragment;
import code.name.monkey.retromusic.ui.fragments.player.blur.BlurPlayerFragment;
import code.name.monkey.retromusic.ui.fragments.player.card.CardFragment;
import code.name.monkey.retromusic.ui.fragments.player.cardblur.CardBlurFragment;
import code.name.monkey.retromusic.ui.fragments.player.color.ColorFragment;
import code.name.monkey.retromusic.ui.fragments.player.fit.FitFragment;
import code.name.monkey.retromusic.ui.fragments.player.flat.FlatPlayerFragment;
import code.name.monkey.retromusic.ui.fragments.player.full.FullPlayerFragment;
import code.name.monkey.retromusic.ui.fragments.player.hmm.HmmPlayerFragment;
import code.name.monkey.retromusic.ui.fragments.player.material.MaterialFragment;
import code.name.monkey.retromusic.ui.fragments.player.normal.PlayerFragment;
import code.name.monkey.retromusic.ui.fragments.player.plain.PlainPlayerFragment;
import code.name.monkey.retromusic.ui.fragments.player.simple.SimplePlayerFragment;
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.ViewUtil;
import code.name.monkey.retromusic.views.BottomNavigationBarTinted; import code.name.monkey.retromusic.views.BottomNavigationBarTinted;
import code.name.monkey.retromusic.views.FitSystemWindowsLayout;
public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivity { public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivity implements
SlidingUpPanelLayout.PanelSlideListener, PlayerFragment.Callbacks {
public static final String TAG = AbsSlidingMusicPanelActivity.class.getSimpleName(); public static final String TAG = AbsSlidingMusicPanelActivity.class.getSimpleName();
@BindView(R.id.sliding_layout)
SlidingUpPanelLayout slidingUpPanelLayout;
@BindView(R.id.bottom_navigation) @BindView(R.id.bottom_navigation)
BottomNavigationBarTinted bottomNavigationView; BottomNavigationBarTinted bottomNavigationView;
@BindView(R.id.parentPanel) @BindView(R.id.main_content)
ViewGroup parentPanel; CoordinatorLayout coordinatorLayout;
@BindView(R.id.mini_player_container)
ViewGroup miniPlayerContainer;
private MiniPlayerFragment miniPlayerFragment; private MiniPlayerFragment miniPlayerFragment;
private AbsPlayerFragment playerFragment;
private NowPlayingScreen currentNowPlayingScreen;
private int navigationbarColor;
private int taskColor;
private boolean lightStatusbar;
private boolean lightNavigationBar;
private ValueAnimator navigationBarColorAnimator;
private ArgbEvaluator argbEvaluator = new ArgbEvaluator();
protected AbsSlidingMusicPanelActivity() { protected AbsSlidingMusicPanelActivity() {
} }
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
setDrawUnderNavigationBar();
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(createContentView()); setContentView(createContentView());
ButterKnife.bind(this); ButterKnife.bind(this);
setLightStatusbar(true); checkDisplayCutout();
setLightNavigationBar(true); choosFragmentForTheme();
//setupBottomView(); setupSlidingUpPanel();
miniPlayerFragment = (MiniPlayerFragment) getSupportFragmentManager().findFragmentById(R.id.mini_player_fragment);
}
private void setupBottomView() {
bottomNavigationView.setBackgroundColor(ThemeStore.primaryColor(this));
bottomNavigationView.setSelectedItemId(PreferenceUtil.getInstance().getLastPage());
int iconColor = ATHUtil.resolveColor(this, R.attr.iconColor);
int accentColor = ThemeStore.accentColor(this);
NavigationViewUtil.setItemIconColors(bottomNavigationView, ColorUtil.withAlpha(iconColor, 0.5f), accentColor);
NavigationViewUtil.setItemTextColors(bottomNavigationView, ColorUtil.withAlpha(iconColor, 0.5f), accentColor);
bottomNavigationView.setLabelVisibilityMode(PreferenceUtil.getInstance().getTabTitleMode());
//bottomNavigationView.getMenu().removeItem(R.id.action_playlist);
} }
public void setBottomBarVisibility(int gone) { public void setBottomBarVisibility(int gone) {
if (bottomNavigationView != null) { if (bottomNavigationView != null) {
bottomNavigationView.setVisibility(gone); bottomNavigationView.setVisibility(gone);
hideBottomBar(false);
} }
} }
@ -76,14 +102,15 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
@Override @Override
public void onServiceConnected() { public void onServiceConnected() {
super.onServiceConnected(); super.onServiceConnected();
if (!MusicPlayerRemote.getPlayingQueue().isEmpty()) if (!MusicPlayerRemote.getPlayingQueue().isEmpty()) {
parentPanel.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { slidingUpPanelLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override @Override
public void onGlobalLayout() { public void onGlobalLayout() {
parentPanel.getViewTreeObserver().removeOnGlobalLayoutListener(this); slidingUpPanelLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
hideBottomBar(false); hideBottomBar(false);
} }
}); });
} // don't call hideBottomBar(true) here as it causes a bug with the SlidingUpPanelLayout
} }
@Override @Override
@ -93,7 +120,28 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
} }
public void hideBottomBar(final boolean hide) { public void hideBottomBar(final boolean hide) {
miniPlayerContainer.setVisibility(hide ? View.GONE : View.VISIBLE); //int heightOfBarWithTabs = getResources().getDimensionPixelSize(R.dimen.mini_player_height_expanded) + RetroUtil.getNavigationBarHeight(getResources());
int height = RetroUtil.checkNavigationBarHeight() ? getResources().getDimensionPixelSize(R.dimen.mini_player_height) : getResources().getDimensionPixelSize(R.dimen.mini_player_height);
int heightOfBar = getResources().getDimensionPixelSize(R.dimen.mini_player_height) + RetroUtil.getNavigationBarHeight(this);
int heightOfBarWithTabs =
getResources().getDimensionPixelSize(R.dimen.mini_player_height_expanded) +
RetroUtil.getNavigationBarHeight(this);
if (hide) {
slidingUpPanelLayout.setPanelHeight(0);
collapsePanel();
} else {
if (!MusicPlayerRemote.getPlayingQueue().isEmpty()) {
slidingUpPanelLayout.setPanelHeight(bottomNavigationView.getVisibility() == View.VISIBLE ? heightOfBarWithTabs : heightOfBar);
}
}
}
private void checkDisplayCutout() {
WindowManager.LayoutParams attrs = getWindow().getAttributes();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
attrs.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
}
} }
protected View wrapSlidingMusicPanel(@LayoutRes int resId) { protected View wrapSlidingMusicPanel(@LayoutRes int resId) {
@ -106,13 +154,18 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if (handleBackPress()) { if (!handleBackPress())
super.onBackPressed(); super.onBackPressed();
}
} }
public boolean handleBackPress() { public boolean handleBackPress() {
return true; if (slidingUpPanelLayout.getPanelHeight() != 0 && playerFragment.onBackPressed())
return true;
if (getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) {
collapsePanel();
return true;
}
return false;
} }
@Override @Override
@ -128,7 +181,7 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
@Override @Override
public void showCastMiniController() { public void showCastMiniController() {
super.showCastMiniController(); super.showCastMiniController();
MusicPlayerRemote.setZeroVolume();
} }
@Override @Override
@ -138,8 +191,8 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
if (castSession == null) { if (castSession == null) {
return; return;
} }
//MusicPlayerRemote.pauseSong(); //MusicPlayerRemote.setZeroVolume();
CastHelper.startCasting(castSession, MusicPlayerRemote.getCurrentSong()); //CastHelper.startCasting(castSession, MusicPlayerRemote.getCurrentSong());
} }
public void toggleBottomNavigationView(boolean toggle) { public void toggleBottomNavigationView(boolean toggle) {
@ -150,4 +203,311 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
return bottomNavigationView; return bottomNavigationView;
} }
public SlidingUpPanelLayout getSlidingUpPanelLayout() {
return slidingUpPanelLayout;
}
public AbsPlayerFragment getPlayerFragment() {
return playerFragment;
}
protected void setupSlidingUpPanel() {
slidingUpPanelLayout.getViewTreeObserver()
.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
slidingUpPanelLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
if (getPanelState() == PanelState.EXPANDED) {
onPanelSlide(slidingUpPanelLayout, 1);
onPanelExpanded(slidingUpPanelLayout);
} else if (getPanelState() == PanelState.COLLAPSED) {
onPanelCollapsed(slidingUpPanelLayout);
} else {
playerFragment.onHide();
}
}
});
slidingUpPanelLayout.addPanelSlideListener(this);
applyInsets();
}
protected void applyInsets() {
ViewCompat.setOnApplyWindowInsetsListener(coordinatorLayout, (v, insets) -> {
//Bottom navigation view
ViewGroup.MarginLayoutParams bParams = (ViewGroup.MarginLayoutParams) bottomNavigationView.getLayoutParams();
if (!PreferenceUtil.getInstance().getFullScreenMode())
bParams.bottomMargin = insets.getSystemWindowInsetBottom();
bParams.rightMargin = insets.getSystemWindowInsetRight();
bParams.leftMargin = insets.getSystemWindowInsetLeft();
//For now playing screen
FrameLayout layout = findViewById(R.id.safeArea);
if (layout != null) {
ViewGroup.MarginLayoutParams fParams = (ViewGroup.MarginLayoutParams) layout.getLayoutParams();
if (!PreferenceUtil.getInstance().getFullScreenMode()) {
fParams.topMargin = insets.getSystemWindowInsetTop();
fParams.bottomMargin = insets.getSystemWindowInsetBottom();
}
fParams.leftMargin = insets.getSystemWindowInsetLeft();
fParams.rightMargin = insets.getSystemWindowInsetRight();
}
//Mini player
FitSystemWindowsLayout miniPlayer = (FitSystemWindowsLayout) miniPlayerFragment.getView();
if (miniPlayer != null) {
ViewGroup.MarginLayoutParams mParams = (ViewGroup.MarginLayoutParams) miniPlayer.getLayoutParams();
mParams.bottomMargin = insets.getSystemWindowInsetBottom();//RetroUtil.checkNavigationBarHeight() ? 0 : getResources().getDimensionPixelSize(R.dimen.mini_player_height);
mParams.leftMargin = insets.getSystemWindowInsetLeft();
mParams.rightMargin = insets.getSystemWindowInsetRight();
}
//For Library, Folder, Home etc
ViewGroup viewGroup = findViewById(R.id.content_container);
if (viewGroup != null) {
ViewGroup.MarginLayoutParams mParams = (ViewGroup.MarginLayoutParams) viewGroup.getLayoutParams();
mParams.leftMargin = insets.getSystemWindowInsetLeft();
mParams.rightMargin = insets.getSystemWindowInsetRight();
mParams.bottomMargin = insets.getSystemWindowInsetBottom();
}
FrameLayout frameLayout = findViewById(R.id.sliding_panel);
if (frameLayout != null) {
ViewGroup.MarginLayoutParams mParams = (ViewGroup.MarginLayoutParams) frameLayout.getLayoutParams();
mParams.leftMargin = insets.getSystemWindowInsetLeft();
mParams.rightMargin = insets.getSystemWindowInsetRight();
if (!PreferenceUtil.getInstance().getFullScreenMode()) {
mParams.bottomMargin = insets.getSystemWindowInsetBottom();
}
}
coordinatorLayout.setOnApplyWindowInsetsListener(null);
return insets.consumeSystemWindowInsets();
});
}
public SlidingUpPanelLayout.PanelState getPanelState() {
return slidingUpPanelLayout == null ? null : slidingUpPanelLayout.getPanelState();
}
@Override
public void onPanelSlide(View panel, float slideOffset) {
bottomNavigationView.setTranslationY(slideOffset * 400);
setMiniPlayerAlphaProgress(slideOffset);
if (navigationBarColorAnimator != null) navigationBarColorAnimator.cancel();
super.setNavigationbarColor((int) argbEvaluator.evaluate(slideOffset, navigationbarColor, Color.TRANSPARENT));
}
@Override
public void onPanelStateChanged(View panel, PanelState previousState, PanelState newState) {
switch (newState) {
case COLLAPSED:
onPanelCollapsed(panel);
break;
case EXPANDED:
onPanelExpanded(panel);
break;
case ANCHORED:
collapsePanel(); // this fixes a bug where the panel would get stuck for some reason
break;
}
}
public void onPanelCollapsed(View panel) {
// restore values
super.setLightStatusbar(lightStatusbar);
super.setTaskDescriptionColor(taskColor);
super.setNavigationbarColor(ThemeStore.primaryColor(this));
super.setLightNavigationBar(lightNavigationBar);
playerFragment.setMenuVisibility(false);
playerFragment.setUserVisibleHint(false);
playerFragment.onHide();
}
public void onPanelExpanded(View panel) {
int playerFragmentColor = playerFragment.getPaletteColor();
super.setTaskDescriptionColor(playerFragmentColor);
if (currentNowPlayingScreen == NowPlayingScreen.COLOR) {
super.setNavigationbarColor(playerFragmentColor);
} else {
super.setNavigationbarColor(Color.TRANSPARENT);
}
onPaletteColorChanged();
playerFragment.setMenuVisibility(true);
playerFragment.setUserVisibleHint(true);
playerFragment.onShow();
}
private void setMiniPlayerAlphaProgress(@FloatRange(from = 0, to = 1) float progress) {
if (miniPlayerFragment.getView() == null) return;
float alpha = 1 - progress;
miniPlayerFragment.getView().setAlpha(alpha);
// necessary to make the views below clickable
miniPlayerFragment.getView().setVisibility(alpha == 0 ? View.GONE : View.VISIBLE);
}
private void choosFragmentForTheme() {
currentNowPlayingScreen = PreferenceUtil.getInstance().getNowPlayingScreen();
Fragment fragment; // must implement AbsPlayerFragment
switch (currentNowPlayingScreen) {
case MATERIAL:
fragment = new MaterialFragment();
break;
case BLUR:
fragment = new BlurPlayerFragment();
break;
case FLAT:
fragment = new FlatPlayerFragment();
break;
case PLAIN:
fragment = new PlainPlayerFragment();
break;
case FULL:
fragment = new FullPlayerFragment();
break;
case COLOR:
fragment = new ColorFragment();
break;
case CARD:
fragment = new CardFragment();
break;
case SIMPLE:
fragment = new SimplePlayerFragment();
break;
case TINY:
fragment = new HmmPlayerFragment();
break;
case BLUR_CARD:
fragment = new CardBlurFragment();
break;
case ADAPTIVE:
fragment = new AdaptiveFragment();
break;
case FIT:
fragment = new FitFragment();
break;
case NORMAL:
default:
fragment = new PlayerFragment();
break;
}
getSupportFragmentManager().beginTransaction().replace(R.id.player_fragment_container, fragment).commit();
getSupportFragmentManager().executePendingTransactions();
playerFragment = (AbsPlayerFragment) getSupportFragmentManager().findFragmentById(R.id.player_fragment_container);
miniPlayerFragment = (MiniPlayerFragment) getSupportFragmentManager().findFragmentById(R.id.mini_player_fragment);
//noinspection ConstantConditions
miniPlayerFragment.getView().setOnClickListener(v -> expandPanel());
}
@Override
protected void onResume() {
super.onResume();
if (currentNowPlayingScreen != PreferenceUtil.getInstance().getNowPlayingScreen()) {
postRecreate();
}
}
public void setAntiDragView(View antiDragView) {
//slidingUpPanelLayout.setAntiDragView(antiDragView);
}
public void collapsePanel() {
slidingUpPanelLayout.setPanelState(PanelState.COLLAPSED);
}
public void expandPanel() {
slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
}
@Override
public void onPaletteColorChanged() {
if (getPanelState() == PanelState.EXPANDED) {
int paletteColor = playerFragment.getPaletteColor();
boolean isColorLight = ColorUtil.isColorLight(paletteColor);
super.setTaskDescriptionColor(paletteColor);
if ((currentNowPlayingScreen == NowPlayingScreen.FLAT || currentNowPlayingScreen == NowPlayingScreen.NORMAL) && PreferenceUtil.getInstance().getAdaptiveColor()) {
super.setLightNavigationBar(true);
super.setLightStatusbar(isColorLight);
} else if (currentNowPlayingScreen == NowPlayingScreen.COLOR) {
super.setLightStatusbar(isColorLight);
super.setLightNavigationBar(isColorLight);
} else if (currentNowPlayingScreen == NowPlayingScreen.BLUR || currentNowPlayingScreen == NowPlayingScreen.BLUR_CARD) {
super.setLightStatusbar(false);
} else if (currentNowPlayingScreen == NowPlayingScreen.CARD || currentNowPlayingScreen == NowPlayingScreen.FULL) {
super.setNavigationbarColor(Color.TRANSPARENT);
super.setLightStatusbar(false);
} else if (currentNowPlayingScreen == NowPlayingScreen.FIT) {
super.setNavigationbarColor(Color.TRANSPARENT);
super.setLightStatusbar(false);
} else {
boolean isTheme = isOneOfTheseThemes() && ColorUtil.isColorLight(ThemeStore.primaryColor(this));
super.setStatusbarColor(Color.TRANSPARENT);
super.setLightStatusbar(isTheme);
super.setLightNavigationBar(isTheme);
}
}
}
private boolean isOneOfTheseThemes() {
return currentNowPlayingScreen == NowPlayingScreen.FLAT
|| currentNowPlayingScreen == NowPlayingScreen.PLAIN
|| currentNowPlayingScreen == NowPlayingScreen.SIMPLE
|| currentNowPlayingScreen == NowPlayingScreen.NORMAL
|| currentNowPlayingScreen == NowPlayingScreen.ADAPTIVE
|| currentNowPlayingScreen == NowPlayingScreen.TINY
|| currentNowPlayingScreen == NowPlayingScreen.MATERIAL;
}
@Override
public void setLightStatusbar(boolean enabled) {
lightStatusbar = enabled;
if (getPanelState() == PanelState.COLLAPSED) {
super.setLightStatusbar(enabled);
}
}
@Override
public void setLightNavigationBar(boolean enabled) {
lightNavigationBar = enabled;
if (getPanelState() == PanelState.COLLAPSED) {
super.setLightNavigationBar(enabled);
}
}
@Override
public void setNavigationbarColor(int color) {
this.navigationbarColor = color;
if (getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
if (navigationBarColorAnimator != null) navigationBarColorAnimator.cancel();
super.setNavigationbarColor(color);
}
}
private void animateNavigationBarColor(int color) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (navigationBarColorAnimator != null) navigationBarColorAnimator.cancel();
navigationBarColorAnimator = ValueAnimator
.ofArgb(getWindow().getNavigationBarColor(), color)
.setDuration(ViewUtil.RETRO_MUSIC_ANIM_TIME);
navigationBarColorAnimator.setInterpolator(new PathInterpolator(0.4f, 0f, 1f, 1f));
navigationBarColorAnimator.addUpdateListener(animation -> AbsSlidingMusicPanelActivity.super.setNavigationbarColor((Integer) animation.getAnimatedValue()));
navigationBarColorAnimator.start();
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (navigationBarColorAnimator != null) navigationBarColorAnimator.cancel(); // just in case
}
} }

View file

@ -89,11 +89,7 @@ public abstract class AbsThemeActivity extends ATHActivity implements Runnable {
} }
public void setDrawUnderNavigationBar() { public void setDrawUnderNavigationBar() {
if (VersionUtils.hasLollipop()) { RetroUtil.setAllowDrawUnderNavigationBar(getWindow());
RetroUtil.setAllowDrawUnderNavigationBar(getWindow());
} else if (VersionUtils.hasKitKat()) {
RetroUtil.setStatusBarTranslucent(getWindow());
}
} }
/** /**
@ -174,7 +170,7 @@ public abstract class AbsThemeActivity extends ATHActivity implements Runnable {
} }
public void setImmersiveFullscreen() { public void setImmersiveFullscreen() {
int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION

View file

@ -80,7 +80,7 @@ public class MiniPlayerFragment extends AbsMusicServiceFragment implements Music
//noinspection ConstantConditions //noinspection ConstantConditions
view.setBackgroundColor(ThemeStore.primaryColor(getContext())); view.setBackgroundColor(ThemeStore.primaryColor(getContext()));
view.setOnTouchListener(new FlingPlayBackController(getActivity())); view.setOnTouchListener(new FlingPlayBackController(getActivity()));
view.setOnClickListener(v -> NavigationUtil.gotoNowPlayingActivity(getContext())); //view.setOnClickListener(v -> NavigationUtil.gotoNowPlayingActivity(getContext()));
setUpMiniPlayer(); setUpMiniPlayer();
if (RetroUtil.isTablet()) { if (RetroUtil.isTablet()) {

View file

@ -2,24 +2,24 @@ package code.name.monkey.retromusic.ui.fragments;
import androidx.annotation.DrawableRes; import androidx.annotation.DrawableRes;
import androidx.annotation.StringRes; import androidx.annotation.StringRes;
import code.name.monkey.retromusic.R; import code.name.monkey.retromusic.R;
public enum NowPlayingScreen { public enum NowPlayingScreen {
NORMAL(R.string.normal, R.drawable.np_normal, 0),
ADAPTIVE(R.string.adaptive, R.drawable.np_adaptive, 10),
BLUR(R.string.blur, R.drawable.np_blur, 4),
CARD(R.string.card, R.drawable.np_card, 6),
COLOR(R.string.color, R.drawable.np_color, 5),
BLUR_CARD(R.string.blur_card, R.drawable.np_blur_card, 9),
FIT(R.string.fit, R.drawable.np_adaptive, 12),
FLAT(R.string.flat, R.drawable.np_flat, 1), FLAT(R.string.flat, R.drawable.np_flat, 1),
FULL(R.string.full, R.drawable.np_full, 2), FULL(R.string.full, R.drawable.np_full, 2),
PLAIN(R.string.plain, R.drawable.np_plain, 3),
BLUR(R.string.blur, R.drawable.np_blur, 4),
COLOR(R.string.color, R.drawable.np_color, 5),
CARD(R.string.card, R.drawable.np_card, 6),
TINY(R.string.tiny, R.drawable.np_tiny, 7), TINY(R.string.tiny, R.drawable.np_tiny, 7),
SIMPLE(R.string.simple, R.drawable.np_simple, 8),
BLUR_CARD(R.string.blur_card, R.drawable.np_blur_card, 9),
ADAPTIVE(R.string.adaptive, R.drawable.np_adaptive, 10),
MATERIAL(R.string.material, R.drawable.np_material, 11), MATERIAL(R.string.material, R.drawable.np_material, 11),
FIT(R.string.fit, R.drawable.np_adaptive, 12); NORMAL(R.string.normal, R.drawable.np_normal, 0),
PLAIN(R.string.plain, R.drawable.np_plain, 3),
SIMPLE(R.string.simple, R.drawable.np_simple, 8);
@StringRes @StringRes
public final int titleRes; public final int titleRes;

View file

@ -34,6 +34,7 @@ import code.name.monkey.retromusic.util.MusicUtil;
import code.name.monkey.retromusic.util.NavigationUtil; import code.name.monkey.retromusic.util.NavigationUtil;
import code.name.monkey.retromusic.util.PreferenceUtil; import code.name.monkey.retromusic.util.PreferenceUtil;
import code.name.monkey.retromusic.util.RetroUtil; import code.name.monkey.retromusic.util.RetroUtil;
import code.name.monkey.retromusic.util.SystemUtils;
import code.name.monkey.retromusic.views.FitSystemWindowsLayout; import code.name.monkey.retromusic.views.FitSystemWindowsLayout;
public abstract class AbsPlayerFragment extends AbsMusicServiceFragment implements Toolbar.OnMenuItemClickListener, PaletteColorHolder { public abstract class AbsPlayerFragment extends AbsMusicServiceFragment implements Toolbar.OnMenuItemClickListener, PaletteColorHolder {
@ -55,8 +56,11 @@ public abstract class AbsPlayerFragment extends AbsMusicServiceFragment implemen
protected void addSafeArea(View view) { protected void addSafeArea(View view) {
FitSystemWindowsLayout safeArea = view.findViewById(R.id.safeArea); FitSystemWindowsLayout safeArea = view.findViewById(R.id.safeArea);
if (safeArea != null) { if (safeArea != null) {
if (PreferenceUtil.getInstance().getFullScreenMode()) safeArea.setFit(false); //ViewGroup.MarginLayoutParams params = ((ViewGroup.MarginLayoutParams) safeArea.getLayoutParams());
else safeArea.setFit(true); //params.topMargin = RetroUtil.getStatusBarHeight();
//params.bottomMargin = RetroUtil.getNavigationBarHeight();
//if (PreferenceUtil.getInstance().getFullScreenMode()) safeArea.setFit(false);
//else safeArea.setFit(true);
} }
} }
@ -227,4 +231,5 @@ public abstract class AbsPlayerFragment extends AbsMusicServiceFragment implemen
void onPaletteColorChanged(); void onPaletteColorChanged();
} }
} }

View file

@ -62,6 +62,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
@BindView(R.id.fragment_container) @BindView(R.id.fragment_container)
View contentContainer; View contentContainer;
private Unbinder unBinder; private Unbinder unBinder;
private MaterialCab cab; private MaterialCab cab;
private FragmentManager fragmentManager; private FragmentManager fragmentManager;
@ -110,6 +111,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
setStatusbarColorAuto(view); setStatusbarColorAuto(view);
setupToolbar(); setupToolbar();
inflateFragment(); inflateFragment();
} }
private void inflateFragment() { private void inflateFragment() {
@ -142,13 +144,14 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
TintHelper.setTintAuto(contentContainer, primaryColor, true); TintHelper.setTintAuto(contentContainer, primaryColor, true);
toolbar.setBackgroundColor(primaryColor); toolbar.setBackgroundColor(primaryColor);
toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
appbar.setBackgroundColor(primaryColor); appbar.setBackgroundColor(primaryColor);
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) -> appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext()))); getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
getMainActivity().setTitle(null); getMainActivity().setTitle(null);
getMainActivity().setSupportActionBar(toolbar); getMainActivity().setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(v -> showMainMenu()); toolbar.setNavigationOnClickListener(v -> NavigationUtil.goToSearch(getMainActivity()));
toolbar.setOnClickListener(v -> showMainMenu());
toolbar.setNavigationIcon(RetroUtil.getTintedDrawable(getMainActivity(), R.drawable.ic_search_white_24dp, ThemeStore.textColorPrimary(getMainActivity())));
} }
private Fragment getCurrentFragment() { private Fragment getCurrentFragment() {
@ -363,9 +366,6 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
MusicPlayerRemote.openAndShuffleQueue(SongLoader.getAllSongs(getContext()) MusicPlayerRemote.openAndShuffleQueue(SongLoader.getAllSongs(getContext())
.blockingFirst(), true); .blockingFirst(), true);
return true; return true;
case R.id.action_search:
NavigationUtil.goToSearch(getMainActivity());
break;
case R.id.action_equalizer: case R.id.action_equalizer:
NavigationUtil.openEqualizer(getActivity()); NavigationUtil.openEqualizer(getActivity());
return true; return true;

View file

@ -1,7 +1,6 @@
package code.name.monkey.retromusic.ui.fragments.mainactivity.home; package code.name.monkey.retromusic.ui.fragments.mainactivity.home;
import android.app.Activity; import android.app.Activity;
import android.content.res.ColorStateList;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.os.Bundle; import android.os.Bundle;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
@ -11,12 +10,9 @@ import android.view.View;
import android.view.ViewGroup; 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 com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
@ -35,7 +31,6 @@ 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.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.helper.MusicPlayerRemote; import code.name.monkey.retromusic.helper.MusicPlayerRemote;
@ -75,9 +70,9 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
@BindView(R.id.toolbar) @BindView(R.id.toolbar)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.app_bar) /*@BindView(R.id.app_bar)
AppBarLayout appbar; AppBarLayout appbar;
*/
@BindView(R.id.image) @BindView(R.id.image)
@Nullable @Nullable
ImageView imageView; ImageView imageView;
@ -85,8 +80,8 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
@BindView(R.id.user_image) @BindView(R.id.user_image)
CircularImageView userImage; CircularImageView userImage;
@BindView(R.id.collapsing_toolbar) /* @BindView(R.id.collapsing_toolbar)
CollapsingToolbarLayout toolbarLayout; CollapsingToolbarLayout toolbarLayout;*/
@BindView(R.id.recycler_view) @BindView(R.id.recycler_view)
RecyclerView recentArtistRV; RecyclerView recentArtistRV;
@ -121,18 +116,12 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
@BindView(R.id.container) @BindView(R.id.container)
View container; View container;
@BindView(R.id.title)
TextView title;
@BindView(R.id.suggestion_songs) @BindView(R.id.suggestion_songs)
RecyclerView suggestionsSongs; RecyclerView suggestionsSongs;
@BindView(R.id.suggestion_container) @BindView(R.id.suggestion_container)
LinearLayout suggestionsContainer; LinearLayout suggestionsContainer;
@BindView(R.id.search_icon)
ImageView searchIcon;
private Unbinder unbinder; private Unbinder unbinder;
private HomePresenter homePresenter; private HomePresenter homePresenter;
private CompositeDisposable disposable; private CompositeDisposable disposable;
@ -241,18 +230,13 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
private void setupToolbar() { private void setupToolbar() {
int primaryColor = ThemeStore.primaryColor(getContext()); int primaryColor = ThemeStore.primaryColor(getContext());
TintHelper.setTintAuto(container, primaryColor, true); TintHelper.setTintAuto(container, primaryColor, true);
userImage.setOnClickListener(v -> showMainMenu());
toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
toolbar.setBackgroundColor(primaryColor);
appbar.setBackgroundColor(primaryColor);
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
getActivity().setTitle(null); getActivity().setTitle(null);
getMainActivity().setSupportActionBar(toolbar); getMainActivity().setSupportActionBar(toolbar);
toolbar.setNavigationIcon(RetroUtil.getTintedDrawable(getMainActivity(), R.drawable.ic_menu_white_24dp, ThemeStore.textColorPrimary(getMainActivity())));
toolbar.setOnClickListener(v -> NavigationUtil.goToSearch(getMainActivity()));
toolbar.setNavigationOnClickListener(v -> showMainMenu()); toolbar.setNavigationOnClickListener(v -> showMainMenu());
title.setTextColor(ThemeStore.textColorPrimary(getContext()));
searchIcon.setImageTintList(ColorStateList.valueOf(ThemeStore.accentColor(getContext())));
} }
@Override @Override
@ -346,7 +330,6 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
Display display = getMainActivity().getWindowManager().getDefaultDisplay(); Display display = getMainActivity().getWindowManager().getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics(); DisplayMetrics metrics = new DisplayMetrics();
display.getMetrics(metrics); display.getMetrics(metrics);
return metrics; return metrics;
} }
@ -360,7 +343,7 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
} }
@OnClick({R.id.last_added, R.id.top_played, R.id.action_shuffle, R.id.history, @OnClick({R.id.last_added, R.id.top_played, R.id.action_shuffle, R.id.history,
R.id.user_image, R.id.search}) R.id.user_image})
void startUserInfo(View view) { void startUserInfo(View view) {
Activity activity = getActivity(); Activity activity = getActivity();
if (activity != null) { if (activity != null) {
@ -380,12 +363,7 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
case R.id.user_image: case R.id.user_image:
NavigationUtil.goToUserInfo(getActivity()); NavigationUtil.goToUserInfo(getActivity());
break; break;
case R.id.search:
NavigationUtil.goToSearch(activity);
break;
} }
} }
} }
} }

View file

@ -107,11 +107,6 @@ public class AdaptiveFragment extends AbsPlayerFragment implements Callbacks {
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_adaptive_player, container, false); View view = inflater.inflate(R.layout.fragment_adaptive_player, container, false);
unbinder = ButterKnife.bind(this, view); unbinder = ButterKnife.bind(this, view);
if (getPlayerActivity() != null) {
getPlayerActivity().setDrawUnderNavigationBar();
getPlayerActivity().setNavigationbarColorAuto();
addSafeArea(view);
}
return view; return view;
} }
@ -162,5 +157,4 @@ public class AdaptiveFragment extends AbsPlayerFragment implements Callbacks {
updateIsFavorite(); updateIsFavorite();
updateSong(); updateSong();
} }
} }

View file

@ -140,11 +140,6 @@ public class BlurPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_blur, container, false); View view = inflater.inflate(R.layout.fragment_blur, container, false);
unbinder = ButterKnife.bind(this, view); unbinder = ButterKnife.bind(this, view);
if (getPlayerActivity() != null) {
getPlayerActivity().setDrawUnderNavigationBar();
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
addSafeArea(view);
}
return view; return view;
} }

View file

@ -160,12 +160,7 @@ public class CardFragment extends AbsPlayerFragment implements PlayerAlbumCoverF
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_card_player, container, false); View view = inflater.inflate(R.layout.fragment_card_player, container, false);
unbinder = ButterKnife.bind(this, view); unbinder = ButterKnife.bind(this, view);
if (getPlayerActivity() != null) { return view;
getPlayerActivity().setDrawUnderNavigationBar();
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
addSafeArea(view);
}
return view;
} }
@Override @Override

View file

@ -122,11 +122,6 @@ public class CardBlurFragment extends AbsPlayerFragment implements
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_card_blur_player, container, false); View view = inflater.inflate(R.layout.fragment_card_blur_player, container, false);
unbinder = ButterKnife.bind(this, view); unbinder = ButterKnife.bind(this, view);
if (getPlayerActivity() != null) {
getPlayerActivity().setDrawUnderNavigationBar();
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
addSafeArea(view);
}
return view; return view;
} }

View file

@ -5,7 +5,6 @@ import android.animation.ValueAnimator;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
@ -136,10 +135,6 @@ public class ColorFragment extends AbsPlayerFragment {
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_color_player, container, false); View view = inflater.inflate(R.layout.fragment_color_player, container, false);
unbinder = ButterKnife.bind(this, view); unbinder = ButterKnife.bind(this, view);
if (getPlayerActivity() != null) {
getPlayerActivity().setDrawUnderNavigationBar();
addSafeArea(view);
}
return view; return view;
} }

View file

@ -88,11 +88,7 @@ public class FlatPlayerFragment extends AbsPlayerFragment implements
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_flat_player, container, false); View view = inflater.inflate(R.layout.fragment_flat_player, container, false);
unbinder = ButterKnife.bind(this, view); unbinder = ButterKnife.bind(this, view);
if (getPlayerActivity() != null) {
getPlayerActivity().setDrawUnderNavigationBar();
//getPlayerActivity().setNavigationbarColorAuto();
addSafeArea(view);
}
return view; return view;
} }

View file

@ -24,7 +24,7 @@ public class FullPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
@BindView(R.id.player_toolbar) @BindView(R.id.player_toolbar)
Toolbar toolbar; Toolbar toolbar;
Unbinder unbinder; private Unbinder unbinder;
private int lastColor; private int lastColor;
private FullPlaybackControlsFragment fullPlaybackControlsFragment; private FullPlaybackControlsFragment fullPlaybackControlsFragment;
@ -42,11 +42,7 @@ public class FullPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_full, container, false); View view = inflater.inflate(R.layout.fragment_full, container, false);
unbinder = ButterKnife.bind(this, view); unbinder = ButterKnife.bind(this, view);
if (getPlayerActivity() != null) {
getPlayerActivity().setDrawUnderNavigationBar();
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
addSafeArea(view);
}
return view; return view;
} }

View file

@ -99,11 +99,7 @@ public class HmmPlayerFragment extends AbsPlayerFragment implements
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_hmm_player, container, false); View view = inflater.inflate(R.layout.fragment_hmm_player, container, false);
unBinder = ButterKnife.bind(this, view); unBinder = ButterKnife.bind(this, view);
if (getPlayerActivity() != null) {
getPlayerActivity().setDrawUnderNavigationBar();
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
addSafeArea(view);
}
return view; return view;
} }

View file

@ -108,11 +108,6 @@ public class MaterialFragment extends AbsPlayerFragment implements PlayerAlbumCo
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_material, container, false); View view = inflater.inflate(R.layout.fragment_material, container, false);
unbinder = ButterKnife.bind(this, view); unbinder = ButterKnife.bind(this, view);
if (getPlayerActivity() != null) {
getPlayerActivity().setDrawUnderNavigationBar();
getPlayerActivity().setNavigationbarColorAuto();
addSafeArea(view);
}
return view; return view;
} }

View file

@ -16,7 +16,6 @@ import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.Unbinder; import butterknife.Unbinder;
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.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.helper.MusicPlayerRemote; import code.name.monkey.retromusic.helper.MusicPlayerRemote;
@ -136,10 +135,7 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_player, container, false); View view = inflater.inflate(R.layout.fragment_player, container, false);
unbinder = ButterKnife.bind(this, view); unbinder = ButterKnife.bind(this, view);
if (getPlayerActivity() != null) {
getPlayerActivity().setDrawUnderNavigationBar();
addSafeArea(view);
}
return view; return view;
} }

View file

@ -75,11 +75,7 @@ public class PlainPlayerFragment extends AbsPlayerFragment implements
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_plain_player, container, false); View view = inflater.inflate(R.layout.fragment_plain_player, container, false);
unbinder = ButterKnife.bind(this, view); unbinder = ButterKnife.bind(this, view);
if (getPlayerActivity() != null) {
getPlayerActivity().setDrawUnderNavigationBar();
getPlayerActivity().setNavigationbarColorAuto();
addSafeArea(view);
}
return view; return view;
} }

View file

@ -46,11 +46,6 @@ public class SimplePlayerFragment extends AbsPlayerFragment implements
@Nullable Bundle savedInstanceState) { @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_simple_player, container, false); View view = inflater.inflate(R.layout.fragment_simple_player, container, false);
unbinder = ButterKnife.bind(this, view); unbinder = ButterKnife.bind(this, view);
if (getPlayerActivity() != null) {
getPlayerActivity().setDrawUnderNavigationBar();
getPlayerActivity().setNavigationbarColorAuto();
addSafeArea(view);
}
return view; return view;
} }

View file

@ -695,41 +695,6 @@ public final class PreferenceUtil {
mPreferences.edit().putBoolean(CIRCULAR_ALBUM_ART, false).apply(); mPreferences.edit().putBoolean(CIRCULAR_ALBUM_ART, false).apply();
} }
@LayoutRes
public int getAlbumGridStyle(Context context) {
int pos = Integer.parseInt(mPreferences.getString(ALBUM_GRID_STYLE, "0"));
TypedArray typedArray = context.getResources().obtainTypedArray(R.array.pref_grid_style_layout);
int layoutRes = typedArray.getResourceId(pos, -1);
typedArray.recycle();
if (layoutRes == -1) {
return R.layout.item_card;
}
return layoutRes;
}
@LayoutRes
public int getHomeGridStyle(Context context) {
int pos = Integer.parseInt(mPreferences.getString(HOME_ARTIST_GRID_STYLE, "0"));
TypedArray typedArray = context.getResources().obtainTypedArray(R.array.pref_home_grid_style_layout);
int layoutRes = typedArray.getResourceId(pos, -1);
typedArray.recycle();
if (layoutRes == -1) {
return R.layout.item_artist;
}
return layoutRes;
}
public int getArtistGridStyle(Context context) {
int pos = Integer.parseInt(Objects.requireNonNull(mPreferences.getString(ARTIST_GRID_STYLE, "0")));
TypedArray typedArray = context.getResources().obtainTypedArray(R.array.pref_grid_style_layout);
int layoutRes = typedArray.getResourceId(pos, -1);
typedArray.recycle();
if (layoutRes == -1) {
return R.layout.item_card;
}
return layoutRes;
}
public String getAlbumDetailsStyle() { public String getAlbumDetailsStyle() {
return mPreferences.getString(ALBUM_DETAIL_STYLE, "0"); return mPreferences.getString(ALBUM_DETAIL_STYLE, "0");
@ -805,4 +770,41 @@ public final class PreferenceUtil {
return LabelVisibilityMode.LABEL_VISIBILITY_UNLABELED; return LabelVisibilityMode.LABEL_VISIBILITY_UNLABELED;
} }
} }
@LayoutRes
public int getHomeGridStyle(Context context) {
int pos = Integer.parseInt(mPreferences.getString(HOME_ARTIST_GRID_STYLE, "0"));
TypedArray typedArray = context.getResources().obtainTypedArray(R.array.pref_home_grid_style_layout);
int layoutRes = typedArray.getResourceId(pos, -1);
typedArray.recycle();
if (layoutRes == -1) {
return R.layout.item_artist;
}
return layoutRes;
}
@LayoutRes
public int getArtistGridStyle(Context context) {
int pos = Integer.parseInt(Objects.requireNonNull(mPreferences.getString(ARTIST_GRID_STYLE, "0")));
TypedArray typedArray = context.getResources().obtainTypedArray(R.array.pref_grid_style_layout);
int layoutRes = typedArray.getResourceId(pos, -1);
typedArray.recycle();
if (layoutRes == -1) {
return R.layout.item_card;
}
return layoutRes;
}
@LayoutRes
public int getAlbumGridStyle(Context context) {
int pos = Integer.parseInt(mPreferences.getString(ALBUM_GRID_STYLE, "0"));
TypedArray typedArray = context.getResources().obtainTypedArray(R.array.pref_grid_style_layout);
int layoutRes = typedArray.getResourceId(pos, -1);
typedArray.recycle();
if (layoutRes == -1) {
return R.layout.item_card;
}
return layoutRes;
}
} }

View file

@ -22,8 +22,10 @@ import android.provider.BaseColumns;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.view.Display; import android.view.Display;
import android.view.Surface; import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
@ -49,6 +51,7 @@ import code.name.monkey.retromusic.RetroApplication;
public class RetroUtil { public class RetroUtil {
private static final int[] TEMP_ARRAY = new int[1]; private static final int[] TEMP_ARRAY = new int[1];
private static final String SHOW_NAV_BAR_RES_NAME = "config_showNavigationBar";
public static int calculateNoOfColumns(Context context) { public static int calculateNoOfColumns(Context context) {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
@ -88,21 +91,18 @@ public class RetroUtil {
return RetroApplication.getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; return RetroApplication.getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
} }
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public static boolean isRTL(@NonNull Context context) { public static boolean isRTL(@NonNull Context context) {
Configuration config = context.getResources().getConfiguration(); Configuration config = context.getResources().getConfiguration();
return config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; return config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
} }
@TargetApi(19) @TargetApi(19)
public static void setStatusBarTranslucent(@NonNull Window window) { public static void setStatusBarTranslucent(@NonNull Window window) {
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
} }
public static boolean isMarshMellow() { public static boolean isMarshMellow() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M; return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
} }
@ -131,7 +131,6 @@ public class RetroUtil {
return px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT); return px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
} }
public static void openUrl(Activity 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));
@ -151,7 +150,6 @@ public class RetroUtil {
return size; return size;
} }
public static void hideSoftKeyboard(@Nullable Activity activity) { public static void hideSoftKeyboard(@Nullable Activity activity) {
if (activity != null) { if (activity != null) {
View currentFocus = activity.getCurrentFocus(); View currentFocus = activity.getCurrentFocus();
@ -179,7 +177,6 @@ public class RetroUtil {
} }
} }
public static Drawable getVectorDrawable(@NonNull Resources res, @DrawableRes int resId, public static Drawable getVectorDrawable(@NonNull Resources res, @DrawableRes int resId,
@Nullable Resources.Theme theme) { @Nullable Resources.Theme theme) {
if (Build.VERSION.SDK_INT >= 21) { if (Build.VERSION.SDK_INT >= 21) {
@ -295,28 +292,18 @@ public class RetroUtil {
} }
public static void statusBarHeight(View statusBar) { public static void statusBarHeight(View statusBar) {
statusBar.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, getStatusBarHeight(statusBar.getContext()))); statusBar.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, getStatusBarHeight()));
} }
public static int getStatusBarHeight(Context context) { public static int getStatusBarHeight() {
int result = 0; int result = 0;
int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); int resourceId = RetroApplication.getContext().getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) { if (resourceId > 0) {
result = context.getResources().getDimensionPixelSize(resourceId); result = RetroApplication.getContext().getResources().getDimensionPixelSize(resourceId);
} }
return result; return result;
} }
public static int getNavigationBarHeight(Context context) {
int result = 0;
int resourceId = context.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId > 0) {
result = context.getResources().getDimensionPixelSize(resourceId);
}
return result;
}
public static void setAllowDrawUnderNavigationBar(Window window) { public static void setAllowDrawUnderNavigationBar(Window window) {
window.setNavigationBarColor(Color.TRANSPARENT); window.setNavigationBarColor(Color.TRANSPARENT);
window.getDecorView().setSystemUiVisibility(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ? window.getDecorView().setSystemUiVisibility(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ?
@ -348,7 +335,59 @@ public class RetroUtil {
return 0; return 0;
} }
public static boolean hasNavBar(Resources resources) { public static int getNavigationBarHeight(Activity activity) {
/* int result = 0;
int resourceId = RetroApplication.getContext().getResources().getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId > 0) {
result = RetroApplication.getContext().getResources().getDimensionPixelSize(resourceId);
}
return result;*/
DisplayMetrics metrics = new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
int usableHeight = metrics.heightPixels;
activity.getWindowManager().getDefaultDisplay().getRealMetrics(metrics);
int realHeight = metrics.heightPixels;
if (realHeight > usableHeight)
if (PreferenceUtil.getInstance().getFullScreenMode()) {
return 0;
} else
return realHeight - usableHeight;
else
return 0;
}
public static int getNavBarHeight(Context c) {
int result = 0;
boolean hasMenuKey = ViewConfiguration.get(c).hasPermanentMenuKey();
boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);
if (!hasMenuKey && !hasBackKey) {
//The device has a navigation bar
Resources resources = c.getResources();
int orientation = resources.getConfiguration().orientation;
int resourceId;
if (isTablet(c)) {
resourceId = resources.getIdentifier(orientation == Configuration.ORIENTATION_PORTRAIT ? "navigation_bar_height" : "navigation_bar_height_landscape", "dimen", "android");
} else {
resourceId = resources.getIdentifier(orientation == Configuration.ORIENTATION_PORTRAIT ? "navigation_bar_height" : "navigation_bar_width", "dimen", "android");
}
if (resourceId > 0) {
return resources.getDimensionPixelSize(resourceId);
}
}
return result;
}
private static boolean isTablet(Context c) {
return (c.getResources().getConfiguration().screenLayout
& Configuration.SCREENLAYOUT_SIZE_MASK)
>= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
private static boolean hasNavBar(Resources resources) {
int id = resources.getIdentifier("config_showNavigationBar", "bool", "android"); int id = resources.getIdentifier("config_showNavigationBar", "bool", "android");
if (id > 0) if (id > 0)
return resources.getBoolean(id); return resources.getBoolean(id);
@ -375,33 +414,17 @@ public class RetroUtil {
return 0; return 0;
} }
public static int getNavigationBarWidth(Resources resources) { public static boolean checkNavigationBarHeight() {
if (!hasNavBar(resources)) Resources resources = RetroApplication.getContext().getResources();
return 0;
int orientation = resources.getConfiguration().orientation; int orientation = resources.getConfiguration().orientation;
if (!hasNavBar(resources)) {
//Only phone between 0-599 has navigationbar can move return false;
boolean isSmartphone = resources.getConfiguration().smallestScreenWidthDp < 600;
if (orientation == Configuration.ORIENTATION_LANDSCAPE && isSmartphone) {
int id = resources.getIdentifier("navigation_bar_width", "dimen", "android");
if (id > 0)
return resources.getDimensionPixelSize(id);
} }
boolean isSmartPhone = resources.getConfiguration().smallestScreenWidthDp < 600;
return 0; if (isSmartPhone && Configuration.ORIENTATION_LANDSCAPE == orientation)
} return false;
int id = resources
public static boolean isNavigationBarLeftSide() { .getIdentifier(orientation == Configuration.ORIENTATION_PORTRAIT ? "navigation_bar_height" : "navigation_bar_height_landscape", "dimen", "android");
Display display = ((WindowManager) RetroApplication.getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); return id > 0;
int screenOrientation = display.getRotation();
return screenOrientation == Surface.ROTATION_180;
}
public static boolean isNavigationBarRightSide() {
Display display = ((WindowManager) RetroApplication.getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
int screenOrientation = display.getRotation();
return screenOrientation == Surface.ROTATION_90;
} }
} }

View file

@ -0,0 +1,99 @@
package code.name.monkey.retromusic.util;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.view.ViewGroup;
import code.name.monkey.retromusic.RetroApplication;
public class SystemUtils {
private static final String STATUS_BAR_HEIGHT_RES_NAME = "status_bar_height";
private static final String NAV_BAR_HEIGHT_RES_NAME = "navigation_bar_height";
private static final String NAV_BAR_HEIGHT_LANDSCAPE_RES_NAME = "navigation_bar_height_landscape";
private static final String NAV_BAR_WIDTH_RES_NAME = "navigation_bar_width";
private static final String SHOW_NAV_BAR_RES_NAME = "config_showNavigationBar";
private final float mSmallestWidthDp;
private final boolean mInPortrait;
private Activity activity;
public SystemUtils(Activity activity) {
this.activity = activity;
Resources resources = activity.getResources();
mSmallestWidthDp = getSmallestWidthDp(activity);
mInPortrait = (resources.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT);
}
private static boolean hasNavBar(Resources resources) {
int id = resources.getIdentifier(SHOW_NAV_BAR_RES_NAME, "bool", "android");
if (id > 0)
return resources.getBoolean(id);
else
return false;
}
public static int getNavigationBarHeight() {
int result = 0;
int resourceId = RetroApplication.getContext().getResources().getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId > 0) {
result = RetroApplication.getContext().getResources().getDimensionPixelSize(resourceId);
}
return result;
}
public int getComboHeight() {
if (isNavigationAtBottom()) {
return getNavigationBarWidth();
} else {
return getNavigationBarHeight();
}
}
public int getNavigationBarWidth() {
Resources res = activity.getResources();
int result = 0;
if (hasNavBar(activity.getResources())) {
if (!isNavigationAtBottom())
return getInternalDimensionSize(res, NAV_BAR_WIDTH_RES_NAME);
}
return result;
}
public void addPadding(ViewGroup viewGroup) {
Context context = viewGroup.getContext();
Resources resources = context.getResources();
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) viewGroup.getLayoutParams();
if (isNavigationAtBottom()) {
params.leftMargin = getNavigationBarWidth();
params.rightMargin = getNavigationBarWidth();
} else {
params.bottomMargin = getNavigationBarHeight();
}
}
private int getInternalDimensionSize(Resources res, String key) {
int result = 0;
int resourceId = res.getIdentifier(key, "dimen", "android");
if (resourceId > 0) {
result = res.getDimensionPixelSize(resourceId);
}
return result;
}
private float getSmallestWidthDp(Activity activity) {
DisplayMetrics metrics = new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getRealMetrics(metrics);
float widthDp = metrics.widthPixels / metrics.density;
float heightDp = metrics.heightPixels / metrics.density;
return Math.min(widthDp, heightDp);
}
boolean isNavigationAtBottom() {
return (mSmallestWidthDp >= 600 || mInPortrait);
}
}

View file

@ -33,12 +33,7 @@ public class FitSystemWindowsLayout extends FrameLayout {
} }
mFit = fit; mFit = fit;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) { requestApplyInsets();
requestApplyInsets();
} else {
//noinspection deprecation
requestFitSystemWindows();
}
} }
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")

View file

@ -92,7 +92,7 @@ public class MetalRecyclerViewPager extends RecyclerView {
if (RetroUtil.isTablet()) { if (RetroUtil.isTablet()) {
itemWidth = (metrics.widthPixels / 2) - itemMargin * 3; itemWidth = (metrics.widthPixels / 2) - itemMargin * 3;
} else { } else {
itemWidth = metrics.widthPixels - itemMargin * 2; itemWidth = metrics.widthPixels - itemMargin ;
} }
} }

View file

@ -1,33 +0,0 @@
package code.name.monkey.retromusic.views;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.WindowInsets;
import android.widget.FrameLayout;
public class StatusBarMarginFrameLayout extends FrameLayout {
public StatusBarMarginFrameLayout(Context context) {
super(context);
}
public StatusBarMarginFrameLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public StatusBarMarginFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
MarginLayoutParams lp = (MarginLayoutParams) getLayoutParams();
lp.topMargin = insets.getSystemWindowInsetTop();
setLayoutParams(lp);
}
return super.onApplyWindowInsets(insets);
}
}

View file

@ -0,0 +1,141 @@
/*
* Mantou Earth - Live your wallpaper with live earth
* Copyright (C) 2015 XiNGRZ <xxx@oxo.ooo>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package code.name.monkey.retromusic.views;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Rect;
import android.os.Build;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.widget.FrameLayout;
import androidx.core.view.GravityCompat;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
public class WindowInsetsFrameLayout extends FrameLayout {
private static final String TAG = "WindowInsetsFrameLayout";
public WindowInsetsFrameLayout(Context context) {
this(context, null);
}
public WindowInsetsFrameLayout(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public WindowInsetsFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
ViewCompat.setOnApplyWindowInsetsListener(this, (v, insets) ->
applySystemWindowInsets21(insets) ? insets.consumeSystemWindowInsets() : insets);
}
@Override
@SuppressWarnings("deprecation")
protected boolean fitSystemWindows(Rect insets) {
if (Build.VERSION.SDK_INT >= 19 && Build.VERSION.SDK_INT < 21) {
return applySystemWindowInsets19(insets);
}
return super.fitSystemWindows(insets);
}
@TargetApi(19)
private boolean applySystemWindowInsets19(Rect insets) {
boolean consumed = false;
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (!child.getFitsSystemWindows()) {
continue;
}
Rect childInsets = new Rect(insets);
computeInsetsWithGravity(child, childInsets);
child.setPadding(childInsets.left, childInsets.top, childInsets.right, childInsets.bottom);
consumed = true;
}
return consumed;
}
@TargetApi(21)
private boolean applySystemWindowInsets21(WindowInsetsCompat insets) {
boolean consumed = false;
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (!child.getFitsSystemWindows()) {
continue;
}
Rect childInsets = new Rect(
insets.getSystemWindowInsetLeft(),
insets.getSystemWindowInsetTop(),
insets.getSystemWindowInsetRight(),
insets.getSystemWindowInsetBottom());
computeInsetsWithGravity(child, childInsets);
ViewCompat.dispatchApplyWindowInsets(child, insets.replaceSystemWindowInsets(childInsets));
consumed = true;
}
return consumed;
}
@SuppressLint("RtlHardcoded")
private void computeInsetsWithGravity(View view, Rect insets) {
LayoutParams lp = (LayoutParams) view.getLayoutParams();
int gravity = GravityCompat.getAbsoluteGravity(
lp.gravity, ViewCompat.getLayoutDirection(view));
if (lp.width != LayoutParams.MATCH_PARENT) {
if ((gravity & Gravity.LEFT) != Gravity.LEFT) {
insets.left = 0;
}
if ((gravity & Gravity.RIGHT) != Gravity.RIGHT) {
insets.right = 0;
}
}
if (lp.height != LayoutParams.MATCH_PARENT) {
if ((gravity & Gravity.TOP) != Gravity.TOP) {
insets.top = 0;
}
if ((gravity & Gravity.BOTTOM) != Gravity.BOTTOM) {
insets.bottom = 0;
}
}
}
}

View file

@ -7,6 +7,6 @@
<path android:pathData="M0,0h24v24H0V0z" /> <path android:pathData="M0,0h24v24H0V0z" />
<path <path
android:fillColor="?iconColor" android:fillColor="@color/md_white_1000"
android:pathData="M4,18h16c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H4c-0.55,0-1,0.45-1,1v0C3,17.55,3.45,18,4,18z M4,13h16c0.55,0,1-0.45,1-1 v0c0-0.55-0.45-1-1-1H4c-0.55,0-1,0.45-1,1v0C3,12.55,3.45,13,4,13z M3,7L3,7c0,0.55,0.45,1,1,1h16c0.55,0,1-0.45,1-1v0 c0-0.55-0.45-1-1-1H4C3.45,6,3,6.45,3,7z" /> android:pathData="M4,18h16c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H4c-0.55,0-1,0.45-1,1v0C3,17.55,3.45,18,4,18z M4,13h16c0.55,0,1-0.45,1-1 v0c0-0.55-0.45-1-1-1H4c-0.55,0-1,0.45-1,1v0C3,12.55,3.45,13,4,13z M3,7L3,7c0,0.55,0.45,1,1,1h16c0.55,0,1-0.45,1-1v0 c0-0.55-0.45-1-1-1H4C3.45,6,3,6.45,3,7z" />
</vector> </vector>

View file

@ -31,6 +31,7 @@
</FrameLayout> </FrameLayout>
<androidx.core.widget.NestedScrollView <androidx.core.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:layout_weight="1" android:layout_weight="1"
@ -47,7 +48,6 @@
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:cardCornerRadius="14dp" app:cardCornerRadius="14dp"

View file

@ -1,119 +1,72 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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_width="match_parent"
android:layout_height="match_parent"> android:id="@+id/main_fragment_content"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:orientation="horizontal">
<com.google.android.material.appbar.AppBarLayout <include layout="@layout/status_bar" />
android:id="@+id/app_bar" </FrameLayout>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
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:orientation="horizontal">
tools:ignore="UnusedAttribute">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:statusBarScrim="?attr/colorPrimary">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/status_bar" />
</FrameLayout>
<androidx.appcompat.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:layout_weight="1"
android:gravity="center"
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
tools:ignore="MissingPrefix" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:layout_weight="0"
app:civ_border="false" />
</LinearLayout>
</androidx.appcompat.widget.Toolbar>
</LinearLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/image_container" android:id="@+id/image_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_margin="4dp" android:layout_margin="4dp"
android:layout_weight="1"
app:cardCornerRadius="8dp" app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="true">
<ImageView <ImageView
android:id="@+id/image" android:id="@+id/image"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="196dp" android:layout_height="match_parent"
android:scaleType="centerCrop" android:scaleType="centerCrop"
app:layout_collapseMode="parallax" app:layout_collapseMode="parallax"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
<androidx.core.widget.NestedScrollView android:id="@+id/container"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:elevation="@dimen/card_elevation"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="@+id/content_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants" android:layout_weight="1"
android:focusable="true" android:elevation="@dimen/card_elevation"
android:focusableInTouchMode="true" app:layout_behavior="@string/appbar_scrolling_view_behavior">
android:orientation="vertical">
<include layout="@layout/status_bar" />
<include layout="@layout/abs_playlists" /> <LinearLayout
android:id="@+id/content_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/home_section_content" />
</LinearLayout> <include layout="@layout/abs_playlists" />
</androidx.core.widget.NestedScrollView>
</LinearLayout> <include layout="@layout/home_section_content" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</LinearLayout>

View file

@ -3,6 +3,7 @@
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_width="match_parent"
android:id="@+id/main_fragment_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
@ -20,44 +21,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:elevation="0dp"
app:elevation="0dp"
tools:ignore="UnusedAttribute">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:titleEnabled="false">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
style="@style/BigTitleTextAppearance"
android:text="@string/app_name" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="end"
android:layout_marginEnd="16dp"
app:civ_border="false" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -65,8 +28,6 @@
android:layout_marginStart="@dimen/horizontal_margin" android:layout_marginStart="@dimen/horizontal_margin"
android:layout_marginEnd="@dimen/horizontal_margin" android:layout_marginEnd="@dimen/horizontal_margin"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/bg_circular_top_corners"
android:elevation="@dimen/card_elevation"
app:behavior_overlapTop="24dp" app:behavior_overlapTop="24dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"> app:layout_behavior="@string/appbar_scrolling_view_behavior">

View file

@ -3,31 +3,23 @@
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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:cardCornerRadius="20dp" android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="true">
<FrameLayout <androidx.appcompat.widget.Toolbar
android:id="@+id/search" android:id="@+id/toolbar"
android:layout_width="match_parent" style="@style/Toolbar48"
android:layout_height="wrap_content" tools:ignore="UnusedAttribute"
android:background="?rectSelector" android:layout_gravity="center_vertical"
android:gravity="center_vertical"> app:layout_collapseMode="pin">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/search_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="14dp"
android:paddingTop="10dp"
android:paddingEnd="12dp"
android:paddingBottom="10dp"
app:srcCompat="@drawable/ic_search_white_24dp"
app:tint="?colorAccent" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView <code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
android:id="@+id/search_view" android:id="@+id/search_view"
@ -38,7 +30,14 @@
android:hint="@string/search_hint" android:hint="@string/search_hint"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Subhead" /> android:textAppearance="@style/Base.TextAppearance.AppCompat.Subhead" />
</FrameLayout> <code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="16dp"
app:civ_border="false" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <code.name.monkey.retromusic.views.FitSystemWindowsLayout 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_width="match_parent"
@ -90,4 +90,4 @@
app:mpb_showProgressBackground="false" app:mpb_showProgressBackground="false"
app:mpb_useIntrinsicPadding="false" /> app:mpb_useIntrinsicPadding="false" />
</FrameLayout> </code.name.monkey.retromusic.views.FitSystemWindowsLayout>

View file

@ -2,6 +2,7 @@
<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:id="@+id/main_fragment_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
@ -20,44 +21,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:elevation="0dp"
app:elevation="0dp"
tools:ignore="UnusedAttribute">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:titleEnabled="false">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
style="@style/BigTitleTextAppearance"
android:text="@string/app_name" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="end"
android:layout_marginEnd="16dp"
app:civ_border="false" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -76,6 +39,23 @@
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:id="@+id/image_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="196dp"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
tools:ignore="ContentDescription" />
</com.google.android.material.card.MaterialCardView>
<include layout="@layout/abs_playlists" /> <include layout="@layout/abs_playlists" />
<include layout="@layout/home_section_content" /> <include layout="@layout/home_section_content" />

View file

@ -1,96 +1,49 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:id="@+id/main_fragment_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout <FrameLayout
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"
tools:ignore="UnusedAttribute"> tools:ignore="UnusedAttribute">
<com.google.android.material.appbar.CollapsingToolbarLayout <include layout="@layout/status_bar" />
android:id="@+id/collapsing_toolbar"
</FrameLayout>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.core.widget.NestedScrollView
android:id="@+id/container"
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" android:layout_marginStart="128dp"
app:statusBarScrim="?attr/colorPrimary"> android:layout_marginEnd="128dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout <LinearLayout
android:id="@+id/content_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <include layout="@layout/abs_playlists" />
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/status_bar" /> <include layout="@layout/home_section_content" />
</FrameLayout>
<androidx.appcompat.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:layout_weight="1"
android:gravity="center"
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
tools:ignore="MissingPrefix" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:layout_weight="0"
app:civ_border="false" />
</LinearLayout>
</androidx.appcompat.widget.Toolbar>
</LinearLayout> </LinearLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout> </androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</com.google.android.material.appbar.AppBarLayout> </LinearLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="128dp"
android:layout_marginEnd="128dp"
android:elevation="@dimen/card_elevation"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="@+id/content_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>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -2,6 +2,7 @@
<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:id="@+id/main_fragment_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
@ -20,45 +21,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:elevation="0dp"
app:elevation="0dp"
tools:ignore="UnusedAttribute">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:titleEnabled="false">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
style="@style/BigTitleTextAppearance"
android:text="@string/app_name" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="end"
android:layout_marginEnd="16dp"
app:civ_border="false" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -3,6 +3,7 @@
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_width="match_parent"
android:id="@+id/main_fragment_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
@ -20,43 +21,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:elevation="0dp"
app:elevation="0dp"
tools:ignore="UnusedAttribute">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:titleEnabled="false">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
style="@style/BigTitleTextAppearance"
android:text="@string/app_name" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="end"
android:layout_marginEnd="16dp"
app:civ_border="false" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container" android:id="@+id/container"

View file

@ -1,6 +1,7 @@
<?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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
@ -8,28 +9,17 @@
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:cardCornerRadius="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="true">
<FrameLayout <androidx.appcompat.widget.Toolbar
android:id="@+id/search" android:id="@+id/toolbar"
android:layout_width="match_parent" style="@style/Toolbar48"
android:layout_height="wrap_content" android:layout_gravity="center_vertical"
android:background="?rectSelector" app:layout_collapseMode="pin"
android:gravity="center_vertical"> tools:ignore="UnusedAttribute">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/search_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="14dp"
android:paddingTop="10dp"
android:paddingEnd="12dp"
android:paddingBottom="10dp"
app:srcCompat="@drawable/ic_search_white_24dp"
app:tint="?colorAccent" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView <code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
android:id="@+id/search_view" android:id="@+id/search_view"
@ -40,7 +30,14 @@
android:hint="@string/search_hint" android:hint="@string/search_hint"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Subhead" /> android:textAppearance="@style/Base.TextAppearance.AppCompat.Subhead" />
</FrameLayout> <code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="16dp"
app:civ_border="false" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView <code.name.monkey.appthemehelper.common.views.ATESecondaryTextView

View file

@ -89,7 +89,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:src="@drawable/ic_shuffle_white_24dp" android:src="@drawable/ic_shuffle_white_24dp"
app:showTitle="true" /> app:showTitle="true" />

View file

@ -19,9 +19,10 @@
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/search"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
app:cardCornerRadius="8dp" app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="true">

View file

@ -61,6 +61,7 @@
android:layoutDirection="ltr" android:layoutDirection="ltr"
android:paddingEnd="4dp" android:paddingEnd="4dp"
android:paddingStart="4dp" android:paddingStart="4dp"
android:layout_marginBottom="8dp"
tools:ignore="ContentDescription,UnusedAttribute"> tools:ignore="ContentDescription,UnusedAttribute">
<ImageButton <ImageButton

View file

@ -3,15 +3,13 @@
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_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" >
android:layout_gravity="center_vertical">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/player_album_art_frame" android:id="@+id/player_album_art_frame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="16dp" android:layout_margin="16dp"
app:cardCornerRadius="8dp" app:cardCornerRadius="8dp"
app:cardElevation="8dp"> app:cardElevation="8dp">

View file

@ -3,14 +3,12 @@
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_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" >
android:layout_gravity="center_vertical">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/player_album_art_frame" android:id="@+id/player_album_art_frame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="16dp" android:layout_margin="16dp"
app:cardCornerRadius="8dp"> app:cardCornerRadius="8dp">

View file

@ -3,6 +3,7 @@
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_width="match_parent"
android:id="@+id/main_fragment_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
@ -17,44 +18,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
android:focusable="true"
app:elevation="0dp"
tools:ignore="UnusedAttribute">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:titleEnabled="false">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
style="@style/BigTitleTextAppearance"
android:text="@string/app_name" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="end"
android:layout_marginEnd="16dp"
app:civ_border="false" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -72,6 +35,7 @@
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/image_container" android:id="@+id/image_container"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -2,6 +2,7 @@
<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:id="@+id/main_fragment_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
@ -22,44 +23,50 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"> android:layout_weight="1">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.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:layout_weight="0"
android:elevation="0dp" android:elevation="0dp"
app:elevation="0dp"> app:elevation="0dp">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.card.MaterialCardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways" android:layout_marginStart="8dp"
app:titleEnabled="false"> android:layout_marginEnd="8dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"
app:layout_scrollFlags="scroll|enterAlways">
<FrameLayout <androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
android:layout_gravity="center_vertical"
app:layout_collapseMode="pin"
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
style="@style/BigTitleTextAppearanceToolbar"
android:text="@string/folders"
tools:ignore="MissingPrefix" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="16dp"
app:civ_border="false" />
</androidx.appcompat.widget.Toolbar>
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent" />
app:layout_collapseMode="pin"> </com.google.android.material.card.MaterialCardView>
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
style="@style/BigTitleTextAppearance"
android:text="@string/folders"
tools:ignore="MissingPrefix" />
</androidx.appcompat.widget.Toolbar>
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="48dp" />
</FrameLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<FrameLayout <FrameLayout

View file

@ -11,12 +11,12 @@
android:name="code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment" android:name="code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:layout="@layout/fragment_player_album_cover" /> tools:layout="@layout/fragment_album_full_cover" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#30000000" /> android:background="#50000000" />
<code.name.monkey.retromusic.views.FitSystemWindowsLayout <code.name.monkey.retromusic.views.FitSystemWindowsLayout
android:id="@+id/safeArea" android:id="@+id/safeArea"

View file

@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/main_fragment_content"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
@ -18,44 +19,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:elevation="0dp"
app:elevation="0dp"
tools:ignore="UnusedAttribute">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:titleEnabled="false">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
app:layout_collapseMode="pin"
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
style="@style/BigTitleTextAppearance"
android:text="@string/app_name" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_gravity="end"
android:layout_marginEnd="16dp"
app:civ_border="false" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -2,6 +2,7 @@
<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:id="@+id/main_fragment_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
@ -21,53 +22,51 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.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:layout_weight="0"
android:elevation="0dp" android:elevation="0dp"
app:elevation="0dp"> app:elevation="0dp">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.card.MaterialCardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways" android:layout_marginStart="8dp"
app:titleEnabled="false"> android:layout_marginEnd="8dp"
app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true"
app:layout_scrollFlags="scroll|enterAlways">
<FrameLayout <androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
android:layout_gravity="center_vertical"
app:layout_collapseMode="pin"
tools:ignore="UnusedAttribute">
<TextView
android:id="@+id/title"
style="@style/BigTitleTextAppearanceToolbar"
android:text="@string/app_name"
tools:ignore="MissingPrefix" />
<code.name.monkey.retromusic.views.CircularImageView
android:id="@+id/user_image"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="16dp"
app:civ_border="false" />
</androidx.appcompat.widget.Toolbar>
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent" />
app:layout_collapseMode="pin"> </com.google.android.material.card.MaterialCardView>
<code.name.monkey.retromusic.views.TintIconColorToolbar
android:id="@+id/toolbar"
style="@style/Toolbar48"
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/app_name"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
tools:ignore="MissingPrefix" />
</code.name.monkey.retromusic.views.TintIconColorToolbar>
<ViewStub
android:id="@+id/cab_stub"
android:layout_width="match_parent"
android:layout_height="48dp" />
</FrameLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<FrameLayout <FrameLayout
android:id="@+id/fragment_container" android:id="@+id/fragment_container"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <code.name.monkey.retromusic.views.FitSystemWindowsLayout 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_width="match_parent"
@ -7,6 +7,7 @@
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:clickable="true" android:clickable="true"
android:focusable="false" android:focusable="false"
android:id="@+id/mini_player_content"
tools:ignore="UnusedAttribute"> tools:ignore="UnusedAttribute">
<LinearLayout <LinearLayout
@ -89,6 +90,5 @@
android:layout_height="3dp" android:layout_height="3dp"
android:progress="20" android:progress="20"
app:mpb_progressStyle="horizontal" app:mpb_progressStyle="horizontal"
app:mpb_showProgressBackground="false"
app:mpb_useIntrinsicPadding="false" /> app:mpb_useIntrinsicPadding="false" />
</FrameLayout> </code.name.monkey.retromusic.views.FitSystemWindowsLayout>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.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_width="match_parent"
@ -14,7 +14,7 @@
<include layout="@layout/shadow_statusbar_toolbar" /> <include layout="@layout/shadow_statusbar_toolbar" />
<code.name.monkey.retromusic.views.FitSystemWindowsLayout <FrameLayout
android:id="@+id/safeArea" android:id="@+id/safeArea"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -65,5 +65,5 @@
app:navigationIcon="@drawable/ic_close_white_24dp" /> app:navigationIcon="@drawable/ic_close_white_24dp" />
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
</code.name.monkey.retromusic.views.FitSystemWindowsLayout> </FrameLayout>
</FrameLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -51,7 +51,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" android:nestedScrollingEnabled="false"
app:itemMargin="28dp" /> app:itemMargin="96dp" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -0,0 +1,37 @@
<?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="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:layout_width="112dp"
android:layout_height="156dp"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
app:cardUseCompatPadding="true">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
</com.google.android.material.card.MaterialCardView>
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/title"
fontPath="@string/circular_std_black"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ellipsize="end"
android:maxLines="1"
android:paddingStart="8dp"
android:paddingTop="6dp"
android:paddingEnd="8dp"
android:paddingBottom="4dp"
android:textSize="12sp"
tools:ignore="MissingPrefix"
tools:text="My top tracks" />
</LinearLayout>

View file

@ -10,7 +10,7 @@
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
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="172dp"
app:cardCornerRadius="12dp" app:cardCornerRadius="12dp"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="true">

View file

@ -2,14 +2,19 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.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/parentPanel"
android:layout_width="match_parent" android:layout_width="match_parent"
android:id="@+id/main_content"
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:gravity="bottom"
sothree:umanoOverlay="false"
sothree:umanoPanelHeight="0dp"
sothree:umanoScrollableView="@+id/recycler_view"
sothree:umanoShadowHeight="0dp">
<FrameLayout <FrameLayout
android:id="@+id/content_container" android:id="@+id/content_container"
@ -17,41 +22,38 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" /> android:layout_weight="1" />
<FrameLayout
<LinearLayout android:id="@+id/sliding_panel"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent">
android:layout_weight="0"
android:background="@drawable/bg_circular_top_corners"
android:orientation="vertical">
<FrameLayout <FrameLayout
android:id="@+id/mini_player_container" android:id="@+id/player_fragment_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent" />
android:visibility="gone">
<fragment <fragment
android:id="@+id/mini_player_fragment" android:id="@+id/mini_player_fragment"
android:name="code.name.monkey.retromusic.ui.fragments.MiniPlayerFragment" android:name="code.name.monkey.retromusic.ui.fragments.MiniPlayerFragment"
android:layout_width="match_parent"
android:layout_height="48dp"
tools:layout="@layout/fragment_mini_player" />
</FrameLayout>
<code.name.monkey.retromusic.views.BottomNavigationBarTinted
android:id="@+id/bottom_navigation"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="56dp" android:layout_height="48dp"
android:elevation="0dp" tools:layout="@layout/fragment_mini_player" />
app:elevation="0dp"
app:itemIconTint="@drawable/bottom_navigation_item_colors"
app:itemTextAppearanceActive="@style/BottomSheetTextAppearance"
app:itemTextAppearanceInactive="@style/BottomSheetTextAppearance"
app:itemTextColor="@drawable/bottom_navigation_item_colors"
app:labelVisibilityMode="labeled"
app:menu="@menu/bottom_navigation_main" />
</LinearLayout> </FrameLayout>
</LinearLayout> </com.sothree.slidinguppanel.SlidingUpPanelLayout>
<code.name.monkey.retromusic.views.BottomNavigationBarTinted
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_gravity="bottom"
android:elevation="0dp"
app:elevation="0dp"
app:itemIconTint="@drawable/bottom_navigation_item_colors"
app:itemTextAppearanceActive="@style/BottomSheetTextAppearance"
app:itemTextAppearanceInactive="@style/BottomSheetTextAppearance"
app:itemTextColor="@drawable/bottom_navigation_item_colors"
app:labelVisibilityMode="labeled"
app:menu="@menu/bottom_navigation_main" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -3,12 +3,6 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
tools:context=".DrawerActivity"> tools:context=".DrawerActivity">
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_search_white_24dp"
android:title="@string/action_search"
app:showAsAction="ifRoom" />
<item <item
android:id="@+id/action_shuffle_all" android:id="@+id/action_shuffle_all"
android:icon="@drawable/ic_shuffle_white_24dp" android:icon="@drawable/ic_shuffle_white_24dp"

View file

@ -3,20 +3,26 @@
<style name="Theme.RetroMusic" parent="Theme.RetroMusic.Base"> <style name="Theme.RetroMusic" parent="Theme.RetroMusic.Base">
<item name="android:statusBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowSharedElementsUseOverlay">false</item> <item name="android:windowSharedElementsUseOverlay">false</item>
<item name="android:textViewStyle">@style/TextViewStyleIm</item>
</style> </style>
<style name="Theme.RetroMusic.Light" parent="Theme.RetroMusic.Base.Light"> <style name="Theme.RetroMusic.Light" parent="Theme.RetroMusic.Base.Light">
<item name="android:statusBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowSharedElementsUseOverlay">false</item> <item name="android:windowSharedElementsUseOverlay">false</item>
<item name="android:textViewStyle">@style/TextViewStyleIm</item>
</style> </style>
<style name="Theme.RetroMusic.Black" parent="Theme.RetroMusic.Base.Black"> <style name="Theme.RetroMusic.Black" parent="Theme.RetroMusic.Base.Black">
<item name="android:statusBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowSharedElementsUseOverlay">false</item> <item name="android:windowSharedElementsUseOverlay">false</item>
<item name="android:textViewStyle">@style/TextViewStyleIm</item>
</style> </style>
<style name="RetroTextViewStyle" parent="android:Widget.Material.TextView" />
<style name="TextViewStyleIm" parent="RetroTextViewStyle">
<item name="android:hyphenationFrequency">none</item>
</style>
<style name="Theme.RetroMusic.Notification" parent="@android:style/TextAppearance.Material.Notification" /> <style name="Theme.RetroMusic.Notification" parent="@android:style/TextAppearance.Material.Notification" />

View file

@ -75,16 +75,19 @@
<string-array name="pref_home_grid_style_list_titles"> <string-array name="pref_home_grid_style_list_titles">
<item>@string/circular</item> <item>@string/circular</item>
<item>@string/card_color_style</item> <item>@string/card_color_style</item>
<item>@string/card_style</item>
</string-array> </string-array>
<string-array name="pref_home_grid_style_list_values"> <string-array name="pref_home_grid_style_list_values">
<item>0</item> <item>0</item>
<item>1</item> <item>1</item>
<item>2</item>
</string-array> </string-array>
<array name="pref_home_grid_style_layout"> <array name="pref_home_grid_style_layout">
<item>@layout/item_artist</item> <item>@layout/item_artist</item>
<item>@layout/item_artist_square</item> <item>@layout/item_artist_square</item>
<item>@layout/item_album_card</item>
</array> </array>
<string-array name="pref_general_theme_list_values"> <string-array name="pref_general_theme_list_values">

View file

@ -59,5 +59,4 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
<dimen name="horizontal_margin">0dp</dimen> <dimen name="horizontal_margin">0dp</dimen>
<dimen name="bottom_sheet_width">0dp</dimen> <dimen name="bottom_sheet_width">0dp</dimen>
<dimen name="mini_player_height_expanded">104dp</dimen> <dimen name="mini_player_height_expanded">104dp</dimen>
</resources> </resources>

View file

@ -50,6 +50,16 @@
</style> </style>
<style name="BigTitleTextAppearance"> <style name="BigTitleTextAppearance">
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Headline6
</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="fontPath">@string/circular_std_black</item>
<item name="android:layout_gravity">center</item>
<item name="android:gravity">center</item>
</style>
<style name="BigTitleTextAppearanceToolbar">
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Headline6</item> <item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Headline6</item>
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>

View file

@ -1,119 +0,0 @@
package code.name.monkey.retromusic;
import android.os.Build;
import com.anjlab.android.iab.v3.BillingProcessor;
import com.anjlab.android.iab.v3.TransactionDetails;
import com.bumptech.glide.Glide;
import androidx.annotation.NonNull;
import androidx.multidex.MultiDexApplication;
import code.name.monkey.appthemehelper.ThemeStore;
import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager;
import uk.co.chrisjenx.calligraphy.CalligraphyConfig;
public class RetroApplication extends MultiDexApplication {
public static final String PRO_VERSION_PRODUCT_ID = "pro_version";
private static RetroApplication app;
private BillingProcessor billingProcessor;
public static RetroApplication getInstance() {
return app;
}
public static boolean isProVersion() {
return BuildConfig.DEBUG || app.billingProcessor.isPurchased(PRO_VERSION_PRODUCT_ID);
}
public static void deleteAppData() {
try {
// clearing app data
String packageName = app.getPackageName();
Runtime runtime = Runtime.getRuntime();
runtime.exec("pm clear " + packageName);
System.exit(0);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onCreate() {
super.onCreate();
app = this;
setupErrorHandler();
// default theme
if (!ThemeStore.isConfigured(this, 1)) {
ThemeStore.editTheme(this)
.accentColorRes(R.color.md_green_A200)
.commit();
}
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
.setDefaultFontPath("fonts/circular_std_book.otf")
.setFontAttrId(R.attr.fontPath)
.build()
);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
new DynamicShortcutManager(this).initDynamicShortcuts();
}
// automatically restores purchases
billingProcessor = new BillingProcessor(this, BuildConfig.GOOGLE_PLAY_LICENSE_KEY,
new BillingProcessor.IBillingHandler() {
@Override
public void onProductPurchased(@NonNull String productId, TransactionDetails details) {
}
@Override
public void onPurchaseHistoryRestored() {
//Toast.makeText(App.this, R.string.restored_previous_purchase_please_restart, Toast.LENGTH_LONG).show();
}
@Override
public void onBillingError(int errorCode, Throwable error) {
}
@Override
public void onBillingInitialized() {
}
});
}
private void setupErrorHandler() {
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable throwable) {
handleUncaughtException(thread, throwable);
}
});
}
private void handleUncaughtException(Thread thread, Throwable throwable) {
throwable.printStackTrace();
deleteAppData();
//Intent intent = new Intent(this, ErrorHandlerActivity.class);
//intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//startActivity(intent);
}
@Override
public void onLowMemory() {
super.onLowMemory();
Glide.with(this).onLowMemory();
}
@Override
public void onTerminate() {
super.onTerminate();
billingProcessor.release();
}
}