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.