aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-09-19 23:33:53 -0400
committerGitHub <noreply@github.com>2017-09-19 23:33:53 -0400
commit52d7966d1830d6380917f1defccd3d9e09e34561 (patch)
treee7883fa685436ee513568d12269fc597e78c2c51 /app/src/main/kotlin/com/pitchedapps
parentd75ad7fb42aba81b334f9453c012f04c3d5f3e0a (diff)
downloadfrost-52d7966d1830d6380917f1defccd3d9e09e34561.tar.gz
frost-52d7966d1830d6380917f1defccd3d9e09e34561.tar.bz2
frost-52d7966d1830d6380917f1defccd3d9e09e34561.zip
Remove network image settings (#320)
* Remove network image settings * Remove import
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/BaseActivity.kt6
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt7
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt8
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/WebStates.kt2
5 files changed, 12 insertions, 13 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseActivity.kt
index c7ca5ec7..ddb42d72 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseActivity.kt
@@ -42,7 +42,7 @@ abstract class BaseActivity : KauBaseActivity() {
this.networkConsumer = consumer
}
- fun observeNetworkConnectivity() {
+ private fun observeNetworkConnectivity() {
val consumer = networkConsumer ?: return
networkDisposable = ReactiveNetwork.observeNetworkConnectivity(applicationContext)
.subscribeOn(Schedulers.io())
@@ -56,8 +56,8 @@ abstract class BaseActivity : KauBaseActivity() {
}
}
- fun disposeNetworkConnectivity() {
- if (!(networkDisposable?.isDisposed ?: true))
+ private fun disposeNetworkConnectivity() {
+ if (networkDisposable?.isDisposed == false)
networkDisposable?.dispose()
networkDisposable = null
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt
index dd8ed558..53480f86 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt
@@ -61,7 +61,6 @@ import com.pitchedapps.frost.utils.iab.IS_FROST_PRO
import com.pitchedapps.frost.views.BadgedIcon
import com.pitchedapps.frost.views.FrostViewPager
import com.pitchedapps.frost.web.SearchWebView
-import com.pitchedapps.frost.web.shouldLoadImages
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
@@ -162,9 +161,9 @@ class MainActivity : BaseActivity(), SearchWebView.SearchContract,
setFrostColors(toolbar, themeWindow = false, headers = arrayOf(appBar), backgrounds = arrayOf(viewPager))
tabs.setBackgroundColor(Prefs.mainActivityLayout.backgroundColor())
onCreateBilling()
- setNetworkObserver { connectivity ->
- shouldLoadImages = !connectivity.isRoaming
- }
+// setNetworkObserver { connectivity ->
+// shouldLoadImages = !connectivity.isRoaming
+// }
}
fun tabsForEachView(action: (position: Int, view: BadgedIcon) -> Unit) {
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt
index 497ee375..c51b6fe5 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt
@@ -93,10 +93,10 @@ class SettingsActivity : KPrefActivity(), FrostBilling by IABSettings() {
iicon = GoogleMaterial.Icon.gmd_notifications
}
- subItems(R.string.network, getNetworkPrefs()) {
- descRes = R.string.network_desc
- iicon = GoogleMaterial.Icon.gmd_network_cell
- }
+// subItems(R.string.network, getNetworkPrefs()) {
+// descRes = R.string.network_desc
+// iicon = GoogleMaterial.Icon.gmd_network_cell
+// }
subItems(R.string.experimental, getExperimentalPrefs()) {
descRes = R.string.experimental_desc
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt
index 4936eaf4..d3d58a5c 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt
@@ -52,7 +52,7 @@ fun WebView.shouldFrostInterceptRequest(request: WebResourceRequest): WebResourc
if (blacklistHost.contains(host)) return blankResource
if (whitelistHost.contains(host)) return null
if (!adWhitelistHost.contains(host) && adblock(context).any { url.contains(it) }) return blankResource
- if (!shouldLoadImages && !Prefs.loadMediaOnMeteredNetwork && request.isMedia) return blankResource
+// if (!shouldLoadImages && !Prefs.loadMediaOnMeteredNetwork && request.isMedia) return blankResource
L.v("Intercept Request", "$host $url")
return null
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/WebStates.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/WebStates.kt
index ad1fe467..d07e67df 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/WebStates.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/WebStates.kt
@@ -6,6 +6,6 @@ package com.pitchedapps.frost.web
* Global variables that are define states or constants for web contents
*/
const val WEB_LOAD_DELAY = 50L
-var shouldLoadImages = false
+//var shouldLoadImages = false
val consoleBlacklist = setOf("edge-chat") \ No newline at end of file