From b8bc16379c88c5be75d745a3fe2a9e546bcb2343 Mon Sep 17 00:00:00 2001 From: Stefan Arentz Date: Thu, 8 Apr 2021 14:38:29 -0400 Subject: [PATCH] Version 4.8 with in-app product deprecation banner. --- app/build.gradle | 2 +- .../firefox/ui/screenshots/PinTileTests.java | 6 --- .../NavigationOverlayFragment.kt | 22 +++++--- .../tv/firefox/webrender/WebRenderFragment.kt | 25 ++++++--- app/src/main/res/drawable-nodpi/warning.png | Bin 0 -> 1746 bytes .../drawable/dismiss_button_background.xml | 31 +++++++++++ app/src/main/res/layout/fragment_browser.xml | 42 +++++++++++++++ .../fragment_navigation_overlay_orig.xml | 50 ++++++++++++++++-- .../fragment_navigation_overlay_top_nav.xml | 8 +++ app/src/main/res/values-de/strings.xml | 4 ++ app/src/main/res/values-es-rES/strings.xml | 4 ++ app/src/main/res/values-fr/strings.xml | 4 ++ app/src/main/res/values-it/strings.xml | 4 ++ app/src/main/res/values-ja/strings.xml | 4 ++ app/src/main/res/values-pt-rBR/strings.xml | 4 ++ app/src/main/res/values-zh-rCN/strings.xml | 4 ++ app/src/main/res/values/strings.xml | 4 ++ app/src/main/res/values/styles.xml | 18 +++++++ 18 files changed, 213 insertions(+), 23 deletions(-) create mode 100644 app/src/main/res/drawable-nodpi/warning.png create mode 100644 app/src/main/res/drawable/dismiss_button_background.xml diff --git a/app/build.gradle b/app/build.gradle index 3693a4466f..d2e76548ff 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -29,7 +29,7 @@ android { targetSdkVersion 28 versionCode 11 // This versionCode is "frozen" for local builds. For "release" builds we // override this with a generated versionCode at build time. - versionName "4.7.2" + versionName "4.8" testInstrumentationRunner "org.mozilla.tv.firefox.FirefoxOnDeviceTestRunner" testInstrumentationRunnerArguments clearPackageData: 'true' diff --git a/app/src/androidTest/java/org/mozilla/tv/firefox/ui/screenshots/PinTileTests.java b/app/src/androidTest/java/org/mozilla/tv/firefox/ui/screenshots/PinTileTests.java index fc6714d025..8bdc364ba7 100644 --- a/app/src/androidTest/java/org/mozilla/tv/firefox/ui/screenshots/PinTileTests.java +++ b/app/src/androidTest/java/org/mozilla/tv/firefox/ui/screenshots/PinTileTests.java @@ -23,11 +23,8 @@ import org.junit.Test; import org.mozilla.tv.firefox.MainActivity; import org.mozilla.tv.firefox.R; -import org.mozilla.tv.firefox.components.locale.LocaleManager; import org.mozilla.tv.firefox.helpers.MainActivityTestRule; -import java.util.Locale; - import tools.fastlane.screengrab.Screengrab; import tools.fastlane.screengrab.locale.LocaleTestRule; @@ -64,9 +61,6 @@ public void tearDown() { public void unpinTileFromContextMenu() { onView(allOf(withId(R.id.navUrlInput), isDisplayed(), hasFocus())); - final Locale currentLocale = LocaleManager.getInstance() - .getCurrentLocale(mActivityTestRule.getActivity()); - mDevice.pressDPadDown(); onView(withText(R.string.homescreen_unpin_tutorial_toast)) diff --git a/app/src/main/java/org/mozilla/tv/firefox/navigationoverlay/NavigationOverlayFragment.kt b/app/src/main/java/org/mozilla/tv/firefox/navigationoverlay/NavigationOverlayFragment.kt index 78284931a7..f0a7da679c 100644 --- a/app/src/main/java/org/mozilla/tv/firefox/navigationoverlay/NavigationOverlayFragment.kt +++ b/app/src/main/java/org/mozilla/tv/firefox/navigationoverlay/NavigationOverlayFragment.kt @@ -16,6 +16,7 @@ import android.view.KeyEvent import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.widget.Button import android.widget.ScrollView import androidx.annotation.VisibleForTesting import androidx.annotation.VisibleForTesting.NONE @@ -29,12 +30,9 @@ import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.Disposable import io.reactivex.rxkotlin.addTo -import kotlinx.android.synthetic.main.fragment_navigation_overlay_orig.channelsContainer -import kotlinx.android.synthetic.main.fragment_navigation_overlay_orig.navUrlInput -import kotlinx.android.synthetic.main.fragment_navigation_overlay_orig.settingsTileContainer -import kotlinx.android.synthetic.main.fragment_navigation_overlay_top_nav.exitButton -import kotlinx.android.synthetic.main.fragment_navigation_overlay_top_nav.fxaButton -import kotlinx.android.synthetic.main.hint_bar.hintBarContainer +import kotlinx.android.synthetic.main.fragment_navigation_overlay_orig.* +import kotlinx.android.synthetic.main.fragment_navigation_overlay_top_nav.* +import kotlinx.android.synthetic.main.hint_bar.* import kotlinx.coroutines.Job import org.mozilla.tv.firefox.MainActivity import org.mozilla.tv.firefox.R @@ -58,6 +56,7 @@ import org.mozilla.tv.firefox.telemetry.UrlTextInputLocation import org.mozilla.tv.firefox.utils.RoundCornerTransformation import org.mozilla.tv.firefox.utils.ServiceLocator import org.mozilla.tv.firefox.utils.Settings +import org.mozilla.tv.firefox.utils.SupportUtils import org.mozilla.tv.firefox.utils.ViewUtils import org.mozilla.tv.firefox.widget.InlineAutocompleteEditText import java.lang.ref.WeakReference @@ -170,6 +169,15 @@ class NavigationOverlayFragment : Fragment() { ).apply { onCreateView(view) } + + val bannerLayout: View = view.findViewById(R.id.bannerLayout) + + val bannerMoreInfoButton: Button = bannerLayout.findViewById(R.id.bannerMoreInfoButton) + bannerMoreInfoButton.setOnClickListener { + (activity as MainActivity).onNonTextInputUrlEntered(SupportUtils.getSumoURLForTopic(this.context, "amazon-end-support")) + context?.serviceLocator?.screenController?.showNavigationOverlay(fragmentManager, false) + } + return view } @@ -406,7 +414,7 @@ class NavigationOverlayFragment : Fragment() { } }, onTileFocused = { - val prefInt = android.preference.PreferenceManager.getDefaultSharedPreferences(context).getInt( + val prefInt = PreferenceManager.getDefaultSharedPreferences(context).getInt( SHOW_UNPIN_TOAST_COUNTER_PREF, 0) if (prefInt < MAX_UNPIN_TOAST_COUNT && canShowUnpinToast) { PreferenceManager.getDefaultSharedPreferences(context) diff --git a/app/src/main/java/org/mozilla/tv/firefox/webrender/WebRenderFragment.kt b/app/src/main/java/org/mozilla/tv/firefox/webrender/WebRenderFragment.kt index dc33c59835..11f26aa52f 100644 --- a/app/src/main/java/org/mozilla/tv/firefox/webrender/WebRenderFragment.kt +++ b/app/src/main/java/org/mozilla/tv/firefox/webrender/WebRenderFragment.kt @@ -13,16 +13,15 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.view.WindowManager +import android.widget.Button import android.widget.FrameLayout +import androidx.core.view.isGone import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.Disposable import io.reactivex.rxkotlin.addTo -import kotlinx.android.synthetic.main.fragment_browser.cursorView -import kotlinx.android.synthetic.main.fragment_browser.progressBar -import kotlinx.android.synthetic.main.fragment_browser.view.browserFragmentRoot -import kotlinx.android.synthetic.main.fragment_browser.view.engineView -import kotlinx.android.synthetic.main.fragment_browser.view.progressBar -import kotlinx.android.synthetic.main.hint_bar.hintBarContainer +import kotlinx.android.synthetic.main.fragment_browser.* +import kotlinx.android.synthetic.main.fragment_browser.view.* +import kotlinx.android.synthetic.main.hint_bar.* import mozilla.components.browser.session.Session import mozilla.components.concept.engine.EngineSession import mozilla.components.concept.engine.EngineView @@ -53,6 +52,7 @@ import org.mozilla.tv.firefox.ext.webRenderComponents import org.mozilla.tv.firefox.hint.HintBinder import org.mozilla.tv.firefox.hint.InactiveHintViewModel import org.mozilla.tv.firefox.session.SessionRepo +import org.mozilla.tv.firefox.utils.SupportUtils import org.mozilla.tv.firefox.utils.URLs private const val ARGUMENT_SESSION_UUID = "sessionUUID" @@ -116,6 +116,9 @@ class WebRenderFragment : EngineViewLifecycleFragment(), Session.Observer { serviceLocator?.experimentsProvider?.shouldUseMp4VideoWorkaround() == true) { engineView?.updateFullscreenScrollPosition() } + + val bannerLayout: View = window.findViewById(R.id.bannerLayout) + bannerLayout.isGone = enabled } override fun onUrlChanged(session: Session, url: String) { @@ -153,6 +156,16 @@ class WebRenderFragment : EngineViewLifecycleFragment(), Session.Observer { } context.serviceLocator.cursorModel.webViewCouldScrollInDirectionProvider = layout.engineView::couldScrollInDirection + // Setup the banner + + val bannerLayout: View = layout.findViewById(R.id.bannerLayout) + + val moreInfoButton: Button = bannerLayout.findViewById(R.id.bannerMoreInfoButton) + moreInfoButton.setOnClickListener { + (activity as MainActivity).onNonTextInputUrlEntered(SupportUtils.getSumoURLForTopic(this.context, "amazon-end-support")) + context?.serviceLocator?.screenController?.showNavigationOverlay(fragmentManager, false) + } + layout.progressBar.initialize(this) // We break encapsulation here: we should use the super.engineView reference but it's not init until diff --git a/app/src/main/res/drawable-nodpi/warning.png b/app/src/main/res/drawable-nodpi/warning.png new file mode 100644 index 0000000000000000000000000000000000000000..6e3df2f572e8bf8e5370f9a5e6207cac6bdf3b7c GIT binary patch literal 1746 zcmZuydo}tLFwHcnHzPtZlzXkqu(LwKib`%%rpOu;hp{wfYI4hF>g|nF z#%(z*O4G9_V9B4r_etFD`(3J+6_4%SJEQLqKszR3|`XPJ~&h#|lIiia+TuTo& z3%LES!z4xx)q+j)t({PJTbqO(=k4&M<<{>{(%Gobc%k; zVWm#|OyHz7VZO#_A)eb9RMts)rrsI&LiSKZ9r|Aym^psbE&+NSfaUt zyKyoF>YvWUF%m;YSKIYMbe%g!D*2uVnt;4VdD2%ZD7@cX&3D*4m3Gt8Lbwl>{odpB zC|LiUuhq3FT=^h3>yL*MMf+@YNO#|~xXgj5R-=3Z7`j+i^DI1-%>@=(@W99|CkGZa=(M$})?KQ4l<=D@= zwg?sbWwWDEY57K&gv;}6+jyAu0V8hvizrI8`%m3hr>b|wcR!*DPe9JqWwF>X$(v-c zu^r4}ft-6;=sI>3Lh=2^5XDwPC!=MHueRK@mKlaA|DV%cKP%ZQAUQ5ICc-QxZ`)vE zw+x{jeN4UERt%DntP(CV85Yxc^Mi@Z1n3RMf~vv1Au~h4&s9p^!8b&Lk-{o!op31xkzTRc>3DhZiE$%X|F{j zfQT%x&|u8S-jU!(ZIL`Qg~AkQ5ixxLL1C}sw^<2?fr-D=_$m4hNv0Z1^p58XFhaFb z*pKkR(FeA$SemdK+}Yf^-HrGa)&|f9p;SI(P$g{~K2r7g>Vl(f35uM17W526oz@Z4 z9N1firwz_fC6GbH#)?i|QP!^SIn86mEB?_5j3)XsgtxTTTvS8Mc=F*z^tx-#0AU27 zj~BK~KS{&wZ*6;v8ejV0;aD%r@xD9wOXTJy`H;cr$^kz!jbqYKt+Uy}*Rh`{ zpVmqDC zpNXcXgAC(e6D4iq!;ME$W(VSQ%%A2_hdk98|uF3_PSO8GZ@vKzkmVTvET=>Mt zTZ-3d!DX_;!JSVy$Q2lM5M-}v1UYN0r<4@c#&ZcIg3J*sFeeeIU7Y5%E2^F$b=TQ? z%HDiBn-6}Vrw(nVt)+aji^sY}wlzc^cG&?f>b8+VpSsR1E9}D>&RJiED8U>f$vM zH$(o(i9S8K+B{-2X=$1+`ut;WGURemN7=h$&*i=NV3RCV`mZVxgFlK654gW*9u=`v zb8af))ZlBKfd%d&uMlh8T4(=oJG)k%US$m*TW+iwKkH7vZ}NUz?lubWx|f#w6$=%3 zdKOQJ*&Z>zcUvI7G}f4d8F$ZEMHHtPPC2lS>KSIHTx{<6n^ppsKVXhb?IuhGO=3B+ zK4w2keYXxHIAed1^Ov0{VX_)Hk|!MUB&>rjr~u9b!azXT>msV)o4%w{TIRcyx#i7p zaJ9JZzxGqg!cvpuYRwRz$6ecQcr|a_FKETLpX8}J&qa`CjTHxU z9o1=PYHw?*yGFwE8W;s!xvzUBHg3(}#rf_y+5UZXufB^|sjt;*BIND-$D@y`$lOFK X3BHv_P21(#7X*C1@n_U~GOzs~3d#s> literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/dismiss_button_background.xml b/app/src/main/res/drawable/dismiss_button_background.xml new file mode 100644 index 0000000000..0af9ce96ce --- /dev/null +++ b/app/src/main/res/drawable/dismiss_button_background.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_browser.xml b/app/src/main/res/layout/fragment_browser.xml index b8031aceb8..f154c42536 100644 --- a/app/src/main/res/layout/fragment_browser.xml +++ b/app/src/main/res/layout/fragment_browser.xml @@ -14,6 +14,48 @@ android:layout_height="match_parent" android:orientation="vertical"> + + + + + + +