diff --git a/android/java/org/chromium/chrome/browser/DeprecateBAPModalDialogFragment.java b/android/java/org/chromium/chrome/browser/DeprecateBAPModalDialogFragment.java index 6a193cea0450..ded1f01f2b91 100644 --- a/android/java/org/chromium/chrome/browser/DeprecateBAPModalDialogFragment.java +++ b/android/java/org/chromium/chrome/browser/DeprecateBAPModalDialogFragment.java @@ -8,12 +8,14 @@ package org.chromium.chrome.browser; import android.content.DialogInterface; +import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.os.Bundle; import android.util.DisplayMetrics; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.Window; import android.view.WindowManager; import android.widget.Button; import android.widget.LinearLayout; @@ -50,6 +52,19 @@ public boolean onKey(android.content.DialogInterface dialog, int keyCode, setDialogParams(); } + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setStyle(STYLE_NO_TITLE, 0); + getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + } + + @Override + public void onDestroyView() { + getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); + super.onDestroyView(); + } + @Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { diff --git a/android/java/org/chromium/chrome/browser/app/BraveActivity.java b/android/java/org/chromium/chrome/browser/app/BraveActivity.java index 6ca9db079ddd..80d0194c3b48 100644 --- a/android/java/org/chromium/chrome/browser/app/BraveActivity.java +++ b/android/java/org/chromium/chrome/browser/app/BraveActivity.java @@ -708,6 +708,15 @@ public boolean isRewardsPanelOpened() { return false; } + public boolean isShieldsTooltipShown() { + BraveToolbarLayout layout = (BraveToolbarLayout) findViewById(R.id.toolbar); + assert layout != null; + if (layout != null) { + return layout.isShieldsTooltipShown(); + } + return false; + } + public Tab selectExistingTab(String url) { Tab tab = getActivityTab(); if (tab != null && tab.getUrlString().equals(url)) { diff --git a/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java b/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java index 767fc27c5470..02ac52652cff 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java +++ b/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java @@ -354,7 +354,8 @@ public void onPageLoadFinished(final Tab tab, String url) { OnboardingPrefManager.getInstance().setTimeSavedNotificationStarted(true); } if (mBraveShieldsButton != null && mBraveShieldsButton.isShown() - && mBraveShieldsHandler != null && !mBraveShieldsHandler.isShowing()) { + && mBraveShieldsHandler != null && !mBraveShieldsHandler.isShowing() + && !isRewardsTooltipShown() && !isRewardsPanelOpened()) { checkForTooltip(tab); } } @@ -564,6 +565,13 @@ public void dismissRewardsTooltip() { } } + public boolean isRewardsTooltipShown() { + if (mRewardsPopupWindowTooltip != null) { + return mRewardsPopupWindowTooltip.isShowing(); + } + return false; + } + @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); @@ -980,6 +988,13 @@ public boolean isRewardsPanelOpened() { return false; } + public boolean isShieldsTooltipShown() { + if (mShieldsPopupWindowTooltip != null) { + return mShieldsPopupWindowTooltip.isShowing(); + } + return false; + } + @Override public void OnNotificationAdded(String id, int type, long timestamp, String[] args) { if (mBraveRewardsNativeWorker == null) { diff --git a/android/java/res/layout/fragment_deprecate_bap_modal_dialog.xml b/android/java/res/layout/fragment_deprecate_bap_modal_dialog.xml index e3f6458a3f6e..ece118f65625 100644 --- a/android/java/res/layout/fragment_deprecate_bap_modal_dialog.xml +++ b/android/java/res/layout/fragment_deprecate_bap_modal_dialog.xml @@ -5,66 +5,75 @@ You can obtain one at http://mozilla.org/MPL/2.0/. --> - + android:fadeScrollbars="false" + android:scrollbars="vertical"> - - - + + + android:background="@drawable/rewards_modal_background"> + + - + - + - + -