本文整理汇总了Java中com.android.volley.toolbox.NetworkImageView类的典型用法代码示例。如果您正苦于以下问题:Java NetworkImageView类的具体用法?Java NetworkImageView怎么用?Java NetworkImageView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NetworkImageView类属于com.android.volley.toolbox包,在下文中一共展示了NetworkImageView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.android.volley.toolbox.NetworkImageView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
iv_image = (ImageView) this.findViewById(R.id.iv_image);
bt_send = (Button) this.findViewById(R.id.bt_send);
nv_image = (NetworkImageView) this.findViewById(R.id.nv_image);
mQueue = Volley.newRequestQueue(getApplicationContext());
bt_send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// UseStringRequest();
UseJsonRequest();
// UseImageRequest();
// UseImageLoader();
// UseNetworkImageView();
}
});
}
示例2: 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;
}
示例3: RecyclerItemViewHolder
import com.android.volley.toolbox.NetworkImageView; //导入依赖的package包/类
public RecyclerItemViewHolder(final View parent, TextView titleTextView,
TextView mStartDateTextView, TextView mEndDateTextView,
NetworkImageView mImageView, TextView id, TextView gun, LinearLayout layout_gun) {
super(parent);
parent.setClickable(true);
parent.setOnClickListener(this);
mTitleTextView = titleTextView;
this.mStartDateTextView = mStartDateTextView;
this.mEndDateTextView = mEndDateTextView;
this.mImageView = mImageView;
this.profilid = id;
this.days = gun;
this.layout = layout_gun;
}
示例4: newInstance
import com.android.volley.toolbox.NetworkImageView; //导入依赖的package包/类
public static RecyclerItemViewHolder newInstance(final View parent) {
TextView blogID = (TextView) parent.findViewById(R.id.blogID);
TextView title = (TextView) parent.findViewById(R.id.itemBaslik);
TextView date = (TextView) parent.findViewById(R.id.blogTarih);
TextView author = (TextView) parent.findViewById(R.id.profilIsim);
TextView excerpt = (TextView) parent.findViewById(R.id.itemOzet);
TextView categories = (TextView) parent.findViewById(R.id.categories);
final TextView profileID = (TextView) parent.findViewById(R.id.profilID);
NetworkImageView image = (NetworkImageView) parent.findViewById(R.id.image);
CircleImageView avatar = (CircleImageView) parent.findViewById(R.id.profile_image);
avatar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(parent.getContext(), ProfilActivity.class);
i.putExtra(Kisi.PROFIL_ID, profileID.getText());
parent.getContext().startActivity(i);
}
});
return new RecyclerItemViewHolder(parent, title, date, author, excerpt, categories, image, avatar, profileID, blogID);
}
示例5: getView
import com.android.volley.toolbox.NetworkImageView; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
CellHolder _cellHolder = null;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.list_home, null);
_cellHolder = new CellHolder();
_cellHolder.list_home_type = (TextView) convertView.findViewById(R.id.list_home_type);
_cellHolder.list_home_title = (TextView) convertView.findViewById(R.id.list_home_title);
_cellHolder.list_home_image = (NetworkImageView) convertView.findViewById(R.id.list_home_image);
_cellHolder.list_home_image.setImageShapeType(NetworkImageView.CIRCLE_IMAGE);
convertView.setTag(_cellHolder);
} else {
_cellHolder = (CellHolder) convertView.getTag();
}
ArtCopyModel artModel = artModels_.get(position);
_cellHolder.list_home_type.setText(UType.getType(artModel.getmType()));
_cellHolder.list_home_title.setText(artModel.getTitle());
UserModel userModel = artModel.getUser();
if(userModel!=null){
_cellHolder.list_home_image.setImageUrl(userModel.getUserimage(), R.drawable.icon);
}
return convertView;
}
示例6: 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);
}
示例7: PostDatabaseHolder
import com.android.volley.toolbox.NetworkImageView; //导入依赖的package包/类
PostDatabaseHolder(View row) {
uname=(TextView)row.findViewById(R.id.row_username);
post_body=(TextView)row.findViewById(R.id.row_body);
date_time=(TextView)row.findViewById(R.id.row_date_time);
image=(NetworkImageView)row.findViewById(R.id.row_image);
pimage=(ImageView)row.findViewById(R.id.row_postimage);
RateBar=(RatingBar)row.findViewById(R.id.row_ratingbar);
ratebtn=(Button)row.findViewById(R.id.rate_clk);
sharebtn=(Button)row.findViewById(R.id.share_clk);
commentbtn=(Button)row.findViewById(R.id.comment_clk);
rowpopup=(ImageButton)row.findViewById(R.id.row_popup);
//image.setErrorImageResId(R.drawable.me);
image.setDefaultImageResId(R.drawable.me);
ratebtn.setOnClickListener(clickListener);
commentbtn.setOnClickListener(clickListener);
sharebtn.setOnClickListener(clickListener);
rowpopup.setOnClickListener(clickListener);
}
示例8: ProfileHolder
import com.android.volley.toolbox.NetworkImageView; //导入依赖的package包/类
ProfileHolder(View row) {
uname=(TextView)row.findViewById(R.id.prow_username);
post_body=(TextView)row.findViewById(R.id.prow_body);
date_time=(TextView)row.findViewById(R.id.prow_date_time);
image=(NetworkImageView)row.findViewById(R.id.prow_image);
pimage=(ImageView)row.findViewById(R.id.prow_postimage);
RateBar=(RatingBar)row.findViewById(R.id.prow_ratingbar);
ratebtn=(Button)row.findViewById(R.id.profrate_clk);
sharebtn=(Button)row.findViewById(R.id.profshare_clk);
commentbtn=(Button)row.findViewById(R.id.profcomment_clk);
//image.setErrorImageResId(R.drawable.me);
image.setDefaultImageResId(R.drawable.me);
}
示例9: getGroupView
import com.android.volley.toolbox.NetworkImageView; //导入依赖的package包/类
@Override
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
holder = new ViewHolder();
convertView = LayoutInflater.from(mContext).inflate(R.layout.item_comments, parent, false);
holder.head = (NetworkImageView) convertView.findViewById(R.id.item_comments_head);
holder.name = (TextView) convertView.findViewById(R.id.item_comments_name);
holder.time = (TextView) convertView.findViewById(R.id.item_comments_time);
holder.content = (TextView) convertView.findViewById(R.id.item_comments_content);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
Comments.DataEntity entity = mCommentsList.get(groupPosition);
if (entity != null) {
holder.name.setText(mCommentsList.get(groupPosition).getUsername());
holder.time.setText(mCommentsList.get(groupPosition).getCreate_time());
holder.content.setText(mCommentsList.get(groupPosition).getBody());
holder.head.setImageUrl(mCommentsList.get(groupPosition).getAvatar(), mImageLoader);
}
return convertView;
}
示例10: getChildView
import com.android.volley.toolbox.NetworkImageView; //导入依赖的package包/类
@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
holder = new ViewHolder();
convertView = LayoutInflater.from(mContext).inflate(R.layout.item_comments, parent, false);
holder.head = (NetworkImageView) convertView.findViewById(R.id.item_comments_head);
holder.name = (TextView) convertView.findViewById(R.id.item_comments_name);
holder.time = (TextView) convertView.findViewById(R.id.item_comments_time);
holder.content = (TextView) convertView.findViewById(R.id.item_comments_content);
holder.layout = (LinearLayout) convertView.findViewById(R.id.item_comments_layout);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.layout.setPadding(100, 0, 0, 0);
holder.name.setText(mCommentsList.get(groupPosition).getChildren().get(childPosition).getUsername());
holder.time.setText(mCommentsList.get(groupPosition).getChildren().get(childPosition).getCreate_time());
holder.content.setText(mCommentsList.get(groupPosition).getChildren().get(childPosition).getBody());
holder.head.setImageUrl(mCommentsList.get(groupPosition).getChildren().get(childPosition).getAvatar(), mImageLoader);
return convertView;
}
示例11: populateProductViews
import com.android.volley.toolbox.NetworkImageView; //导入依赖的package包/类
private void populateProductViews() {
Bundle bundle = getIntent().getExtras();
if (bundle == null) {
String error = "Error retrieving product information.";
Log.e(TAG, error);
Snackbar.make(findViewById(R.id.ProductTitle), error, Snackbar.LENGTH_SHORT).show();
fabMessage = error;
} else {
TextView productTitle = findViewById(R.id.ProductTitle);
productTitle.setText(bundle.getString(PRODUCT_TITLE));
TextView productDescription = findViewById(R.id.ProductDescription);
productDescription.setText(bundle.getString(PRODUCT_DESCRIPTION));
initSpinner();
NetworkImageView productImage = findViewById(R.id.ProductImage);
ImageRequester.getInstance(this).setImageFromUrl(productImage, bundle.getString(PRODUCT_URL));
fabMessage = getString(R.string.shrine_product_added_message);
}
}
示例12: initCollapsingToolbar
import com.android.volley.toolbox.NetworkImageView; //导入依赖的package包/类
private void initCollapsingToolbar() {
Toolbar toolbar = findViewById(R.id.AppBar);
int collapsingToolbarImageIndex = 6;
int collapsingImageToolbarSize = 1200;
NetworkImageView collapsingToolbarImage = findViewById(R.id.CollapsingToolbarImage);
StringBuilder collapsingToolbarImageUrl =
new StringBuilder(productEntryList.get(collapsingToolbarImageIndex).url);
collapsingToolbarImageUrl.append("=s");
collapsingToolbarImageUrl.append(collapsingImageToolbarSize);
setSupportActionBar(toolbar);
CollapsingToolbarLayout collapsingToolbarLayout = findViewById(R.id.CollapsingToolbarLayout);
collapsingToolbarLayout.setTitle(toolbar.getTitle());
collapsingToolbarLayout.setExpandedTitleTextAppearance(R.style.TextAppearance_Shrine_Logo);
collapsingToolbarLayout.setCollapsedTitleTextAppearance(R.style.TextAppearance_Shrine_Logo);
imageRequester.setImageFromUrl(collapsingToolbarImage, collapsingToolbarImageUrl.toString());
Point windowSize = new Point();
getWindowManager().getDefaultDisplay().getSize(windowSize);
int windowWidth = windowSize.x;
collapsingToolbarImage.setX(collapsingToolbarImage.getX() - windowWidth / 4);
collapsingToolbarLayout.setScrimVisibleHeightTrigger(
(int) getResources().getDimension(R.dimen.shrine_tall_toolbar_height) / 2);
}
示例13: ContactViewHolder
import com.android.volley.toolbox.NetworkImageView; //导入依赖的package包/类
public ContactViewHolder(View v) {
super(v);
date = (TextView) v.findViewById(R.id.tv_date);
header = (TextView) v.findViewById(R.id.tv_header);
team1 = (TextView) v.findViewById(R.id.tv_team1);
team2 = (TextView) v.findViewById(R.id.tv_team2);
status = (TextView) v.findViewById(R.id.tv_status);
team1score = (TextView) v
.findViewById(R.id.tv_team1_score);
team2score = (TextView) v
.findViewById(R.id.tv_team2_score);
flag1 = (NetworkImageView) v
.findViewById(R.id.img_team1_flag);
flag2 = (NetworkImageView) v
.findViewById(R.id.img_team2_flag);
}
示例14: onCreate
import com.android.volley.toolbox.NetworkImageView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dashboard_tips_activity);
Intent intent = getIntent();
imageLoader = AppController.getInstance().getImageLoader(this);
findViewById(R.id.back_btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TipsActivity.this.finish();
overridePendingTransition(R.anim.nude, R.anim.slide_out_to_right);
}
});
((TextView) findViewById(R.id.action_bar_title)).setText(getString(R.string.health_tips));
((NetworkImageView) findViewById(R.id.tip_image)).setImageUrl(intent.getStringExtra("image"), imageLoader);
((TextView) findViewById(R.id.title)).setText(intent.getStringExtra("title"));
JustifiedTextView content = (JustifiedTextView) findViewById(R.id.content);
content.setText(intent.getStringExtra("content"));
}
示例15: 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);
}