本文整理匯總了Java中android.graphics.drawable.Drawable.setDither方法的典型用法代碼示例。如果您正苦於以下問題:Java Drawable.setDither方法的具體用法?Java Drawable.setDither怎麽用?Java Drawable.setDither使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.graphics.drawable.Drawable
的用法示例。
在下文中一共展示了Drawable.setDither方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: applyTo
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
@SuppressLint("Range")
public void applyTo(Drawable drawable) {
if (drawable == null) {
return;
}
if (mAlpha != UNSET) {
drawable.setAlpha(mAlpha);
}
if (mIsSetColorFilter) {
drawable.setColorFilter(mColorFilter);
}
if (mDither != UNSET) {
drawable.setDither(mDither != 0);
}
if (mFilterBitmap != UNSET) {
drawable.setFilterBitmap(mFilterBitmap != 0);
}
}
示例2: setImageBitmap
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
private void setImageBitmap(Bitmap bitmap, int rotation) {
super.setImageBitmap(bitmap);
Drawable d = getDrawable();
if (d != null) {
d.setDither(true);
}
Bitmap old = mBitmapDisplayed.getBitmap();
mBitmapDisplayed.setBitmap(bitmap);
mBitmapDisplayed.setRotation(rotation);
if (old != null && old != bitmap && mRecycler != null) {
mRecycler.recycle(old);
}
}
示例3: createImageTileView
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public static View createImageTileView(LayoutInflater layoutInflater,
View convertView, ViewGroup parent, Drawable thumb) {
View view;
if (convertView == null) {
view = layoutInflater.inflate(R.layout.wallpaper_picker_item, parent, false);
} else {
view = convertView;
}
ImageView image = (ImageView) view.findViewById(R.id.wallpaper_image);
if (thumb != null) {
image.setImageDrawable(thumb);
thumb.setDither(true);
}
return view;
}
示例4: setDither
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
@Override
public void setDither(boolean dither) {
mDrawableProperties.setDither(dither);
for (int i = 0; i < mLayers.length; i++) {
Drawable drawable = mLayers[i];
if (drawable != null) {
drawable.setDither(dither);
}
}
}
示例5: setImageBitmap
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
private void setImageBitmap(Bitmap bitmap, int rotation) {
super.setImageBitmap(bitmap);
Drawable d = getDrawable();
if (d != null) {
d.setDither(true);
}
Bitmap old = bitmapDisplayed.getBitmap();
bitmapDisplayed.setBitmap(bitmap);
bitmapDisplayed.setRotation(rotation);
if (old != null && old != bitmap && recycler != null) {
recycler.recycle(old);
}
}
示例6: setThumb
import android.graphics.drawable.Drawable; //導入方法依賴的package包/類
public void setThumb(Drawable thumb) {
if (mView != null && thumb != null) {
thumb.setDither(true);
ImageView image = (ImageView) mView.findViewById(R.id.wallpaper_image);
image.setImageDrawable(thumb);
}
}