本文整理匯總了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;
}
}
示例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;
}
}
示例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;
}
示例4: setDrawableLayoutDirection
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
private static boolean setDrawableLayoutDirection(Drawable drawable, int layoutDirection) {
return Util.SDK_INT >= 23 && drawable.setLayoutDirection(layoutDirection);
}
示例5: setDrawableLayoutDirection
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
private static boolean setDrawableLayoutDirection(Drawable drawable, int layoutDirection) {
return Util.SDK_INT >= 23 && drawable.setLayoutDirection(layoutDirection);
}
示例6: setLayoutDirection
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public static void setLayoutDirection(Drawable drawable, int layoutDirection) {
drawable.setLayoutDirection(layoutDirection);
}