backup with notch problem
This commit is contained in:
parent
f31831ea7f
commit
62b12da2ad
70 changed files with 1131 additions and 990 deletions
28
app/app.iml
28
app/app.iml
|
@ -158,6 +158,7 @@
|
|||
<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/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/rs" />
|
||||
<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/transforms" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
|
||||
<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: 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: 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.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.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: 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.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: 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: 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.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: 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.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: 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: 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: 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.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: 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: 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: 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: 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: 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.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: 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: 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: 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.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: 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.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: 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.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: 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: 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.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: io.reactivex.rxjava2:rxandroid-2.0.2" 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.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: 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.print:print-1.0.0" level="project" />
|
||||
<orderEntry type="library" name="Gradle: androidx.collection:collection:1.0.0@jar" level="project" />
|
||||
|
|
|
@ -11,8 +11,8 @@ android {
|
|||
vectorDrawables.useSupportLibrary = true
|
||||
|
||||
applicationId "code.name.monkey.retromusic"
|
||||
versionCode 246
|
||||
versionName '2.2.000'
|
||||
versionCode 252
|
||||
versionName '2.2.100'
|
||||
|
||||
multiDexEnabled true
|
||||
|
||||
|
@ -99,7 +99,7 @@ dependencies {
|
|||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'androidx.multidex:multidex:2.0.0'
|
||||
implementation "androidx.fragment:fragment:$supportLibVersion"
|
||||
implementation "androidx.appcompat:appcompat:$supportLibVersion"
|
||||
implementation "androidx.appcompat:appcompat:1.0.2"
|
||||
implementation "androidx.recyclerview:recyclerview:$supportLibVersion"
|
||||
implementation "androidx.gridlayout:gridlayout:$supportLibVersion"
|
||||
implementation "androidx.cardview:cardview:$supportLibVersion"
|
||||
|
@ -112,7 +112,7 @@ dependencies {
|
|||
|
||||
//For casting
|
||||
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:converter-gson:2.4.0"
|
||||
|
@ -143,7 +143,7 @@ dependencies {
|
|||
implementation 'com.r0adkll:slidableactivity:2.0.6'
|
||||
/*Backend all*/
|
||||
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 'org.nanohttpd:nanohttpd:2.3.1'
|
||||
|
||||
|
|
|
@ -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>
|
|
@ -3,6 +3,7 @@ package code.name.monkey.retromusic.cast;
|
|||
import android.net.Uri;
|
||||
|
||||
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.framework.CastSession;
|
||||
import com.google.android.gms.cast.framework.media.RemoteMediaClient;
|
||||
|
@ -22,7 +23,7 @@ public class CastHelper {
|
|||
String ipAddress = RetroUtil.getIPAddress(true);
|
||||
URL baseUrl;
|
||||
try {
|
||||
baseUrl = new URL("http", ipAddress, Constants.CAST_SERVER_PORT, "");
|
||||
baseUrl = new URL("https", ipAddress, Constants.CAST_SERVER_PORT, "");
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
|
@ -48,7 +49,9 @@ public class CastHelper {
|
|||
.setStreamDuration(song.duration)
|
||||
.build();
|
||||
RemoteMediaClient remoteMediaClient = castSession.getRemoteMediaClient();
|
||||
remoteMediaClient.load(mediaInfo, true, 0);
|
||||
remoteMediaClient.load(mediaInfo, new MediaLoadOptions.Builder()
|
||||
.build());
|
||||
//remoteMediaClient.load(mediaInfo, true, 0);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -455,10 +455,6 @@ public class MusicPlayerRemote {
|
|||
return musicService != null;
|
||||
}
|
||||
|
||||
public static void setZeroVolume() {
|
||||
|
||||
}
|
||||
|
||||
@interface PlaybackLocation {
|
||||
int REMOTE = 0;
|
||||
int LOCAL = 1;
|
||||
|
|
|
@ -305,6 +305,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
|
|||
|
||||
registerHeadsetEvents();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private AudioManager getAudioManager() {
|
||||
|
@ -1209,6 +1210,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
|
|||
playerHandler.sendEmptyMessage(TRACK_ENDED);
|
||||
}
|
||||
|
||||
|
||||
private static final class QueueSaveHandler extends Handler {
|
||||
@NonNull
|
||||
private final WeakReference<MusicService> mService;
|
||||
|
|
|
@ -186,7 +186,7 @@ public class AlbumDetailsActivity extends AbsSlidingMusicPanelActivity implement
|
|||
|
||||
if (toolbar != null && !PreferenceUtil.getInstance().getFullScreenMode()) {
|
||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
|
||||
params.topMargin = RetroUtil.getStatusBarHeight(this);
|
||||
params.topMargin = RetroUtil.getStatusBarHeight( );
|
||||
toolbar.setLayoutParams(params);
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ public class ArtistDetailActivity extends AbsSlidingMusicPanelActivity implement
|
|||
|
||||
if (toolbar != null && !PreferenceUtil.getInstance().getFullScreenMode()) {
|
||||
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
|
||||
params.topMargin = RetroUtil.getStatusBarHeight(this);
|
||||
params.topMargin = RetroUtil.getStatusBarHeight( );
|
||||
toolbar.setLayoutParams(params);
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public class LyricsActivity extends AbsMusicServiceActivity implements
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
setDrawUnderStatusBar();
|
||||
setDrawUnderNavigationBar();
|
||||
//setDrawUnderNavigationBar();
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_lyrics);
|
||||
|
|
|
@ -97,8 +97,6 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements Shared
|
|||
|
||||
getBottomNavigationView().setOnNavigationItemSelectedListener(this);
|
||||
|
||||
drawerLayout.setOnApplyWindowInsetsListener((view, windowInsets) -> windowInsets.replaceSystemWindowInsets(0, 0, 0, 0));
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
selectedFragment(PreferenceUtil.getInstance().getLastPage());
|
||||
//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
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
if (key.equals(PreferenceUtil.GENERAL_THEME) ||
|
||||
|
@ -325,11 +318,11 @@ public class MainActivity extends AbsSlidingMusicPanelActivity implements Shared
|
|||
.show();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
|
||||
PreferenceUtil.getInstance().setLastPage(menuItem.getItemId());
|
||||
selectedFragment(menuItem.getItemId());
|
||||
applyInsets();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@ package code.name.monkey.retromusic.ui.activities.base;
|
|||
|
||||
import android.os.Bundle;
|
||||
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.CastSession;
|
||||
import com.google.android.gms.cast.framework.SessionManagerListener;
|
||||
|
@ -11,6 +13,7 @@ import com.google.android.gms.common.GoogleApiAvailability;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.cast.WebServer;
|
||||
|
||||
public abstract class AbsCastActivity extends AbsBaseActivity {
|
||||
|
|
|
@ -1,73 +1,99 @@
|
|||
package code.name.monkey.retromusic.ui.activities.base;
|
||||
|
||||
import android.animation.ArgbEvaluator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
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.material.bottomnavigation.BottomNavigationView;
|
||||
import com.sothree.slidinguppanel.SlidingUpPanelLayout;
|
||||
import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState;
|
||||
|
||||
import androidx.annotation.FloatRange;
|
||||
import androidx.annotation.LayoutRes;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
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.NavigationViewUtil;
|
||||
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.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.RetroUtil;
|
||||
import code.name.monkey.retromusic.util.ViewUtil;
|
||||
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();
|
||||
|
||||
@BindView(R.id.sliding_layout)
|
||||
SlidingUpPanelLayout slidingUpPanelLayout;
|
||||
|
||||
@BindView(R.id.bottom_navigation)
|
||||
BottomNavigationBarTinted bottomNavigationView;
|
||||
|
||||
@BindView(R.id.parentPanel)
|
||||
ViewGroup parentPanel;
|
||||
|
||||
@BindView(R.id.mini_player_container)
|
||||
ViewGroup miniPlayerContainer;
|
||||
@BindView(R.id.main_content)
|
||||
CoordinatorLayout coordinatorLayout;
|
||||
|
||||
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() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
setDrawUnderNavigationBar();
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(createContentView());
|
||||
ButterKnife.bind(this);
|
||||
setLightStatusbar(true);
|
||||
setLightNavigationBar(true);
|
||||
//setupBottomView();
|
||||
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);
|
||||
checkDisplayCutout();
|
||||
choosFragmentForTheme();
|
||||
setupSlidingUpPanel();
|
||||
}
|
||||
|
||||
public void setBottomBarVisibility(int gone) {
|
||||
if (bottomNavigationView != null) {
|
||||
bottomNavigationView.setVisibility(gone);
|
||||
hideBottomBar(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,14 +102,15 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
@Override
|
||||
public void onServiceConnected() {
|
||||
super.onServiceConnected();
|
||||
if (!MusicPlayerRemote.getPlayingQueue().isEmpty())
|
||||
parentPanel.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
if (!MusicPlayerRemote.getPlayingQueue().isEmpty()) {
|
||||
slidingUpPanelLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
parentPanel.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
slidingUpPanelLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
hideBottomBar(false);
|
||||
}
|
||||
});
|
||||
} // don't call hideBottomBar(true) here as it causes a bug with the SlidingUpPanelLayout
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,7 +120,28 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
}
|
||||
|
||||
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) {
|
||||
|
@ -106,13 +154,18 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (handleBackPress()) {
|
||||
if (!handleBackPress())
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean handleBackPress() {
|
||||
return true;
|
||||
if (slidingUpPanelLayout.getPanelHeight() != 0 && playerFragment.onBackPressed())
|
||||
return true;
|
||||
if (getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) {
|
||||
collapsePanel();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -128,7 +181,7 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
@Override
|
||||
public void showCastMiniController() {
|
||||
super.showCastMiniController();
|
||||
MusicPlayerRemote.setZeroVolume();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,8 +191,8 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
if (castSession == null) {
|
||||
return;
|
||||
}
|
||||
//MusicPlayerRemote.pauseSong();
|
||||
CastHelper.startCasting(castSession, MusicPlayerRemote.getCurrentSong());
|
||||
//MusicPlayerRemote.setZeroVolume();
|
||||
//CastHelper.startCasting(castSession, MusicPlayerRemote.getCurrentSong());
|
||||
}
|
||||
|
||||
public void toggleBottomNavigationView(boolean toggle) {
|
||||
|
@ -150,4 +203,311 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
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
|
||||
}
|
||||
}
|
|
@ -89,11 +89,7 @@ public abstract class AbsThemeActivity extends ATHActivity implements Runnable {
|
|||
}
|
||||
|
||||
public void setDrawUnderNavigationBar() {
|
||||
if (VersionUtils.hasLollipop()) {
|
||||
RetroUtil.setAllowDrawUnderNavigationBar(getWindow());
|
||||
} else if (VersionUtils.hasKitKat()) {
|
||||
RetroUtil.setStatusBarTranslucent(getWindow());
|
||||
}
|
||||
RetroUtil.setAllowDrawUnderNavigationBar(getWindow());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -174,7 +170,7 @@ public abstract class AbsThemeActivity extends ATHActivity implements Runnable {
|
|||
}
|
||||
|
||||
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_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
|
|
|
@ -80,7 +80,7 @@ public class MiniPlayerFragment extends AbsMusicServiceFragment implements Music
|
|||
//noinspection ConstantConditions
|
||||
view.setBackgroundColor(ThemeStore.primaryColor(getContext()));
|
||||
view.setOnTouchListener(new FlingPlayBackController(getActivity()));
|
||||
view.setOnClickListener(v -> NavigationUtil.gotoNowPlayingActivity(getContext()));
|
||||
//view.setOnClickListener(v -> NavigationUtil.gotoNowPlayingActivity(getContext()));
|
||||
setUpMiniPlayer();
|
||||
|
||||
if (RetroUtil.isTablet()) {
|
||||
|
|
|
@ -2,24 +2,24 @@ package code.name.monkey.retromusic.ui.fragments;
|
|||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import code.name.monkey.retromusic.R;
|
||||
|
||||
|
||||
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),
|
||||
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),
|
||||
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),
|
||||
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
|
||||
public final int titleRes;
|
||||
|
|
|
@ -34,6 +34,7 @@ import code.name.monkey.retromusic.util.MusicUtil;
|
|||
import code.name.monkey.retromusic.util.NavigationUtil;
|
||||
import code.name.monkey.retromusic.util.PreferenceUtil;
|
||||
import code.name.monkey.retromusic.util.RetroUtil;
|
||||
import code.name.monkey.retromusic.util.SystemUtils;
|
||||
import code.name.monkey.retromusic.views.FitSystemWindowsLayout;
|
||||
|
||||
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) {
|
||||
FitSystemWindowsLayout safeArea = view.findViewById(R.id.safeArea);
|
||||
if (safeArea != null) {
|
||||
if (PreferenceUtil.getInstance().getFullScreenMode()) safeArea.setFit(false);
|
||||
else safeArea.setFit(true);
|
||||
//ViewGroup.MarginLayoutParams params = ((ViewGroup.MarginLayoutParams) safeArea.getLayoutParams());
|
||||
//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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
@BindView(R.id.fragment_container)
|
||||
View contentContainer;
|
||||
|
||||
|
||||
private Unbinder unBinder;
|
||||
private MaterialCab cab;
|
||||
private FragmentManager fragmentManager;
|
||||
|
@ -110,6 +111,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
setStatusbarColorAuto(view);
|
||||
setupToolbar();
|
||||
inflateFragment();
|
||||
|
||||
}
|
||||
|
||||
private void inflateFragment() {
|
||||
|
@ -142,13 +144,14 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
TintHelper.setTintAuto(contentContainer, primaryColor, true);
|
||||
|
||||
toolbar.setBackgroundColor(primaryColor);
|
||||
toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
|
||||
appbar.setBackgroundColor(primaryColor);
|
||||
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
||||
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
|
||||
getMainActivity().setTitle(null);
|
||||
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() {
|
||||
|
@ -363,9 +366,6 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
|
|||
MusicPlayerRemote.openAndShuffleQueue(SongLoader.getAllSongs(getContext())
|
||||
.blockingFirst(), true);
|
||||
return true;
|
||||
case R.id.action_search:
|
||||
NavigationUtil.goToSearch(getMainActivity());
|
||||
break;
|
||||
case R.id.action_equalizer:
|
||||
NavigationUtil.openEqualizer(getActivity());
|
||||
return true;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package code.name.monkey.retromusic.ui.fragments.mainactivity.home;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
|
@ -11,12 +10,9 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
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.util.ArrayList;
|
||||
|
@ -35,7 +31,6 @@ import butterknife.ButterKnife;
|
|||
import butterknife.OnClick;
|
||||
import butterknife.Unbinder;
|
||||
import code.name.monkey.appthemehelper.ThemeStore;
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil;
|
||||
import code.name.monkey.appthemehelper.util.TintHelper;
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||
|
@ -75,9 +70,9 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
@BindView(R.id.toolbar)
|
||||
Toolbar toolbar;
|
||||
|
||||
@BindView(R.id.app_bar)
|
||||
/*@BindView(R.id.app_bar)
|
||||
AppBarLayout appbar;
|
||||
|
||||
*/
|
||||
@BindView(R.id.image)
|
||||
@Nullable
|
||||
ImageView imageView;
|
||||
|
@ -85,8 +80,8 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
@BindView(R.id.user_image)
|
||||
CircularImageView userImage;
|
||||
|
||||
@BindView(R.id.collapsing_toolbar)
|
||||
CollapsingToolbarLayout toolbarLayout;
|
||||
/* @BindView(R.id.collapsing_toolbar)
|
||||
CollapsingToolbarLayout toolbarLayout;*/
|
||||
|
||||
@BindView(R.id.recycler_view)
|
||||
RecyclerView recentArtistRV;
|
||||
|
@ -121,18 +116,12 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
@BindView(R.id.container)
|
||||
View container;
|
||||
|
||||
@BindView(R.id.title)
|
||||
TextView title;
|
||||
|
||||
@BindView(R.id.suggestion_songs)
|
||||
RecyclerView suggestionsSongs;
|
||||
|
||||
@BindView(R.id.suggestion_container)
|
||||
LinearLayout suggestionsContainer;
|
||||
|
||||
@BindView(R.id.search_icon)
|
||||
ImageView searchIcon;
|
||||
|
||||
private Unbinder unbinder;
|
||||
private HomePresenter homePresenter;
|
||||
private CompositeDisposable disposable;
|
||||
|
@ -241,18 +230,13 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
private void setupToolbar() {
|
||||
int primaryColor = ThemeStore.primaryColor(getContext());
|
||||
TintHelper.setTintAuto(container, primaryColor, true);
|
||||
|
||||
toolbar.setNavigationIcon(R.drawable.ic_menu_white_24dp);
|
||||
toolbar.setBackgroundColor(primaryColor);
|
||||
appbar.setBackgroundColor(primaryColor);
|
||||
appbar.addOnOffsetChangedListener((appBarLayout, verticalOffset) ->
|
||||
getMainActivity().setLightStatusbar(!ATHUtil.isWindowBackgroundDark(getContext())));
|
||||
userImage.setOnClickListener(v -> showMainMenu());
|
||||
|
||||
getActivity().setTitle(null);
|
||||
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());
|
||||
title.setTextColor(ThemeStore.textColorPrimary(getContext()));
|
||||
searchIcon.setImageTintList(ColorStateList.valueOf(ThemeStore.accentColor(getContext())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -346,7 +330,6 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
Display display = getMainActivity().getWindowManager().getDefaultDisplay();
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
display.getMetrics(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,
|
||||
R.id.user_image, R.id.search})
|
||||
R.id.user_image})
|
||||
void startUserInfo(View view) {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null) {
|
||||
|
@ -380,12 +363,7 @@ public class BannerHomeFragment extends AbsMainActivityFragment implements MainA
|
|||
case R.id.user_image:
|
||||
NavigationUtil.goToUserInfo(getActivity());
|
||||
break;
|
||||
case R.id.search:
|
||||
NavigationUtil.goToSearch(activity);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -107,11 +107,6 @@ public class AdaptiveFragment extends AbsPlayerFragment implements Callbacks {
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_adaptive_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColorAuto();
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -162,5 +157,4 @@ public class AdaptiveFragment extends AbsPlayerFragment implements Callbacks {
|
|||
updateIsFavorite();
|
||||
updateSong();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -140,11 +140,6 @@ public class BlurPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_blur, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -160,12 +160,7 @@ public class CardFragment extends AbsPlayerFragment implements PlayerAlbumCoverF
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_card_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -122,11 +122,6 @@ public class CardBlurFragment extends AbsPlayerFragment implements
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_card_blur_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import android.animation.ValueAnimator;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
@ -136,10 +135,6 @@ public class ColorFragment extends AbsPlayerFragment {
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_color_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,11 +88,7 @@ public class FlatPlayerFragment extends AbsPlayerFragment implements
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_flat_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
//getPlayerActivity().setNavigationbarColorAuto();
|
||||
addSafeArea(view);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ public class FullPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
|||
@BindView(R.id.player_toolbar)
|
||||
Toolbar toolbar;
|
||||
|
||||
Unbinder unbinder;
|
||||
private Unbinder unbinder;
|
||||
|
||||
private int lastColor;
|
||||
private FullPlaybackControlsFragment fullPlaybackControlsFragment;
|
||||
|
@ -42,11 +42,7 @@ public class FullPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_full, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
|
||||
addSafeArea(view);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,11 +99,7 @@ public class HmmPlayerFragment extends AbsPlayerFragment implements
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_hmm_player, container, false);
|
||||
unBinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColor(Color.TRANSPARENT);
|
||||
addSafeArea(view);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -108,11 +108,6 @@ public class MaterialFragment extends AbsPlayerFragment implements PlayerAlbumCo
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_material, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColorAuto();
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ import butterknife.BindView;
|
|||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
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.retromusic.R;
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||
|
@ -136,10 +135,7 @@ public class PlayerFragment extends AbsPlayerFragment implements PlayerAlbumCove
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
addSafeArea(view);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,11 +75,7 @@ public class PlainPlayerFragment extends AbsPlayerFragment implements
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_plain_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColorAuto();
|
||||
addSafeArea(view);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,11 +46,6 @@ public class SimplePlayerFragment extends AbsPlayerFragment implements
|
|||
@Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_simple_player, container, false);
|
||||
unbinder = ButterKnife.bind(this, view);
|
||||
if (getPlayerActivity() != null) {
|
||||
getPlayerActivity().setDrawUnderNavigationBar();
|
||||
getPlayerActivity().setNavigationbarColorAuto();
|
||||
addSafeArea(view);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -695,41 +695,6 @@ public final class PreferenceUtil {
|
|||
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() {
|
||||
return mPreferences.getString(ALBUM_DETAIL_STYLE, "0");
|
||||
|
@ -805,4 +770,41 @@ public final class PreferenceUtil {
|
|||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,8 +22,10 @@ import android.provider.BaseColumns;
|
|||
import android.provider.MediaStore;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Display;
|
||||
import android.view.Surface;
|
||||
import android.view.KeyCharacterMap;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
@ -49,6 +51,7 @@ import code.name.monkey.retromusic.RetroApplication;
|
|||
public class RetroUtil {
|
||||
|
||||
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) {
|
||||
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
|
||||
|
@ -88,21 +91,18 @@ public class RetroUtil {
|
|||
return RetroApplication.getContext().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
|
||||
}
|
||||
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
|
||||
public static boolean isRTL(@NonNull Context context) {
|
||||
Configuration config = context.getResources().getConfiguration();
|
||||
return config.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
|
||||
}
|
||||
|
||||
|
||||
@TargetApi(19)
|
||||
public static void setStatusBarTranslucent(@NonNull Window window) {
|
||||
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
|
||||
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
}
|
||||
|
||||
|
||||
public static boolean isMarshMellow() {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
|
||||
}
|
||||
|
@ -131,7 +131,6 @@ public class RetroUtil {
|
|||
return px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
|
||||
}
|
||||
|
||||
|
||||
public static void openUrl(Activity context, String str) {
|
||||
Intent intent = new Intent("android.intent.action.VIEW");
|
||||
intent.setData(Uri.parse(str));
|
||||
|
@ -151,7 +150,6 @@ public class RetroUtil {
|
|||
return size;
|
||||
}
|
||||
|
||||
|
||||
public static void hideSoftKeyboard(@Nullable Activity activity) {
|
||||
if (activity != null) {
|
||||
View currentFocus = activity.getCurrentFocus();
|
||||
|
@ -179,7 +177,6 @@ public class RetroUtil {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public static Drawable getVectorDrawable(@NonNull Resources res, @DrawableRes int resId,
|
||||
@Nullable Resources.Theme theme) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
|
@ -295,28 +292,18 @@ public class RetroUtil {
|
|||
}
|
||||
|
||||
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 resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
|
||||
int resourceId = RetroApplication.getContext().getResources().getIdentifier("status_bar_height", "dimen", "android");
|
||||
if (resourceId > 0) {
|
||||
result = context.getResources().getDimensionPixelSize(resourceId);
|
||||
result = RetroApplication.getContext().getResources().getDimensionPixelSize(resourceId);
|
||||
}
|
||||
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) {
|
||||
window.setNavigationBarColor(Color.TRANSPARENT);
|
||||
window.getDecorView().setSystemUiVisibility(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ?
|
||||
|
@ -348,7 +335,59 @@ public class RetroUtil {
|
|||
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");
|
||||
if (id > 0)
|
||||
return resources.getBoolean(id);
|
||||
|
@ -375,33 +414,17 @@ public class RetroUtil {
|
|||
return 0;
|
||||
}
|
||||
|
||||
public static int getNavigationBarWidth(Resources resources) {
|
||||
if (!hasNavBar(resources))
|
||||
return 0;
|
||||
|
||||
public static boolean checkNavigationBarHeight() {
|
||||
Resources resources = RetroApplication.getContext().getResources();
|
||||
int orientation = resources.getConfiguration().orientation;
|
||||
|
||||
//Only phone between 0-599 has navigationbar can move
|
||||
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);
|
||||
if (!hasNavBar(resources)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static boolean isNavigationBarLeftSide() {
|
||||
Display display = ((WindowManager) RetroApplication.getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
|
||||
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;
|
||||
boolean isSmartPhone = resources.getConfiguration().smallestScreenWidthDp < 600;
|
||||
if (isSmartPhone && Configuration.ORIENTATION_LANDSCAPE == orientation)
|
||||
return false;
|
||||
int id = resources
|
||||
.getIdentifier(orientation == Configuration.ORIENTATION_PORTRAIT ? "navigation_bar_height" : "navigation_bar_height_landscape", "dimen", "android");
|
||||
return id > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -33,12 +33,7 @@ public class FitSystemWindowsLayout extends FrameLayout {
|
|||
}
|
||||
|
||||
mFit = fit;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
|
||||
requestApplyInsets();
|
||||
} else {
|
||||
//noinspection deprecation
|
||||
requestFitSystemWindows();
|
||||
}
|
||||
requestApplyInsets();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
|
|
@ -92,7 +92,7 @@ public class MetalRecyclerViewPager extends RecyclerView {
|
|||
if (RetroUtil.isTablet()) {
|
||||
itemWidth = (metrics.widthPixels / 2) - itemMargin * 3;
|
||||
} else {
|
||||
itemWidth = metrics.widthPixels - itemMargin * 2;
|
||||
itemWidth = metrics.widthPixels - itemMargin ;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -7,6 +7,6 @@
|
|||
|
||||
<path android:pathData="M0,0h24v24H0V0z" />
|
||||
<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" />
|
||||
</vector>
|
|
@ -31,6 +31,7 @@
|
|||
</FrameLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
|
@ -47,7 +48,6 @@
|
|||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="14dp"
|
||||
|
|
|
@ -1,119 +1,72 @@
|
|||
<?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:tools="http://schemas.android.com/tools"
|
||||
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_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
<include layout="@layout/status_bar" />
|
||||
</FrameLayout>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
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>
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/image_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="4dp"
|
||||
android:layout_weight="1"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="196dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_collapseMode="parallax"
|
||||
tools:ignore="ContentDescription" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
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"
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical">
|
||||
android:layout_weight="1"
|
||||
android:elevation="@dimen/card_elevation"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<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>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
<include layout="@layout/abs_playlists" />
|
||||
|
||||
<include layout="@layout/home_section_content" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</LinearLayout>
|
|
@ -3,6 +3,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/main_fragment_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
@ -20,44 +21,6 @@
|
|||
android:layout_width="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
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -65,8 +28,6 @@
|
|||
android:layout_marginStart="@dimen/horizontal_margin"
|
||||
android:layout_marginEnd="@dimen/horizontal_margin"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_circular_top_corners"
|
||||
android:elevation="@dimen/card_elevation"
|
||||
app:behavior_overlapTop="24dp"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
|
|
|
@ -3,31 +3,23 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="20dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?rectSelector"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<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" />
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar48"
|
||||
tools:ignore="UnusedAttribute"
|
||||
android:layout_gravity="center_vertical"
|
||||
app:layout_collapseMode="pin">
|
||||
|
||||
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
|
||||
android:id="@+id/search_view"
|
||||
|
@ -38,7 +30,14 @@
|
|||
android:hint="@string/search_hint"
|
||||
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>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?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:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -90,4 +90,4 @@
|
|||
app:mpb_showProgressBackground="false"
|
||||
app:mpb_useIntrinsicPadding="false" />
|
||||
|
||||
</FrameLayout>
|
||||
</code.name.monkey.retromusic.views.FitSystemWindowsLayout>
|
|
@ -2,6 +2,7 @@
|
|||
<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:id="@+id/main_fragment_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
@ -20,44 +21,6 @@
|
|||
android:layout_width="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
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -76,6 +39,23 @@
|
|||
android:focusableInTouchMode="true"
|
||||
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/home_section_content" />
|
||||
|
|
|
@ -1,96 +1,49 @@
|
|||
<?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:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main_fragment_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:id="@+id/collapsing_toolbar"
|
||||
<include layout="@layout/status_bar" />
|
||||
|
||||
</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_height="wrap_content"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
||||
app:statusBarScrim="?attr/colorPrimary">
|
||||
android:layout_marginStart="128dp"
|
||||
android:layout_marginEnd="128dp"
|
||||
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">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<include layout="@layout/abs_playlists" />
|
||||
|
||||
<include layout="@layout/status_bar" />
|
||||
</FrameLayout>
|
||||
<include layout="@layout/home_section_content" />
|
||||
|
||||
<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>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<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>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</LinearLayout>
|
|
@ -2,6 +2,7 @@
|
|||
<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:id="@+id/main_fragment_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
@ -20,45 +21,6 @@
|
|||
android:layout_width="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
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/main_fragment_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
@ -20,43 +21,7 @@
|
|||
android:layout_width="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
|
||||
android:id="@+id/container"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
@ -8,28 +9,17 @@
|
|||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?rectSelector"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<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" />
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar48"
|
||||
android:layout_gravity="center_vertical"
|
||||
app:layout_collapseMode="pin"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
|
||||
android:id="@+id/search_view"
|
||||
|
@ -40,7 +30,14 @@
|
|||
android:hint="@string/search_hint"
|
||||
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>
|
||||
|
||||
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
|
||||
|
|
|
@ -89,7 +89,6 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_shuffle_white_24dp"
|
||||
app:showTitle="true" />
|
||||
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
android:layoutDirection="ltr"
|
||||
android:paddingEnd="4dp"
|
||||
android:paddingStart="4dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
tools:ignore="ContentDescription,UnusedAttribute">
|
||||
|
||||
<ImageButton
|
||||
|
|
|
@ -3,15 +3,13 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical">
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/player_album_art_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="16dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="8dp">
|
||||
|
|
|
@ -3,14 +3,12 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical">
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/player_album_art_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="16dp"
|
||||
app:cardCornerRadius="8dp">
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/main_fragment_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
@ -17,44 +18,6 @@
|
|||
android:layout_width="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
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -72,6 +35,7 @@
|
|||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/image_container"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<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:id="@+id/main_fragment_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
@ -22,44 +23,50 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
|
||||
<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">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:titleEnabled="false">
|
||||
android:layout_marginStart="8dp"
|
||||
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_height="wrap_content"
|
||||
app:layout_collapseMode="pin">
|
||||
|
||||
<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>
|
||||
android:layout_height="match_parent" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<FrameLayout
|
||||
|
|
|
@ -11,12 +11,12 @@
|
|||
android:name="code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:layout="@layout/fragment_player_album_cover" />
|
||||
tools:layout="@layout/fragment_album_full_cover" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#30000000" />
|
||||
android:background="#50000000" />
|
||||
|
||||
<code.name.monkey.retromusic.views.FitSystemWindowsLayout
|
||||
android:id="@+id/safeArea"
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/main_fragment_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
|
@ -18,44 +19,6 @@
|
|||
android:layout_width="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
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<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:id="@+id/main_fragment_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
@ -21,53 +22,51 @@
|
|||
android:layout_width="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">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:titleEnabled="false">
|
||||
android:layout_marginStart="8dp"
|
||||
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_height="wrap_content"
|
||||
app:layout_collapseMode="pin">
|
||||
|
||||
<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>
|
||||
android:layout_height="match_parent" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?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:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -7,6 +7,7 @@
|
|||
android:background="@android:color/transparent"
|
||||
android:clickable="true"
|
||||
android:focusable="false"
|
||||
android:id="@+id/mini_player_content"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -89,6 +90,5 @@
|
|||
android:layout_height="3dp"
|
||||
android:progress="20"
|
||||
app:mpb_progressStyle="horizontal"
|
||||
app:mpb_showProgressBackground="false"
|
||||
app:mpb_useIntrinsicPadding="false" />
|
||||
</FrameLayout>
|
||||
</code.name.monkey.retromusic.views.FitSystemWindowsLayout>
|
|
@ -1,5 +1,5 @@
|
|||
<?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:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -14,7 +14,7 @@
|
|||
|
||||
<include layout="@layout/shadow_statusbar_toolbar" />
|
||||
|
||||
<code.name.monkey.retromusic.views.FitSystemWindowsLayout
|
||||
<FrameLayout
|
||||
android:id="@+id/safeArea"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
@ -65,5 +65,5 @@
|
|||
app:navigationIcon="@drawable/ic_close_white_24dp" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
</code.name.monkey.retromusic.views.FitSystemWindowsLayout>
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:nestedScrollingEnabled="false"
|
||||
app:itemMargin="28dp" />
|
||||
app:itemMargin="96dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
|
|
37
app/src/main/res/layout/item_album_card.xml
Normal file
37
app/src/main/res/layout/item_album_card.xml
Normal 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>
|
|
@ -10,7 +10,7 @@
|
|||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/image_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="182dp"
|
||||
android:layout_height="172dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
|
|
|
@ -2,14 +2,19 @@
|
|||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:id="@+id/parentPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/main_content"
|
||||
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_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:gravity="bottom"
|
||||
sothree:umanoOverlay="false"
|
||||
sothree:umanoPanelHeight="0dp"
|
||||
sothree:umanoScrollableView="@+id/recycler_view"
|
||||
sothree:umanoShadowHeight="0dp">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/content_container"
|
||||
|
@ -17,41 +22,38 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
<FrameLayout
|
||||
android:id="@+id/sliding_panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:background="@drawable/bg_circular_top_corners"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/mini_player_container"
|
||||
android:id="@+id/player_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/mini_player_fragment"
|
||||
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"
|
||||
<fragment
|
||||
android:id="@+id/mini_player_fragment"
|
||||
android:name="code.name.monkey.retromusic.ui.fragments.MiniPlayerFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
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" />
|
||||
android:layout_height="48dp"
|
||||
tools:layout="@layout/fragment_mini_player" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</FrameLayout>
|
||||
</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>
|
|
@ -3,12 +3,6 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
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
|
||||
android:id="@+id/action_shuffle_all"
|
||||
android:icon="@drawable/ic_shuffle_white_24dp"
|
||||
|
|
|
@ -3,20 +3,26 @@
|
|||
<style name="Theme.RetroMusic" parent="Theme.RetroMusic.Base">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowSharedElementsUseOverlay">false</item>
|
||||
<item name="android:textViewStyle">@style/TextViewStyleIm</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.RetroMusic.Light" parent="Theme.RetroMusic.Base.Light">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowSharedElementsUseOverlay">false</item>
|
||||
|
||||
<item name="android:textViewStyle">@style/TextViewStyleIm</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.RetroMusic.Black" parent="Theme.RetroMusic.Base.Black">
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowSharedElementsUseOverlay">false</item>
|
||||
|
||||
<item name="android:textViewStyle">@style/TextViewStyleIm</item>
|
||||
</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" />
|
||||
|
||||
|
|
|
@ -75,16 +75,19 @@
|
|||
<string-array name="pref_home_grid_style_list_titles">
|
||||
<item>@string/circular</item>
|
||||
<item>@string/card_color_style</item>
|
||||
<item>@string/card_style</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_home_grid_style_list_values">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<array name="pref_home_grid_style_layout">
|
||||
<item>@layout/item_artist</item>
|
||||
<item>@layout/item_artist_square</item>
|
||||
<item>@layout/item_album_card</item>
|
||||
</array>
|
||||
|
||||
<string-array name="pref_general_theme_list_values">
|
||||
|
|
|
@ -59,5 +59,4 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
|
|||
<dimen name="horizontal_margin">0dp</dimen>
|
||||
<dimen name="bottom_sheet_width">0dp</dimen>
|
||||
<dimen name="mini_player_height_expanded">104dp</dimen>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -50,6 +50,16 @@
|
|||
</style>
|
||||
|
||||
<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:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue