FileDocCategorySizeDatePackage
LinearGradient_Delegate.javaAPI DocAndroid 5.1 API8724Thu Mar 12 22:22:44 GMT 2015android.graphics

LinearGradient_Delegate

public 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}.
see
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.

param
x0 The x-coordinate for the start of the gradient line
param
y0 The y-coordinate for the start of the gradient line
param
x1 The x-coordinate for the end of the gradient line
param
y1 The y-coordinate for the end of the gradient line
param
colors The colors to be distributed along the gradient line
param
positions May be null. The relative positions [0..1] of each corresponding color in the colors array. If this is null, the the colors are distributed evenly along the gradient line.
param
tile The Shader tiling mode

        super(colors, positions);
        mJavaPaint = new LinearGradientPaint(x0, y0, x1, y1, mColors, mPositions, tile);
    
Methods Summary
public java.awt.PaintgetJavaPaint()

        return mJavaPaint;
    
static longnativeCreate1(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 longnativeCreate2(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);