本文整理了Java中android.widget.ImageView.getContext()
方法的一些代码示例,展示了ImageView.getContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.getContext()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:getContext
暂无
代码示例来源:origin: mikepenz/MaterialDrawer
@Override
public void cancel(ImageView imageView) {
Glide.with(imageView.getContext()).clear(imageView);
}
代码示例来源:origin: koral--/android-gif-drawable
static boolean setGifImageUri(ImageView imageView, Uri uri) {
if (uri != null) {
try {
imageView.setImageDrawable(new GifDrawable(imageView.getContext().getContentResolver(), uri));
return true;
} catch (IOException ignored) {
//ignored
}
}
return false;
}
代码示例来源:origin: mikepenz/MaterialDrawer
/**
* @param imageView
* @param uri
* @param tag
* @return false if not consumed
*/
public boolean setImage(ImageView imageView, Uri uri, String tag) {
//if we do not handle all uris and are not http or https we keep the original behavior
if (mHandleAllUris || "http".equals(uri.getScheme()) || "https".equals(uri.getScheme())) {
if (imageLoader != null) {
Drawable placeHolder = imageLoader.placeholder(imageView.getContext(), tag);
imageLoader.set(imageView, uri, placeHolder, tag);
}
return true;
}
return false;
}
代码示例来源:origin: commonsguy/cw-omnibus
void bindModel(Video video) {
title.setText(video.title);
videoUri=video.videoUri;
videoMimeType=video.mimeType;
Picasso.with(thumbnail.getContext())
.load(videoUri.toString())
.fit().centerCrop()
.placeholder(R.drawable.ic_media_video_poster)
.into(thumbnail);
}
}
代码示例来源:origin: commonsguy/cw-omnibus
void showLargeThumbnail(Uri videoUri) {
Picasso.with(thumbnailLarge.getContext())
.load(videoUri.toString())
.fit().centerCrop()
.placeholder(R.drawable.ic_media_video_poster)
.into(thumbnailLarge);
}
代码示例来源:origin: commonsguy/cw-omnibus
private void showLargeThumbnail(Uri videoUri) {
Picasso.with(thumbnailLarge.getContext())
.load(videoUri.toString())
.fit().centerCrop()
.placeholder(R.drawable.ic_media_video_poster)
.into(thumbnailLarge);
}
代码示例来源:origin: commonsguy/cw-omnibus
private void showLargeThumbnail(Uri videoUri) {
Picasso.with(thumbnailLarge.getContext())
.load(videoUri.toString())
.fit().centerCrop()
.placeholder(R.drawable.ic_media_video_poster)
.into(thumbnailLarge);
}
代码示例来源:origin: commonsguy/cw-omnibus
private void showLargeThumbnail(Uri videoUri) {
Picasso.with(thumbnailLarge.getContext())
.load(videoUri.toString())
.fit().centerCrop()
.placeholder(R.drawable.ic_media_video_poster)
.into(thumbnailLarge);
}
代码示例来源:origin: commonsguy/cw-omnibus
private void showLargeThumbnail(Uri videoUri) {
Picasso.with(thumbnailLarge.getContext())
.load(videoUri.toString())
.fit().centerCrop()
.placeholder(R.drawable.ic_media_video_poster)
.into(thumbnailLarge);
}
代码示例来源:origin: yanzhenjie/NoHttp
@Override
public void load(ImageView imageView, String url) {
Glide.with(imageView.getContext())
.load(url)
.placeholder(R.mipmap.placeholder)
.error(R.mipmap.placeholder)
.crossFade()
.into(imageView);
}
}
代码示例来源:origin: commonsguy/cw-omnibus
@Override
void bindModel(Cursor row) {
super.bindModel(row);
Picasso.with(thumbnail.getContext())
.load(videoUri.toString())
.fit().centerCrop()
.placeholder(R.drawable.ic_media_video_poster)
.into(thumbnail);
}
}
代码示例来源:origin: chrisbanes/PhotoView
@Override
public void onFling(float startX, float startY, float velocityX, float velocityY) {
mCurrentFlingRunnable = new FlingRunnable(mImageView.getContext());
mCurrentFlingRunnable.fling(getImageViewWidth(mImageView),
getImageViewHeight(mImageView), (int) velocityX, (int) velocityY);
mImageView.post(mCurrentFlingRunnable);
}
代码示例来源:origin: commonsguy/cw-omnibus
@BindingAdapter({"app:imageUrl", "app:placeholder", "app:error"})
public static void bindImageView(ImageView iv,
String url,
Drawable placeholder,
Drawable error) {
Picasso.with(iv.getContext())
.load(url)
.fit()
.centerCrop()
.placeholder(placeholder)
.error(error)
.into(iv);
}
代码示例来源:origin: commonsguy/cw-omnibus
@BindingAdapter({"app:imageUrl", "app:placeholder", "app:error"})
public static void bindImageView(ImageView iv,
String url,
Drawable placeholder,
Drawable error) {
Picasso.with(iv.getContext())
.load(url)
.fit()
.centerCrop()
.placeholder(placeholder)
.error(error)
.into(iv);
}
代码示例来源:origin: commonsguy/cw-omnibus
@BindingAdapter({"app:imageUrl", "app:placeholder", "app:error"})
public static void bindImageView(ImageView iv,
String url,
Drawable placeholder,
Drawable error) {
Picasso.with(iv.getContext())
.load(url)
.fit()
.centerCrop()
.placeholder(placeholder)
.error(error)
.into(iv);
}
代码示例来源:origin: commonsguy/cw-omnibus
@BindingAdapter({"app:imageUrl", "app:placeholder", "app:error"})
public static void bindImageView(ImageView iv,
String url,
Drawable placeholder,
Drawable error) {
Picasso.with(iv.getContext())
.load(url)
.fit()
.centerCrop()
.placeholder(placeholder)
.error(error)
.into(iv);
}
代码示例来源:origin: mikepenz/MaterialDrawer
@Override
public void set(ImageView imageView, Uri uri, Drawable placeholder, String tag) {
GlideApp.with(imageView.getContext()).load(uri).placeholder(placeholder).into(imageView);
}
代码示例来源:origin: naman14/Timber
public static void loadAlbumArtIntoView(final long albumId, final ImageView view,
final ImageLoadingListener listener) {
if (PreferencesUtility.getInstance(view.getContext()).alwaysLoadAlbumImagesFromLastfm()) {
loadAlbumArtFromLastfm(albumId, view, listener);
} else {
loadAlbumArtFromDiskWithLastfmFallback(albumId, view, listener);
}
}
代码示例来源:origin: androidquery/androidquery
private void presetBitmap(String url, ImageView v){
if(!url.equals(v.getTag(AQuery.TAG_URL)) || preset != null){
v.setTag(AQuery.TAG_URL, url);
if(preset != null && !cacheAvailable(v.getContext())){
setBitmap(url, v, preset, true);
}else{
setBitmap(url, v, null, true);
}
}
}
代码示例来源:origin: mikepenz/MaterialDrawer
/**
* small helper method to set an profile image or a placeholder
*
* @param iv
* @param imageHolder
*/
private void setImageOrPlaceholder(ImageView iv, ImageHolder imageHolder) {
//cancel previous started image loading processes
DrawerImageLoader.getInstance().cancelImage(iv);
//set the placeholder
iv.setImageDrawable(DrawerImageLoader.getInstance().getImageLoader().placeholder(iv.getContext(), DrawerImageLoader.Tags.PROFILE.name()));
//set the real image (probably also the uri)
ImageHolder.applyTo(imageHolder, iv, DrawerImageLoader.Tags.PROFILE.name());
}
内容来源于网络,如有侵权,请联系作者删除!