diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-20 19:53:21 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-20 19:53:21 -0700 |
commit | 89673894356e29ac48ebaba5bd75d03690da1d66 (patch) | |
tree | 6a9cc12ea6a1097781b917e480ffa8b138d5c535 /app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt | |
parent | 13b8505674e08cc1610ce7e77d7db8fa292372cf (diff) | |
download | frost-89673894356e29ac48ebaba5bd75d03690da1d66.tar.gz frost-89673894356e29ac48ebaba5bd75d03690da1d66.tar.bz2 frost-89673894356e29ac48ebaba5bd75d03690da1d66.zip |
Fix up url overlays and theme more components
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt index 8df7f1bd..665e32b4 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt @@ -1,5 +1,6 @@ package com.pitchedapps.frost +import android.content.Intent import android.os.Bundle import android.support.design.widget.CoordinatorLayout import android.support.v7.app.AppCompatActivity @@ -50,12 +51,26 @@ open class WebOverlayActivity : AppCompatActivity() { frostWeb.web.setupWebview(url) frostWeb.web.addTitleListener({ toolbar.title = it }) - L.d("UU $userId") if (userId != Prefs.userId) FbCookie.switchUser(userId) { frostWeb.web.loadBaseUrl() } else frostWeb.web.loadBaseUrl() } /** + * Manage url loadings + * This is usually only called when multiple listeners are added and inject the same url + * We will avoid reloading if the url is the same + */ + override fun onNewIntent(intent: Intent) { + super.onNewIntent(intent) + val newUrl = intent.extras!!.getString(ARG_URL).formattedFbUrl + if (url != newUrl) { + this.intent = intent + frostWeb.web.baseUrl = newUrl + frostWeb.web.loadBaseUrl() + } + } + + /** * Our theme for the overlay should be fully opaque */ fun theme() { |