Loading core/java/android/widget/ExpandableListView.java +1 −12 Original line number Diff line number Diff line Loading @@ -185,7 +185,6 @@ public class ExpandableListView extends ListView { /** Drawable to be used as a divider when it is adjacent to any children */ private Drawable mChildDivider; private boolean mClipChildDivider; // Bounds of the indicator to be drawn private final Rect mIndicatorRect = new Rect(); Loading Loading @@ -379,7 +378,6 @@ public class ExpandableListView extends ListView { */ public void setChildDivider(Drawable childDivider) { mChildDivider = childDivider; mClipChildDivider = childDivider != null && childDivider instanceof ColorDrawable; } @Override Loading @@ -396,17 +394,8 @@ public class ExpandableListView extends ListView { pos.groupMetadata.lastChildFlPos != pos.groupMetadata.flPos)) { // These are the cases where we draw the child divider final Drawable divider = mChildDivider; final boolean clip = mClipChildDivider; if (!clip) { divider.setBounds(bounds); } else { canvas.save(); canvas.clipRect(bounds); } divider.draw(canvas); if (clip) { canvas.restore(); } pos.recycle(); return; } Loading core/java/android/widget/ListView.java +1 −15 Original line number Diff line number Diff line Loading @@ -107,7 +107,6 @@ public class ListView extends AbsListView { private boolean mIsCacheColorOpaque; private boolean mDividerIsOpaque; private boolean mClipDivider; private boolean mHeaderDividersEnabled; private boolean mFooterDividersEnabled; Loading Loading @@ -3057,20 +3056,9 @@ public class ListView extends AbsListView { void drawDivider(Canvas canvas, Rect bounds, int childIndex) { // This widget draws the same divider for all children final Drawable divider = mDivider; final boolean clipDivider = mClipDivider; if (!clipDivider) { divider.setBounds(bounds); } else { canvas.save(); canvas.clipRect(bounds); } divider.draw(canvas); if (clipDivider) { canvas.restore(); } } /** Loading @@ -3091,10 +3079,8 @@ public class ListView extends AbsListView { public void setDivider(Drawable divider) { if (divider != null) { mDividerHeight = divider.getIntrinsicHeight(); mClipDivider = divider instanceof ColorDrawable; } else { mDividerHeight = 0; mClipDivider = false; } mDivider = divider; mDividerIsOpaque = divider == null || divider.getOpacity() == PixelFormat.OPAQUE; Loading graphics/java/android/graphics/drawable/ColorDrawable.java +7 −5 Original line number Diff line number Diff line Loading @@ -26,10 +26,8 @@ import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; /** * A specialized Drawable that fills the Canvas with a specified color, * with respect to the clip region. Note that a ColorDrawable ignores the ColorFilter. * It also ignores the Bounds, meaning it will draw everywhere in the current clip, * even if setBounds(...) was called with a smaller area. * A specialized Drawable that fills the Canvas with a specified color. * Note that a ColorDrawable ignores the ColorFilter. * * <p>It can be defined in an XML file with the <code><color></code> element.</p> * Loading @@ -37,6 +35,7 @@ import java.io.IOException; */ public class ColorDrawable extends Drawable { private ColorState mState; private final Paint mPaint = new Paint(); /** * Creates a new black ColorDrawable. Loading Loading @@ -66,7 +65,10 @@ public class ColorDrawable extends Drawable { @Override public void draw(Canvas canvas) { canvas.drawColor(mState.mUseColor); if ((mState.mUseColor >>> 24) != 0) { mPaint.setColor(mState.mUseColor); canvas.drawRect(getBounds(), mPaint); } } /** Loading Loading
core/java/android/widget/ExpandableListView.java +1 −12 Original line number Diff line number Diff line Loading @@ -185,7 +185,6 @@ public class ExpandableListView extends ListView { /** Drawable to be used as a divider when it is adjacent to any children */ private Drawable mChildDivider; private boolean mClipChildDivider; // Bounds of the indicator to be drawn private final Rect mIndicatorRect = new Rect(); Loading Loading @@ -379,7 +378,6 @@ public class ExpandableListView extends ListView { */ public void setChildDivider(Drawable childDivider) { mChildDivider = childDivider; mClipChildDivider = childDivider != null && childDivider instanceof ColorDrawable; } @Override Loading @@ -396,17 +394,8 @@ public class ExpandableListView extends ListView { pos.groupMetadata.lastChildFlPos != pos.groupMetadata.flPos)) { // These are the cases where we draw the child divider final Drawable divider = mChildDivider; final boolean clip = mClipChildDivider; if (!clip) { divider.setBounds(bounds); } else { canvas.save(); canvas.clipRect(bounds); } divider.draw(canvas); if (clip) { canvas.restore(); } pos.recycle(); return; } Loading
core/java/android/widget/ListView.java +1 −15 Original line number Diff line number Diff line Loading @@ -107,7 +107,6 @@ public class ListView extends AbsListView { private boolean mIsCacheColorOpaque; private boolean mDividerIsOpaque; private boolean mClipDivider; private boolean mHeaderDividersEnabled; private boolean mFooterDividersEnabled; Loading Loading @@ -3057,20 +3056,9 @@ public class ListView extends AbsListView { void drawDivider(Canvas canvas, Rect bounds, int childIndex) { // This widget draws the same divider for all children final Drawable divider = mDivider; final boolean clipDivider = mClipDivider; if (!clipDivider) { divider.setBounds(bounds); } else { canvas.save(); canvas.clipRect(bounds); } divider.draw(canvas); if (clipDivider) { canvas.restore(); } } /** Loading @@ -3091,10 +3079,8 @@ public class ListView extends AbsListView { public void setDivider(Drawable divider) { if (divider != null) { mDividerHeight = divider.getIntrinsicHeight(); mClipDivider = divider instanceof ColorDrawable; } else { mDividerHeight = 0; mClipDivider = false; } mDivider = divider; mDividerIsOpaque = divider == null || divider.getOpacity() == PixelFormat.OPAQUE; Loading
graphics/java/android/graphics/drawable/ColorDrawable.java +7 −5 Original line number Diff line number Diff line Loading @@ -26,10 +26,8 @@ import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; /** * A specialized Drawable that fills the Canvas with a specified color, * with respect to the clip region. Note that a ColorDrawable ignores the ColorFilter. * It also ignores the Bounds, meaning it will draw everywhere in the current clip, * even if setBounds(...) was called with a smaller area. * A specialized Drawable that fills the Canvas with a specified color. * Note that a ColorDrawable ignores the ColorFilter. * * <p>It can be defined in an XML file with the <code><color></code> element.</p> * Loading @@ -37,6 +35,7 @@ import java.io.IOException; */ public class ColorDrawable extends Drawable { private ColorState mState; private final Paint mPaint = new Paint(); /** * Creates a new black ColorDrawable. Loading Loading @@ -66,7 +65,10 @@ public class ColorDrawable extends Drawable { @Override public void draw(Canvas canvas) { canvas.drawColor(mState.mUseColor); if ((mState.mUseColor >>> 24) != 0) { mPaint.setColor(mState.mUseColor); canvas.drawRect(getBounds(), mPaint); } } /** Loading