當前位置: 首頁>>代碼示例>>Java>>正文


Java Drawable.setAutoMirrored方法代碼示例

本文整理匯總了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();
}
 
開發者ID:Jusenr,項目名稱:androidgithub,代碼行數:25,代碼來源:LinearBreadcrumbView.java

示例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;
    }
}
 
開發者ID:Trumeet,項目名稱:SetupWizardLibCompat,代碼行數:28,代碼來源:SetupWizardLayout.java

示例3: setAutoMirrored

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public static void setAutoMirrored(Drawable drawable, boolean mirrored) {
    drawable.setAutoMirrored(mirrored);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:4,代碼來源:DrawableCompatKitKat.java


注:本文中的android.graphics.drawable.Drawable.setAutoMirrored方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。