fixes copy option not appearing for multi asset upload (#5320)

This commit is contained in:
Srishti Rohatgi 2023-10-01 15:38:36 +05:30 committed by GitHub
parent fec27ed914
commit f7e6d30499
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -88,6 +88,21 @@ public class UploadMediaDetailAdapter extends RecyclerView.Adapter<UploadMediaDe
.inflate(R.layout.row_item_description, parent, false)); .inflate(R.layout.row_item_description, parent, false));
} }
/**
* This is a workaround for a known bug by android here https://issuetracker.google.com/issues/37095917
* makes the edit text on second and subsequent fragments inside an adapter receptive to long click
* for copy/paste options
* @param holder the view holder
*/
@Override
public void onViewAttachedToWindow(@NonNull final ViewHolder holder) {
super.onViewAttachedToWindow(holder);
holder.captionItemEditText.setEnabled(false);
holder.captionItemEditText.setEnabled(true);
holder.descItemEditText.setEnabled(false);
holder.descItemEditText.setEnabled(true);
}
@Override @Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) { public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
holder.bind(position); holder.bind(position);