diff options
author | 2011-08-11 16:57:59 -0700 | |
---|---|---|
committer | 2011-08-11 21:54:47 -0700 | |
commit | 9ca705e323cb737a07a667c1e86bac702f11a29c (patch) | |
tree | 583c529ca6a51a021dfbcd366f089a25d4c273cc | |
parent | 0e382005eb5ca3f71c9b374b9ffb6cd95dc3a081 (diff) |
Fix bug 5075761 - Visual assets: CAB states
Integrate new assets for the contextual action bar (action modes).
Change-Id: I8439196f8b7466ce862e1c21a34b7ae1abf88f36
83 files changed, 92 insertions, 56 deletions
diff --git a/api/current.txt b/api/current.txt index 8f3b38fcea1c..fee4df6a6967 100644 --- a/api/current.txt +++ b/api/current.txt @@ -211,6 +211,7 @@ package android { field public static final int actionModeCutDrawable = 16843537; // 0x1010311 field public static final int actionModePasteDrawable = 16843539; // 0x1010313 field public static final int actionModeSelectAllDrawable = 16843642; // 0x101037a + field public static final int actionModeSplitBackground = 16843687; // 0x10103a7 field public static final int actionModeStyle = 16843678; // 0x101039e field public static final int actionOverflowButtonStyle = 16843510; // 0x10102f6 field public static final int actionProviderClass = 16843667; // 0x1010393 diff --git a/core/java/com/android/internal/widget/ActionBarContextView.java b/core/java/com/android/internal/widget/ActionBarContextView.java index 3e3eeab4cbed..5645a6f5fbf8 100644 --- a/core/java/com/android/internal/widget/ActionBarContextView.java +++ b/core/java/com/android/internal/widget/ActionBarContextView.java @@ -15,12 +15,18 @@ */ package com.android.internal.widget; +import com.android.internal.R; +import com.android.internal.view.menu.ActionMenuPresenter; +import com.android.internal.view.menu.ActionMenuView; +import com.android.internal.view.menu.MenuBuilder; + import android.animation.Animator; import android.animation.Animator.AnimatorListener; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.content.Context; import android.content.res.TypedArray; +import android.graphics.drawable.Drawable; import android.text.TextUtils; import android.util.AttributeSet; import android.view.ActionMode; @@ -30,11 +36,6 @@ import android.view.animation.DecelerateInterpolator; import android.widget.LinearLayout; import android.widget.TextView; -import com.android.internal.R; -import com.android.internal.view.menu.ActionMenuPresenter; -import com.android.internal.view.menu.ActionMenuView; -import com.android.internal.view.menu.MenuBuilder; - /** * @hide */ @@ -53,6 +54,7 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi private TextView mSubtitleView; private int mTitleStyleRes; private int mSubtitleStyleRes; + private Drawable mSplitBackground; private Animator mCurrentAnimation; private boolean mAnimateInOnLayout; @@ -83,6 +85,10 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi mContentHeight = a.getLayoutDimension( com.android.internal.R.styleable.ActionMode_height, 0); + + mSplitBackground = a.getDrawable( + com.android.internal.R.styleable.ActionMode_backgroundSplit); + a.recycle(); } @@ -175,6 +181,7 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi if (mSplitView == null) { menu.addMenuPresenter(mActionMenuPresenter); mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); + mMenuView.setBackgroundDrawable(null); addView(mMenuView, layoutParams); } else { // Allow full screen width in split mode. @@ -187,6 +194,7 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi layoutParams.height = mContentHeight; menu.addMenuPresenter(mActionMenuPresenter); mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); + mMenuView.setBackgroundDrawable(mSplitBackground); mSplitView.addView(mMenuView, layoutParams); } @@ -256,7 +264,12 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi protected LayoutParams generateDefaultLayoutParams() { // Used by custom views if they don't supply layout params. Everything else // added to an ActionBarContextView should have them already. - return new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); + return new MarginLayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); + } + + @Override + public LayoutParams generateLayoutParams(AttributeSet attrs) { + return new MarginLayoutParams(getContext(), attrs); } @Override @@ -285,6 +298,8 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi if (mClose != null) { availableWidth = measureChildView(mClose, availableWidth, childSpecHeight, 0); + MarginLayoutParams lp = (MarginLayoutParams) mClose.getLayoutParams(); + availableWidth -= lp.leftMargin + lp.rightMargin; } if (mMenuView != null && mMenuView.getParent() == this) { @@ -327,7 +342,8 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi } private Animator makeInAnimation() { - mClose.setTranslationX(-mClose.getWidth()); + mClose.setTranslationX(-mClose.getWidth() - + ((MarginLayoutParams) mClose.getLayoutParams()).leftMargin); ObjectAnimator buttonAnimator = ObjectAnimator.ofFloat(mClose, "translationX", 0); buttonAnimator.setDuration(200); buttonAnimator.addListener(this); @@ -355,7 +371,7 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi private Animator makeOutAnimation() { ObjectAnimator buttonAnimator = ObjectAnimator.ofFloat(mClose, "translationX", - -mClose.getWidth()); + -mClose.getWidth() - ((MarginLayoutParams) mClose.getLayoutParams()).leftMargin); buttonAnimator.setDuration(200); buttonAnimator.addListener(this); buttonAnimator.setInterpolator(new DecelerateInterpolator()); @@ -387,7 +403,10 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi final int contentHeight = b - t - getPaddingTop() - getPaddingBottom(); if (mClose != null && mClose.getVisibility() != GONE) { + MarginLayoutParams lp = (MarginLayoutParams) mClose.getLayoutParams(); + x += lp.leftMargin; x += positionChild(mClose, x, y, contentHeight); + x += lp.rightMargin; if (mAnimateInOnLayout) { mAnimationMode = ANIMATE_IN; diff --git a/core/res/res/drawable-hdpi/btn_cab_done_default_holo.9.png b/core/res/res/drawable-hdpi/btn_cab_done_default_holo.9.png Binary files differdeleted file mode 100644 index f5e60541810b..000000000000 --- a/core/res/res/drawable-hdpi/btn_cab_done_default_holo.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/btn_cab_done_default_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_cab_done_default_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..769f57063c9e --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_cab_done_default_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_cab_done_default_holo_light.9.png b/core/res/res/drawable-hdpi/btn_cab_done_default_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..74cefd6d1fbf --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_cab_done_default_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_cab_done_focused_holo.9.png b/core/res/res/drawable-hdpi/btn_cab_done_focused_holo.9.png Binary files differdeleted file mode 100644 index 1121070d5733..000000000000 --- a/core/res/res/drawable-hdpi/btn_cab_done_focused_holo.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/btn_cab_done_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_cab_done_focused_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..4450f110eead --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_cab_done_focused_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_cab_done_focused_holo_light.9.png b/core/res/res/drawable-hdpi/btn_cab_done_focused_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..93b7b17a0223 --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_cab_done_focused_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/btn_cab_done_holo.9.png b/core/res/res/drawable-hdpi/btn_cab_done_holo.9.png Binary files differdeleted file mode 100644 index ec9faae1a4be..000000000000 --- a/core/res/res/drawable-hdpi/btn_cab_done_holo.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/btn_cab_done_pressed_holo.9.png b/core/res/res/drawable-hdpi/btn_cab_done_pressed_holo.9.png Binary files differdeleted file mode 100644 index 1a072a905368..000000000000 --- a/core/res/res/drawable-hdpi/btn_cab_done_pressed_holo.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/btn_cab_done_pressed_holo_dark.9.png b/core/res/res/drawable-hdpi/btn_cab_done_pressed_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..3ada1be991dc --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_cab_done_pressed_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/btn_cab_done_pressed_holo_light.9.png b/core/res/res/drawable-hdpi/btn_cab_done_pressed_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..749ea56951e4 --- /dev/null +++ b/core/res/res/drawable-hdpi/btn_cab_done_pressed_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/cab_background_bottom_holo_dark.9.png b/core/res/res/drawable-hdpi/cab_background_bottom_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..269def426e71 --- /dev/null +++ b/core/res/res/drawable-hdpi/cab_background_bottom_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/cab_background_bottom_holo_light.9.png b/core/res/res/drawable-hdpi/cab_background_bottom_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..49bcfb49272a --- /dev/null +++ b/core/res/res/drawable-hdpi/cab_background_bottom_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/cab_background_holo_dark.9.png b/core/res/res/drawable-hdpi/cab_background_holo_dark.9.png Binary files differdeleted file mode 100644 index 1a916b3fa658..000000000000 --- a/core/res/res/drawable-hdpi/cab_background_holo_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/cab_background_holo_light.9.png b/core/res/res/drawable-hdpi/cab_background_holo_light.9.png Binary files differdeleted file mode 100644 index e8c9c6082169..000000000000 --- a/core/res/res/drawable-hdpi/cab_background_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/cab_background_opaque_holo_dark.9.png b/core/res/res/drawable-hdpi/cab_background_opaque_holo_dark.9.png Binary files differdeleted file mode 100644 index 0f4c3c31e350..000000000000 --- a/core/res/res/drawable-hdpi/cab_background_opaque_holo_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/cab_background_opaque_holo_light.9.png b/core/res/res/drawable-hdpi/cab_background_opaque_holo_light.9.png Binary files differdeleted file mode 100644 index fb9b8318ae07..000000000000 --- a/core/res/res/drawable-hdpi/cab_background_opaque_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/cab_background_top_holo_dark.9.png b/core/res/res/drawable-hdpi/cab_background_top_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..b7ddc14b7bc2 --- /dev/null +++ b/core/res/res/drawable-hdpi/cab_background_top_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/cab_background_top_holo_light.9.png b/core/res/res/drawable-hdpi/cab_background_top_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..af80ad522f3f --- /dev/null +++ b/core/res/res/drawable-hdpi/cab_background_top_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/cab_divider_holo_dark.png b/core/res/res/drawable-hdpi/cab_divider_holo_dark.png Binary files differdeleted file mode 100755 index e2c2119de1df..000000000000 --- a/core/res/res/drawable-hdpi/cab_divider_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/cab_divider_holo_light.png b/core/res/res/drawable-hdpi/cab_divider_holo_light.png Binary files differdeleted file mode 100755 index 51e229507943..000000000000 --- a/core/res/res/drawable-hdpi/cab_divider_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/cab_divider_vertical_dark.png b/core/res/res/drawable-hdpi/cab_divider_vertical_dark.png Binary files differdeleted file mode 100755 index b1f035c93d93..000000000000 --- a/core/res/res/drawable-hdpi/cab_divider_vertical_dark.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/cab_divider_vertical_light.png b/core/res/res/drawable-hdpi/cab_divider_vertical_light.png Binary files differdeleted file mode 100755 index 2183b128ce33..000000000000 --- a/core/res/res/drawable-hdpi/cab_divider_vertical_light.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/cab_holo_light.9.png b/core/res/res/drawable-hdpi/cab_holo_light.9.png Binary files differdeleted file mode 100755 index 4f2afcfdd81e..000000000000 --- a/core/res/res/drawable-hdpi/cab_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/cab_ic_close_focused_holo.png b/core/res/res/drawable-hdpi/cab_ic_close_focused_holo.png Binary files differdeleted file mode 100755 index 9d7f9320824e..000000000000 --- a/core/res/res/drawable-hdpi/cab_ic_close_focused_holo.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/cab_ic_close_normal_holo.png b/core/res/res/drawable-hdpi/cab_ic_close_normal_holo.png Binary files differdeleted file mode 100755 index 641507dfd263..000000000000 --- a/core/res/res/drawable-hdpi/cab_ic_close_normal_holo.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/cab_ic_close_pressed_holo.png b/core/res/res/drawable-hdpi/cab_ic_close_pressed_holo.png Binary files differdeleted file mode 100755 index ebb0fc825f03..000000000000 --- a/core/res/res/drawable-hdpi/cab_ic_close_pressed_holo.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/ic_cab_close_holo.png b/core/res/res/drawable-hdpi/ic_cab_close_holo.png Binary files differdeleted file mode 100644 index 0dcd54ccc65a..000000000000 --- a/core/res/res/drawable-hdpi/ic_cab_close_holo.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/ic_cab_done_holo_dark.png b/core/res/res/drawable-hdpi/ic_cab_done_holo_dark.png Binary files differnew file mode 100644 index 000000000000..d8662e3f0fda --- /dev/null +++ b/core/res/res/drawable-hdpi/ic_cab_done_holo_dark.png diff --git a/core/res/res/drawable-hdpi/ic_cab_done_holo_light.png b/core/res/res/drawable-hdpi/ic_cab_done_holo_light.png Binary files differnew file mode 100644 index 000000000000..ed03f620f8ef --- /dev/null +++ b/core/res/res/drawable-hdpi/ic_cab_done_holo_light.png diff --git a/core/res/res/drawable-mdpi/btn_cab_done_default_holo.9.png b/core/res/res/drawable-mdpi/btn_cab_done_default_holo.9.png Binary files differdeleted file mode 100644 index 7af26cabea27..000000000000 --- a/core/res/res/drawable-mdpi/btn_cab_done_default_holo.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/btn_cab_done_default_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_cab_done_default_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..d00d2352966f --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_cab_done_default_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_cab_done_default_holo_light.9.png b/core/res/res/drawable-mdpi/btn_cab_done_default_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..d7b20493f736 --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_cab_done_default_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_cab_done_focused_holo.9.png b/core/res/res/drawable-mdpi/btn_cab_done_focused_holo.9.png Binary files differdeleted file mode 100644 index 486c37a72c1f..000000000000 --- a/core/res/res/drawable-mdpi/btn_cab_done_focused_holo.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/btn_cab_done_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_cab_done_focused_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..59c1580536bb --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_cab_done_focused_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_cab_done_focused_holo_light.9.png b/core/res/res/drawable-mdpi/btn_cab_done_focused_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..143564abe012 --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_cab_done_focused_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/btn_cab_done_holo.9.png b/core/res/res/drawable-mdpi/btn_cab_done_holo.9.png Binary files differdeleted file mode 100644 index 517242c06f4b..000000000000 --- a/core/res/res/drawable-mdpi/btn_cab_done_holo.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/btn_cab_done_pressed_holo.9.png b/core/res/res/drawable-mdpi/btn_cab_done_pressed_holo.9.png Binary files differdeleted file mode 100644 index 3cfb4bd49764..000000000000 --- a/core/res/res/drawable-mdpi/btn_cab_done_pressed_holo.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/btn_cab_done_pressed_holo_dark.9.png b/core/res/res/drawable-mdpi/btn_cab_done_pressed_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..e5b9cfd9c973 --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_cab_done_pressed_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/btn_cab_done_pressed_holo_light.9.png b/core/res/res/drawable-mdpi/btn_cab_done_pressed_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..ec43f8513e92 --- /dev/null +++ b/core/res/res/drawable-mdpi/btn_cab_done_pressed_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/cab_background_bottom_holo_dark.9.png b/core/res/res/drawable-mdpi/cab_background_bottom_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..0e4b28e4dd24 --- /dev/null +++ b/core/res/res/drawable-mdpi/cab_background_bottom_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/cab_background_bottom_holo_light.9.png b/core/res/res/drawable-mdpi/cab_background_bottom_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..e449090cc3cd --- /dev/null +++ b/core/res/res/drawable-mdpi/cab_background_bottom_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/cab_background_holo_dark.9.png b/core/res/res/drawable-mdpi/cab_background_holo_dark.9.png Binary files differdeleted file mode 100644 index 38f44ce1cffc..000000000000 --- a/core/res/res/drawable-mdpi/cab_background_holo_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/cab_background_holo_light.9.png b/core/res/res/drawable-mdpi/cab_background_holo_light.9.png Binary files differdeleted file mode 100644 index 2a4deea44642..000000000000 --- a/core/res/res/drawable-mdpi/cab_background_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/cab_background_opaque_holo_dark.9.png b/core/res/res/drawable-mdpi/cab_background_opaque_holo_dark.9.png Binary files differdeleted file mode 100644 index 013319ce2dcc..000000000000 --- a/core/res/res/drawable-mdpi/cab_background_opaque_holo_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/cab_background_opaque_holo_light.9.png b/core/res/res/drawable-mdpi/cab_background_opaque_holo_light.9.png Binary files differdeleted file mode 100644 index 6d8861ab4e46..000000000000 --- a/core/res/res/drawable-mdpi/cab_background_opaque_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/cab_background_top_holo_dark.9.png b/core/res/res/drawable-mdpi/cab_background_top_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..d0ebc1a67e33 --- /dev/null +++ b/core/res/res/drawable-mdpi/cab_background_top_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/cab_background_top_holo_light.9.png b/core/res/res/drawable-mdpi/cab_background_top_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..c2dd608a9e47 --- /dev/null +++ b/core/res/res/drawable-mdpi/cab_background_top_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/cab_divider_holo_dark.png b/core/res/res/drawable-mdpi/cab_divider_holo_dark.png Binary files differdeleted file mode 100755 index 317263a120bb..000000000000 --- a/core/res/res/drawable-mdpi/cab_divider_holo_dark.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/cab_divider_holo_light.png b/core/res/res/drawable-mdpi/cab_divider_holo_light.png Binary files differdeleted file mode 100755 index 824ad27ee768..000000000000 --- a/core/res/res/drawable-mdpi/cab_divider_holo_light.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/cab_divider_vertical_dark.png b/core/res/res/drawable-mdpi/cab_divider_vertical_dark.png Binary files differdeleted file mode 100755 index f7ed6dff8ecf..000000000000 --- a/core/res/res/drawable-mdpi/cab_divider_vertical_dark.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/cab_divider_vertical_light.png b/core/res/res/drawable-mdpi/cab_divider_vertical_light.png Binary files differdeleted file mode 100755 index 73ac0d9ed4d8..000000000000 --- a/core/res/res/drawable-mdpi/cab_divider_vertical_light.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/cab_holo_light.9.png b/core/res/res/drawable-mdpi/cab_holo_light.9.png Binary files differdeleted file mode 100755 index 0e64c5c23e81..000000000000 --- a/core/res/res/drawable-mdpi/cab_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/cab_ic_close_focused_holo.png b/core/res/res/drawable-mdpi/cab_ic_close_focused_holo.png Binary files differdeleted file mode 100755 index 59149e4a54c1..000000000000 --- a/core/res/res/drawable-mdpi/cab_ic_close_focused_holo.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/cab_ic_close_normal_holo.png b/core/res/res/drawable-mdpi/cab_ic_close_normal_holo.png Binary files differdeleted file mode 100755 index b37888533a7e..000000000000 --- a/core/res/res/drawable-mdpi/cab_ic_close_normal_holo.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/cab_ic_close_pressed_holo.png b/core/res/res/drawable-mdpi/cab_ic_close_pressed_holo.png Binary files differdeleted file mode 100755 index 29b04078017c..000000000000 --- a/core/res/res/drawable-mdpi/cab_ic_close_pressed_holo.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/ic_cab_close_holo.png b/core/res/res/drawable-mdpi/ic_cab_close_holo.png Binary files differdeleted file mode 100644 index 135577e5768e..000000000000 --- a/core/res/res/drawable-mdpi/ic_cab_close_holo.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/ic_cab_done_holo_dark.png b/core/res/res/drawable-mdpi/ic_cab_done_holo_dark.png Binary files differnew file mode 100644 index 000000000000..a17b6a789208 --- /dev/null +++ b/core/res/res/drawable-mdpi/ic_cab_done_holo_dark.png diff --git a/core/res/res/drawable-mdpi/ic_cab_done_holo_light.png b/core/res/res/drawable-mdpi/ic_cab_done_holo_light.png Binary files differnew file mode 100644 index 000000000000..b28b3b54f4c8 --- /dev/null +++ b/core/res/res/drawable-mdpi/ic_cab_done_holo_light.png diff --git a/core/res/res/drawable-xhdpi/btn_cab_done_default_holo_dark.9.png b/core/res/res/drawable-xhdpi/btn_cab_done_default_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..a338924ed538 --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_cab_done_default_holo_dark.9.png diff --git a/core/res/res/drawable-xhdpi/btn_cab_done_default_holo_light.9.png b/core/res/res/drawable-xhdpi/btn_cab_done_default_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..6f2d3e59375a --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_cab_done_default_holo_light.9.png diff --git a/core/res/res/drawable-xhdpi/btn_cab_done_focused_holo_dark.9.png b/core/res/res/drawable-xhdpi/btn_cab_done_focused_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..faa36b0f2ab8 --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_cab_done_focused_holo_dark.9.png diff --git a/core/res/res/drawable-xhdpi/btn_cab_done_focused_holo_light.9.png b/core/res/res/drawable-xhdpi/btn_cab_done_focused_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..c57f3ff6c97b --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_cab_done_focused_holo_light.9.png diff --git a/core/res/res/drawable-xhdpi/btn_cab_done_pressed_holo_dark.9.png b/core/res/res/drawable-xhdpi/btn_cab_done_pressed_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..9d6402f296ee --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_cab_done_pressed_holo_dark.9.png diff --git a/core/res/res/drawable-xhdpi/btn_cab_done_pressed_holo_light.9.png b/core/res/res/drawable-xhdpi/btn_cab_done_pressed_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..bfd966c2ff8d --- /dev/null +++ b/core/res/res/drawable-xhdpi/btn_cab_done_pressed_holo_light.9.png diff --git a/core/res/res/drawable-xhdpi/cab_background_bottom_holo_dark.9.png b/core/res/res/drawable-xhdpi/cab_background_bottom_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..2bd8cee41cd8 --- /dev/null +++ b/core/res/res/drawable-xhdpi/cab_background_bottom_holo_dark.9.png diff --git a/core/res/res/drawable-xhdpi/cab_background_bottom_holo_light.9.png b/core/res/res/drawable-xhdpi/cab_background_bottom_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..d254e77541e0 --- /dev/null +++ b/core/res/res/drawable-xhdpi/cab_background_bottom_holo_light.9.png diff --git a/core/res/res/drawable-xhdpi/cab_background_opaque_holo_dark.9.png b/core/res/res/drawable-xhdpi/cab_background_opaque_holo_dark.9.png Binary files differdeleted file mode 100644 index e2b604ba1dbc..000000000000 --- a/core/res/res/drawable-xhdpi/cab_background_opaque_holo_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/cab_background_opaque_holo_light.9.png b/core/res/res/drawable-xhdpi/cab_background_opaque_holo_light.9.png Binary files differdeleted file mode 100644 index 0c1aeaa2450b..000000000000 --- a/core/res/res/drawable-xhdpi/cab_background_opaque_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable-xhdpi/cab_background_top_holo_dark.9.png b/core/res/res/drawable-xhdpi/cab_background_top_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..919eac07d15d --- /dev/null +++ b/core/res/res/drawable-xhdpi/cab_background_top_holo_dark.9.png diff --git a/core/res/res/drawable-xhdpi/cab_background_top_holo_light.9.png b/core/res/res/drawable-xhdpi/cab_background_top_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..1357105786e4 --- /dev/null +++ b/core/res/res/drawable-xhdpi/cab_background_top_holo_light.9.png diff --git a/core/res/res/drawable-xhdpi/ic_cab_done_holo_dark.png b/core/res/res/drawable-xhdpi/ic_cab_done_holo_dark.png Binary files differnew file mode 100644 index 000000000000..2e06dd01be8c --- /dev/null +++ b/core/res/res/drawable-xhdpi/ic_cab_done_holo_dark.png diff --git a/core/res/res/drawable-xhdpi/ic_cab_done_holo_light.png b/core/res/res/drawable-xhdpi/ic_cab_done_holo_light.png Binary files differnew file mode 100644 index 000000000000..bb19810bc206 --- /dev/null +++ b/core/res/res/drawable-xhdpi/ic_cab_done_holo_light.png diff --git a/core/res/res/drawable/btn_cab_done.xml b/core/res/res/drawable/btn_cab_done_holo_dark.xml index e3cf461511c0..2cdb60509239 100644 --- a/core/res/res/drawable/btn_cab_done.xml +++ b/core/res/res/drawable/btn_cab_done_holo_dark.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2008 The Android Open Source Project +<!-- Copyright (C) 2011 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. @@ -16,11 +16,11 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_window_focused="false" android:state_enabled="true" - android:drawable="@drawable/btn_cab_done_default_holo" /> + android:drawable="@drawable/btn_cab_done_default_holo_dark" /> <item android:state_pressed="true" - android:drawable="@drawable/btn_cab_done_pressed_holo" /> + android:drawable="@drawable/btn_cab_done_pressed_holo_dark" /> <item android:state_focused="true" android:state_enabled="true" - android:drawable="@drawable/btn_cab_done_focused_holo" /> + android:drawable="@drawable/btn_cab_done_focused_holo_dark" /> <item android:state_enabled="true" - android:drawable="@drawable/btn_cab_done_default_holo" /> + android:drawable="@drawable/btn_cab_done_default_holo_dark" /> </selector> diff --git a/core/res/res/drawable/cab_ic_close_holo.xml b/core/res/res/drawable/btn_cab_done_holo_light.xml index 1baf7cc0b2b7..81add4c5da04 100644 --- a/core/res/res/drawable/cab_ic_close_holo.xml +++ b/core/res/res/drawable/btn_cab_done_holo_light.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2010 The Android Open Source Project +<!-- Copyright (C) 2011 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. @@ -15,9 +15,12 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_window_focused="false" android:state_enabled="true" + android:drawable="@drawable/btn_cab_done_default_holo_light" /> <item android:state_pressed="true" - android:drawable="@drawable/cab_ic_close_pressed_holo" /> - <item android:state_focused="true" - android:drawable="@drawable/cab_ic_close_focused_holo" /> - <item android:drawable="@drawable/cab_ic_close_normal_holo" /> + android:drawable="@drawable/btn_cab_done_pressed_holo_light" /> + <item android:state_focused="true" android:state_enabled="true" + android:drawable="@drawable/btn_cab_done_focused_holo_light" /> + <item android:state_enabled="true" + android:drawable="@drawable/btn_cab_done_default_holo_light" /> </selector> diff --git a/core/res/res/layout-large/action_mode_close_item.xml b/core/res/res/layout-large/action_mode_close_item.xml index 321622ef387b..a7b3fbb653f4 100644 --- a/core/res/res/layout-large/action_mode_close_item.xml +++ b/core/res/res/layout-large/action_mode_close_item.xml @@ -16,23 +16,23 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/action_mode_close_button" - android:background="@drawable/btn_cab_done" android:focusable="true" android:clickable="true" android:paddingLeft="16dip" + style="?android:attr/actionModeCloseButtonStyle" android:layout_width="wrap_content" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:layout_marginRight="16dip"> <ImageView android:layout_width="48dip" android:layout_height="wrap_content" android:layout_gravity="center" android:scaleType="center" - android:src="@drawable/ic_cab_close_holo" /> + android:src="?android:attr/actionModeCloseDrawable" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginLeft="8dip" android:layout_marginRight="16dip" - android:textAppearance="@android:style/TextAppearance.Holo.Medium" - android:textColor="@android:color/white" + android:textAppearance="?android:attr/textAppearanceMedium" android:text="@string/action_mode_done" /> </LinearLayout> diff --git a/core/res/res/layout/action_mode_close_item.xml b/core/res/res/layout/action_mode_close_item.xml index 2a4d8e0513eb..57c0f1d42eae 100644 --- a/core/res/res/layout/action_mode_close_item.xml +++ b/core/res/res/layout/action_mode_close_item.xml @@ -16,15 +16,16 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/action_mode_close_button" - android:background="@drawable/btn_cab_done" android:focusable="true" android:clickable="true" - android:paddingLeft="8dip" + android:paddingLeft="16dip" + style="?android:attr/actionModeCloseButtonStyle" android:layout_width="wrap_content" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:layout_marginRight="16dip"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:scaleType="fitCenter" - android:src="@drawable/ic_cab_close_holo" /> + android:src="?android:attr/actionModeCloseDrawable" /> </LinearLayout> diff --git a/core/res/res/values/arrays.xml b/core/res/res/values/arrays.xml index 96fa9316c178..fe5ace87e64d 100644 --- a/core/res/res/values/arrays.xml +++ b/core/res/res/values/arrays.xml @@ -241,21 +241,18 @@ <item>@drawable/spinner_pressed_holo_dark</item> <item>@drawable/spinner_pressed_holo_light</item> <item>@drawable/spinner_select</item> - <item>@drawable/btn_cab_done</item> - <item>@drawable/btn_cab_done_focused_holo</item> - <item>@drawable/btn_cab_done_holo</item> - <item>@drawable/btn_cab_done_pressed_holo</item> - <item>@drawable/cab_background_holo_dark</item> - <item>@drawable/cab_background_holo_light</item> - <item>@drawable/cab_background_opaque_holo_dark</item> - <item>@drawable/cab_background_opaque_holo_light</item> - <item>@drawable/cab_ic_close_focused_holo</item> - <item>@drawable/cab_ic_close_holo</item> - <item>@drawable/cab_ic_close_normal_holo</item> - <item>@drawable/cab_ic_close_pressed_holo</item> - <item>@drawable/ic_cab_close_holo</item> - <item>@drawable/action_bar_background</item> - <item>@drawable/action_bar_divider</item> + <item>@drawable/cab_background_bottom_holo_dark</item> + <item>@drawable/cab_background_top_holo_light</item> + <item>@drawable/cab_background_bottom_holo_light</item> + <item>@drawable/ic_cab_done_holo_dark</item> + <item>@drawable/cab_background_top_holo_dark</item> + <item>@drawable/ic_cab_done_holo_light</item> + <item>@drawable/btn_cab_done_default_holo_dark</item> + <item>@drawable/btn_cab_done_focused_holo_light</item> + <item>@drawable/btn_cab_done_default_holo_light</item> + <item>@drawable/btn_cab_done_pressed_holo_dark</item> + <item>@drawable/btn_cab_done_focused_holo_dark</item> + <item>@drawable/btn_cab_done_pressed_holo_light</item> <item>@drawable/ic_menu_close_clear_cancel</item> <item>@drawable/ic_menu_copy_holo_dark</item> <item>@drawable/ic_menu_copy_holo_light</item> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 140a8c947130..f63eb62379af 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -651,6 +651,8 @@ <attr name="actionModeCloseButtonStyle" format="reference" /> <!-- Background drawable to use for action mode UI --> <attr name="actionModeBackground" format="reference" /> + <!-- Background drawable to use for action mode UI in the lower split bar --> + <attr name="actionModeSplitBackground" format="reference" /> <!-- Drawable to use for the close action mode button --> <attr name="actionModeCloseDrawable" format="reference" /> @@ -5273,6 +5275,8 @@ <attr name="subtitleTextStyle" /> <!-- Specifies a background for the action mode bar. --> <attr name="background" /> + <!-- Specifies a background for the split action mode bar. --> + <attr name="backgroundSplit" /> <!-- Specifies a fixed height for the action mode bar. --> <attr name="height" /> </declare-styleable> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 44995c8be34b..730d971d05ea 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1790,6 +1790,7 @@ <public type="attr" name="actionBarDivider" /> <public type="attr" name="actionBarItemBackground" /> + <public type="attr" name="actionModeSplitBackground" /> <public type="style" name="TextAppearance.SuggestionHighlight" /> diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 1f6b50a93c89..8ff9d4636301 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -1090,6 +1090,7 @@ please see styles_device_defaults.xml. <style name="Widget.ActionMode"> <item name="android:background">?android:attr/actionModeBackground</item> + <item name="android:backgroundSplit">?android:attr/actionModeSplitBackground</item> <item name="android:height">?android:attr/actionBarSize</item> <item name="android:titleTextStyle">@android:style/TextAppearance.Widget.ActionMode.Title</item> <item name="android:subtitleTextStyle">@android:style/TextAppearance.Widget.ActionMode.Subtitle</item> @@ -1126,7 +1127,6 @@ please see styles_device_defaults.xml. </style> <style name="Widget.ActionButton.CloseMode"> - <item name="android:src">?android:attr/actionModeCloseDrawable</item> </style> <style name="Widget.ActionBar.TabView" parent="Widget"> @@ -1866,7 +1866,7 @@ please see styles_device_defaults.xml. </style> <style name="Widget.Holo.ActionButton.CloseMode"> - <item name="android:src">@drawable/cab_ic_close_holo</item> + <item name="android:background">@drawable/btn_cab_done_holo_dark</item> </style> <style name="Widget.Holo.ActionBar" parent="Widget.ActionBar"> @@ -2230,6 +2230,7 @@ please see styles_device_defaults.xml. </style> <style name="Widget.Holo.Light.ActionButton.CloseMode"> + <item name="android:background">@drawable/btn_cab_done_holo_light</item> </style> <style name="Widget.Holo.Light.ActionBar" parent="Widget.Holo.ActionBar"> diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index add7dc846c1f..397278ccac69 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -287,7 +287,8 @@ please see themes_device_defaults.xml. <item name="actionDropDownStyle">@android:style/Widget.Spinner.DropDown</item> <item name="actionButtonStyle">@android:style/Widget.ActionButton</item> <item name="actionOverflowButtonStyle">@android:style/Widget.ActionButton.Overflow</item> - <item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_dark</item> + <item name="actionModeBackground">@android:drawable/cab_background_top_holo_dark</item> + <item name="actionModeSplitBackground">@null</item> <item name="actionModeCloseDrawable">@android:drawable/ic_menu_close_clear_cancel</item> <item name="actionModeCutDrawable">@android:drawable/ic_menu_cut_holo_dark</item> <item name="actionModeCopyDrawable">@android:drawable/ic_menu_copy_holo_dark</item> @@ -430,7 +431,8 @@ please see themes_device_defaults.xml. <item name="actionModeShareDrawable">@android:drawable/ic_menu_share_holo_light</item> <item name="actionModeFindDrawable">@android:drawable/ic_menu_find_holo_light</item> <item name="actionModeWebSearchDrawable">@android:drawable/ic_menu_search_holo_light</item> - <item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_light</item> + <item name="actionModeBackground">@android:drawable/cab_background_top_holo_light</item> + <item name="actionModeSplitBackground">@android:drawable/cab_background_bottom_holo_light</item> <!-- SearchView attributes --> <item name="searchDropdownBackground">@android:drawable/search_dropdown_light</item> @@ -719,22 +721,26 @@ please see themes_device_defaults.xml. <!-- Theme for the search input bar. --> <style name="Theme.SearchBar" parent="Theme.Holo.Light.Panel"> - <item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_light</item> + <item name="actionModeBackground">@android:drawable/cab_background_top_holo_light</item> + <item name="actionModeSplitBackground">@android:drawable/cab_background_bottom_holo_light</item> </style> <style name="Theme.Holo.SearchBar" parent="Theme.Holo.Panel"> - <item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_dark</item> + <item name="actionModeBackground">@android:drawable/cab_background_top_holo_dark</item> + <item name="actionModeSplitBackground">@android:drawable/cab_background_bottom_holo_light</item> </style> <style name="Theme.Holo.Light.SearchBar" parent="Theme.Holo.Light.Panel"> - <item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_light</item> + <item name="actionModeBackground">@android:drawable/cab_background_top_holo_light</item> + <item name="actionModeSplitBackground">@android:drawable/cab_background_bottom_holo_light</item> </style> <!-- Theme for the search input bar when doing global search. The only difference from non-global search is that we do not dim the background. --> <style name="Theme.GlobalSearchBar" parent="Theme.Panel"> <item name="windowContentOverlay">@null</item> - <item name="actionModeBackground">@android:drawable/cab_background_opaque_holo_light</item> + <item name="actionModeBackground">@android:drawable/cab_background_top_holo_light</item> + <item name="actionModeSplitBackground">@android:drawable/cab_background_bottom_holo_light</item> </style> <!-- Menu Themes --> @@ -1072,8 +1078,9 @@ please see themes_device_defaults.xml. <item name="actionDropDownStyle">@android:style/Widget.Holo.Spinner.DropDown.ActionBar</item> <item name="actionButtonStyle">@android:style/Widget.Holo.ActionButton</item> <item name="actionOverflowButtonStyle">@android:style/Widget.Holo.ActionButton.Overflow</item> - <item name="actionModeBackground">@android:drawable/cab_background_holo_dark</item> - <item name="actionModeCloseDrawable">@android:drawable/cab_ic_close_holo</item> + <item name="actionModeBackground">@android:drawable/cab_background_top_holo_dark</item> + <item name="actionModeSplitBackground">@android:drawable/cab_background_bottom_holo_dark</item> + <item name="actionModeCloseDrawable">@android:drawable/ic_cab_done_holo_dark</item> <item name="actionBarTabStyle">@style/Widget.Holo.ActionBar.TabView</item> <item name="actionBarTabBarStyle">@style/Widget.Holo.ActionBar.TabBar</item> <item name="actionBarTabTextStyle">@style/Widget.Holo.ActionBar.TabText</item> @@ -1373,8 +1380,9 @@ please see themes_device_defaults.xml. <item name="actionDropDownStyle">@android:style/Widget.Holo.Light.Spinner.DropDown.ActionBar</item> <item name="actionButtonStyle">@android:style/Widget.Holo.Light.ActionButton</item> <item name="actionOverflowButtonStyle">@android:style/Widget.Holo.Light.ActionButton.Overflow</item> - <item name="actionModeBackground">@android:drawable/cab_background_holo_light</item> - <item name="actionModeCloseDrawable">@android:drawable/cab_ic_close_holo</item> + <item name="actionModeBackground">@android:drawable/cab_background_top_holo_light</item> + <item name="actionModeSplitBackground">@android:drawable/cab_background_bottom_holo_light</item> + <item name="actionModeCloseDrawable">@android:drawable/ic_cab_done_holo_light</item> <item name="actionBarTabStyle">@style/Widget.Holo.Light.ActionBar.TabView</item> <item name="actionBarTabBarStyle">@style/Widget.Holo.Light.ActionBar.TabBar</item> <item name="actionBarTabTextStyle">@style/Widget.Holo.Light.ActionBar.TabText</item> @@ -1438,8 +1446,9 @@ please see themes_device_defaults.xml. <item name="actionDropDownStyle">@android:style/Widget.Holo.Spinner.DropDown.ActionBar</item> <item name="actionButtonStyle">@android:style/Widget.Holo.ActionButton</item> <item name="actionOverflowButtonStyle">@android:style/Widget.Holo.ActionButton.Overflow</item> - <item name="actionModeBackground">@android:drawable/cab_background_holo_dark</item> - <item name="actionModeCloseDrawable">@android:drawable/cab_ic_close_holo</item> + <item name="actionModeBackground">@android:drawable/cab_background_top_holo_dark</item> + <item name="actionModeSplitBackground">@android:drawable/cab_background_bottom_holo_dark</item> + <item name="actionModeCloseDrawable">@android:drawable/ic_cab_done_holo_dark</item> <item name="homeAsUpIndicator">@android:drawable/ic_ab_back_holo_dark</item> <item name="actionBarTabStyle">@style/Widget.Holo.Light.ActionBar.TabView.Inverse</item> <item name="actionBarTabBarStyle">@style/Widget.Holo.Light.ActionBar.TabBar.Inverse</item> |