diff options
author | Yuli Huang <yuli@google.com> | 2011-09-14 15:00:33 +0800 |
---|---|---|
committer | Yuli Huang <yuli@google.com> | 2011-09-14 15:00:33 +0800 |
commit | 8cb3c51b16dc4aa9aea1a252eb59d6b5cbb33af3 (patch) | |
tree | 45237d9e03cf0ec294b42270303bf0170b77f196 | |
parent | 6af98c9e0f4125d658b10303a01adef6a5a9e8f1 (diff) | |
download | android_packages_apps_Gallery2-8cb3c51b16dc4aa9aea1a252eb59d6b5cbb33af3.tar.gz android_packages_apps_Gallery2-8cb3c51b16dc4aa9aea1a252eb59d6b5cbb33af3.tar.bz2 android_packages_apps_Gallery2-8cb3c51b16dc4aa9aea1a252eb59d6b5cbb33af3.zip |
Fix b/5182741: Add 'Edit' title in the action-bar.
Change-Id: I3964bfcb23818f2f3f8364475f74b401f7eed097
-rw-r--r-- | res/layout/photoeditor_main.xml | 5 | ||||
-rwxr-xr-x | res/values-sw320dp/photoeditor_dimens.xml | 2 | ||||
-rwxr-xr-x | res/values-sw600dp/photoeditor_dimens.xml | 2 | ||||
-rwxr-xr-x | res/values-sw800dp/photoeditor_dimens.xml | 2 | ||||
-rw-r--r-- | src/com/android/gallery3d/photoeditor/ActionBar.java | 12 |
5 files changed, 19 insertions, 4 deletions
diff --git a/res/layout/photoeditor_main.xml b/res/layout/photoeditor_main.xml index dd7551ff6..ed4841ab3 100644 --- a/res/layout/photoeditor_main.xml +++ b/res/layout/photoeditor_main.xml @@ -63,7 +63,10 @@ <ImageView style="@style/ActionBarIcon"/> </LinearLayout> - <TextView android:id="@+id/action_bar_title" style="@style/ActionBarText"/> + <TextView + android:id="@+id/action_bar_title" + style="@style/ActionBarText" + android:text="@string/edit"/> </LinearLayout> <LinearLayout style="@style/ActionBarLinearLayout" android:layout_alignParentRight="true"> diff --git a/res/values-sw320dp/photoeditor_dimens.xml b/res/values-sw320dp/photoeditor_dimens.xml index cde3fe9ed..c0f523fcc 100755 --- a/res/values-sw320dp/photoeditor_dimens.xml +++ b/res/values-sw320dp/photoeditor_dimens.xml @@ -16,7 +16,7 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android"> <dimen name="effect_label_text_size">11sp</dimen> - <dimen name="effect_label_width">98sp</dimen> + <dimen name="effect_label_width">98dp</dimen> <dimen name="effect_icon_size">72dp</dimen> <dimen name="effect_padding_left_right">2dp</dimen> <dimen name="effects_container_padding">12dp</dimen> diff --git a/res/values-sw600dp/photoeditor_dimens.xml b/res/values-sw600dp/photoeditor_dimens.xml index 285420a55..413347d31 100755 --- a/res/values-sw600dp/photoeditor_dimens.xml +++ b/res/values-sw600dp/photoeditor_dimens.xml @@ -16,7 +16,7 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android"> <dimen name="effect_label_text_size">14sp</dimen> - <dimen name="effect_label_width">120sp</dimen> + <dimen name="effect_label_width">120dp</dimen> <dimen name="effect_icon_size">90dp</dimen> <dimen name="effect_padding_left_right">2dp</dimen> <dimen name="effects_container_padding">12dp</dimen> diff --git a/res/values-sw800dp/photoeditor_dimens.xml b/res/values-sw800dp/photoeditor_dimens.xml index 8cce1bad6..3b054ceb4 100755 --- a/res/values-sw800dp/photoeditor_dimens.xml +++ b/res/values-sw800dp/photoeditor_dimens.xml @@ -16,7 +16,7 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android"> <dimen name="effect_label_text_size">15sp</dimen> - <dimen name="effect_label_width">138sp</dimen> + <dimen name="effect_label_width">138dp</dimen> <dimen name="effect_icon_size">100dp</dimen> <dimen name="effect_padding_left_right">3dp</dimen> <dimen name="effects_container_padding">18dp</dimen> diff --git a/src/com/android/gallery3d/photoeditor/ActionBar.java b/src/com/android/gallery3d/photoeditor/ActionBar.java index 52dfb0bd7..32eb79274 100644 --- a/src/com/android/gallery3d/photoeditor/ActionBar.java +++ b/src/com/android/gallery3d/photoeditor/ActionBar.java @@ -72,6 +72,18 @@ public class ActionBar extends RelativeLayout implements FilterStack.StackListen }; } + @Override + protected void onLayout(boolean changed, int l, int t, int r, int b) { + super.onLayout(changed, l, t, r, b); + + // Show action-bar title only when there's still room for it; otherwise, hide it. + int width = 0; + for (int i = 0; i < getChildCount(); i++) { + width += getChildAt(i).getWidth(); + } + findViewById(R.id.action_bar_title).setVisibility(((width > r - l)) ? INVISIBLE: VISIBLE); + } + /** * Initializes with a non-null ActionBarListener. */ |