aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-15 19:25:17 -0700
committerAllan Wang <me@allanwang.ca>2017-06-15 19:25:17 -0700
commitc8f76b5aa406f84f49789a50871c68a1a95a232d (patch)
tree7a47029f13dd023b2947eb294c8c9f7c7dbd3fe0 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
parent0d1f0e215b1890f2f5d45373b2746b7ef91da494 (diff)
downloadfrost-c8f76b5aa406f84f49789a50871c68a1a95a232d.tar.gz
frost-c8f76b5aa406f84f49789a50871c68a1a95a232d.tar.bz2
frost-c8f76b5aa406f84f49789a50871c68a1a95a232d.zip
Only animate webview when explicitly asked
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt16
1 files changed, 4 insertions, 12 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
index c3eb0a1f..e4ff4e10 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
@@ -4,7 +4,6 @@ import android.content.Context
import android.graphics.Bitmap
import android.view.KeyEvent
import android.webkit.*
-import ca.allanwang.kau.utils.isVisible
import com.pitchedapps.frost.LoginActivity
import com.pitchedapps.frost.MainActivity
import com.pitchedapps.frost.SelectorActivity
@@ -18,9 +17,6 @@ import com.pitchedapps.frost.utils.L
import com.pitchedapps.frost.utils.Prefs
import com.pitchedapps.frost.utils.cookies
import com.pitchedapps.frost.utils.launchNewTask
-import com.pitchedapps.frost.views.circularReveal
-import com.pitchedapps.frost.views.fadeIn
-import com.pitchedapps.frost.views.fadeOut
import io.reactivex.subjects.Subject
/**
@@ -36,7 +32,6 @@ open class FrostWebViewClient(val refreshObservable: Subject<Boolean>) : WebView
if (!url.contains(FACEBOOK_COM)) return
if (url.contains("logout.php")) FbCookie.logout(Prefs.userId, { launchLogin(view.context) })
else if (url.contains("login.php")) FbCookie.reset({ launchLogin(view.context) })
- view.fadeOut(duration = 200L)
}
fun launchLogin(c: Context) {
@@ -50,19 +45,18 @@ open class FrostWebViewClient(val refreshObservable: Subject<Boolean>) : WebView
super.onPageFinished(view, url)
if (!url.contains(FACEBOOK_COM)) {
refreshObservable.onNext(false)
- if (!view.isVisible()) view.fadeIn(duration = 200L)
return
}
L.i("Page finished $url")
JsActions.LOGIN_CHECK.inject(view)
- onPageFinishedReveal(view as FrostWebViewCore, url)
+ onPageFinishedActions(view as FrostWebViewCore, url)
}
- open internal fun onPageFinishedReveal(view: FrostWebViewCore, url: String?) {
- onPageFinishedReveal(view, true)
+ open internal fun onPageFinishedActions(view: FrostWebViewCore, url: String?) {
+ onPageFinishedActions(view)
}
- internal fun onPageFinishedReveal(view: FrostWebViewCore, animate: Boolean) {
+ internal fun onPageFinishedActions(view: FrostWebViewCore) {
L.d("Page finished reveal")
view.jsInject(CssHider.HEADER,
Prefs.themeInjector,
@@ -70,8 +64,6 @@ open class FrostWebViewClient(val refreshObservable: Subject<Boolean>) : WebView
callback = {
L.d("Finished ${it.contentToString()}")
refreshObservable.onNext(false)
- if (animate) view.circularReveal(offset = 150L)
- else view.fadeIn(duration = 100L)
})
}