Avoid extra saveLayer calls in RippleDrawable, fix docs
Also fixes opacity returned from InsetDrawable to accurately reflect the transparent inset area and updates button to correctly use tint. BUG: 18226391 Change-Id: Ia9a88d9d663990a6829d2f251c7f59ea2a79d816
This commit is contained in:
@@ -30,6 +30,7 @@ import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.Insets;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.PorterDuff.Mode;
|
||||
import android.graphics.Rect;
|
||||
import android.util.AttributeSet;
|
||||
@@ -317,7 +318,13 @@ public class InsetDrawable extends Drawable implements Drawable.Callback {
|
||||
|
||||
@Override
|
||||
public int getOpacity() {
|
||||
return mState.mDrawable.getOpacity();
|
||||
final InsetState state = mState;
|
||||
final int opacity = state.mDrawable.getOpacity();
|
||||
if (opacity == PixelFormat.OPAQUE && (state.mInsetLeft > 0 || state.mInsetTop > 0
|
||||
|| state.mInsetRight > 0 || state.mInsetBottom > 0)) {
|
||||
return PixelFormat.TRANSLUCENT;
|
||||
}
|
||||
return opacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user