From 62b12da2ad47b30d2312fafdb39ec8db5388617c Mon Sep 17 00:00:00 2001 From: h4h13 Date: Tue, 20 Nov 2018 20:57:59 +0530 Subject: [PATCH] backup with notch problem --- app/app.iml | 28 +- app/build.gradle | 10 +- app/src/main/assets/retro-changelog.html | 2 +- .../monkey/retromusic/cast/CastHelper.java | 7 +- .../retromusic/helper/MusicPlayerRemote.java | 4 - .../retromusic/service/MusicService.java | 2 + .../ui/activities/AlbumDetailsActivity.java | 2 +- .../ui/activities/ArtistDetailActivity.java | 2 +- .../ui/activities/LyricsActivity.java | 2 +- .../ui/activities/MainActivity.java | 9 +- .../ui/activities/base/AbsCastActivity.java | 3 + .../base/AbsSlidingMusicPanelActivity.java | 432 ++++++++++++++++-- .../ui/activities/base/AbsThemeActivity.java | 8 +- .../ui/fragments/MiniPlayerFragment.java | 2 +- .../ui/fragments/NowPlayingScreen.java | 20 +- .../ui/fragments/base/AbsPlayerFragment.java | 9 +- .../mainactivity/LibraryFragment.java | 10 +- .../mainactivity/home/BannerHomeFragment.java | 38 +- .../player/adaptive/AdaptiveFragment.java | 6 - .../player/blur/BlurPlayerFragment.java | 5 - .../fragments/player/card/CardFragment.java | 7 +- .../player/cardblur/CardBlurFragment.java | 5 - .../fragments/player/color/ColorFragment.java | 5 - .../player/flat/FlatPlayerFragment.java | 6 +- .../player/full/FullPlayerFragment.java | 8 +- .../player/hmm/HmmPlayerFragment.java | 6 +- .../player/material/MaterialFragment.java | 5 - .../player/normal/PlayerFragment.java | 6 +- .../player/plain/PlainPlayerFragment.java | 6 +- .../player/simple/SimplePlayerFragment.java | 5 - .../retromusic/util/PreferenceUtil.java | 72 +-- .../monkey/retromusic/util/RetroUtil.java | 119 +++-- .../monkey/retromusic/util/SystemUtils.java | 99 ++++ .../views/FitSystemWindowsLayout.java | 7 +- .../views/MetalRecyclerViewPager.java | 2 +- .../views/StatusBarMarginFrameLayout.java | 33 -- .../views/WindowInsetsFrameLayout.java | 141 ++++++ .../main/res/drawable/ic_menu_white_24dp.xml | 2 +- .../layout-land/activity_artist_details.xml | 2 +- .../res/layout-land/fragment_banner_home.xml | 131 ++---- .../main/res/layout-land/fragment_home.xml | 41 +- .../main/res/layout-sw600dp/abs_playlists.xml | 37 +- .../layout-sw600dp/fragment_mini_player.xml | 4 +- .../fragment_banner_home.xml | 56 +-- .../res/layout-xlarge-land/fragment_home.xml | 103 ++--- .../layout-xlarge/fragment_banner_home.xml | 40 +- .../main/res/layout-xlarge/fragment_home.xml | 37 +- app/src/main/res/layout/abs_playlists.xml | 37 +- .../res/layout/activity_playlist_detail.xml | 1 - app/src/main/res/layout/activity_search.xml | 3 +- ...ment_adaptive_player_playback_controls.xml | 1 + .../main/res/layout/fragment_album_cover.xml | 4 +- .../layout/fragment_album_material_cover.xml | 4 +- .../main/res/layout/fragment_banner_home.xml | 40 +- app/src/main/res/layout/fragment_folder.xml | 61 +-- app/src/main/res/layout/fragment_full.xml | 4 +- app/src/main/res/layout/fragment_home.xml | 39 +- app/src/main/res/layout/fragment_library.xml | 67 ++- .../main/res/layout/fragment_mini_player.xml | 6 +- app/src/main/res/layout/fragment_player.xml | 8 +- .../main/res/layout/home_section_content.xml | 2 +- app/src/main/res/layout/item_album_card.xml | 37 ++ app/src/main/res/layout/pager_item.xml | 2 +- .../res/layout/sliding_music_panel_layout.xml | 70 +-- app/src/main/res/menu/menu_main.xml | 6 - app/src/main/res/values-v21/styles.xml | 10 +- app/src/main/res/values/arrays.xml | 3 + app/src/main/res/values/dimens.xml | 1 - app/src/main/res/values/styles.xml | 10 + .../RetroApplication.java | 119 ----- 70 files changed, 1131 insertions(+), 990 deletions(-) create mode 100644 app/src/main/java/code/name/monkey/retromusic/util/SystemUtils.java delete mode 100644 app/src/main/java/code/name/monkey/retromusic/views/StatusBarMarginFrameLayout.java create mode 100644 app/src/main/java/code/name/monkey/retromusic/views/WindowInsetsFrameLayout.java create mode 100644 app/src/main/res/layout/item_album_card.xml delete mode 100644 app/src/sans/java/code.name.monkey.retromusic/RetroApplication.java diff --git a/app/app.iml b/app/app.iml index 1efa53cb..3859914a 100644 --- a/app/app.iml +++ b/app/app.iml @@ -158,6 +158,7 @@ + @@ -168,72 +169,74 @@ + - - + + - + + + + + - + - + + - - - + - + - - - + @@ -246,7 +249,6 @@ - diff --git a/app/build.gradle b/app/build.gradle index 690e25f9..f5dc4e48 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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' diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html index 4cc69626..1731cbca 100644 --- a/app/src/main/assets/retro-changelog.html +++ b/app/src/main/assets/retro-changelog.html @@ -1 +1 @@ -

