本文整理匯總了Java中android.graphics.drawable.Drawable.setAutoMirrored方法的典型用法代碼示例。如果您正苦於以下問題:Java Drawable.setAutoMirrored方法的具體用法?Java Drawable.setAutoMirrored怎麽用?Java Drawable.setAutoMirrored使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.graphics.drawable.Drawable
的用法示例。
在下文中一共展示了Drawable.setAutoMirrored方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addCrumb
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public void addCrumb(@NonNull Crumb crumb, boolean refreshLayout) {
LinearLayout view = (LinearLayout) LayoutInflater.from(getContext()).inflate(R.layout.layout_bread_crumb, this, false);
view.setTag(mCrumbs.size());
view.setOnClickListener(this);
ImageView iv = (ImageView) view.getChildAt(1);
Drawable arrow = getResources().getDrawable(R.mipmap.ic_right_arrow);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (arrow != null) {
arrow.setAutoMirrored(true);
}
}
iv.setImageDrawable(arrow);
iv.setVisibility(View.GONE);
mChildFrame.addView(view, new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
mCrumbs.add(crumb);
if (refreshLayout) {
mActive = mCrumbs.size() - 1;
requestLayout();
}
invalidateActivatedAll();
}
示例2: getIllustration
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
@SuppressLint("RtlHardcoded")
private Drawable getIllustration(Drawable asset, Drawable horizontalTile) {
final Context context = getContext();
if (context.getResources().getBoolean(R.bool.suwUseTabletLayout)) {
// If it is a "tablet" (sw600dp), create a LayerDrawable with the horizontal tile.
if (horizontalTile instanceof BitmapDrawable) {
((BitmapDrawable) horizontalTile).setTileModeX(TileMode.REPEAT);
((BitmapDrawable) horizontalTile).setGravity(Gravity.TOP);
}
if (asset instanceof BitmapDrawable) {
// Always specify TOP | LEFT, Illustration will flip the entire LayerDrawable.
((BitmapDrawable) asset).setGravity(Gravity.TOP | Gravity.LEFT);
}
final LayerDrawable layers =
new LayerDrawable(new Drawable[] { horizontalTile, asset });
if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
layers.setAutoMirrored(true);
}
return layers;
} else {
// If it is a "phone" (not sw600dp), simply return the illustration
if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {
asset.setAutoMirrored(true);
}
return asset;
}
}
示例3: setAutoMirrored
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public static void setAutoMirrored(Drawable drawable, boolean mirrored) {
drawable.setAutoMirrored(mirrored);
}