Pass FlatViewGroup to DrawCommand.draw()
Summary: @public To render `View`s inside `FlatViewGroup`, we need to pass the parent to `DrawCommand.draw()` method. Used in a followup diff. Reviewed By: sriramramani Differential Revision: D2564478
This commit is contained in:
parent
f19acaed4b
commit
7db444c9ae
|
@ -26,7 +26,7 @@ import android.graphics.Paint;
|
|||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
public void draw(FlatViewGroup parent, Canvas canvas) {
|
||||
PAINT.setColor(mBackgroundColor);
|
||||
canvas.drawRect(getLeft(), getTop(), getRight(), getBottom(), PAINT);
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ import com.facebook.csslayout.Spacing;
|
|||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
public void draw(FlatViewGroup parent, Canvas canvas) {
|
||||
if (getBorderRadius() >= 0.5f) {
|
||||
drawRoundedBorders(canvas);
|
||||
} else {
|
||||
|
|
|
@ -25,5 +25,5 @@ public interface DrawCommand {
|
|||
*
|
||||
* @param canvas The canvas to draw into
|
||||
*/
|
||||
public void draw(Canvas canvas);
|
||||
public void draw(FlatViewGroup parent, Canvas canvas);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ import com.facebook.react.views.image.ImageResizeMode;
|
|||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
public void draw(FlatViewGroup parent, Canvas canvas) {
|
||||
Bitmap bitmap = Assertions.assumeNotNull(mBitmapRequestHelper).getBitmap();
|
||||
if (bitmap == null) {
|
||||
return;
|
||||
|
|
|
@ -31,7 +31,7 @@ import android.text.Layout;
|
|||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
public void draw(FlatViewGroup parent, Canvas canvas) {
|
||||
float left = getLeft();
|
||||
float top = getTop();
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ import android.view.ViewGroup;
|
|||
super.dispatchDraw(canvas);
|
||||
|
||||
for (DrawCommand drawCommand : mDrawCommands) {
|
||||
drawCommand.draw(canvas);
|
||||
drawCommand.draw(this, canvas);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue