mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-03 22:48:25 +08:00
Add support for show layout bounds.
Summary: Supports show layout bounds either by override within FlatViewGroup, or if show layout bounds is set in settings. Currently requires app restart to disable. Reviewed By: ahmedre Differential Revision: D3553669
This commit is contained in:
committed by
Ahmed El-Helw
parent
76c2904d31
commit
7df627f9be
@@ -10,6 +10,7 @@
|
||||
package com.facebook.react.flat;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
|
||||
/**
|
||||
* Base class for all DrawCommands. Becomes immutable once it has its bounds set. Until then, a
|
||||
@@ -40,6 +41,26 @@ import android.graphics.Canvas;
|
||||
}
|
||||
}
|
||||
|
||||
protected static int getDebugBorderColor() {
|
||||
return Color.CYAN;
|
||||
}
|
||||
|
||||
protected String getDebugName() {
|
||||
return getClass().getSimpleName().substring(4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debugDraw(FlatViewGroup parent, Canvas canvas) {
|
||||
parent.debugDrawNamedRect(
|
||||
canvas,
|
||||
getDebugBorderColor(),
|
||||
getDebugName(),
|
||||
mLeft,
|
||||
mTop,
|
||||
mRight,
|
||||
mBottom);
|
||||
}
|
||||
|
||||
protected void onPreDraw(FlatViewGroup parent, Canvas canvas) {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user