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

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

Merge "Add support for setting action mode titles/subtitles by resource ID"

parents 589f1555 c9ae2a24
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -177071,6 +177071,19 @@
<parameter name="subtitle" type="java.lang.CharSequence">
</parameter>
</method>
<method name="setSubtitle"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="resId" type="int">
</parameter>
</method>
<method name="setTitle"
 return="void"
 abstract="true"
@@ -177084,6 +177097,19 @@
<parameter name="title" type="java.lang.CharSequence">
</parameter>
</method>
<method name="setTitle"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="resId" type="int">
</parameter>
</method>
</class>
<interface name="ActionMode.Callback"
 abstract="true"
+24 −0
Original line number Diff line number Diff line
@@ -29,20 +29,44 @@ public abstract class ActionMode {
     *
     * @param title Title string to set
     *
     * @see #setTitle(int)
     * @see #setCustomView(View)
     */
    public abstract void setTitle(CharSequence title);

    /**
     * Set the title of the action mode. This method will have no visible effect if
     * a custom view has been set.
     *
     * @param resId Resource ID of a string to set as the title
     *
     * @see #setTitle(CharSequence)
     * @see #setCustomView(View)
     */
    public abstract void setTitle(int resId);

    /**
     * Set the subtitle of the action mode. This method will have no visible effect if
     * a custom view has been set.
     *
     * @param subtitle Subtitle string to set
     *
     * @see #setSubtitle(int)
     * @see #setCustomView(View)
     */
    public abstract void setSubtitle(CharSequence subtitle);

    /**
     * Set the subtitle of the action mode. This method will have no visible effect if
     * a custom view has been set.
     *
     * @param resId Resource ID of a string to set as the subtitle
     *
     * @see #setSubtitle(CharSequence)
     * @see #setCustomView(View)
     */
    public abstract void setSubtitle(int resId);

    /**
     * Set a custom view for this action mode. The custom view will take the place of
     * the title and subtitle. Useful for things like search boxes.
+10 −0
Original line number Diff line number Diff line
@@ -421,6 +421,16 @@ public class ActionBarImpl extends ActionBar {
            mUpperContextView.setTitle(title);
        }

        @Override
        public void setTitle(int resId) {
            setTitle(mActivity.getString(resId));
        }

        @Override
        public void setSubtitle(int resId) {
            setSubtitle(mActivity.getString(resId));
        }

        @Override
        public CharSequence getTitle() {
            return mUpperContextView.getTitle();
+10 −0
Original line number Diff line number Diff line
@@ -57,6 +57,16 @@ public class StandaloneActionMode extends ActionMode implements MenuBuilder.Call
        mContextView.setSubtitle(subtitle);
    }

    @Override
    public void setTitle(int resId) {
        setTitle(mContext.getString(resId));
    }

    @Override
    public void setSubtitle(int resId) {
        setSubtitle(mContext.getString(resId));
    }

    @Override
    public void setCustomView(View view) {
        mContextView.setCustomView(view);