From e736b53094629c4250c536170e938c625f5dc03c Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 7 Sep 2019 18:10:38 -0700 Subject: [PATCH] Remove desktop overlay activity --- app/src/main/AndroidManifest.xml | 7 ------- .../frost/activities/WebOverlayActivity.kt | 17 +++-------------- .../com/pitchedapps/frost/utils/Utils.kt | 4 ---- .../frost/web/FrostUrlOverlayValidator.kt | 19 +------------------ 4 files changed, 4 insertions(+), 43 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 664ffd38d..d30b51776 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -59,13 +59,6 @@ android:label="@string/frost_name" android:launchMode="singleTop" android:theme="@style/FrostTheme.Overlay.Slide" /> - Context.launchWebOverlay fun Context.launchWebOverlay(url: String) = launchWebOverlayImpl(url) -fun Context.launchWebOverlayDesktop(url: String) = - launchWebOverlayImpl(url) - private fun Context.fadeBundle() = ActivityOptions.makeCustomAnimation( this, android.R.anim.fade_in, android.R.anim.fade_out diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt index 4aa43b49b..eec5a5dcf 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt @@ -22,7 +22,6 @@ import com.pitchedapps.frost.activities.WebOverlayActivityBase import com.pitchedapps.frost.contracts.VideoViewHolder import com.pitchedapps.frost.facebook.FbCookie import com.pitchedapps.frost.facebook.FbItem -import com.pitchedapps.frost.facebook.USER_AGENT_DESKTOP import com.pitchedapps.frost.facebook.formattedFbUrl import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.Prefs @@ -32,7 +31,6 @@ import com.pitchedapps.frost.utils.isIndirectImageUrl import com.pitchedapps.frost.utils.isVideoUrl import com.pitchedapps.frost.utils.launchImageActivity import com.pitchedapps.frost.utils.launchWebOverlay -import com.pitchedapps.frost.utils.launchWebOverlayDesktop import com.pitchedapps.frost.views.FrostWebView /** @@ -74,22 +72,7 @@ fun FrostWebView.requestWebOverlay(url: String): Boolean { return false } if (!Prefs.overlayEnabled) return false - if (context is WebOverlayActivityBase) { - val shouldUseDesktop = url.formattedFbUrl.shouldUseDesktopAgent - //already overlay; manage user agent - if (userAgentString != USER_AGENT_DESKTOP && shouldUseDesktop) { - L._i { "Switch to desktop agent overlay" } - context.launchWebOverlayDesktop(url) - return true - } - if (userAgentString == USER_AGENT_DESKTOP && !shouldUseDesktop) { - L._i { "Switch from desktop agent" } - context.launchWebOverlay(url) - return true - } - L._i { "return false switch" } - return false - } + if (context is WebOverlayActivityBase) return false L.v { "Request web overlay passed" } context.launchWebOverlay(url) return true