summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuli Huang <yuli@google.com>2011-10-18 12:42:50 +0800
committerYuli Huang <yuli@google.com>2011-10-18 13:10:10 +0800
commit5ac228e7d9a7e57d8c3bfa9dca08378762aa8b47 (patch)
tree27fa1b8456084ea27939d00f53f90f48e110f324
parentad3229857bd9585129824b0bffa966bfbc2e8a3c (diff)
downloadandroid_packages_apps_Snap-5ac228e7d9a7e57d8c3bfa9dca08378762aa8b47.tar.gz
android_packages_apps_Snap-5ac228e7d9a7e57d8c3bfa9dca08378762aa8b47.tar.bz2
android_packages_apps_Snap-5ac228e7d9a7e57d8c3bfa9dca08378762aa8b47.zip
Fix b/5403449.
1. Extract code that recreates/restores ActionBar as RestorableView, and make both ActionBar and EffectsMenu extend RestorableView. 2. Fix effects-menu buttons too close to each other. 3. Remove effects-menu buttons' highlight animations to look more responsive. Change-Id: I68e5bdcde702e611ccced5e169852c0e58a949fc
-rw-r--r--res/drawable/photoeditor_toggle_button_background.xml3
-rw-r--r--res/layout/photoeditor_actionbar.xml8
-rw-r--r--res/layout/photoeditor_effects_menu.xml44
-rw-r--r--res/layout/photoeditor_main.xml38
-rwxr-xr-xres/values-sw320dp/photoeditor_dimens.xml1
-rwxr-xr-xres/values-sw600dp/photoeditor_dimens.xml1
-rwxr-xr-xres/values-sw800dp/photoeditor_dimens.xml1
-rw-r--r--res/values/photoeditor_styles.xml18
8 files changed, 74 insertions, 40 deletions
diff --git a/res/drawable/photoeditor_toggle_button_background.xml b/res/drawable/photoeditor_toggle_button_background.xml
index e8e540694..e6cd75d40 100644
--- a/res/drawable/photoeditor_toggle_button_background.xml
+++ b/res/drawable/photoeditor_toggle_button_background.xml
@@ -14,8 +14,7 @@
limitations under the License.
-->
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
- android:exitFadeDuration="@android:integer/config_mediumAnimTime">
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@android:color/transparent" />
<item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/photoeditor_tab_selected_holo" />
diff --git a/res/layout/photoeditor_actionbar.xml b/res/layout/photoeditor_actionbar.xml
index 2437611a2..8bd51ed43 100644
--- a/res/layout/photoeditor_actionbar.xml
+++ b/res/layout/photoeditor_actionbar.xml
@@ -14,10 +14,10 @@
limitations under the License.
-->
-<com.android.gallery3d.photoeditor.ActionBar
+<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/action_bar"
- style="@style/TopActionBar">
+ style="@style/ActionBarInner"
+ android:background="@drawable/photoeditor_actionbar_translucent">
<LinearLayout style="@style/ActionBarLinearLayout">
@@ -62,4 +62,4 @@
</ViewSwitcher>
</LinearLayout>
-</com.android.gallery3d.photoeditor.ActionBar>
+</RelativeLayout>
diff --git a/res/layout/photoeditor_effects_menu.xml b/res/layout/photoeditor_effects_menu.xml
new file mode 100644
index 000000000..1688a9056
--- /dev/null
+++ b/res/layout/photoeditor_effects_menu.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+-->
+
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/ActionBarInner"
+ android:background="@drawable/photoeditor_actionbar_translucent_bottom">
+
+ <LinearLayout
+ android:id="@+id/toggles"
+ style="@style/EffectsMenuContainer">
+
+ <ImageButton
+ android:id="@+id/exposure_button"
+ style="@style/EffectsMenuActionButton"
+ android:src="@drawable/photoeditor_exposure"/>
+ <ImageButton
+ android:id="@+id/artistic_button"
+ style="@style/EffectsMenuActionButton"
+ android:src="@drawable/photoeditor_artistic"/>
+ <ImageButton
+ android:id="@+id/color_button"
+ style="@style/EffectsMenuActionButton"
+ android:src="@drawable/photoeditor_color"/>
+ <ImageButton
+ android:id="@+id/fix_button"
+ style="@style/EffectsMenuActionButton"
+ android:src="@drawable/photoeditor_fix"/>
+ </LinearLayout>
+
+</FrameLayout>
diff --git a/res/layout/photoeditor_main.xml b/res/layout/photoeditor_main.xml
index 49597ed02..a040ca749 100644
--- a/res/layout/photoeditor_main.xml
+++ b/res/layout/photoeditor_main.xml
@@ -25,33 +25,19 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
- <com.android.gallery3d.photoeditor.EffectsBar android:id="@+id/effects_bar" style="@style/EffectsBar">
-
- <LinearLayout style="@style/BottomActionBar" android:gravity="center_horizontal">
-
- <LinearLayout android:id="@+id/effects_menu" style="@style/ActionBarLinearLayout">
-
- <ImageButton
- android:id="@+id/exposure_button"
- style="@style/EffectsMenuActionButton"
- android:src="@drawable/photoeditor_exposure"/>
- <ImageButton
- android:id="@+id/artistic_button"
- style="@style/EffectsMenuActionButton"
- android:src="@drawable/photoeditor_artistic"/>
- <ImageButton
- android:id="@+id/color_button"
- style="@style/EffectsMenuActionButton"
- android:src="@drawable/photoeditor_color"/>
- <ImageButton
- android:id="@+id/fix_button"
- style="@style/EffectsMenuActionButton"
- android:src="@drawable/photoeditor_fix"/>
- </LinearLayout>
-
- </LinearLayout>
+ <com.android.gallery3d.photoeditor.EffectsBar
+ android:id="@+id/effects_bar"
+ style="@style/EffectsBar">
+
+ <com.android.gallery3d.photoeditor.EffectsMenu
+ android:id="@+id/effects_menu"
+ style="@style/ActionBarOuter"/>
+
</com.android.gallery3d.photoeditor.EffectsBar>
- <include layout="@layout/photoeditor_actionbar"/>
+ <com.android.gallery3d.photoeditor.ActionBar
+ android:id="@+id/action_bar"
+ style="@style/ActionBarOuter"
+ android:layout_alignParentTop="true"/>
</com.android.gallery3d.photoeditor.Toolbar>
diff --git a/res/values-sw320dp/photoeditor_dimens.xml b/res/values-sw320dp/photoeditor_dimens.xml
index 66e9d5ffc..ff76e2557 100755
--- a/res/values-sw320dp/photoeditor_dimens.xml
+++ b/res/values-sw320dp/photoeditor_dimens.xml
@@ -26,6 +26,7 @@
<dimen name="action_bar_icon_padding_left">0dp</dimen>
<dimen name="action_bar_icon_padding_right">5dp</dimen>
<dimen name="action_button_padding_horizontal">13dp</dimen>
+ <dimen name="effects_menu_container_width">320dp</dimen>
<dimen name="effect_tool_panel_padding">10dp</dimen>
<dimen name="seekbar_width">290dp</dimen>
<dimen name="seekbar_height">27dp</dimen>
diff --git a/res/values-sw600dp/photoeditor_dimens.xml b/res/values-sw600dp/photoeditor_dimens.xml
index 980272713..29d7f5336 100755
--- a/res/values-sw600dp/photoeditor_dimens.xml
+++ b/res/values-sw600dp/photoeditor_dimens.xml
@@ -28,6 +28,7 @@
<dimen name="action_bar_icon_padding_right">5dp</dimen>
<dimen name="action_button_padding_vertical">8dp</dimen>
<dimen name="action_button_padding_horizontal">22dp</dimen>
+ <dimen name="effects_menu_container_width">400dp</dimen>
<dimen name="effect_tool_panel_padding">13dp</dimen>
<dimen name="seekbar_width">560dp</dimen>
<dimen name="seekbar_height">35dp</dimen>
diff --git a/res/values-sw800dp/photoeditor_dimens.xml b/res/values-sw800dp/photoeditor_dimens.xml
index 1bcc28d45..e869acf55 100755
--- a/res/values-sw800dp/photoeditor_dimens.xml
+++ b/res/values-sw800dp/photoeditor_dimens.xml
@@ -28,6 +28,7 @@
<dimen name="action_bar_icon_padding_right">5dp</dimen>
<dimen name="action_button_padding_vertical">8dp</dimen>
<dimen name="action_button_padding_horizontal">28dp</dimen>
+ <dimen name="effects_menu_container_width">400dp</dimen>
<dimen name="effect_tool_panel_padding">15dp</dimen>
<dimen name="seekbar_width">560dp</dimen>
<dimen name="seekbar_height">35dp</dimen>
diff --git a/res/values/photoeditor_styles.xml b/res/values/photoeditor_styles.xml
index 964ecbf34..7bd7fd098 100644
--- a/res/values/photoeditor_styles.xml
+++ b/res/values/photoeditor_styles.xml
@@ -54,17 +54,14 @@
<item name="android:layout_alignParentBottom">true</item>
<item name="android:orientation">vertical</item>
</style>
- <style name="TopActionBar" parent="@style/ActionBar">
- <item name="android:layout_alignParentTop">true</item>
- <item name="android:background">@drawable/photoeditor_actionbar_translucent</item>
- </style>
- <style name="BottomActionBar" parent="@style/ActionBar">
- <item name="android:background">@drawable/photoeditor_actionbar_translucent_bottom</item>
- </style>
- <style name="ActionBar">
+ <style name="ActionBarInner">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">?android:attr/actionBarSize</item>
</style>
+ <style name="ActionBarOuter">
+ <item name="android:layout_width">fill_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ </style>
<style name="ActionBarLinearLayout">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">fill_parent</item>
@@ -117,7 +114,12 @@
<item name="android:paddingRight">@dimen/action_button_padding_horizontal</item>
<item name="android:background">?android:attr/selectableItemBackground</item>
</style>
+ <style name="EffectsMenuContainer" parent="@style/ActionBarLinearLayout">
+ <item name="android:layout_width">@dimen/effects_menu_container_width</item>
+ <item name="android:layout_gravity">center_horizontal</item>
+ </style>
<style name="EffectsMenuActionButton" parent="@style/ImageActionButton">
+ <item name="android:layout_weight">1</item>
<item name="android:background">@drawable/photoeditor_toggle_button_background</item>
</style>
<style name="FullscreenToolView">