OSDN Git Service

Slide the title bar onto the screen rather than stretching it.
authorLeon Scroggins <scroggo@google.com>
Wed, 30 Sep 2009 15:55:54 +0000 (11:55 -0400)
committerLeon Scroggins <scroggo@google.com>
Wed, 30 Sep 2009 15:55:54 +0000 (11:55 -0400)
Fix for http://b/issue?id=2154614

Also update the header for the find dialog animations.

Change-Id: Ibf40bd9ee12c270c2794d4d2316143686a072458

res/anim/find_dialog_enter.xml
res/anim/find_dialog_exit.xml
res/anim/title_bar_enter.xml [new file with mode: 0644]
res/anim/title_bar_exit.xml [new file with mode: 0644]
res/values/styles.xml
src/com/android/browser/BrowserActivity.java

index 6e19c21..5e597a4 100644 (file)
@@ -1,21 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/options_panel_enter.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
-**
-**     http://www.apache.org/licenses/LICENSE-2.0 
-**
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
-** limitations under the License.
-*/
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
 -->
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
index 5775bab..854abd0 100644 (file)
@@ -1,21 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!--
-/* //device/apps/common/res/anim/options_panel_exit.xml
-**
-** Copyright 2007, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
-**
-**     http://www.apache.org/licenses/LICENSE-2.0 
-**
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
-** limitations under the License.
-*/
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
 -->
 
 <set xmlns:android="http://schemas.android.com/apk/res/android"
diff --git a/res/anim/title_bar_enter.xml b/res/anim/title_bar_enter.xml
new file mode 100644 (file)
index 0000000..ce4df1d
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<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="@android:integer/config_shortAnimTime"/>
+       <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
+            android:duration="@android:integer/config_shortAnimTime" />
+</set>
diff --git a/res/anim/title_bar_exit.xml b/res/anim/title_bar_exit.xml
new file mode 100644 (file)
index 0000000..b56710c
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<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="@android:integer/config_shortAnimTime"/>
+       <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
+            android:duration="@android:integer/config_shortAnimTime" />
+</set>
index 89d5a04..21ab98f 100644 (file)
         <item name="android:windowEnterAnimation">@anim/find_dialog_enter</item>
         <item name="android:windowExitAnimation">@anim/find_dialog_exit</item>
     </style>
+
+    <style name="TitleBar">
+        <item name="android:windowEnterAnimation">@anim/title_bar_enter</item>
+        <item name="android:windowExitAnimation">@anim/title_bar_exit</item>
+    </style>
 </resources>
 
index 1954dad..1e7361b 100644 (file)
@@ -1021,8 +1021,7 @@ public class BrowserActivity extends Activity
             params.gravity = Gravity.TOP;
             WebView mainView = mTabControl.getCurrentWebView();
             boolean atTop = mainView != null && mainView.getScrollY() == 0;
-            params.windowAnimations = atTop ? 0
-                    : com.android.internal.R.style.Animation_DropDownDown;
+            params.windowAnimations = atTop ? 0 : R.style.TitleBar;
             // XXX : Without providing an offset, the fake title bar will be
             // placed underneath the status bar.  Use the global visible rect
             // of mBrowserFrameLayout to determine the bottom of the status bar
@@ -1063,7 +1062,7 @@ public class BrowserActivity extends Activity
         // fake title bar was displayed.  Make sure it has the appropriate
         // animation/lack thereof before removing.
         params.windowAnimations = mainView != null && mainView.getScrollY() == 0
-                ? 0 : com.android.internal.R.style.Animation_DropDownDown;
+                ? 0 : R.style.TitleBar;
         WindowManager manager
                     = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
         manager.updateViewLayout(mFakeTitleBarHolder, params);