本文整理汇总了Java中com.android.volley.toolbox.NetworkImageView.setImageUrl方法的典型用法代码示例。如果您正苦于以下问题:Java NetworkImageView.setImageUrl方法的具体用法?Java NetworkImageView.setImageUrl怎么用?Java NetworkImageView.setImageUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.volley.toolbox.NetworkImageView
的用法示例。
在下文中一共展示了NetworkImageView.setImageUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getView
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
View view = getView(convertView, parent);
TextView titleView = view.findViewById(R.id.podcast_search_item_title);
TextView authorView = view.findViewById(R.id.podcast_search_item_author);
NetworkImageView logoView = view.findViewById(R.id.podcast_search_item_logo);
if (position % 2 == 0) {
view.setBackgroundColor(getContext().getResources().getColor(R.color.colorAlmostPrimary, null));
} else {
view.setBackgroundColor(getContext().getResources().getColor(R.color.colorPrimary, null));
}
Podcast podcast = getItem(position);
if (podcast != null) {
titleView.setText(podcast.getName());
authorView.setText(podcast.getAuthor());
logoView.setImageUrl(podcast.getLogoUrl(), mImageLoader);
}
return view;
}
示例2: initWidget
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
@Override
public void initWidget() {
super.initWidget();
NetworkImageView imageView = get(R.id.user_image);
imageView.setImageShapeType(NetworkImageView.CIRCLE_IMAGE);
imageView.setImageUrl(AppHper.getAppUser().getUserimage(), R.drawable.icon);
TextView textView3 = get(R.id.textView3);
textView3.setText(AppHper.getAppUser().getUsername());
get(R.id.textView6).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showAlert(DIALOG_NORMAL, "DrCoSu工作室\n线永洁");
}
});
setOnClickListener(this,R.id.textView5,R.id.textView6);
}
示例3: onBindViewHolder
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
//Get the data model based on position
Book book = mBooks.get(position);
// Setting item views based on my views and data model
TextView textViewName = holder.nameTextView;
textViewName.setText(book.getBookName());
TextView textViewAuthor = holder.authorTextView;
final NetworkImageView image = holder.bookImage;
ImageLoader mImageLoader = MySingleton.getInstance(mContext).getImageLoader();
image.setImageUrl(book.getBookImgUrl(), mImageLoader);
image.setErrorImageResId(R.drawable.defaultcover);
}
示例4: getView
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
public View getView(int position, View convertView, ViewGroup parent) {
RelativeLayout view = (RelativeLayout) convertView;
if (view == null) {
LayoutInflater inflater = getLayoutInflater();
view = (RelativeLayout)inflater.inflate(R.layout.home_row, parent, false);
}
String username = accountUsers[position];
view.setId(Integer.valueOf(accountIDs[position]));
TextView blogName = (TextView)view.findViewById(R.id.blogName);
TextView blogUsername = (TextView)view.findViewById(R.id.blogUser);
NetworkImageView blavatar = (NetworkImageView)view.findViewById(R.id.blavatar);
blogName.setText(
StringUtils.unescapeHTML(blogNames[position]));
blogUsername.setText(
StringUtils.unescapeHTML(username));
blavatar.setErrorImageResId(R.drawable.blavatar_placeholder);
blavatar.setImageUrl(blavatars[position], WordPress.imageLoader);
return view;
}
示例5: getView
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
final HistoryModels.HistoryRecord historyItem = historyRecordList.get(position);
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.item_user_last_watched, parent, false);
// view.findViewById(R.id.user_profile_last_watched_poster);
NetworkImageView avatar = view.findViewById(R.id.user_profile_last_watched_poster);
avatar.setImageUrl(UrlHelpers.getImageUrl(historyItem.thumb, "600", "400"),
ImageCacheManager.getInstance().getImageLoader());
if(historyItem.date != null && !historyItem.date.equals("null")){
CharSequence timeAgo = DateUtils.getRelativeTimeSpanString(historyItem.date * 1000, System.currentTimeMillis(), 0);
((TextView) view.findViewById(R.id.user_profile_last_watched_date)).setText(timeAgo.toString());
}
((TextView) view.findViewById(R.id.user_profile_last_watched_title)).setText(historyItem.fullTitle);
// ((TextView) view.findViewById(R.id.user_profile_last_watched_transcode_decision)).setText(WordUtils.capitalize(historyItem.transcodeDecision));
return view;
}
示例6: getView
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (inflater == null) {
inflater = (LayoutInflater) activityProducts.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
if (convertView == null) {
convertView = inflater.inflate(R.layout.custom_layout, null);
}
imageLoaderVar = AppControl.getmInstance().getmImageLoader();
NetworkImageView imageView = (NetworkImageView) convertView.findViewById(R.id.image_view_category);
TextView title = (TextView) convertView.findViewById(R.id.tv_title);
//getting data for row
AppItem item = itemsProducts.get(position);
imageView.setImageUrl(item.getIcon(), imageLoaderVar);
//title
title.setText(item.getTitle());
return convertView;
}
示例7: getView
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater inflater = ((Activity) mContext).getLayoutInflater();
convertView = inflater.inflate(mResourceId, parent, false);
}
CloudMemeMeme meme = getItem(position);
if (meme != null && convertView != null) {
NetworkImageView image = (NetworkImageView) convertView.findViewById(R.id.meme_image);
String imageUrl = meme.getImageUrl();
Log.d(TAG, "Requesting Image: " + imageUrl);
image.setContentDescription(meme.getText());
image.setImageUrl(imageUrl, mVolley.getImageLoader());
image.setDefaultImageResId(R.drawable.ic_action_camera_wide);
image.setErrorImageResId(R.drawable.ic_action_camera_wide);
TextView scoreDisplay = (TextView) convertView.findViewById(R.id.meme_score);
int score = 0; // TODO: Replace with score from API when available
scoreDisplay.setText("+" + score);
View voteButton = convertView.findViewById(R.id.meme_vote_button);
voteButton.setOnClickListener(this);
voteButton.setTag(position);
}
return convertView;
}
示例8: getView
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater inflater = ((Activity) mContext).getLayoutInflater();
convertView = inflater.inflate(mResourceId, parent, false);
}
CloudMemeTemplate meme = getItem(position);
if (meme != null && convertView != null) {
markView(convertView, mSelected == position);
NetworkImageView image =
(NetworkImageView) convertView.findViewById(R.id.meme_template_image);
String imageUrl = meme.getUrl();
Log.d(TAG, "Requesting template: " + imageUrl);
image.setImageUrl(imageUrl, mVolley.getImageLoader());
image.setDefaultImageResId(R.drawable.ic_action_camera_wide);
image.setErrorImageResId(R.drawable.ic_action_camera_wide);
}
return convertView;
}
示例9: getGroupView
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
@Override
public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
EventoContainer evento = getGroup(groupPosition);
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) _act
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.listitem, null);
}
if (imageLoader == null)
imageLoader = AppController.getInstance().getImageLoader();
NetworkImageView thumbNail = (NetworkImageView) convertView
.findViewById(R.id.thumbnail);
thumbNail.setDefaultImageResId(R.drawable.loader);
thumbNail.setErrorImageResId(R.drawable.loader);
TextView eventoNome = (TextView)convertView.findViewById(R.id.textView1);
TextView eventoDesc = (TextView)convertView.findViewById(R.id.textView2);
eventoNome.setText(evento.getEventoNome());
eventoDesc.setText(evento.getEventoDesc());
thumbNail.setImageUrl(evento.getImageLink(), imageLoader);
return convertView;
}
示例10: onCreateView
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_photo_detail, container, false);
if (mPhoto != null) {
NetworkImageView photo = (NetworkImageView) rootView.findViewById(R.id.photo);
photo.setImageUrl(mPhoto.photoFileUrl, SoasApplication.getImageLoader(getActivity()));
photo.setDefaultImageResId(R.drawable.default_photo);
TextView photoName = (TextView) rootView.findViewById(R.id.photoName);
photoName.setText(mPhoto.photoTitle);
TextView photoOwner = (TextView) rootView.findViewById(R.id.photoOwner);
photoOwner.setText(mPhoto.ownerName);
}
return rootView;
}
示例11: getView
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(mResource, parent, false);
}
TvdbItem item = getItem(position);
TextView titleView = ViewHolder.get(convertView, mTitleViewResourceId);
titleView.setText(item.getTitleText());
if (mImageViewResourceId != NO_RESOURCE) {
NetworkImageView imageView = ViewHolder.get(convertView, mImageViewResourceId);
imageView.setImageUrl(item.getImageUrl(), mImageLoader);
}
if (mDescViewResourceId != NO_RESOURCE) {
TextView descView = ViewHolder.get(convertView, mDescViewResourceId);
descView.setText(item.getDescText());
}
return convertView;
}
示例12: onCreateView
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_haiku, container, false);
VolleyContainer volley = VolleyContainer.getInstance(getActivity());
if (mHaiku != null) {
NetworkImageView profile = ((NetworkImageView) v.findViewById(R.id.haiku_profile_pic));
profile.setImageUrl(mHaiku.author.googlePhotoUrl, volley.getImageLoader());
((TextView) v.findViewById(R.id.haiku_title)).setText(mHaiku.title);
((TextView) v.findViewById(R.id.haiku_line_one)).setText(mHaiku.lineOne);
((TextView) v.findViewById(R.id.haiku_line_two)).setText(mHaiku.lineTwo);
((TextView) v.findViewById(R.id.haiku_line_three)).setText(mHaiku.lineThree);
((TextView) v.findViewById(R.id.haiku_user_display_name))
.setText(mHaiku.author.googleDisplayName);
((TextView) v.findViewById(R.id.haiku_date)).setText(mHaiku.getFormattedDate());
((TextView) v.findViewById(R.id.haiku_vote_count)).setText(mHaiku.votes + " votes");
((Button) v.findViewById(R.id.button_promote)).setOnClickListener(this);
((Button) v.findViewById(R.id.button_vote)).setOnClickListener(this);
}
return v;
}
示例13: setImageUrl
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
public static void setImageUrl(NetworkImageView niv, String url, Integer defaultImage) {
if (niv == null) {
return;
}
niv.setDefaultImageResId(defaultImage == null ? 0 : defaultImage);
niv.setImageUrl(url, VolleyHelper.getInstance().getImageLoader());
}
示例14: imageViews
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
public View imageViews(String url) {
NetworkImageView imageView = new NetworkImageView(getActivity());
//String urln = Configer.HTTP_CONFIG+url;
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setImageUrl(url, R.drawable.icon);
return imageView;
}
示例15: setImageURI
import com.android.volley.toolbox.NetworkImageView; //导入方法依赖的package包/类
/**
* 通过url为ImageView赋值
* @param viewId
* @param url
* @return
*/
public ViewHolder setImageURI(int viewId, String url){
NetworkImageView view = getView(viewId);
view.setTag(url); //标识,防止重复加载
view.setImageUrl(url, mImageLoader);
//new ImageLoader().showImageByThread(view, url);
//ImageLoader.getInstance().showImageByAsyncTast(view,url);
//Imageloader.getInstance().loadImag(view,url);
return this;
}