X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Factivities%2FViewSourceActivity.kt;h=759b79c0fb00ebbbe91fc20bb21e002392c4bfb7;hp=eb8ba87cc0a3147738c6c7276eb1e1fb7d10211f;hb=322b36f275782a06ed66b950083f28cc37f5690a;hpb=aa121d6d6df14a0425ac3b5603765dbae7e8d156 diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/ViewSourceActivity.kt b/app/src/main/java/com/stoutner/privacybrowser/activities/ViewSourceActivity.kt index eb8ba87c..759b79c0 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/ViewSourceActivity.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/ViewSourceActivity.kt @@ -82,8 +82,9 @@ class ViewSourceActivity: AppCompatActivity(), UntrustedSslCertificateListener { // 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) { @@ -104,7 +105,11 @@ class ViewSourceActivity: AppCompatActivity(), UntrustedSslCertificateListener { 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(R.id.view_source_toolbar) @@ -181,11 +186,7 @@ class ViewSourceActivity: AppCompatActivity(), UntrustedSslCertificateListener { } // 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()