|
|
|
@ -87,22 +87,15 @@ import app.fedilab.android.mastodon.viewmodel.mastodon.StatusesVM;
|
|
|
|
|
|
|
|
|
|
public class StatusDirectMessageAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
|
|
|
|
|
|
|
|
|
private static float measuredWidth = -1;
|
|
|
|
|
private final List<Status> statusList;
|
|
|
|
|
private Context context;
|
|
|
|
|
private RecyclerView mRecyclerView;
|
|
|
|
|
private static float measuredWidth = -1;
|
|
|
|
|
|
|
|
|
|
public StatusDirectMessageAdapter(List<Status> data) {
|
|
|
|
|
this.statusList = data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
|
@Override
|
|
|
|
|
public RecyclerView.ViewHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) {
|
|
|
|
|
context = parent.getContext();
|
|
|
|
|
DrawerStatusChatBinding itemBinding = DrawerStatusChatBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
|
|
|
|
|
return new StatusChatViewHolder(itemBinding);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void loadAndAddAttachment(Context context, LayoutMediaBinding layoutMediaBinding,
|
|
|
|
|
StatusChatViewHolder holder,
|
|
|
|
|
RecyclerView.Adapter<RecyclerView.ViewHolder> adapter,
|
|
|
|
@ -214,6 +207,14 @@ public class StatusDirectMessageAdapter extends RecyclerView.Adapter<RecyclerVie
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
|
@Override
|
|
|
|
|
public RecyclerView.ViewHolder onCreateViewHolder(@NotNull ViewGroup parent, int viewType) {
|
|
|
|
|
context = parent.getContext();
|
|
|
|
|
DrawerStatusChatBinding itemBinding = DrawerStatusChatBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
|
|
|
|
|
return new StatusChatViewHolder(itemBinding);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) {
|
|
|
|
|
super.onAttachedToRecyclerView(recyclerView);
|
|
|
|
@ -227,15 +228,6 @@ public class StatusDirectMessageAdapter extends RecyclerView.Adapter<RecyclerVie
|
|
|
|
|
return statusList.size();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class StatusChatViewHolder extends RecyclerView.ViewHolder {
|
|
|
|
|
DrawerStatusChatBinding binding;
|
|
|
|
|
|
|
|
|
|
StatusChatViewHolder(DrawerStatusChatBinding itemView) {
|
|
|
|
|
super(itemView.getRoot());
|
|
|
|
|
binding = itemView;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
|
|
|
|
|
|
|
|
|
@ -675,4 +667,13 @@ public class StatusDirectMessageAdapter extends RecyclerView.Adapter<RecyclerVie
|
|
|
|
|
holder.binding.media.mediaContainer.setVisibility(View.GONE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class StatusChatViewHolder extends RecyclerView.ViewHolder {
|
|
|
|
|
DrawerStatusChatBinding binding;
|
|
|
|
|
|
|
|
|
|
StatusChatViewHolder(DrawerStatusChatBinding itemView) {
|
|
|
|
|
super(itemView.getRoot());
|
|
|
|
|
binding = itemView;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|