aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt
diff options
context:
space:
mode:
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 {