summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2014-09-03 17:17:45 -0700
committerAdam Powell <adamp@google.com>2014-09-03 17:17:45 -0700
commitb2536cf473a6fc386eea75ab8c97edf3a1ad323b (patch)
tree4c2acee973fa1b11a35f803c69e59e984f314313 /core/java
parent5ec176dc2bdfdc596c9918c286ac14723f28a383 (diff)
downloadframeworks_base-b2536cf473a6fc386eea75ab8c97edf3a1ad323b.zip
frameworks_base-b2536cf473a6fc386eea75ab8c97edf3a1ad323b.tar.gz
frameworks_base-b2536cf473a6fc386eea75ab8c97edf3a1ad323b.tar.bz2
Change the CAB to use the up-glyph for closing action modes
In an effort to reduce glyph proliferation, change the "done" checkmark from the CAB to the up-navigation arrow, placing the CAB firmly in the current navigation hierarchy. This matches behavior for expandable action views such as SearchView. Allow the use of different CAB "done" layouts by theme; the material layout should not include the "done" text and should use the standard borderless selectable item background. Bug 17372188 Change-Id: Icfb3e0bbc6a718e22ab27f9d520da5fe4eb833e7
Diffstat (limited to 'core/java')
-rw-r--r--core/java/com/android/internal/widget/ActionBarContextView.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/java/com/android/internal/widget/ActionBarContextView.java b/core/java/com/android/internal/widget/ActionBarContextView.java
index c7ac815..062a9b1 100644
--- a/core/java/com/android/internal/widget/ActionBarContextView.java
+++ b/core/java/com/android/internal/widget/ActionBarContextView.java
@@ -59,6 +59,7 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi
private int mSubtitleStyleRes;
private Drawable mSplitBackground;
private boolean mTitleOptional;
+ private int mCloseItemLayout;
private Animator mCurrentAnimation;
private boolean mAnimateInOnLayout;
@@ -99,6 +100,10 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi
mSplitBackground = a.getDrawable(
com.android.internal.R.styleable.ActionMode_backgroundSplit);
+ mCloseItemLayout = a.getResourceId(
+ com.android.internal.R.styleable.ActionMode_closeItemLayout,
+ R.layout.action_mode_close_item);
+
a.recycle();
}
@@ -120,7 +125,7 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi
LayoutParams.MATCH_PARENT);
if (!split) {
mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
- mMenuView.setBackgroundDrawable(null);
+ mMenuView.setBackground(null);
final ViewGroup oldParent = (ViewGroup) mMenuView.getParent();
if (oldParent != null) oldParent.removeView(mMenuView);
addView(mMenuView, layoutParams);
@@ -134,7 +139,7 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi
layoutParams.width = LayoutParams.MATCH_PARENT;
layoutParams.height = mContentHeight;
mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
- mMenuView.setBackgroundDrawable(mSplitBackground);
+ mMenuView.setBackground(mSplitBackground);
final ViewGroup oldParent = (ViewGroup) mMenuView.getParent();
if (oldParent != null) oldParent.removeView(mMenuView);
mSplitView.addView(mMenuView, layoutParams);
@@ -211,7 +216,7 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi
public void initForMode(final ActionMode mode) {
if (mClose == null) {
LayoutInflater inflater = LayoutInflater.from(mContext);
- mClose = inflater.inflate(R.layout.action_mode_close_item, this, false);
+ mClose = inflater.inflate(mCloseItemLayout, this, false);
addView(mClose);
} else if (mClose.getParent() == null) {
addView(mClose);