Merge "Implement alpha as documented for drawables" into lmp-dev
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package android.graphics.drawable;
|
package android.graphics.drawable;
|
||||||
|
|
||||||
|
import android.annotation.NonNull;
|
||||||
import android.graphics.*;
|
import android.graphics.*;
|
||||||
import android.graphics.PorterDuff.Mode;
|
import android.graphics.PorterDuff.Mode;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
@@ -210,6 +211,12 @@ public class ColorDrawable extends Drawable {
|
|||||||
return PixelFormat.TRANSLUCENT;
|
return PixelFormat.TRANSLUCENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getOutline(@NonNull Outline outline) {
|
||||||
|
outline.setRect(getBounds());
|
||||||
|
outline.setAlpha(getAlpha() / 255.0f);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme)
|
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme)
|
||||||
throws XmlPullParserException, IOException {
|
throws XmlPullParserException, IOException {
|
||||||
|
|||||||
@@ -895,7 +895,7 @@ public abstract class Drawable {
|
|||||||
*/
|
*/
|
||||||
public void getOutline(@NonNull Outline outline) {
|
public void getOutline(@NonNull Outline outline) {
|
||||||
outline.setRect(getBounds());
|
outline.setRect(getBounds());
|
||||||
outline.setAlpha(getAlpha() / 255.0f);
|
outline.setAlpha(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user