Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ef16eaa authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Change the CAB to use the up-glyph for closing action modes" into lmp-dev

parents 3bdda955 b2536cf4
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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);
+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.
@@ -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" />
+2 −0
Original line number Diff line number Diff line
@@ -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">
+2 −1
Original line number Diff line number Diff line
@@ -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">
@@ -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">
+1 −0
Original line number Diff line number Diff line
@@ -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