You can view the changelog dialog again at any time from the about section.

Version 2.2.00

  • Sorry for late update, Bottom navigation bar again at the bottom because it should according to Android Material Design guideline.
  • BottomSheetDialogue is now adaptable to screens, background colour and text size consistency.
  • Removed coloured navigation bar option to making app adapt the primary colour
  • Swipe up gesture for now playing removed, replaced with "tap to open", To achieve transparent navigation bar for desired themes.
  • Improved tablet UI and home screen by adding suggestions toggle banner issues.
  • Improving lyrics page

FAQ's

*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again.

\ No newline at end of file +

Are you subscribe to PewDiePie

You can view the changelog dialog again at any time from the about section.

Version 2.2.100

  • On library click on toolbar for accessing main menu
  • On home click on toolbar for accessing search
  • BottomSheetDialogue is now adaptable to screens, background colour and text size consistency.
  • Removed coloured navigation bar option to making app adapt the primary colour
  • Swipe up gesture for now playing removed, replaced with "tap to open", To achieve transparent navigation bar for desired themes.
  • Improved tablet UI and home screen by adding suggestions toggle banner issues.
  • Improving lyrics page

FAQ's

*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again.

\ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/cast/CastHelper.java b/app/src/main/java/code/name/monkey/retromusic/cast/CastHelper.java index 15993da6..89bfa519 100644 --- a/app/src/main/java/code/name/monkey/retromusic/cast/CastHelper.java +++ b/app/src/main/java/code/name/monkey/retromusic/cast/CastHelper.java @@ -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(); } diff --git a/app/src/main/java/code/name/monkey/retromusic/helper/MusicPlayerRemote.java b/app/src/main/java/code/name/monkey/retromusic/helper/MusicPlayerRemote.java index c804d06d..a1350042 100644 --- a/app/src/main/java/code/name/monkey/retromusic/helper/MusicPlayerRemote.java +++ b/app/src/main/java/code/name/monkey/retromusic/helper/MusicPlayerRemote.java @@ -455,10 +455,6 @@ public class MusicPlayerRemote { return musicService != null; } - public static void setZeroVolume() { - - } - @interface PlaybackLocation { int REMOTE = 0; int LOCAL = 1; diff --git a/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java b/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java index 02ca8437..72326e0a 100644 --- a/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java +++ b/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java @@ -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 mService; diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/AlbumDetailsActivity.java b/app/src/main/java/code/name/monkey/retromusic/ui/activities/AlbumDetailsActivity.java index 91731353..2c7c868e 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/AlbumDetailsActivity.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/AlbumDetailsActivity.java @@ -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); } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/ArtistDetailActivity.java b/app/src/main/java/code/name/monkey/retromusic/ui/activities/ArtistDetailActivity.java index bfc47690..62694222 100755 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/ArtistDetailActivity.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/ArtistDetailActivity.java @@ -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); } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/LyricsActivity.java b/app/src/main/java/code/name/monkey/retromusic/ui/activities/LyricsActivity.java index 6454266e..17590e82 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/LyricsActivity.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/LyricsActivity.java @@ -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); diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/MainActivity.java b/app/src/main/java/code/name/monkey/retromusic/ui/activities/MainActivity.java index 00049d74..4049f8bb 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/MainActivity.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/MainActivity.java @@ -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; } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsCastActivity.java b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsCastActivity.java index 79c53ae7..7047458b 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsCastActivity.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsCastActivity.java @@ -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 { diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.java b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.java index 86f20ac2..4ae985ce 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsSlidingMusicPanelActivity.java @@ -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 + } } \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsThemeActivity.java b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsThemeActivity.java index 54cb4820..c0231627 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsThemeActivity.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/activities/base/AbsThemeActivity.java @@ -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 diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/MiniPlayerFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/MiniPlayerFragment.java index 05efd21b..e87e4d34 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/MiniPlayerFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/MiniPlayerFragment.java @@ -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()) { diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/NowPlayingScreen.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/NowPlayingScreen.java index e20b20dc..237fcbe0 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/NowPlayingScreen.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/NowPlayingScreen.java @@ -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; diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerFragment.java index 4baa5881..070e2ba6 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/base/AbsPlayerFragment.java @@ -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(); } + } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/LibraryFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/LibraryFragment.java index c3ed41e3..8603e6bb 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/LibraryFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/LibraryFragment.java @@ -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; diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.java index 7c1cbb1d..fa0b9ea7 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/mainactivity/home/BannerHomeFragment.java @@ -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; } } } - - } \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/adaptive/AdaptiveFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/adaptive/AdaptiveFragment.java index af92b48f..28c4cbda 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/adaptive/AdaptiveFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/adaptive/AdaptiveFragment.java @@ -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(); } - } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlayerFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlayerFragment.java index 4c6c66a9..561030eb 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlayerFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/blur/BlurPlayerFragment.java @@ -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; } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/card/CardFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/card/CardFragment.java index 3cc691e6..0a1e9e25 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/card/CardFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/card/CardFragment.java @@ -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 diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/cardblur/CardBlurFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/cardblur/CardBlurFragment.java index d44fe5aa..97e7931f 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/cardblur/CardBlurFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/cardblur/CardBlurFragment.java @@ -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; } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/color/ColorFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/color/ColorFragment.java index f9e78b08..76d46883 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/color/ColorFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/color/ColorFragment.java @@ -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; } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/flat/FlatPlayerFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/flat/FlatPlayerFragment.java index eff1154e..5d302840 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/flat/FlatPlayerFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/flat/FlatPlayerFragment.java @@ -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; } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlayerFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlayerFragment.java index 9f91fedd..dfd79f4e 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlayerFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/full/FullPlayerFragment.java @@ -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; } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/hmm/HmmPlayerFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/hmm/HmmPlayerFragment.java index ba5b0a93..7197914e 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/hmm/HmmPlayerFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/hmm/HmmPlayerFragment.java @@ -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; } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/material/MaterialFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/material/MaterialFragment.java index 9ce0c216..502e40a2 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/material/MaterialFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/material/MaterialFragment.java @@ -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; } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerFragment.java index 4838e138..bc2eadc7 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/normal/PlayerFragment.java @@ -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; } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/plain/PlainPlayerFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/plain/PlainPlayerFragment.java index 9d8b379f..7a1a72ca 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/plain/PlainPlayerFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/plain/PlainPlayerFragment.java @@ -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; } diff --git a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/simple/SimplePlayerFragment.java b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/simple/SimplePlayerFragment.java index 657c8277..302ae16a 100644 --- a/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/simple/SimplePlayerFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/ui/fragments/player/simple/SimplePlayerFragment.java @@ -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; } diff --git a/app/src/main/java/code/name/monkey/retromusic/util/PreferenceUtil.java b/app/src/main/java/code/name/monkey/retromusic/util/PreferenceUtil.java index 0422344c..e0ba9e10 100644 --- a/app/src/main/java/code/name/monkey/retromusic/util/PreferenceUtil.java +++ b/app/src/main/java/code/name/monkey/retromusic/util/PreferenceUtil.java @@ -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; + } + } diff --git a/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java b/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java index ebe1948c..30cb0e0a 100755 --- a/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java +++ b/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java @@ -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; } } diff --git a/app/src/main/java/code/name/monkey/retromusic/util/SystemUtils.java b/app/src/main/java/code/name/monkey/retromusic/util/SystemUtils.java new file mode 100644 index 00000000..62eaf510 --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/util/SystemUtils.java @@ -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); + } + +} diff --git a/app/src/main/java/code/name/monkey/retromusic/views/FitSystemWindowsLayout.java b/app/src/main/java/code/name/monkey/retromusic/views/FitSystemWindowsLayout.java index 06c9d7e3..427dc3f9 100644 --- a/app/src/main/java/code/name/monkey/retromusic/views/FitSystemWindowsLayout.java +++ b/app/src/main/java/code/name/monkey/retromusic/views/FitSystemWindowsLayout.java @@ -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") diff --git a/app/src/main/java/code/name/monkey/retromusic/views/MetalRecyclerViewPager.java b/app/src/main/java/code/name/monkey/retromusic/views/MetalRecyclerViewPager.java index af627666..ae117ce0 100644 --- a/app/src/main/java/code/name/monkey/retromusic/views/MetalRecyclerViewPager.java +++ b/app/src/main/java/code/name/monkey/retromusic/views/MetalRecyclerViewPager.java @@ -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 ; } } diff --git a/app/src/main/java/code/name/monkey/retromusic/views/StatusBarMarginFrameLayout.java b/app/src/main/java/code/name/monkey/retromusic/views/StatusBarMarginFrameLayout.java deleted file mode 100644 index b995a811..00000000 --- a/app/src/main/java/code/name/monkey/retromusic/views/StatusBarMarginFrameLayout.java +++ /dev/null @@ -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); - } -} \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/views/WindowInsetsFrameLayout.java b/app/src/main/java/code/name/monkey/retromusic/views/WindowInsetsFrameLayout.java new file mode 100644 index 00000000..923e842e --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/views/WindowInsetsFrameLayout.java @@ -0,0 +1,141 @@ +/* + * Mantou Earth - Live your wallpaper with live earth + * Copyright (C) 2015 XiNGRZ + * + * 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 . + */ +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; + } + } + } + +} \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_menu_white_24dp.xml b/app/src/main/res/drawable/ic_menu_white_24dp.xml index 2cdf1b83..a6045b30 100644 --- a/app/src/main/res/drawable/ic_menu_white_24dp.xml +++ b/app/src/main/res/drawable/ic_menu_white_24dp.xml @@ -7,6 +7,6 @@ \ No newline at end of file diff --git a/app/src/main/res/layout-land/activity_artist_details.xml b/app/src/main/res/layout-land/activity_artist_details.xml index 0da4ac73..99510ff9 100644 --- a/app/src/main/res/layout-land/activity_artist_details.xml +++ b/app/src/main/res/layout-land/activity_artist_details.xml @@ -31,6 +31,7 @@ - + android:id="@+id/main_fragment_content" + android:layout_height="match_parent" + android:orientation="vertical"> - + android:layout_height="wrap_content"> - + + + + + - - - - - - - - - - - - - - - - - - - - - + android:layout_height="match_parent" + android:orientation="horizontal"> - - - - - - + android:layout_weight="1" + android:elevation="@dimen/card_elevation" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - - + - - - - - + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_home.xml b/app/src/main/res/layout-land/fragment_home.xml index 637cb1fc..13329b24 100644 --- a/app/src/main/res/layout-land/fragment_home.xml +++ b/app/src/main/res/layout-land/fragment_home.xml @@ -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"> - - - - - - - - - - - - - diff --git a/app/src/main/res/layout-sw600dp/abs_playlists.xml b/app/src/main/res/layout-sw600dp/abs_playlists.xml index db1086c8..c331768b 100644 --- a/app/src/main/res/layout-sw600dp/abs_playlists.xml +++ b/app/src/main/res/layout-sw600dp/abs_playlists.xml @@ -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"> - - - + - + + - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout-xlarge-land/fragment_banner_home.xml b/app/src/main/res/layout-xlarge-land/fragment_banner_home.xml index 539fc11b..136a5f34 100644 --- a/app/src/main/res/layout-xlarge-land/fragment_banner_home.xml +++ b/app/src/main/res/layout-xlarge-land/fragment_banner_home.xml @@ -2,6 +2,7 @@ @@ -20,44 +21,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - - - - - - - - - - - + + + + + diff --git a/app/src/main/res/layout-xlarge-land/fragment_home.xml b/app/src/main/res/layout-xlarge-land/fragment_home.xml index e5147d62..19ece360 100644 --- a/app/src/main/res/layout-xlarge-land/fragment_home.xml +++ b/app/src/main/res/layout-xlarge-land/fragment_home.xml @@ -1,96 +1,49 @@ - + android:layout_height="match_parent" + android:orientation="vertical"> - - + + + + + + + + android:layout_marginStart="128dp" + android:layout_marginEnd="128dp" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - + - - + - - - - - - - - - - + - - - - - - - - - - - - - - - + + \ No newline at end of file diff --git a/app/src/main/res/layout-xlarge/fragment_banner_home.xml b/app/src/main/res/layout-xlarge/fragment_banner_home.xml index 8f6b34f5..e0b52e47 100644 --- a/app/src/main/res/layout-xlarge/fragment_banner_home.xml +++ b/app/src/main/res/layout-xlarge/fragment_banner_home.xml @@ -2,6 +2,7 @@ @@ -20,45 +21,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - - - - - - - - - - - - @@ -20,43 +21,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - - - - - - - - - @@ -8,28 +9,17 @@ - - - + - + + diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml index 22eae57e..36afaf92 100755 --- a/app/src/main/res/layout/activity_search.xml +++ b/app/src/main/res/layout/activity_search.xml @@ -19,9 +19,10 @@ android:orientation="vertical"> diff --git a/app/src/main/res/layout/fragment_adaptive_player_playback_controls.xml b/app/src/main/res/layout/fragment_adaptive_player_playback_controls.xml index 53efc852..8ddad582 100644 --- a/app/src/main/res/layout/fragment_adaptive_player_playback_controls.xml +++ b/app/src/main/res/layout/fragment_adaptive_player_playback_controls.xml @@ -61,6 +61,7 @@ android:layoutDirection="ltr" android:paddingEnd="4dp" android:paddingStart="4dp" + android:layout_marginBottom="8dp" tools:ignore="ContentDescription,UnusedAttribute"> + android:layout_height="match_parent" > diff --git a/app/src/main/res/layout/fragment_album_material_cover.xml b/app/src/main/res/layout/fragment_album_material_cover.xml index 6ebf7a82..76ae1a3f 100644 --- a/app/src/main/res/layout/fragment_album_material_cover.xml +++ b/app/src/main/res/layout/fragment_album_material_cover.xml @@ -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" > diff --git a/app/src/main/res/layout/fragment_banner_home.xml b/app/src/main/res/layout/fragment_banner_home.xml index f00ab652..5f40073a 100644 --- a/app/src/main/res/layout/fragment_banner_home.xml +++ b/app/src/main/res/layout/fragment_banner_home.xml @@ -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"> - - - - - - - - - - - - - + @@ -22,44 +23,50 @@ android:layout_height="match_parent" android:layout_weight="1"> + - + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" + app:cardCornerRadius="8dp" + app:cardUseCompatPadding="true" + app:layout_scrollFlags="scroll|enterAlways"> - + + + + + + + - - - - - - - - - - + android:layout_height="match_parent" /> + + tools:layout="@layout/fragment_album_full_cover" /> + android:background="#50000000" /> - - - - - - - - - - - - - @@ -21,53 +22,51 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" + app:cardCornerRadius="8dp" + app:cardUseCompatPadding="true" + app:layout_scrollFlags="scroll|enterAlways"> - + + + + + + + - - - - - - - - - - + android:layout_height="match_parent" /> + - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_player.xml b/app/src/main/res/layout/fragment_player.xml index f562efe2..3fd5919c 100644 --- a/app/src/main/res/layout/fragment_player.xml +++ b/app/src/main/res/layout/fragment_player.xml @@ -1,5 +1,5 @@ - - @@ -65,5 +65,5 @@ app:navigationIcon="@drawable/ic_close_white_24dp" /> - - + + diff --git a/app/src/main/res/layout/home_section_content.xml b/app/src/main/res/layout/home_section_content.xml index 8a812422..8a1b7a2f 100644 --- a/app/src/main/res/layout/home_section_content.xml +++ b/app/src/main/res/layout/home_section_content.xml @@ -51,7 +51,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:nestedScrollingEnabled="false" - app:itemMargin="28dp" /> + app:itemMargin="96dp" /> + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/pager_item.xml b/app/src/main/res/layout/pager_item.xml index 16ef3087..1f5d06fa 100644 --- a/app/src/main/res/layout/pager_item.xml +++ b/app/src/main/res/layout/pager_item.xml @@ -10,7 +10,7 @@ diff --git a/app/src/main/res/layout/sliding_music_panel_layout.xml b/app/src/main/res/layout/sliding_music_panel_layout.xml index c65513d1..e66ef14c 100644 --- a/app/src/main/res/layout/sliding_music_panel_layout.xml +++ b/app/src/main/res/layout/sliding_music_panel_layout.xml @@ -2,14 +2,19 @@ - + android:gravity="bottom" + sothree:umanoOverlay="false" + sothree:umanoPanelHeight="0dp" + sothree:umanoScrollableView="@+id/recycler_view" + sothree:umanoShadowHeight="0dp"> - - + android:layout_height="match_parent"> + + android:layout_height="match_parent" /> - - - - + android:layout_height="48dp" + tools:layout="@layout/fragment_mini_player" /> - - - + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index 2d2ce665..cb9fa8a4 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -3,12 +3,6 @@ xmlns:tools="http://schemas.android.com/tools" tools:context=".DrawerActivity"> - - @android:color/transparent false + @style/TextViewStyleIm + + +