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
|
@Override
|
||||||
public void draw(Canvas canvas) {
|
public void draw(FlatViewGroup parent, Canvas canvas) {
|
||||||
PAINT.setColor(mBackgroundColor);
|
PAINT.setColor(mBackgroundColor);
|
||||||
canvas.drawRect(getLeft(), getTop(), getRight(), getBottom(), PAINT);
|
canvas.drawRect(getLeft(), getTop(), getRight(), getBottom(), PAINT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ import com.facebook.csslayout.Spacing;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Canvas canvas) {
|
public void draw(FlatViewGroup parent, Canvas canvas) {
|
||||||
if (getBorderRadius() >= 0.5f) {
|
if (getBorderRadius() >= 0.5f) {
|
||||||
drawRoundedBorders(canvas);
|
drawRoundedBorders(canvas);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -25,5 +25,5 @@ public interface DrawCommand {
|
||||||
*
|
*
|
||||||
* @param canvas The canvas to draw into
|
* @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
|
@Override
|
||||||
public void draw(Canvas canvas) {
|
public void draw(FlatViewGroup parent, Canvas canvas) {
|
||||||
Bitmap bitmap = Assertions.assumeNotNull(mBitmapRequestHelper).getBitmap();
|
Bitmap bitmap = Assertions.assumeNotNull(mBitmapRequestHelper).getBitmap();
|
||||||
if (bitmap == null) {
|
if (bitmap == null) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -31,7 +31,7 @@ import android.text.Layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Canvas canvas) {
|
public void draw(FlatViewGroup parent, Canvas canvas) {
|
||||||
float left = getLeft();
|
float left = getLeft();
|
||||||
float top = getTop();
|
float top = getTop();
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ import android.view.ViewGroup;
|
||||||
super.dispatchDraw(canvas);
|
super.dispatchDraw(canvas);
|
||||||
|
|
||||||
for (DrawCommand drawCommand : mDrawCommands) {
|
for (DrawCommand drawCommand : mDrawCommands) {
|
||||||
drawCommand.draw(canvas);
|
drawCommand.draw(this, canvas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue