本文整理了Java中android.widget.ImageView.getTag()
方法的一些代码示例,展示了ImageView.getTag()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.getTag()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:getTag
暂无
代码示例来源:origin: GitLqr/LQRWeChat
@Override
protected void onPostExecute(Bitmap bitmap) {
if (imgView.getTag() != null && imgView.getTag().equals(path)) {
imgView.setImageBitmap(bitmap);
}
}
}
代码示例来源:origin: GitLqr/LQRWeChat
public void handleMessage(Message msg) {
if (imgView.getTag().equals(path)) {
Bitmap btp = (Bitmap) msg.obj;
imgView.setImageBitmap(btp);
}
}
};
代码示例来源:origin: stackoverflow.com
public class DownloadImagesTask extends AsyncTask<ImageView, Void, Bitmap> {
ImageView imageView = null;
@Override
protected Bitmap doInBackground(ImageView... imageViews) {
this.imageView = imageViews[0];
return download_Image((String)imageView.getTag());
}
@Override
protected void onPostExecute(Bitmap result) {
imageView.setImageBitmap(result);
}
private Bitmap download_Image(String url) {
...
}
代码示例来源:origin: naman14/Timber
@Override
public void onClick(View v) {
NavigationUtils.navigateToPlaylistDetail(mContext, getPlaylistType(getAdapterPosition()), (long) albumArt.getTag(), String.valueOf(title.getText()), foregroundColor, arraylist.get(getAdapterPosition()).id, null);
}
代码示例来源:origin: androidquery/androidquery
private void checkCb(BitmapAjaxCallback cb, String url, ImageView v, Bitmap bm, AjaxStatus status){
if(v == null || cb == null) return;
if(url.equals(v.getTag(AQuery.TAG_URL))){
if(v instanceof ImageView){
cb.callback(url, (ImageView) v, bm, status);
}else{
cb.setBitmap(url, v, bm, false);
}
}
cb.showProgress(false);
}
代码示例来源: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: stackoverflow.com
Log.e("Tag",""+imageView.getTag());
代码示例来源:origin: facebook/facebook-android-sdk
private void processImageResponse(ImageResponse response, String graphObjectId, ImageView imageView) {
pendingRequests.remove(graphObjectId);
if (response.getError() != null) {
callOnErrorListener(response.getError());
}
if (imageView == null) {
// This was a pre-fetch request.
if (response.getBitmap() != null) {
// Is the cache too big?
if (prefetchedPictureCache.size() >= MAX_PREFETCHED_PICTURES) {
// Find the oldest one and remove it.
String oldestId = prefetchedProfilePictureIds.remove(0);
prefetchedPictureCache.remove(oldestId);
}
prefetchedPictureCache.put(graphObjectId, response);
}
} else if (graphObjectId.equals(imageView.getTag())) {
Exception error = response.getError();
Bitmap bitmap = response.getBitmap();
if (error == null && bitmap != null) {
imageView.setImageBitmap(bitmap);
imageView.setTag(response.getRequest().getImageUri());
}
}
}
代码示例来源:origin: alibaba/Tangram-Android
public void setCurrItem(int position) {
if (mImageViews != null) {
for (int i = 0; i < mImageViews.length; i++) {
if (style == STYLE_DOT) {
mImageViews[i].setImageDrawable(getGradientDrawable(position == i ? focusColor : norColor, radius));
} else if (style == STYLE_IMG) {
ImageView imageView = mImageViews[i];
if (imageView.getTag(R.id.TANGRAM_BANNER_INDICATOR_POS) == null) {
continue;
} else {
imageView.setTag(R.id.TANGRAM_BANNER_INDICATOR_POS, null);
ImageUtils.doLoadImageUrl(imageView, norUrl);
}
}
}
mImageViews[currentItemPos].setTag(R.id.TANGRAM_BANNER_INDICATOR_POS, currentItemPos);
if (style == STYLE_IMG) {
ImageUtils.doLoadImageUrl(mImageViews[currentItemPos], focusUrl);
}
}
}
代码示例来源:origin: alibaba/Tangram-Android
public void setCurrItem(int position) {
if (mImageViews != null) {
for (int i = 0; i < mImageViews.length; i++) {
if (style == STYLE_DOT) {
mImageViews[i].setImageDrawable(getGradientDrawable(position == i ? focusColor : norColor, radius));
} else if (style == STYLE_IMG){
ImageView imageView = mImageViews[i];
if (imageView.getTag(R.id.TANGRAM_BANNER_INDICATOR_POS) == null) {
continue;
} else {
imageView.setTag(R.id.TANGRAM_BANNER_INDICATOR_POS, null);
ImageUtils.doLoadImageUrl(imageView, norUrl);
}
}
}
mImageViews[currentItemPos].setTag(R.id.TANGRAM_BANNER_INDICATOR_POS, currentItemPos);
if (style == STYLE_IMG) {
ImageUtils.doLoadImageUrl(mImageViews[currentItemPos], focusUrl);
}
}
}
代码示例来源:origin: facebook/facebook-android-sdk
if (prefetching || !pictureUri.equals(imageView.getTag())) {
if (!prefetching) {
代码示例来源:origin: stackoverflow.com
ImageView view = (ImageView) findViewById(R.id.someImage);
view.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
ImageView imageView = (ImageView) view;
assert(R.id.someImage == imageView.getId());
Integer integer = (Integer) imageView.getTag();
integer = integer == null ? 0 : integer;
switch(integer) {
case R.drawable.foo:
imageView.setDrawableResource(R.drawable.bar);
imageView.setTag(R.drawable.bar);
break;
case R.drawable.bar:
default:
imageView.setDrawableResource(R.drawable.foo);
imageView.setTag(R.drawable.foo);
break;
}
});
代码示例来源:origin: alibaba/Tangram-Android
for (int i = 0; i < mImageViews.length; i++) {
ImageView imageView = mImageViews[i];
if (imageView.getTag(R.id.TANGRAM_BANNER_INDICATOR_POS) == null) {
continue;
} else {
代码示例来源:origin: alibaba/Tangram-Android
for (int i = 0; i < mImageViews.length; i++) {
ImageView imageView = mImageViews[i];
if (imageView.getTag(R.id.TANGRAM_BANNER_INDICATOR_POS) == null) {
continue;
} else {
代码示例来源:origin: stackoverflow.com
private int getDrawableId(ImageView iv) {
return (Integer) iv.getTag();
}
代码示例来源:origin: stackoverflow.com
ImageView i = (ImageView)v;
String activityClassName = (String)i.getTag(); // Get the info we stored in the tag.
MyActivity.this.startActivity((new Intent()).setClassName(MyActivity.this, activityClassName));
代码示例来源:origin: pili-engineering/PLDroidShortVideo
@Override
protected void onPostExecute(Bitmap result) {
if (((Integer) mImageView.getTag()) == mIndex) {
mImageView.setImageBitmap(result);
}
mOngoingTasks.remove(mIndex);
}
}
代码示例来源:origin: chaychan/TouTiao
/**
* 开启编辑模式
*/
private void startEditMode(boolean isEdit) {
mIsEdit = isEdit;
int visibleChildCount = mRecyclerView.getChildCount();
for (int i = 0; i < visibleChildCount; i++) {
View view = mRecyclerView.getChildAt(i);
ImageView imgEdit = (ImageView) view.findViewById(R.id.ivDelete);
if (imgEdit != null) {
boolean isVis = imgEdit.getTag() == null ? false : (boolean) imgEdit.getTag();
imgEdit.setVisibility(isVis && isEdit && !mData.get(i).title.equals("推荐") ? View.VISIBLE : View.INVISIBLE);
}
}
}
}
代码示例来源:origin: Neamar/KISS
@Override
protected Drawable doInBackground(Void... voids) {
ImageView image = imageViewWeakReference.get();
if (isCancelled() || image == null || image.getTag() != this) {
imageViewWeakReference.clear();
return null;
}
Result result = appResultWeakReference.get();
if (result == null)
return null;
return result.getDrawable(image.getContext());
}
代码示例来源:origin: stackoverflow.com
@Override
public void handleMessage(Message msg) {
int currentImage = 0;
int nextImage = 0;
// Logic to change the images
for (ImageView imageView : imageHolders) {
currentImage = Integer.parseInt(imageView.getTag().toString());
if (currentImage < 9) {
nextImage = currentImage + 1;
} else {
nextImage = 1;
}
imageView.setTag("" + nextImage);
imageView.setImageResource(getResources().getIdentifier(
images.get(nextImage - 1), "drawable",
"com.beanie.example"));
}
super.handleMessage(msg);
}
内容来源于网络,如有侵权,请联系作者删除!