From 2a449ef649d84fae6913be72d64ea08eb65eb54a Mon Sep 17 00:00:00 2001 From: h4h13 Date: Wed, 5 Jun 2019 00:07:43 +0530 Subject: [PATCH] Added semi transparent toolbar on Home --- app/build.gradle | 4 +-- .../activities/ArtistDetailActivity.kt | 6 ++-- .../mainactivity/home/BannerHomeFragment.kt | 6 ++-- app/src/main/res/values/colors.xml | 5 +++- app/src/main/res/values/styles_parents.xml | 29 +++++++------------ 5 files changed, 23 insertions(+), 27 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 324630bf..be002f75 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,8 +31,8 @@ android { vectorDrawables.useSupportLibrary = true applicationId "code.name.monkey.retromusic" - versionCode 330 - versionName '3.1.850' + versionCode 331 + versionName '3.1.900' multiDexEnabled true diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/ArtistDetailActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/ArtistDetailActivity.kt index 784f26ce..9c0dc629 100755 --- a/app/src/main/java/code/name/monkey/retromusic/activities/ArtistDetailActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/ArtistDetailActivity.kt @@ -136,13 +136,13 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac } appBarLayout?.addOnOffsetChangedListener(object : AppBarStateChangeListener() { - override fun onStateChanged(appBarLayout: AppBarLayout, state: AppBarStateChangeListener.State) { + override fun onStateChanged(appBarLayout: AppBarLayout, state: State) { val color: Int = when (state) { - AppBarStateChangeListener.State.COLLAPSED -> { + State.COLLAPSED -> { setLightStatusbar(ColorUtil.isColorLight(ThemeStore.primaryColor(appBarLayout.context))) ThemeStore.primaryColor(appBarLayout.context) } - AppBarStateChangeListener.State.EXPANDED, AppBarStateChangeListener.State.IDLE -> { + State.EXPANDED, State.IDLE -> { setLightStatusbar(false) Color.TRANSPARENT } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/home/BannerHomeFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/home/BannerHomeFragment.kt index 5e26e71c..481e417e 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/home/BannerHomeFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/home/BannerHomeFragment.kt @@ -1,6 +1,7 @@ package code.name.monkey.retromusic.fragments.mainactivity.home import android.graphics.Bitmap +import android.graphics.Color import android.os.Bundle import android.util.DisplayMetrics import android.view.* @@ -10,6 +11,7 @@ import androidx.core.util.Pair import androidx.recyclerview.widget.LinearLayoutManager import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.common.ATHToolbarActivity +import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper import code.name.monkey.retromusic.Constants import code.name.monkey.retromusic.Constants.USER_BANNER @@ -151,11 +153,11 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba } private fun setupToolbar() { + toolbarContainer.setBackgroundColor(Color.TRANSPARENT) toolbar.apply { - setBackgroundColor(RetroUtil.toolbarColor(mainActivity)) + setBackgroundColor(ColorUtil.withAlpha(RetroUtil.toolbarColor(mainActivity), 0.85f)) setNavigationIcon(R.drawable.ic_menu_white_24dp) setOnClickListener { - val pairImageView = Pair.create(toolbarContainer, resources.getString(R.string.transition_toolbar)) NavigationUtil.goToSearch(activity!!, pairImageView) } diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 1df4872a..bca60909 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -5,5 +5,8 @@ #607d8b #f5f5f5 #3D5AFE - + #202124 + #2C2D30 + #121212 + #1E1E1E diff --git a/app/src/main/res/values/styles_parents.xml b/app/src/main/res/values/styles_parents.xml index 5f9500c8..3160afbd 100644 --- a/app/src/main/res/values/styles_parents.xml +++ b/app/src/main/res/values/styles_parents.xml @@ -65,27 +65,24 @@ @drawable/rect_selector_dark @drawable/rect_selector_strong_dark - @color/md_grey_800 + @color/card_dark_color + @color/dark_color + @color/dark_color - @color/md_grey_800 - - @color/md_grey_800 @color/ate_secondary_text_dark @style/ThemeOverlay.AppCompat - @color/md_grey_900 + @color/dark_color @android:color/white - @color/md_grey_900 + @color/dark_color @style/Widget.ActionButton.Overflow @style/PreferenceThemeOverlay.v14.Material - @style/BottomSheetDialog - true @transition/grid_exit @transition/grid_exit @@ -112,18 +109,14 @@