use of com.android.tools.layoutlib.annotations.LayoutlibDelegate in project platform_frameworks_base by android.
the class Region_Delegate method nativeOp.
@LayoutlibDelegate
static /*package*/
boolean nativeOp(long native_dst, Rect rect, long native_region, int op) {
Region_Delegate region = sManager.getDelegate(native_dst);
if (region == null) {
return false;
}
region.mArea = combineShapes(region.mArea, new Rectangle2D.Float(rect.left, rect.top, rect.width(), rect.height()), op);
assert region.mArea != null;
if (region.mArea != null) {
region.mArea = new Area();
}
return region.mArea.getBounds().isEmpty() == false;
}
use of com.android.tools.layoutlib.annotations.LayoutlibDelegate in project platform_frameworks_base by android.
the class Region_Delegate method nativeGetBounds.
@LayoutlibDelegate
static /*package*/
boolean nativeGetBounds(long native_region, Rect rect) {
Region_Delegate region = sManager.getDelegate(native_region);
if (region == null) {
return true;
}
Rectangle bounds = region.mArea.getBounds();
if (bounds.isEmpty()) {
rect.left = rect.top = rect.right = rect.bottom = 0;
return false;
}
rect.left = bounds.x;
rect.top = bounds.y;
rect.right = bounds.x + bounds.width;
rect.bottom = bounds.y + bounds.height;
return true;
}
use of com.android.tools.layoutlib.annotations.LayoutlibDelegate in project platform_frameworks_base by android.
the class AnimatedVectorDrawable_Delegate method nCreateGroupPropertyHolder.
@LayoutlibDelegate
static /*package*/
long nCreateGroupPropertyHolder(long nativePtr, int propertyId, float startValue, float endValue) {
VGroup_Delegate group = VNativeObject.getDelegate(nativePtr);
Consumer<Float> setter = group.getPropertySetter(propertyId);
return sHolders.addNewDelegate(FloatPropertySetter.of(setter, startValue, endValue));
}
use of com.android.tools.layoutlib.annotations.LayoutlibDelegate in project platform_frameworks_base by android.
the class AnimatedVectorDrawable_Delegate method nCreatePathColorPropertyHolder.
@LayoutlibDelegate
static /*package*/
long nCreatePathColorPropertyHolder(long nativePtr, int propertyId, int startValue, int endValue) {
VFullPath_Delegate path = VNativeObject.getDelegate(nativePtr);
Consumer<Integer> setter = path.getIntPropertySetter(propertyId);
return sHolders.addNewDelegate(IntPropertySetter.of(setter, startValue, endValue));
}
use of com.android.tools.layoutlib.annotations.LayoutlibDelegate in project platform_frameworks_base by android.
the class AnimatedVectorDrawable_Delegate method nCreatePathPropertyHolder.
@LayoutlibDelegate
static /*package*/
long nCreatePathPropertyHolder(long nativePtr, int propertyId, float startValue, float endValue) {
VFullPath_Delegate path = VNativeObject.getDelegate(nativePtr);
Consumer<Float> setter = path.getFloatPropertySetter(propertyId);
return sHolders.addNewDelegate(FloatPropertySetter.of(setter, startValue, endValue));
}
Aggregations