diff options
author | John Reck <jreck@google.com> | 2011-09-16 14:36:39 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2011-09-16 15:12:17 -0700 |
commit | aae029c3166b0f6e0179a5973c885aea118fb31b (patch) | |
tree | 8347a62c577f152c13c345dbf1189f9e40c71b21 /src/com/android/browser/PhoneUi.java | |
parent | b68db35d469fae510c35ef9ab0da7fe25fc88836 (diff) | |
download | packages_apps_Browser-aae029c3166b0f6e0179a5973c885aea118fb31b.zip packages_apps_Browser-aae029c3166b0f6e0179a5973c885aea118fb31b.tar.gz packages_apps_Browser-aae029c3166b0f6e0179a5973c885aea118fb31b.tar.bz2 |
Use overlay action mode
Bug: 5327408
By using actionBar: false with actionModeOverlay: true the
action mode callbacks happen before the action mode animation.
This allows us to animate down the URL bar at the same time if
needed (when the URL is being edited).
Overlay mode fixes the issue with webview being translated, which
was what caused the selection handles to move. Only the selection
handles were affected thanks to b/4982054
Change-Id: I8153de63124eb4e4d02e88637f0cf01658054a14
Diffstat (limited to 'src/com/android/browser/PhoneUi.java')
-rw-r--r-- | src/com/android/browser/PhoneUi.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java index 606a47d..61acef5 100644 --- a/src/com/android/browser/PhoneUi.java +++ b/src/com/android/browser/PhoneUi.java @@ -26,6 +26,7 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Matrix; import android.util.Log; +import android.util.TypedValue; import android.view.ActionMode; import android.view.Gravity; import android.view.KeyEvent; @@ -52,6 +53,7 @@ public class PhoneUi extends BaseUi { private PieControlPhone mPieControl; private NavScreen mNavScreen; private NavigationBarPhone mNavigationBar; + private int mActionBarHeight; boolean mExtendedMenuOpen; boolean mOptionsMenuOpen; @@ -63,9 +65,13 @@ public class PhoneUi extends BaseUi { */ public PhoneUi(Activity browser, UiController controller) { super(browser, controller); - mActivity.getActionBar().hide(); setUseQuickControls(BrowserSettings.getInstance().useQuickControls()); mNavigationBar = (NavigationBarPhone) mTitleBar.getNavigationBar(); + TypedValue heightValue = new TypedValue(); + browser.getTheme().resolveAttribute( + com.android.internal.R.attr.actionBarSize, heightValue, true); + mActionBarHeight = TypedValue.complexToDimensionPixelSize(heightValue.data, + browser.getResources().getDisplayMetrics()); } @Override @@ -208,18 +214,20 @@ public class PhoneUi extends BaseUi { public void onActionModeStarted(ActionMode mode) { if (!isEditingUrl()) { hideTitleBar(); + } else { + mTitleBar.animate().translationY(mActionBarHeight); } } @Override public void onActionModeFinished(boolean inLoad) { + mTitleBar.animate().translationY(0); if (inLoad) { if (mUseQuickControls) { mTitleBar.setShowProgressOnly(true); } showTitleBar(); } - mActivity.getActionBar().hide(); } @Override |