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

Commit 6356ad35 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Make Drawable#hasFocusStateSpecified public

Bug: 154628299
Test: ColorStateListDrawableTest, DefaultFocusHighlightTest

The system needs this to show keyboard focus. Apps may want to do
something for keyboard focus, and they may also want to write custom
drawables that handle keyboard focus. Making this API public allows them
to do this.

Change-Id: Id6b2df3a14f15db5b7f8ca664362be0b78c3e2c4
parent c8d49eff
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15820,7 +15820,6 @@ package android.graphics.drawable {
    method public void draw(@NonNull android.graphics.Canvas);
    method @NonNull public android.content.res.ColorStateList getColorStateList();
    method public int getOpacity();
    method public boolean hasFocusStateSpecified();
    method public void invalidateDrawable(@NonNull android.graphics.drawable.Drawable);
    method public void scheduleDrawable(@NonNull android.graphics.drawable.Drawable, @NonNull Runnable, long);
    method public void setAlpha(@IntRange(from=0, to=255) int);
@@ -15866,6 +15865,7 @@ package android.graphics.drawable {
    method public boolean getPadding(@NonNull android.graphics.Rect);
    method @NonNull public int[] getState();
    method @Nullable public android.graphics.Region getTransparentRegion();
    method public boolean hasFocusStateSpecified();
    method public void inflate(@NonNull android.content.res.Resources, @NonNull org.xmlpull.v1.XmlPullParser, @NonNull android.util.AttributeSet) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public void inflate(@NonNull android.content.res.Resources, @NonNull org.xmlpull.v1.XmlPullParser, @NonNull android.util.AttributeSet, @Nullable android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public void invalidateSelf();
+0 −4
Original line number Diff line number Diff line
@@ -1166,10 +1166,6 @@ package android.graphics.drawable {
    method public android.graphics.Xfermode getXfermode();
  }

  public abstract class Drawable {
    method public boolean hasFocusStateSpecified();
  }

  public class ShapeDrawable extends android.graphics.drawable.Drawable {
    method public void setXfermode(@Nullable android.graphics.Xfermode);
  }
+0 −1
Original line number Diff line number Diff line
@@ -768,7 +768,6 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback
        return mLayerState.isStateful();
    }

    /** @hide */
    @Override
    public boolean hasFocusStateSpecified() {
        return mLayerState.hasFocusStateSpecified();
+0 −1
Original line number Diff line number Diff line
@@ -760,7 +760,6 @@ public class BitmapDrawable extends Drawable {
                || super.isStateful();
    }

    /** @hide */
    @Override
    public boolean hasFocusStateSpecified() {
        return mBitmapState.mTint != null && mBitmapState.mTint.hasFocusStateSpecified();
+0 −1
Original line number Diff line number Diff line
@@ -238,7 +238,6 @@ public class ColorDrawable extends Drawable {
        return mColorState.mTint != null && mColorState.mTint.isStateful();
    }

    /** @hide */
    @Override
    public boolean hasFocusStateSpecified() {
        return mColorState.mTint != null && mColorState.mTint.hasFocusStateSpecified();
Loading