diff options
author | Leon Scroggins <scroggo@google.com> | 2010-04-29 16:01:46 +0100 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2010-05-10 16:25:14 -0400 |
commit | 79e36d97b67bf06b1e0c0edf773882e93a3293e4 (patch) | |
tree | 2fc9c50092e505b18b86c8c5a47c44affd02a162 | |
parent | 650f42f1d22e6fd51b3838662e141d9fb906c6f9 (diff) | |
download | packages_apps_Browser-79e36d97b67bf06b1e0c0edf773882e93a3293e4.zip packages_apps_Browser-79e36d97b67bf06b1e0c0edf773882e93a3293e4.tar.gz packages_apps_Browser-79e36d97b67bf06b1e0c0edf773882e93a3293e4.tar.bz2 |
Move the find dialog to the top of the screen.
Adjust the animations for the new location, and remove
the browser bar when Find is showing.
Bug 2667046
Change-Id: I565106b6c7e02200ed45ae145033447a8931af62
-rw-r--r-- | res/anim/find_dialog_enter.xml | 4 | ||||
-rw-r--r-- | res/anim/find_dialog_exit.xml | 4 | ||||
-rw-r--r-- | src/com/android/browser/BrowserActivity.java | 36 | ||||
-rw-r--r-- | src/com/android/browser/Tab.java | 2 |
4 files changed, 39 insertions, 7 deletions
diff --git a/res/anim/find_dialog_enter.xml b/res/anim/find_dialog_enter.xml index 5e597a4..6fbcb9e 100644 --- a/res/anim/find_dialog_enter.xml +++ b/res/anim/find_dialog_enter.xml @@ -16,6 +16,6 @@ <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/decelerate_interpolator"> - <translate android:fromYDelta="25%" android:toYDelta="0" android:duration="75"/> - <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="75" /> + <translate android:fromYDelta="-25%" android:toYDelta="0" android:duration="75"/> + <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="75" /> </set> diff --git a/res/anim/find_dialog_exit.xml b/res/anim/find_dialog_exit.xml index 854abd0..9845849 100644 --- a/res/anim/find_dialog_exit.xml +++ b/res/anim/find_dialog_exit.xml @@ -16,7 +16,7 @@ <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator"> - <translate android:fromYDelta="0" android:toYDelta="50%" android:duration="50"/> - <alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="50" /> + <translate android:fromYDelta="0" android:toYDelta="-50%" android:duration="50"/> + <alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="50" /> </set> diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 4209a28..bee06b5 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -834,6 +834,13 @@ public class BrowserActivity extends Activity if (mainView == null) { return; } + // Do not need to check for null, since the current tab will have + // at least a main WebView, or we would have returned above. + if (getTopWindow().getFindIsUp()) { + // Do not show the fake title bar, which would cover up the + // FindDialog. + return; + } WindowManager manager = (WindowManager) getSystemService(Context.WINDOW_SERVICE); @@ -1368,7 +1375,17 @@ public class BrowserActivity extends Activity mFindDialog = new FindDialog(this); } // Need to do something special for Tablet - mTabControl.getCurrentTab().showFind(mFindDialog); + Tab tab = mTabControl.getCurrentTab(); + if (tab.getSubWebView() == null) { + // If the Find is being performed on the main webview, + // remove the embedded title bar. + WebView mainView = tab.getWebView(); + if (mainView != null) { + mainView.setEmbeddedTitleBar(null); + } + } + hideFakeTitleBar(); + tab.showFind(mFindDialog); mMenuState = EMPTY_MENU; break; @@ -1453,11 +1470,26 @@ public class BrowserActivity extends Activity * Remove the FindDialog. */ public void closeFind() { + Tab currentTab = mTabControl.getCurrentTab(); if (mFindDialog != null) { - mTabControl.getCurrentTab().closeFind(mFindDialog); + currentTab.closeFind(mFindDialog); mFindDialog.dismiss(); } + // If the Find was being performed in the main WebView, replace the + // embedded title bar. + if (currentTab.getSubWebView() == null) { + WebView mainView = currentTab.getWebView(); + if (mainView != null) { + mainView.setEmbeddedTitleBar(mTitleBar); + } + } mMenuState = R.id.MAIN_MENU; + if (mInLoad) { + // The title bar was hidden, because otherwise it would cover up the + // find dialog. Now that the dialog has been removed, show the fake + // title bar once again. + showFakeTitleBar(); + } } @Override diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java index 12f0cf6..921ecb3 100644 --- a/src/com/android/browser/Tab.java +++ b/src/com/android/browser/Tab.java @@ -1963,7 +1963,7 @@ class Tab { container = mContainer; } dialog.show(); - container.addView(dialog, new LinearLayout.LayoutParams( + container.addView(dialog, 0, new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); dialog.setWebView(view); |