From: Soren Stoutner Date: Tue, 11 Apr 2023 23:52:38 +0000 (-0700) Subject: Move the blocklist helper to a class instance. https://redmine.stoutner.com/issues/991 X-Git-Tag: v3.14~7 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=31e82dfc6235a460886d7dc9cdd1fbcba8ce695c;p=PrivacyBrowserAndroid.git Move the blocklist helper to a class instance. https://redmine.stoutner.com/issues/991 --- diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt index d56d9b71..fc14e997 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt @@ -217,12 +217,14 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook // Declare the class variables. private lateinit var appBar: ActionBar + private lateinit var blocklistHelper: BlocklistHelper private lateinit var bookmarksCursorAdapter: CursorAdapter private lateinit var bookmarksListView: ListView private lateinit var bookmarksDrawerPinnedImageView: ImageView private lateinit var bookmarksTitleTextView: TextView private lateinit var coordinatorLayout: CoordinatorLayout private lateinit var cookieManager: CookieManager + private lateinit var domainsSettingsSet: MutableSet private lateinit var drawerLayout: DrawerLayout private lateinit var easyList: ArrayList>> private lateinit var easyPrivacy: ArrayList>> @@ -310,7 +312,6 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook private var displayAdditionalAppBarIcons = false private var displayingFullScreenVideo = false private var domainsDatabaseHelper: DomainsDatabaseHelper? = null - private var domainsSettingsSet: MutableSet = HashSet() private var downloadWithExternalApp = false private var fullScreenBrowsingModeEnabled = false private var hideAppBar = false @@ -3366,6 +3367,9 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook // Update the domains settings set. updateDomainsSettingsSet() + + // Instantiate the blocklist helper. + blocklistHelper = BlocklistHelper() } private fun applyAppSettings() { @@ -4741,9 +4745,6 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook // Get a handle for the input method manager. val inputMethodManager = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager - // Instantiate the blocklist helper. TODO. Make a class instance. - val blocklistHelper = BlocklistHelper() - // Set the app bar scrolling. nestedScrollWebView.isNestedScrollingEnabled = scrollAppBar