本文整理汇总了Java中android.graphics.Shader.TileMode方法的典型用法代码示例。如果您正苦于以下问题:Java Shader.TileMode方法的具体用法?Java Shader.TileMode怎么用?Java Shader.TileMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.graphics.Shader
的用法示例。
在下文中一共展示了Shader.TileMode方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createGradient
import android.graphics.Shader; //导入方法依赖的package包/类
private LinearGradient createGradient(int width, int height) {
Shader.TileMode mode = Shader.TileMode.CLAMP;
switch (mOrientation) {
default:
case TOP_BOTTOM:
return new LinearGradient(width / 2, 0, width / 2, height, mGradient, null, mode);
case TR_BL:
return new LinearGradient(width, 0, 0, height, mGradient, null, mode);
case RIGHT_LEFT:
return new LinearGradient(width, height / 2, 0, height / 2, mGradient, null, mode);
case BR_TL:
return new LinearGradient(width, height, 0, 0, mGradient, null, mode);
case BOTTOM_TOP:
return new LinearGradient(width / 2, height, width / 2, 0, mGradient, null, mode);
case BL_TR:
return new LinearGradient(0, height, width, 0, mGradient, null, mode);
case LEFT_RIGHT:
return new LinearGradient(0, height / 2, width, height / 2, mGradient, null, mode);
case TL_BR:
return new LinearGradient(0, 0, width, height, mGradient, null, mode);
}
}
示例2: setTileModeX
import android.graphics.Shader; //导入方法依赖的package包/类
public RoundedDrawable setTileModeX(Shader.TileMode tileModeX) {
if (mTileModeX != tileModeX) {
mTileModeX = tileModeX;
mRebuildShader = true;
invalidateSelf();
}
return this;
}
示例3: setTileModeY
import android.graphics.Shader; //导入方法依赖的package包/类
public RoundedDrawable setTileModeY(Shader.TileMode tileModeY) {
if (mTileModeY != tileModeY) {
mTileModeY = tileModeY;
mRebuildShader = true;
invalidateSelf();
}
return this;
}
示例4: parseTileMode
import android.graphics.Shader; //导入方法依赖的package包/类
private static Shader.TileMode parseTileMode(int tileMode) {
switch (tileMode) {
case TILE_MODE_CLAMP:
return Shader.TileMode.CLAMP;
case TILE_MODE_REPEAT:
return Shader.TileMode.REPEAT;
case TILE_MODE_MIRROR:
return Shader.TileMode.MIRROR;
default:
return null;
}
}
示例5: setTileModeX
import android.graphics.Shader; //导入方法依赖的package包/类
public void setTileModeX(Shader.TileMode tileModeX) {
if (this.mTileModeX == tileModeX) { return; }
this.mTileModeX = tileModeX;
updateDrawableAttrs();
updateBackgroundDrawableAttrs(false);
invalidate();
}
示例6: setTileModeY
import android.graphics.Shader; //导入方法依赖的package包/类
public void setTileModeY(Shader.TileMode tileModeY) {
if (this.mTileModeY == tileModeY) { return; }
this.mTileModeY = tileModeY;
updateDrawableAttrs();
updateBackgroundDrawableAttrs(false);
invalidate();
}
示例7: linearShader
import android.graphics.Shader; //导入方法依赖的package包/类
@ProtoMethod(description = "Create a linear shader", example = "")
@ProtoMethodParam(params = {"x1", "y1", "x2", "y2", "colorHex1", "colorHex2", "tileMode"})
public Shader linearShader(float x1, float y1, float x2, float y2, String c1, String c2) {
Shader.TileMode mode = Shader.TileMode.REPEAT;
Shader shader = new LinearGradient(x1, y1, x2, y2, Color.parseColor(c1), Color.parseColor(c2), mode);
return shader;
}
示例8: getTileModeX
import android.graphics.Shader; //导入方法依赖的package包/类
public Shader.TileMode getTileModeX() {
return mTileModeX;
}
示例9: getTileModeY
import android.graphics.Shader; //导入方法依赖的package包/类
public Shader.TileMode getTileModeY() {
return mTileModeY;
}
示例10: getTileModeX
import android.graphics.Shader; //导入方法依赖的package包/类
@Override
public Shader.TileMode getTileModeX() {
return mBase.getTileModeX();
}
示例11: getTileModeY
import android.graphics.Shader; //导入方法依赖的package包/类
@Override
public Shader.TileMode getTileModeY() {
return mBase.getTileModeY();
}
示例12: setTileModeX
import android.graphics.Shader; //导入方法依赖的package包/类
@Override
public void setTileModeX(Shader.TileMode mode) {
mBase.setTileModeX(mode);
}
示例13: setTileModeXY
import android.graphics.Shader; //导入方法依赖的package包/类
@Override
public void setTileModeXY(Shader.TileMode xmode, Shader.TileMode ymode) {
mBase.setTileModeXY(xmode, ymode);
}