Added semi transparent toolbar on Home
This commit is contained in:
parent
02d9eb765d
commit
2a449ef649
5 changed files with 23 additions and 27 deletions
|
@ -31,8 +31,8 @@ android {
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|
||||||
applicationId "code.name.monkey.retromusic"
|
applicationId "code.name.monkey.retromusic"
|
||||||
versionCode 330
|
versionCode 331
|
||||||
versionName '3.1.850'
|
versionName '3.1.900'
|
||||||
|
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
|
||||||
|
|
|
@ -136,13 +136,13 @@ class ArtistDetailActivity : AbsSlidingMusicPanelActivity(), ArtistDetailContrac
|
||||||
}
|
}
|
||||||
|
|
||||||
appBarLayout?.addOnOffsetChangedListener(object : AppBarStateChangeListener() {
|
appBarLayout?.addOnOffsetChangedListener(object : AppBarStateChangeListener() {
|
||||||
override fun onStateChanged(appBarLayout: AppBarLayout, state: AppBarStateChangeListener.State) {
|
override fun onStateChanged(appBarLayout: AppBarLayout, state: State) {
|
||||||
val color: Int = when (state) {
|
val color: Int = when (state) {
|
||||||
AppBarStateChangeListener.State.COLLAPSED -> {
|
State.COLLAPSED -> {
|
||||||
setLightStatusbar(ColorUtil.isColorLight(ThemeStore.primaryColor(appBarLayout.context)))
|
setLightStatusbar(ColorUtil.isColorLight(ThemeStore.primaryColor(appBarLayout.context)))
|
||||||
ThemeStore.primaryColor(appBarLayout.context)
|
ThemeStore.primaryColor(appBarLayout.context)
|
||||||
}
|
}
|
||||||
AppBarStateChangeListener.State.EXPANDED, AppBarStateChangeListener.State.IDLE -> {
|
State.EXPANDED, State.IDLE -> {
|
||||||
setLightStatusbar(false)
|
setLightStatusbar(false)
|
||||||
Color.TRANSPARENT
|
Color.TRANSPARENT
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package code.name.monkey.retromusic.fragments.mainactivity.home
|
package code.name.monkey.retromusic.fragments.mainactivity.home
|
||||||
|
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.DisplayMetrics
|
import android.util.DisplayMetrics
|
||||||
import android.view.*
|
import android.view.*
|
||||||
|
@ -10,6 +11,7 @@ import androidx.core.util.Pair
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
import code.name.monkey.appthemehelper.common.ATHToolbarActivity
|
import code.name.monkey.appthemehelper.common.ATHToolbarActivity
|
||||||
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||||
import code.name.monkey.retromusic.Constants
|
import code.name.monkey.retromusic.Constants
|
||||||
import code.name.monkey.retromusic.Constants.USER_BANNER
|
import code.name.monkey.retromusic.Constants.USER_BANNER
|
||||||
|
@ -151,11 +153,11 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupToolbar() {
|
private fun setupToolbar() {
|
||||||
|
toolbarContainer.setBackgroundColor(Color.TRANSPARENT)
|
||||||
toolbar.apply {
|
toolbar.apply {
|
||||||
setBackgroundColor(RetroUtil.toolbarColor(mainActivity))
|
setBackgroundColor(ColorUtil.withAlpha(RetroUtil.toolbarColor(mainActivity), 0.85f))
|
||||||
setNavigationIcon(R.drawable.ic_menu_white_24dp)
|
setNavigationIcon(R.drawable.ic_menu_white_24dp)
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
|
|
||||||
val pairImageView = Pair.create<View, String>(toolbarContainer, resources.getString(R.string.transition_toolbar))
|
val pairImageView = Pair.create<View, String>(toolbarContainer, resources.getString(R.string.transition_toolbar))
|
||||||
NavigationUtil.goToSearch(activity!!, pairImageView)
|
NavigationUtil.goToSearch(activity!!, pairImageView)
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,5 +5,8 @@
|
||||||
<color name="app_shortcut_default_foreground">#607d8b</color>
|
<color name="app_shortcut_default_foreground">#607d8b</color>
|
||||||
<color name="app_shortcut_default_background">#f5f5f5</color>
|
<color name="app_shortcut_default_background">#f5f5f5</color>
|
||||||
<color name="md_indigo_A400">#3D5AFE</color>
|
<color name="md_indigo_A400">#3D5AFE</color>
|
||||||
|
<color name="dark_color">#202124</color>
|
||||||
|
<color name="card_dark_color">#2C2D30</color>
|
||||||
|
<color name="black_color">#121212</color>
|
||||||
|
<color name="card_black_color">#1E1E1E</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -65,27 +65,24 @@
|
||||||
<item name="rectSelector">@drawable/rect_selector_dark</item>
|
<item name="rectSelector">@drawable/rect_selector_dark</item>
|
||||||
<item name="rectSelectorStrong">@drawable/rect_selector_strong_dark</item>
|
<item name="rectSelectorStrong">@drawable/rect_selector_strong_dark</item>
|
||||||
|
|
||||||
<item name="cardBackgroundColor">@color/md_grey_800</item>
|
<item name="cardBackgroundColor">@color/card_dark_color</item>
|
||||||
|
<item name="defaultFooterColor">@color/dark_color</item>
|
||||||
|
<item name="dividerColor">@color/dark_color</item>
|
||||||
|
|
||||||
<item name="defaultFooterColor">@color/md_grey_800</item>
|
|
||||||
|
|
||||||
<item name="dividerColor">@color/md_grey_800</item>
|
|
||||||
<item name="iconColor">@color/ate_secondary_text_dark</item>
|
<item name="iconColor">@color/ate_secondary_text_dark</item>
|
||||||
|
|
||||||
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat</item>
|
<item name="toolbarPopupTheme">@style/ThemeOverlay.AppCompat</item>
|
||||||
|
|
||||||
<!-- just in case-->
|
<!-- just in case-->
|
||||||
<item name="android:windowBackground">@color/md_grey_900</item>
|
<item name="android:windowBackground">@color/dark_color</item>
|
||||||
<item name="colorAccent">@android:color/white</item>
|
<item name="colorAccent">@android:color/white</item>
|
||||||
<item name="colorPrimary">@color/md_grey_900</item>
|
<item name="colorPrimary">@color/dark_color</item>
|
||||||
|
|
||||||
<!-- necessary to find the overflow button later in the layout-->
|
<!-- necessary to find the overflow button later in the layout-->
|
||||||
<item name="android:actionOverflowButtonStyle">@style/Widget.ActionButton.Overflow</item>
|
<item name="android:actionOverflowButtonStyle">@style/Widget.ActionButton.Overflow</item>
|
||||||
|
|
||||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||||
|
|
||||||
<item name="bottomSheetDialogTheme">@style/BottomSheetDialog</item>
|
|
||||||
|
|
||||||
<item name="android:windowActivityTransitions">true</item>
|
<item name="android:windowActivityTransitions">true</item>
|
||||||
<item name="android:windowExitTransition">@transition/grid_exit</item>
|
<item name="android:windowExitTransition">@transition/grid_exit</item>
|
||||||
<item name="android:windowEnterTransition">@transition/grid_exit</item>
|
<item name="android:windowEnterTransition">@transition/grid_exit</item>
|
||||||
|
@ -112,18 +109,14 @@
|
||||||
|
|
||||||
<style name="Theme.RetroMusic.Base.Black" parent="@style/Theme.RetroMusic.Base">
|
<style name="Theme.RetroMusic.Base.Black" parent="@style/Theme.RetroMusic.Base">
|
||||||
|
|
||||||
<item name="dividerColor">#18FFFFFF</item>
|
<item name="dividerColor">@color/dark_color</item>
|
||||||
<item name="defaultFooterColor">@color/md_grey_800</item>
|
<item name="defaultFooterColor">@color/md_grey_800</item>
|
||||||
<item name="cardBackgroundColor">@color/md_grey_900</item>
|
<item name="cardBackgroundColor">@color/md_grey_900</item>
|
||||||
<item name="md_background_color">@color/md_grey_900</item>
|
<item name="md_background_color">@color/card_black_color</item>
|
||||||
|
|
||||||
<item name="android:windowBackground">@color/md_black_1000</item>
|
|
||||||
|
|
||||||
<item name="colorPrimary">@android:color/black</item>
|
|
||||||
<item name="android:colorPrimary">@android:color/black</item>
|
|
||||||
|
|
||||||
<item name="bottomSheetDialogTheme">@style/BottomSheetDialog</item>
|
|
||||||
|
|
||||||
|
<item name="android:windowBackground">@color/black_color</item>
|
||||||
|
<item name="colorPrimary">@color/black_color</item>
|
||||||
|
<item name="android:colorPrimary">@color/black_color</item>
|
||||||
|
|
||||||
<item name="android:windowActivityTransitions">true</item>
|
<item name="android:windowActivityTransitions">true</item>
|
||||||
<item name="android:windowExitTransition">@transition/grid_exit</item>
|
<item name="android:windowExitTransition">@transition/grid_exit</item>
|
||||||
|
@ -171,8 +164,6 @@
|
||||||
|
|
||||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||||
|
|
||||||
<item name="bottomSheetDialogTheme">@style/BottomSheetDialog</item>
|
|
||||||
|
|
||||||
<item name="android:windowActivityTransitions">true</item>
|
<item name="android:windowActivityTransitions">true</item>
|
||||||
<item name="android:windowExitTransition">@transition/grid_exit</item>
|
<item name="android:windowExitTransition">@transition/grid_exit</item>
|
||||||
<item name="android:windowEnterTransition">@transition/grid_exit</item>
|
<item name="android:windowEnterTransition">@transition/grid_exit</item>
|
||||||
|
|
Loading…
Reference in a new issue