aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-13 00:42:31 -0700
committerAllan Wang <me@allanwang.ca>2017-06-13 00:42:31 -0700
commite4377fed20ce1e3f4a0b236271eecdb1fe573b7a (patch)
treeaa0b14e328daa4ece41f65cfed5a4422f2c9e898 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt
parenta7a37f8f5b1955f006a83d4713a2c6af500c28af (diff)
downloadfrost-e4377fed20ce1e3f4a0b236271eecdb1fe573b7a.tar.gz
frost-e4377fed20ce1e3f4a0b236271eecdb1fe573b7a.tar.bz2
frost-e4377fed20ce1e3f4a0b236271eecdb1fe573b7a.zip
Created js base for facebook menu
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt15
1 files changed, 7 insertions, 8 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 d4bf8e07..4554e0a4 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt
@@ -7,9 +7,9 @@ import android.util.AttributeSet
import android.view.View
import android.widget.FrameLayout
import android.widget.ProgressBar
-import butterknife.ButterKnife
-import com.pitchedapps.frost.R
import ca.allanwang.kau.utils.bindView
+import com.pitchedapps.frost.R
+import com.pitchedapps.frost.facebook.FbTab
import io.reactivex.android.schedulers.AndroidSchedulers
/**
@@ -17,11 +17,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers
*/
class FrostWebView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0)
: FrameLayout(context, attrs, defStyleAttr, defStyleRes), SwipeRefreshLayout.OnRefreshListener {
- var baseUrl: String?
- get() = web.baseUrl
- set(value) {
- web.baseUrl = value
- }
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)
@@ -46,8 +41,12 @@ class FrostWebView @JvmOverloads constructor(context: Context, attrs: AttributeS
})
}
+ //Some urls have javascript injections so make sure we load the base url
override fun onRefresh() {
- web.reload()
+ when (web.baseUrl) {
+ FbTab.MENU.url -> web.loadBaseUrl()
+ else -> web.reload()
+ }
}
fun onBackPressed(): Boolean {