当前位置: 首页>>代码示例>>Java>>正文


Java NetworkImageView.setImageUrl方法代码示例

本文整理汇总了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;
}
 
开发者ID:KevinLiddle,项目名称:crockpod,代码行数:24,代码来源:PodcastArrayAdapter.java

示例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);
}
 
开发者ID:Rabbit00,项目名称:MeifuGO,代码行数:18,代码来源:MineViewDelegate.java

示例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);

}
 
开发者ID:datafile4,项目名称:book-store-android,代码行数:18,代码来源:CartAdapter.java

示例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;

}
 
开发者ID:ldsddn,项目名称:wordpress_app_android,代码行数:24,代码来源:AddQuickPressShortcutActivity.java

示例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;
    }
 
开发者ID:wcomartin,项目名称:PlexPy-Remote,代码行数:24,代码来源:UserProfileLastWatchedAdapter.java

示例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;
}
 
开发者ID:tarasM,项目名称:Bozon.kg_App,代码行数:23,代码来源:AppAdapter.java

示例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;
}
 
开发者ID:blynch,项目名称:CloudMemeAndroid,代码行数:25,代码来源:MemeAdapter.java

示例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;
}
 
开发者ID:blynch,项目名称:CloudMemeAndroid,代码行数:20,代码来源:MemeTemplateAdapter.java

示例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;
  }
 
开发者ID:carloscorreia94,项目名称:AEISTMobileDROID,代码行数:26,代码来源:EventoExpAdapter.java

示例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;
}
 
开发者ID:MostafaGazar,项目名称:soas,代码行数:20,代码来源:PhotoDetailFragment.java

示例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;
}
 
开发者ID:sburba,项目名称:Tvdb-Api-Android,代码行数:20,代码来源:TvdbItemAdapter.java

示例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;
}
 
开发者ID:googleplus,项目名称:gplus-haiku-client-android,代码行数:24,代码来源:HaikuFragment.java

示例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());
}
 
开发者ID:yajnesh,项目名称:AndroidGeneralUtils,代码行数:8,代码来源:ViewUtil.java

示例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;
}
 
开发者ID:Rabbit00,项目名称:MeifuGO,代码行数:8,代码来源:CarouselFragmentViewDelegate.java

示例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;
}
 
开发者ID:starmelon,项目名称:lovelife,代码行数:16,代码来源:ViewHolder.java


注:本文中的com.android.volley.toolbox.NetworkImageView.setImageUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。