/*
- * Copyright 2018-2023 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2018-2024 Soren Stoutner <soren@stoutner.com>.
*
- * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
+ * This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android/>.
*
* Privacy Browser Android is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
import com.stoutner.privacybrowser.adapters.RequestsArrayAdapter
import com.stoutner.privacybrowser.dialogs.ViewRequestDialog.Companion.request
import com.stoutner.privacybrowser.dialogs.ViewRequestDialog.ViewRequestListener
-import com.stoutner.privacybrowser.helpers.BlocklistHelper
+import com.stoutner.privacybrowser.helpers.REQUEST_ALLOWED
+import com.stoutner.privacybrowser.helpers.REQUEST_BLOCKED
+import com.stoutner.privacybrowser.helpers.REQUEST_DEFAULT
+import com.stoutner.privacybrowser.helpers.REQUEST_DISPOSITION
+import com.stoutner.privacybrowser.helpers.REQUEST_THIRD_PARTY
// Define the public constants.
const val BLOCK_ALL_THIRD_PARTY_REQUESTS = "block_all_third_party_requests"
// Get the launching intent
val intent = intent
- // Get the status of the third-party blocklist.
+ // Get the status of the third-party filter list.
val blockAllThirdPartyRequests = intent.getBooleanExtra(BLOCK_ALL_THIRD_PARTY_REQUESTS, false)
// Set the content view.
// Add the request to the list of all requests.
allResourceRequests.add(request)
- when (request[BlocklistHelper.REQUEST_DISPOSITION]) {
- BlocklistHelper.REQUEST_DEFAULT -> {
+ when (request[REQUEST_DISPOSITION]) {
+ REQUEST_DEFAULT -> {
// Add the request to the list of default requests.
defaultResourceRequests.add(request)
}
- BlocklistHelper.REQUEST_ALLOWED -> {
+ REQUEST_ALLOWED -> {
// Add the request to the list of allowed requests.
allowedResourceRequests.add(request)
}
- BlocklistHelper.REQUEST_THIRD_PARTY -> {
+ REQUEST_THIRD_PARTY -> {
// Add the request to the list of third-party requests.
thirdPartyResourceRequests.add(request)
}
- BlocklistHelper.REQUEST_BLOCKED -> {
+ REQUEST_BLOCKED -> {
// Add the request to the list of blocked requests.
blockedResourceRequests.add(request)
}
// Handle clicks on the spinner dropdown.
appBarSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
- override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) {
+ override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
when (id.toInt()) {
0 -> {
// Get an adapter for all the requests.
}
}
- public override fun onSaveInstanceState(savedInstanceState: Bundle) {
+ public override fun onSaveInstanceState(outState: Bundle) {
// Run the default commands.
- super.onSaveInstanceState(savedInstanceState)
+ super.onSaveInstanceState(outState)
// Get the listview position.
val listViewPosition = requestsListView.firstVisiblePosition
// Store the listview position in the bundle.
- savedInstanceState.putInt(LISTVIEW_POSITION, listViewPosition)
+ outState.putInt(LISTVIEW_POSITION, listViewPosition)
}
override fun onPrevious(currentId: Int) {