aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt
index cdeea064..8000c106 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt
@@ -1,7 +1,12 @@
package com.pitchedapps.frost.fragments
+import android.webkit.WebView
+import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.pitchedapps.frost.R
+import com.pitchedapps.frost.contracts.MainFabContract
import com.pitchedapps.frost.facebook.FbItem
+import com.pitchedapps.frost.injectors.JsActions
+import com.pitchedapps.frost.utils.L
import com.pitchedapps.frost.views.FrostWebView
import com.pitchedapps.frost.web.FrostWebViewClient
import com.pitchedapps.frost.web.FrostWebViewClientMenu
@@ -24,4 +29,20 @@ class WebFragment : BaseFragment() {
else -> FrostWebViewClient(web)
}
+ override fun updateFab(contract: MainFabContract) {
+ L.e { "Update fab" }
+ val web = core as? WebView
+ if (web == null) {
+ L.e { "Webview not found in fragment $baseEnum" }
+ return super.updateFab(contract)
+ }
+ if (baseEnum.isFeed) {
+ contract.showFab(GoogleMaterial.Icon.gmd_edit) {
+ JsActions.CREATE_POST.inject(web)
+ }
+ L.e { "UPP" }
+ return
+ }
+ super.updateFab(contract)
+ }
} \ No newline at end of file