Loading core/java/com/android/internal/widget/ActionBarContextView.java +8 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); } Loading @@ -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); Loading @@ -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); Loading Loading @@ -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); Loading core/res/res/drawable/ic_cab_done_material.xml→core/res/res/layout/action_mode_close_item_material.xml +11 −4 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2014 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. Loading @@ -14,6 +14,13 @@ limitations under the License. --> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/ic_cab_done_mtrl_alpha" android:tint="?attr/colorControlNormal" /> <ImageButton xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/action_mode_close_button" android:focusable="true" android:clickable="true" android:paddingStart="8dip" android:src="?android:attr/actionModeCloseDrawable" style="?android:attr/actionModeCloseButtonStyle" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_marginEnd="16dip" /> core/res/res/values/attrs.xml +2 −0 Original line number Diff line number Diff line Loading @@ -7117,6 +7117,8 @@ <attr name="backgroundSplit" /> <!-- Specifies a fixed height for the action mode bar. --> <attr name="height" /> <!-- Specifies a layout to use for the "close" item at the starting edge. --> <attr name="closeItemLayout" format="reference" /> </declare-styleable> <declare-styleable name="SearchView"> Loading core/res/res/values/styles_material.xml +2 −1 Original line number Diff line number Diff line Loading @@ -838,7 +838,7 @@ please see styles_device_defaults.xml. </style> <style name="Widget.Material.ActionButton.CloseMode"> <item name="background">@drawable/btn_cab_done_material</item> <item name="background">?attr/selectableItemBackgroundBorderless</item> </style> <style name="Widget.Material.ActionButton.Overflow"> Loading Loading @@ -901,6 +901,7 @@ please see styles_device_defaults.xml. <style name="Widget.Material.ActionMode" parent="Widget.ActionMode"> <item name="titleTextStyle">@style/TextAppearance.Material.Widget.ActionMode.Title</item> <item name="subtitleTextStyle">@style/TextAppearance.Material.Widget.ActionMode.Subtitle</item> <item name="closeItemLayout">@layout/action_mode_close_item_material</item> </style> <style name="Widget.Material.FastScroll" parent="Widget.FastScroll"> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2001,4 +2001,5 @@ <java-symbol type="id" name="parentMatrix" /> <java-symbol type="bool" name="config_auto_attach_data_on_creation" /> <java-symbol type="id" name="date_picker_month_day_year_layout" /> <java-symbol type="attr" name="closeItemLayout" /> </resources> Loading
core/java/com/android/internal/widget/ActionBarContextView.java +8 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(); } Loading @@ -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); Loading @@ -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); Loading Loading @@ -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); Loading
core/res/res/drawable/ic_cab_done_material.xml→core/res/res/layout/action_mode_close_item_material.xml +11 −4 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2014 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. Loading @@ -14,6 +14,13 @@ limitations under the License. --> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/ic_cab_done_mtrl_alpha" android:tint="?attr/colorControlNormal" /> <ImageButton xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/action_mode_close_button" android:focusable="true" android:clickable="true" android:paddingStart="8dip" android:src="?android:attr/actionModeCloseDrawable" style="?android:attr/actionModeCloseButtonStyle" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_marginEnd="16dip" />
core/res/res/values/attrs.xml +2 −0 Original line number Diff line number Diff line Loading @@ -7117,6 +7117,8 @@ <attr name="backgroundSplit" /> <!-- Specifies a fixed height for the action mode bar. --> <attr name="height" /> <!-- Specifies a layout to use for the "close" item at the starting edge. --> <attr name="closeItemLayout" format="reference" /> </declare-styleable> <declare-styleable name="SearchView"> Loading
core/res/res/values/styles_material.xml +2 −1 Original line number Diff line number Diff line Loading @@ -838,7 +838,7 @@ please see styles_device_defaults.xml. </style> <style name="Widget.Material.ActionButton.CloseMode"> <item name="background">@drawable/btn_cab_done_material</item> <item name="background">?attr/selectableItemBackgroundBorderless</item> </style> <style name="Widget.Material.ActionButton.Overflow"> Loading Loading @@ -901,6 +901,7 @@ please see styles_device_defaults.xml. <style name="Widget.Material.ActionMode" parent="Widget.ActionMode"> <item name="titleTextStyle">@style/TextAppearance.Material.Widget.ActionMode.Title</item> <item name="subtitleTextStyle">@style/TextAppearance.Material.Widget.ActionMode.Subtitle</item> <item name="closeItemLayout">@layout/action_mode_close_item_material</item> </style> <style name="Widget.Material.FastScroll" parent="Widget.FastScroll"> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2001,4 +2001,5 @@ <java-symbol type="id" name="parentMatrix" /> <java-symbol type="bool" name="config_auto_attach_data_on_creation" /> <java-symbol type="id" name="date_picker_month_day_year_layout" /> <java-symbol type="attr" name="closeItemLayout" /> </resources>