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