For #9207 - changed status bar color in home fragment to match gradient background
parent
fa9dae0d72
commit
494db56ea5
|
@ -8,6 +8,7 @@ import android.animation.Animator
|
|||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
|
@ -41,8 +42,19 @@ import androidx.recyclerview.widget.RecyclerView
|
|||
import androidx.recyclerview.widget.RecyclerView.SCROLL_STATE_IDLE
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import kotlinx.android.synthetic.main.fragment_home.*
|
||||
import kotlinx.android.synthetic.main.fragment_home.view.*
|
||||
import kotlinx.android.synthetic.main.fragment_home.homeAppBar
|
||||
import kotlinx.android.synthetic.main.fragment_home.privateBrowsingButton
|
||||
import kotlinx.android.synthetic.main.fragment_home.search_engine_icon
|
||||
import kotlinx.android.synthetic.main.fragment_home.toolbarLayout
|
||||
import kotlinx.android.synthetic.main.fragment_home.view.add_tab_button
|
||||
import kotlinx.android.synthetic.main.fragment_home.view.bottomBarShadow
|
||||
import kotlinx.android.synthetic.main.fragment_home.view.bottom_bar
|
||||
import kotlinx.android.synthetic.main.fragment_home.view.homeAppBar
|
||||
import kotlinx.android.synthetic.main.fragment_home.view.menuButton
|
||||
import kotlinx.android.synthetic.main.fragment_home.view.sessionControlRecyclerView
|
||||
import kotlinx.android.synthetic.main.fragment_home.view.toolbar
|
||||
import kotlinx.android.synthetic.main.fragment_home.view.toolbarLayout
|
||||
import kotlinx.android.synthetic.main.fragment_home.view.toolbar_wrapper
|
||||
import kotlinx.coroutines.Dispatchers.IO
|
||||
import kotlinx.coroutines.Dispatchers.Main
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
|
@ -486,11 +498,24 @@ class HomeFragment : Fragment() {
|
|||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (browsingModeManager.mode == BrowsingMode.Private) {
|
||||
activity?.window?.setBackgroundDrawableResource(R.drawable.private_home_background_gradient)
|
||||
}
|
||||
hideToolbar()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
if (browsingModeManager.mode == BrowsingMode.Private) {
|
||||
activity?.window?.setBackgroundDrawable(
|
||||
ColorDrawable(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.foundation_private_theme
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
calculateNewOffset()
|
||||
}
|
||||
|
||||
|
|
|
@ -4,18 +4,10 @@
|
|||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<resources>
|
||||
<style name="NormalTheme" parent="NormalThemeBase">
|
||||
<!-- Style the status bar -->
|
||||
<!-- We have to pull in the changes from v23/styles.xml to make
|
||||
sure we also get them in 27+ -->
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">@bool/theme_is_light</item>
|
||||
</style>
|
||||
|
||||
<style name="PrivateTheme" parent="PrivateThemeBase">
|
||||
<!-- Style the status bar -->
|
||||
<!-- We have to pull in the changes from v23/styles.xml to make
|
||||
sure we also get them in 27+ -->
|
||||
<item name="android:statusBarColor">@color/above_private_theme</item>
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
|
||||
<!-- Style the navigation bar -->
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
<!-- Style the status bar -->
|
||||
<!-- We have to pull in the changes from v23/styles.xml to make
|
||||
sure we also get them in 27+ -->
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">@bool/theme_is_light</item>
|
||||
|
||||
<!-- Style the navigation bar -->
|
||||
|
@ -19,7 +18,6 @@
|
|||
<!-- Style the status bar -->
|
||||
<!-- We have to pull in the changes from v23/styles.xml to make
|
||||
sure we also get them in 27+ -->
|
||||
<item name="android:statusBarColor">@color/foundation_private_theme</item>
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
|
||||
<!-- Style the navigation bar -->
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<item name="android:windowContentTransitions">true</item>
|
||||
<item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item>
|
||||
<item name="android:progressBarStyleHorizontal">@style/progressBarStyleHorizontal</item>
|
||||
<item name="android:statusBarColor">@color/foundation_normal_theme</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowBackground">@color/foundation_normal_theme</item>
|
||||
<item name="android:colorEdgeEffect">@color/accent_normal_theme</item>
|
||||
<item name="android:colorAccent">@color/primary_text_normal_theme</item>
|
||||
|
@ -106,7 +106,7 @@
|
|||
<item name="android:windowContentTransitions">true</item>
|
||||
<item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item>
|
||||
<item name="android:progressBarStyleHorizontal">@style/progressBarStyleHorizontal</item>
|
||||
<item name="android:statusBarColor">@color/foundation_private_theme</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowBackground">@color/foundation_private_theme</item>
|
||||
<item name="android:colorEdgeEffect">@color/accent_private_theme</item>
|
||||
<item name="android:colorAccent">@color/primary_text_private_theme</item>
|
||||
|
|
Loading…
Reference in New Issue