Fix issue #1257 - Automatically expand media does not work with the Pixelfed presentation

This commit is contained in:
Thomas 2025-07-27 11:13:42 +02:00
parent 6dc779e03d
commit cd995da607

View file

@ -71,7 +71,11 @@ public class SliderAdapter extends SliderViewAdapter<SliderAdapter.SliderAdapter
public void onBindViewHolder(SliderAdapterVH viewHolder, final int position) {
Attachment sliderItem = mSliderItems.get(position);
if (status.sensitive) {
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
final int timeout = sharedpreferences.getInt(context.getString(R.string.SET_NSFW_TIMEOUT), 5);
boolean expand_media = sharedpreferences.getBoolean(context.getString(R.string.SET_EXPAND_MEDIA), false);
if (status.sensitive && !expand_media) {
Glide.with(viewHolder.itemView)
.load(sliderItem.preview_url)
.fitCenter()
@ -83,9 +87,6 @@ public class SliderAdapter extends SliderViewAdapter<SliderAdapter.SliderAdapter
.fitCenter()
.into(viewHolder.binding.ivAutoImageSlider);
}
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
final int timeout = sharedpreferences.getInt(context.getString(R.string.SET_NSFW_TIMEOUT), 5);
boolean expand_media = sharedpreferences.getBoolean(context.getString(R.string.SET_EXPAND_MEDIA), false);
viewHolder.itemView.setOnClickListener(v -> {
if (status.sensitive && !expand_media) {