mirror of
https://github.com/tuskyapp/Tusky
synced 2025-01-31 07:24:47 +01:00
fix crash in ViewThreadFragment
This commit is contained in:
parent
c38d2ad25e
commit
b9e433c77f
@ -255,7 +255,11 @@ abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int urlIndex = i;
|
final int urlIndex = i;
|
||||||
previews[i].setOnClickListener(v -> listener.onViewMedia(getAdapterPosition(), urlIndex, v));
|
previews[i].setOnClickListener(v -> {
|
||||||
|
if(getAdapterPosition() != RecyclerView.NO_POSITION) {
|
||||||
|
listener.onViewMedia(getAdapterPosition(), urlIndex, v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (n <= 2) {
|
if (n <= 2) {
|
||||||
previews[0].getLayoutParams().height = getMediaPreviewHeight(context) * 2;
|
previews[0].getLayoutParams().height = getMediaPreviewHeight(context) * 2;
|
||||||
@ -273,7 +277,6 @@ abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
|
|||||||
hiddenContentText = context.getString(R.string.status_sensitive_media_template,
|
hiddenContentText = context.getString(R.string.status_sensitive_media_template,
|
||||||
context.getString(R.string.status_sensitive_media_title),
|
context.getString(R.string.status_sensitive_media_title),
|
||||||
context.getString(R.string.status_sensitive_media_directions));
|
context.getString(R.string.status_sensitive_media_directions));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
hiddenContentText = context.getString(R.string.status_sensitive_media_template,
|
hiddenContentText = context.getString(R.string.status_sensitive_media_template,
|
||||||
context.getString(R.string.status_media_hidden_title),
|
context.getString(R.string.status_media_hidden_title),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user