// Get a handle for the shared preferences.
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(applicationContext)
- // Get the screenshot preference.
+ // Get the preferences.
val allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false)
+ val bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false)
// Disable screenshots if not allowed.
if (!allowScreenshots) {
val userAgent = intent.getStringExtra(USER_AGENT)!!
// Set the content view.
- setContentView(R.layout.view_source_coordinatorlayout)
+ if (bottomAppBar) {
+ setContentView(R.layout.view_source_bottom_appbar)
+ } else {
+ setContentView(R.layout.view_source_top_appbar)
+ }
// Get a handle for the toolbar.
val toolbar = findViewById<Toolbar>(R.id.view_source_toolbar)
}
// Set the refresh color scheme according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
- swipeRefreshLayout.setColorSchemeResources(R.color.blue_700)
- } else {
- swipeRefreshLayout.setColorSchemeResources(R.color.violet_500)
- }
+ swipeRefreshLayout.setColorSchemeResources(R.color.blue_text)
// Initialize a color background typed value.
val colorBackgroundTypedValue = TypedValue()