LinearGradient_Delegatepublic final class LinearGradient_Delegate extends Gradient_Delegate Delegate implementing the native methods of android.graphics.LinearGradient
Through the layoutlib_create tool, the original native methods of LinearGradient have been
replaced by calls to methods of the same name in this delegate class.
This class behaves like the original native implementation, but in Java, keeping previously
native data into its own objects and mapping them to int that are sent back and forth between
it and the original LinearGradient class.
Because this extends {@link Shader_Delegate}, there's no need to use a {@link DelegateManager},
as all the Shader classes will be added to the manager owned by {@link Shader_Delegate}. |
Fields Summary |
---|
private Paint | mJavaPaint |
Constructors Summary |
---|
private LinearGradient_Delegate(float x0, float y0, float x1, float y1, int[] colors, float[] positions, android.graphics.Shader.TileMode tile)Create a shader that draws a linear gradient along a line.
super(colors, positions);
mJavaPaint = new LinearGradientPaint(x0, y0, x1, y1, mColors, mPositions, tile);
|
Methods Summary |
---|
public java.awt.Paint | getJavaPaint()
return mJavaPaint;
| static long | nativeCreate1(LinearGradient thisGradient, float x0, float y0, float x1, float y1, int[] colors, float[] positions, int tileMode)
LinearGradient_Delegate newDelegate = new LinearGradient_Delegate(x0, y0, x1, y1,
colors, positions, Shader_Delegate.getTileMode(tileMode));
return sManager.addNewDelegate(newDelegate);
| static long | nativeCreate2(LinearGradient thisGradient, float x0, float y0, float x1, float y1, int color0, int color1, int tileMode)
return nativeCreate1(thisGradient,
x0, y0, x1, y1, new int[] { color0, color1}, null /*positions*/,
tileMode);
|
|