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


Java Drawable.setLayoutDirection方法代碼示例

本文整理匯總了Java中android.graphics.drawable.Drawable.setLayoutDirection方法的典型用法代碼示例。如果您正苦於以下問題:Java Drawable.setLayoutDirection方法的具體用法?Java Drawable.setLayoutDirection怎麽用?Java Drawable.setLayoutDirection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.graphics.drawable.Drawable的用法示例。


在下文中一共展示了Drawable.setLayoutDirection方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateDrawable

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
private void updateDrawable(Drawable d) {
        if (mDrawable != null) {
            mDrawable.setCallback(null);
            unscheduleDrawable(mDrawable);
            if (isAttachedWindow) {
                mDrawable.setVisible(false, false);
            }
        }
        mDrawable = d;

        if (d != null) {
            d.setCallback(this);
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                d.setLayoutDirection(getLayoutDirection());
            }
            if (d.isStateful()) {
                d.setState(getDrawableState());
            }
            if (isAttachedWindow) {
                d.setVisible(getWindowVisibility() == VISIBLE && isShown(), true);
            }
            d.setLevel(mLevel);
            mDrawableWidth = d.getIntrinsicWidth();
            mDrawableHeight = d.getIntrinsicHeight();
//            applyImageTint();
//            applyColorMod();
//
//            configureBounds();
        } else {
            mDrawableWidth = mDrawableHeight = -1;
        }
    }
 
開發者ID:jeasinlee,項目名稱:AndroidBasicLibs,代碼行數:33,代碼來源:LargeImageView.java

示例2: updateDrawable

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
private void updateDrawable(Drawable d) {
        boolean sameDrawable = false;
        boolean sCompatDrawableVisibilityDispatch = false;

        if (mDrawable != null) {
            sameDrawable = mDrawable == d;
            mDrawable.setCallback(null);
            unscheduleDrawable(mDrawable);
            if (!sCompatDrawableVisibilityDispatch && !sameDrawable && isAttachedWindow) {
                mDrawable.setVisible(false, false);
            }
        }

        mDrawable = d;

        if (d != null) {
            d.setCallback(this);
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                d.setLayoutDirection(getLayoutDirection());
            }
            if (d.isStateful()) {
                d.setState(getDrawableState());
            }
            if (!sameDrawable || sCompatDrawableVisibilityDispatch) {
                final boolean visible = sCompatDrawableVisibilityDispatch
                        ? getVisibility() == VISIBLE
                        : isAttachedWindow && getWindowVisibility() == VISIBLE && isShown();
                d.setVisible(visible, true);
            }
            d.setLevel(mLevel);
            mDrawableWidth = d.getIntrinsicWidth();
            mDrawableHeight = d.getIntrinsicHeight();
//            applyImageTint();
//            applyColorMod();
//
//            configureBounds();
        } else {
            mDrawableWidth = mDrawableHeight = -1;
        }
    }
 
開發者ID:jeasinlee,項目名稱:AndroidBasicLibs,代碼行數:41,代碼來源:UpdateImageView.java

示例3: addDrawable

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
/**
 * 添加drawable, 如果id已經存在, drawable將會被替換
 *
 * @param id       the drawable id.
 * @param drawable the drawable.
 * @return <code>true</code> - 如果添加成功, <code>false</code> - 其他
 */
public boolean addDrawable(int id, @NonNull Drawable drawable) {
    DrawableInfo old = findAvatarDrawableById(id);
    if (old != null) {
        Drawable d = old.mDrawable;
        old.mDrawable = drawable;
        if (!hasSameDrawable(d)) {
            cleanDrawable(d);
        }
        updateDrawableBounds(old);
    } else {
        if (getNumberOfDrawables() >= MAX_DRAWABLE_COUNT) {
            return false;
        }

        mDrawables.add(crateAvatarDrawable(id, drawable));
        layoutDrawables();
    }

    drawable.setCallback(this);
    drawable.setVisible(getWindowVisibility() == VISIBLE && isShown(), true);
    if (drawable.isStateful()) {
        drawable.setState(getDrawableState());
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        drawable.setLayoutDirection(getLayoutDirection());
    }
    invalidate();

    return true;
}
 
開發者ID:YiiGuxing,項目名稱:CompositionAvatar,代碼行數:38,代碼來源:CompositionAvatarView.java

示例4: setDrawableLayoutDirection

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
private static boolean setDrawableLayoutDirection(Drawable drawable, int layoutDirection) {
  return Util.SDK_INT >= 23 && drawable.setLayoutDirection(layoutDirection);
}
 
開發者ID:yangchaojiang,項目名稱:yjPlay,代碼行數:4,代碼來源:DefaultTimeBar.java

示例5: setDrawableLayoutDirection

import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
private static boolean setDrawableLayoutDirection(Drawable drawable, int layoutDirection) {
    return Util.SDK_INT >= 23 && drawable.setLayoutDirection(layoutDirection);
}
 
開發者ID:rubensousa,項目名稱:PreviewSeekBar,代碼行數:4,代碼來源:CustomTimeBar.java

示例6: setLayoutDirection

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


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