From 31e82dfc6235a460886d7dc9cdd1fbcba8ce695c Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Tue, 11 Apr 2023 16:52:38 -0700 Subject: [PATCH] Move the blocklist helper to a class instance. https://redmine.stoutner.com/issues/991 --- .../privacybrowser/activities/MainWebViewActivity.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 -- 2.45.2