diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-22 19:50:44 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-22 19:50:44 -0700 |
commit | da5967f87b8a0e9863fb6b82fc5807bae9e62a00 (patch) | |
tree | 8575d63efacb79ae10a50c471bf3c8055ea1dbf9 /app/src/main/kotlin/com/pitchedapps/frost/web | |
parent | 42d441c0e2b436c7b95fe8dc02ef36608395dbff (diff) | |
download | frost-da5967f87b8a0e9863fb6b82fc5807bae9e62a00.tar.gz frost-da5967f87b8a0e9863fb6b82fc5807bae9e62a00.tar.bz2 frost-da5967f87b8a0e9863fb6b82fc5807bae9e62a00.zip |
Fix up colors and add overlay tip
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt | 9 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt index 694550d0..7f74990e 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt @@ -9,6 +9,7 @@ import android.widget.FrameLayout import android.widget.ProgressBar import ca.allanwang.kau.utils.bindView import ca.allanwang.kau.utils.tint +import ca.allanwang.kau.utils.visible import ca.allanwang.kau.utils.withAlpha import com.pitchedapps.frost.R import com.pitchedapps.frost.facebook.FbTab @@ -18,8 +19,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers /** * Created by Allan Wang on 2017-06-01. */ -class FrostWebView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0) - : FrameLayout(context, attrs, defStyleAttr, defStyleRes), SwipeRefreshLayout.OnRefreshListener { +class FrostWebView @JvmOverloads constructor( + context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0 +) : FrameLayout(context, attrs, defStyleAttr, defStyleRes), SwipeRefreshLayout.OnRefreshListener { + val refresh: SwipeRefreshLayout by bindView(R.id.swipe_refresh) val web: FrostWebViewCore by bindView(R.id.frost_webview_core) val progress: ProgressBar by bindView(R.id.progressBar) @@ -40,7 +43,7 @@ class FrostWebView @JvmOverloads constructor(context: Context, attrs: AttributeS refresh.setOnRefreshListener(this) addOnAttachStateChangeListener(object : OnAttachStateChangeListener { override fun onViewDetachedFromWindow(v: View) { - web.visibility = View.VISIBLE + web.visible() } override fun onViewAttachedToWindow(v: View) {} diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt index 8265f429..fe024ea3 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt @@ -7,6 +7,7 @@ import android.view.View import android.webkit.* import ca.allanwang.kau.utils.fadeIn import ca.allanwang.kau.utils.snackbar +import com.pitchedapps.frost.R import com.pitchedapps.frost.dbflow.CookieModel import com.pitchedapps.frost.facebook.FACEBOOK_COM import com.pitchedapps.frost.facebook.FbCookie @@ -14,6 +15,7 @@ import com.pitchedapps.frost.injectors.CssHider import com.pitchedapps.frost.injectors.jsInject import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.Prefs +import com.pitchedapps.frost.utils.frostSnackbar import io.reactivex.subjects.PublishSubject import io.reactivex.subjects.SingleSubject import io.reactivex.subjects.Subject @@ -77,7 +79,7 @@ class LoginWebView @JvmOverloads constructor( override fun onPageFinished(view: WebView, url: String) { super.onPageFinished(view, url) if (!url.contains(FACEBOOK_COM)) { - view.snackbar("No longer under facebook; refreshing...") + view.frostSnackbar(R.string.no_longer_facebook) loadLogin() return } |