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 | 72963d1288aa082e8a0497cb7acc1c15d95b0233 (patch) | |
tree | cfc9f750ab40e3ef06ebb6774728d92b580044ac /src/com/android/gallery3d/photoeditor | |
parent | e0c32157e3aabdb8f78692d777232eb30a2513e2 (diff) | |
download | android_packages_apps_Snap-72963d1288aa082e8a0497cb7acc1c15d95b0233.tar.gz android_packages_apps_Snap-72963d1288aa082e8a0497cb7acc1c15d95b0233.tar.bz2 android_packages_apps_Snap-72963d1288aa082e8a0497cb7acc1c15d95b0233.zip |
Fix b/5182741: Add 'Edit' title in the action-bar.
Change-Id: I3964bfcb23818f2f3f8364475f74b401f7eed097
Diffstat (limited to 'src/com/android/gallery3d/photoeditor')
-rw-r--r-- | src/com/android/gallery3d/photoeditor/ActionBar.java | 12 |
1 files changed, 12 insertions, 0 deletions
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. */ |