diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java index 78a806c1f..e5530a739 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java @@ -146,6 +146,7 @@ public class TimelineFragment extends SFragment implements private boolean didLoadEverythingBottom; private boolean alwaysShowSensitiveMedia; + private boolean collapseLongStatusContent; @Override protected TimelineCases timelineCases() { @@ -158,7 +159,11 @@ public class TimelineFragment extends SFragment implements public StatusViewData apply(Either input) { Status status = input.getAsRightOrNull(); if (status != null) { - return ViewDataUtils.statusToViewData(status, alwaysShowSensitiveMedia); + return ViewDataUtils.statusToViewData( + status, + alwaysShowSensitiveMedia, + collapseLongStatusContent + ); } else { Placeholder placeholder = input.getAsLeft(); return new StatusViewData.Placeholder(placeholder.id, false); @@ -262,6 +267,8 @@ public class TimelineFragment extends SFragment implements filterRemoveRegexMatcher = Pattern.compile(regexFilter, Pattern.CASE_INSENSITIVE) .matcher(""); } + + collapseLongStatusContent = preferences.getBoolean("collapseLongStatuses", true); } private void setupSwipeRefreshLayout() { @@ -687,7 +694,12 @@ public class TimelineFragment extends SFragment implements case "alwaysShowSensitiveMedia": { //it is ok if only newly loaded statuses are affected, no need to fully refresh alwaysShowSensitiveMedia = sharedPreferences.getBoolean("alwaysShowSensitiveMedia", false); + break; } + case "collapseLongStatuses": + // As for "always show sensitive media" settings, only apply this to newer posts + collapseLongStatusContent = sharedPreferences.getBoolean("collapseLongStatuses", true); + break; } } diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java index 94c9fe09d..a56df7895 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java @@ -91,6 +91,7 @@ public final class ViewThreadFragment extends SFragment implements private String thisThreadsStatusId; private Card card; private boolean alwaysShowSensitiveMedia; + private boolean collapseLongStatusContent; private int statusIndex = 0; @@ -98,7 +99,11 @@ public final class ViewThreadFragment extends SFragment implements new PairedList<>(new Function() { @Override public StatusViewData.Concrete apply(Status input) { - return ViewDataUtils.statusToViewData(input, alwaysShowSensitiveMedia); + return ViewDataUtils.statusToViewData( + input, + alwaysShowSensitiveMedia, + collapseLongStatusContent + ); } }); @@ -154,6 +159,7 @@ public final class ViewThreadFragment extends SFragment implements SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences( getActivity()); alwaysShowSensitiveMedia = preferences.getBoolean("alwaysShowSensitiveMedia", false); + collapseLongStatusContent = preferences.getBoolean("collapseLongStatuses", true); boolean mediaPreviewEnabled = preferences.getBoolean("mediaPreviewEnabled", true); adapter.setMediaPreviewEnabled(mediaPreviewEnabled); recyclerView.setAdapter(adapter);