]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/activities/AboutActivity.kt
Replace `Blocklists` with `Filter Lists`. https://redmine.stoutner.com/issues/705
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / activities / AboutActivity.kt
index 4b4042cee2f3e7dc279538ebb1952f41f85eb194..bd5c34e0caa34a98748c151f1635b4d92f0cdc05 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2016-2022 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2016-2022 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
  *
@@ -32,15 +32,9 @@ import com.google.android.material.tabs.TabLayout
 import com.stoutner.privacybrowser.R
 import com.stoutner.privacybrowser.adapters.AboutPagerAdapter
 
-class AboutActivity : AppCompatActivity() {
-    // Declare the class variables.
-    private lateinit var aboutPagerAdapter: AboutPagerAdapter
-
-    companion object {
-        // Define the companion object constants.  These can be move to being public constants once MainWebViewActivity has been converted to Kotlin.
-        const val BLOCKLIST_VERSIONS = "blocklist_versions"
-    }
+const val FILTERLIST_VERSIONS = "filterlist_versions"
 
+class AboutActivity : AppCompatActivity() {
     override fun onCreate(savedInstanceState: Bundle?) {
         // Get a handle for the shared preferences.
         val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)
@@ -54,24 +48,20 @@ class AboutActivity : AppCompatActivity() {
             window.addFlags(WindowManager.LayoutParams.FLAG_SECURE)
         }
 
-        // Set the theme.
-        setTheme(R.style.PrivacyBrowser)
-
         // Run the default commands.
         super.onCreate(savedInstanceState)
 
         // Get the intent that launched the activity.
         val launchingIntent = intent
 
-        // Store the blocklist versions.
-        val blocklistVersions = launchingIntent.getStringArrayExtra(BLOCKLIST_VERSIONS)!!
+        // Get the filter list versions.
+        val filterListVersions = launchingIntent.getStringArrayExtra(FILTERLIST_VERSIONS)!!
 
         // Set the content view.
-        if (bottomAppBar) {
+        if (bottomAppBar)
             setContentView(R.layout.about_bottom_appbar)
-        } else {
+        else
             setContentView(R.layout.about_top_appbar)
-        }
 
         // Get handles for the views.
         val toolbar = findViewById<Toolbar>(R.id.about_toolbar)
@@ -88,7 +78,7 @@ class AboutActivity : AppCompatActivity() {
         actionBar.setDisplayHomeAsUpEnabled(true)
 
         // Initialize the about pager adapter.
-        aboutPagerAdapter = AboutPagerAdapter(supportFragmentManager, applicationContext, blocklistVersions)
+        val aboutPagerAdapter = AboutPagerAdapter(supportFragmentManager, applicationContext, filterListVersions)
 
         // Set the view pager adapter.
         aboutViewPager.adapter = aboutPagerAdapter