For 4780: ThemeManager now sends an intent before recreating
Updating themes recreates the activity, so if we aren't persisting 'usePrivateMode', we need to pass it to the new instance
This commit is contained in:
parent
693034951c
commit
dd6439269b
|
@ -6,6 +6,7 @@ package org.mozilla.fenix.theme
|
|||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.res.Configuration
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
|
@ -14,6 +15,8 @@ import android.util.TypedValue
|
|||
import android.view.View
|
||||
import android.view.Window
|
||||
import androidx.annotation.StyleRes
|
||||
import mozilla.components.support.utils.toSafeIntent
|
||||
import org.mozilla.fenix.HomeActivity
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
|
||||
import org.mozilla.fenix.ext.getColorFromAttr
|
||||
|
@ -111,6 +114,10 @@ class DefaultThemeManager(
|
|||
field = value
|
||||
|
||||
setActivityTheme(activity)
|
||||
|
||||
val intent = activity.intent ?: Intent().also { activity.intent = it }
|
||||
intent.putExtra(HomeActivity.PRIVATE_BROWSING_MODE, value == BrowsingMode.Private)
|
||||
|
||||
activity.recreate()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user