mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1919200 - Restore the toolbar background after the microsurvey is dismissed r=android-reviewers,twhite
Use `isMicrosurveyPromptDismissed.value` to know when either of the survey prompt or survey options dialog was closed. Reapplying the default background when the survey is closed will mean a small divider line included in the background shape will also be shown. Differential Revision: https://phabricator.services.mozilla.com/D222423
This commit is contained in:
parent
90e93d430d
commit
52ec377ade
@ -1541,6 +1541,8 @@ abstract class BaseBrowserFragment :
|
||||
},
|
||||
)
|
||||
}
|
||||
} else {
|
||||
restoreBrowserToolbarAfterMicrosurveyPrompt(browserToolbar)
|
||||
}
|
||||
|
||||
if (isToolbarAtBottom) {
|
||||
@ -1744,6 +1746,7 @@ abstract class BaseBrowserFragment :
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("LongMethod")
|
||||
private fun initializeMicrosurveyPrompt() {
|
||||
val context = requireContext()
|
||||
val view = requireView()
|
||||
@ -1799,6 +1802,8 @@ abstract class BaseBrowserFragment :
|
||||
},
|
||||
)
|
||||
}
|
||||
} else {
|
||||
restoreBrowserToolbarAfterMicrosurveyPrompt(browserToolbar)
|
||||
}
|
||||
|
||||
if (isToolbarAtBottom) {
|
||||
@ -1844,6 +1849,15 @@ abstract class BaseBrowserFragment :
|
||||
browserToolbar.elevation = 0.0f
|
||||
}
|
||||
|
||||
private fun restoreBrowserToolbarAfterMicrosurveyPrompt(browserToolbar: BrowserToolbar) {
|
||||
val defaultBackground = ResourcesCompat.getDrawable(
|
||||
resources,
|
||||
R.drawable.toolbar_background,
|
||||
context?.theme,
|
||||
)
|
||||
browserToolbar.background = defaultBackground
|
||||
}
|
||||
|
||||
private var currentMicrosurvey: MicrosurveyUIData? = null
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user