Facebookのような投稿を表示しています。複数の画像を含む画像スライダがあります。異種RecyclerViewを使用して、ここで、ここではXMLコードが参照してくださいです...私は横のRecyclerViewが正常に動作していない、onCreateViewHolderが呼び出されていない
if (commentList.get(position).getAttachment() != null && !commentList.get(position).getAttachment().equals(""))
{
List<String> imageUrl = new ArrayList<>();
imageUrl.add(commentList.get(position).getAttachment());
holder.getImageSliderCommentRecycler().setAdapter(new ImageSliderAdapter(context, imageUrl, new ImageSlideItemListener()
{
@Override
public void imageClicked(int position)
{
List<String> imageUrl = new ArrayList<>();
imageUrl.add(commentList.get(holder.getAdapterPosition()-1).getAttachment());
listener.showImage(imageUrl, position);
}
}));
holder.getImageSliderCommentRecycler().setLayoutManager(new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false));
}
else holder.getImageSliderCommentRecycler().setVisibility(View.GONE);
条件実行した場合、私のコードを参照してください行っているが、imageSliderAdapterはoncreateViewHolderか何かを呼び出すことはありません何
<RelativeLayout
android:id="@+id/post_photo_relative_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/comment_textview"
android:layout_marginEnd="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginStart="20dp"
android:layout_marginTop="35dp">
<android.support.v7.widget.RecyclerView
android:id="@+id/about_doctor_fragment_doctor_photos_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layoutManager="android.support.v7.widget.LinearLayoutManager"/>
</RelativeLayout>
ここに私のadapterVですiewHolder ...
public class CommentViewHolder extends RecyclerView.ViewHolder
{
private ImageView commentProfileImage;
private TextView commentName;
private TextView commentSpeciality;
private ImageView commentDeleteIcon;
private Button bookAppointmentButton;
private TextView commentDescription;
private TextView commentDateTime;
private ImageView commentLikeIcon;
private TextView commentLikeCounter;
private Button replyButton;
private RecyclerView replyRecyclerView;
private RecyclerView imageSliderCommentRecycler;
public CommentViewHolder(View itemView)
{
super(itemView);
commentProfileImage = (ImageView) itemView.findViewById(R.id.photo_imageview);
commentName = (TextView) itemView.findViewById(R.id.user_name_textview);
commentSpeciality = (TextView) itemView.findViewById(R.id.user_speciality_textview);
commentDeleteIcon = (ImageView) itemView.findViewById(R.id.delete_comment_imageview);
bookAppointmentButton = (Button) itemView.findViewById(R.id.book_appointment_button);
commentDescription = (TextView) itemView.findViewById(R.id.comment_textview);
commentDateTime = (TextView) itemView.findViewById(R.id.comment_time_textview);
commentLikeIcon = (ImageView) itemView.findViewById(R.id.like_imageview);
commentLikeCounter = (TextView) itemView.findViewById(R.id.likes_count_textview);
replyButton = (Button) itemView.findViewById(R.id.reply_button);
replyRecyclerView = (RecyclerView) itemView.findViewById(R.id.replies_recyclerview);
imageSliderCommentRecycler = (RecyclerView) itemView.findViewById(R.id.about_doctor_fragment_doctor_photos_fragment);
}
public ImageView getCommentProfileImage()
{
return commentProfileImage;
}
public TextView getCommentName()
{
return commentName;
}
public TextView getCommentSpeciality()
{
return commentSpeciality;
}
public ImageView getCommentDeleteIcon()
{
return commentDeleteIcon;
}
public Button getBookAppointmentButton()
{
return bookAppointmentButton;
}
public TextView getCommentDescription()
{
return commentDescription;
}
public TextView getCommentDateTime()
{
return commentDateTime;
}
public ImageView getCommentLikeIcon()
{
return commentLikeIcon;
}
public TextView getCommentLikeCounter()
{
return commentLikeCounter;
}
public Button getReplyButton()
{
return replyButton;
}
public RecyclerView getReplyRecyclerView()
{
return replyRecyclerView;
}
public RecyclerView getImageSliderCommentRecycler()
{
return imageSliderCommentRecycler;
}
}
他のすべてが正常に動作しますので、コードは、したがって、私は唯一のチャンクを掲載しています非常に複雑です....私はその時、一日前だけを追加したこの画像スライダー問題だった....すべてのヘルプは、事前
私はほとんどすべての解決策を行ってきましたが、何も私のために働いていません...編集または参照する前に一度尋ねてください。 – Najam
アダプタ/ホルダーコードとあなたの活動は –
@JonathanAsteに返信してくれてありがとう.....完全なコードはあまりにも長いここに貼り付けて....私は最初のコードブロックにアダプタを設定しています.... – Najam