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

Commit ae11a1ab authored by Stevie Kideckel's avatar Stevie Kideckel Committed by Android (Google) Code Review
Browse files

Merge "Enable use of of CompoundButtons in RemoteViews" into sc-dev

parents 65d500d9 c42edd69
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -53349,7 +53349,7 @@ package android.widget {
    method public void onSelectedDayChange(@NonNull android.widget.CalendarView, int, int, int);
  }
  public class CheckBox extends android.widget.CompoundButton {
  @android.widget.RemoteViews.RemoteView public class CheckBox extends android.widget.CompoundButton {
    ctor public CheckBox(android.content.Context);
    ctor public CheckBox(android.content.Context, android.util.AttributeSet);
    ctor public CheckBox(android.content.Context, android.util.AttributeSet, int);
@@ -53415,6 +53415,7 @@ package android.widget {
    method public boolean isChecked();
    method public void setButtonDrawable(@DrawableRes int);
    method public void setButtonDrawable(@Nullable android.graphics.drawable.Drawable);
    method public void setButtonIcon(@Nullable android.graphics.drawable.Icon);
    method public void setButtonTintBlendMode(@Nullable android.graphics.BlendMode);
    method public void setButtonTintList(@Nullable android.content.res.ColorStateList);
    method public void setButtonTintMode(@Nullable android.graphics.PorterDuff.Mode);
@@ -54455,14 +54456,14 @@ package android.widget {
    field protected String[] mExcludeMimes;
  }
  public class RadioButton extends android.widget.CompoundButton {
  @android.widget.RemoteViews.RemoteView public class RadioButton extends android.widget.CompoundButton {
    ctor public RadioButton(android.content.Context);
    ctor public RadioButton(android.content.Context, android.util.AttributeSet);
    ctor public RadioButton(android.content.Context, android.util.AttributeSet, int);
    ctor public RadioButton(android.content.Context, android.util.AttributeSet, int, int);
  }
  public class RadioGroup extends android.widget.LinearLayout {
  @android.widget.RemoteViews.RemoteView public class RadioGroup extends android.widget.LinearLayout {
    ctor public RadioGroup(android.content.Context);
    ctor public RadioGroup(android.content.Context, android.util.AttributeSet);
    method public void check(@IdRes int);
@@ -54584,6 +54585,7 @@ package android.widget {
    method public void setChronometerCountDown(@IdRes int, boolean);
    method public void setColor(@IdRes int, @NonNull String, @ColorRes int);
    method public void setColorStateList(@IdRes int, @NonNull String, @ColorRes int);
    method public void setCompoundButtonChecked(@IdRes int, boolean);
    method public void setContentDescription(@IdRes int, CharSequence);
    method public void setDisplayedChild(@IdRes int, int);
    method public void setDouble(@IdRes int, String, double);
@@ -54608,6 +54610,7 @@ package android.widget {
    method public void setOnClickResponse(@IdRes int, @NonNull android.widget.RemoteViews.RemoteResponse);
    method public void setPendingIntentTemplate(@IdRes int, android.app.PendingIntent);
    method public void setProgressBar(@IdRes int, int, int, boolean);
    method public void setRadioGroupChecked(@IdRes int, @IdRes int);
    method public void setRelativeScrollPosition(@IdRes int, int);
    method @Deprecated public void setRemoteAdapter(int, @IdRes int, android.content.Intent);
    method public void setRemoteAdapter(@IdRes int, android.content.Intent);
@@ -54974,7 +54977,7 @@ package android.widget {
    ctor public StackView(android.content.Context, android.util.AttributeSet, int, int);
  }
  public class Switch extends android.widget.CompoundButton {
  @android.widget.RemoteViews.RemoteView public class Switch extends android.widget.CompoundButton {
    ctor public Switch(android.content.Context);
    ctor public Switch(android.content.Context, android.util.AttributeSet);
    ctor public Switch(android.content.Context, android.util.AttributeSet, int);
@@ -55005,12 +55008,14 @@ package android.widget {
    method public void setTextOff(CharSequence);
    method public void setTextOn(CharSequence);
    method public void setThumbDrawable(android.graphics.drawable.Drawable);
    method public void setThumbIcon(@Nullable android.graphics.drawable.Icon);
    method public void setThumbResource(@DrawableRes int);
    method public void setThumbTextPadding(int);
    method public void setThumbTintBlendMode(@Nullable android.graphics.BlendMode);
    method public void setThumbTintList(@Nullable android.content.res.ColorStateList);
    method public void setThumbTintMode(@Nullable android.graphics.PorterDuff.Mode);
    method public void setTrackDrawable(android.graphics.drawable.Drawable);
    method public void setTrackIcon(@Nullable android.graphics.drawable.Icon);
    method public void setTrackResource(@DrawableRes int);
    method public void setTrackTintBlendMode(@Nullable android.graphics.BlendMode);
    method public void setTrackTintList(@Nullable android.content.res.ColorStateList);
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.RemoteViews.RemoteView;

/**
 * <p>
@@ -52,6 +53,7 @@ import android.util.AttributeSet;
 * {@link android.R.styleable#View View Attributes}
 * </p>
 */
@RemoteView
public class CheckBox extends CompoundButton {
    public CheckBox(Context context) {
        this(context, null);
+28 −0
Original line number Diff line number Diff line
@@ -27,11 +27,13 @@ import android.graphics.BlendMode;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Gravity;
import android.view.RemotableViewMethod;
import android.view.SoundEffectConstants;
import android.view.ViewDebug;
import android.view.ViewHierarchyEncoder;
@@ -275,6 +277,7 @@ public abstract class CompoundButton extends Button implements Checkable {
     * @param resId the resource identifier of the drawable
     * @attr ref android.R.styleable#CompoundButton_button
     */
    @RemotableViewMethod(asyncImpl = "setButtonDrawableAsync")
    public void setButtonDrawable(@DrawableRes int resId) {
        final Drawable d;
        if (resId != 0) {
@@ -285,6 +288,12 @@ public abstract class CompoundButton extends Button implements Checkable {
        setButtonDrawable(d);
    }

    /** @hide **/
    public Runnable setButtonDrawableAsync(@DrawableRes int resId) {
        Drawable drawable = resId == 0 ? null : getContext().getDrawable(resId);
        return () -> setButtonDrawable(drawable);
    }

    /**
     * Sets a drawable as the compound button image.
     *
@@ -335,6 +344,23 @@ public abstract class CompoundButton extends Button implements Checkable {
        return mButtonDrawable;
    }

    /**
     * Sets the button of this CompoundButton to the specified Icon.
     *
     * @param icon an Icon holding the desired button, or {@code null} to clear
     *             the button
     */
    @RemotableViewMethod(asyncImpl = "setButtonIconAsync")
    public void setButtonIcon(@Nullable Icon icon) {
        setButtonDrawable(icon == null ? null : icon.loadDrawable(getContext()));
    }

    /** @hide **/
    public Runnable setButtonIconAsync(@Nullable Icon icon) {
        Drawable button = icon == null ? null : icon.loadDrawable(getContext());
        return () -> setButtonDrawable(button);
    }

    /**
     * Applies a tint to the button drawable. Does not modify the current tint
     * mode, which is {@link PorterDuff.Mode#SRC_IN} by default.
@@ -350,6 +376,7 @@ public abstract class CompoundButton extends Button implements Checkable {
     * @see #setButtonTintList(ColorStateList)
     * @see Drawable#setTintList(ColorStateList)
     */
    @RemotableViewMethod
    public void setButtonTintList(@Nullable ColorStateList tint) {
        mButtonTintList = tint;
        mHasButtonTint = true;
@@ -394,6 +421,7 @@ public abstract class CompoundButton extends Button implements Checkable {
     * @see #getButtonTintMode()
     * @see Drawable#setTintBlendMode(BlendMode)
     */
    @RemotableViewMethod
    public void setButtonTintBlendMode(@Nullable BlendMode tintMode) {
        mButtonBlendMode = tintMode;
        mHasButtonBlendMode = true;
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.annotation.NonNull;
import android.content.Context;
import android.util.AttributeSet;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.RemoteViews.RemoteView;

import com.android.internal.R;

@@ -49,6 +50,7 @@ import com.android.internal.R;
 * {@link android.R.styleable#View View Attributes}
 * </p>
 */
@RemoteView
public class RadioButton extends CompoundButton {

    public RadioButton(Context context) {
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.view.ViewStructure;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.autofill.AutofillManager;
import android.view.autofill.AutofillValue;
import android.widget.RemoteViews.RemoteView;

import com.android.internal.R;

@@ -59,6 +60,7 @@ import com.android.internal.R;
 * @see RadioButton
 *
 */
@RemoteView
public class RadioGroup extends LinearLayout {
    private static final String LOG_TAG = RadioGroup.class.getSimpleName();

Loading