本文整理匯總了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);
}