一个问题中有很多评论,我认为其中一个很重要,因此我想将此评论放在问题的开头。
这可能吗?我怎么能得到它?
答案 0 :(得分:1)
评论按其创建顺序列出,并且该顺序无法调整。
但是,您可以通过单击注释右侧的三个点,然后单击public class MoviesAdapter extends RecyclerView.Adapter<MoviesAdapter.MoviesViewHolder> {
Context context;
List<Movies> articles;
public MoviesAdapter(Context context, List<Movies> articles) {
this.context = context;
this.articles = articles;
}
@NonNull
@Override
public MoviesAdapter.MoviesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.movies_item, parent, false);
return new MoviesViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull MoviesAdapter.MoviesViewHolder holder, final int position) {
holder.tvName.setText(articles.get(position).getTitle());
holder.tvDesCription.setText(articles.get(position).getPoster());
String url = articles.get(position).getPoster();
if(url!=null) {
/* Glide.with(context) //passing context
.load(url) //passing your url to load image.
.dontAnimate()
.placeholder(context.getDrawable(R.drawable.ic_launcher_background)) //this would be your default image (like default profile or logo etc). it would be loaded at initial time and it will replace with your loaded image once glide successfully load image using url.
.centerCrop()//this method help to fit image into center of your ImageView
.into(holder.ivNews);*/ //pass imageView reference to appear the image.*/
Picasso.get()
.load(url)
.placeholder(R.drawable.ic_launcher_background)
.error(R.drawable.ic_launcher_background)
.into(holder.ivNews);
}
}
@Override
public int getItemCount() {
return articles.size();
}
public class MoviesViewHolder extends RecyclerView.ViewHolder {
TextView tvName;
TextView tvDesCription;
ImageView ivNews;
public MoviesViewHolder(@NonNull View itemView) {
super(itemView);
tvName = itemView.findViewById(R.id.tvName);
tvDesCription = itemView.findViewById(R.id.tvDesCription);
ivNews = itemView.findViewById(R.id.ivNews);
}
}
}
,将其链接到注释。如果以后需要引用此链接,则将该链接粘贴到导航栏中将直接带您到单个评论。
这将同时对问题和请求请求发表意见。