remove compact reblog line setting

This commit is contained in:
sk
2023-10-15 19:57:22 +02:00
parent 7d1853bc88
commit d3744bb397
3 changed files with 7 additions and 12 deletions

View File

@@ -51,7 +51,6 @@ public class GlobalUserPreferences{
public static boolean collapseLongPosts; public static boolean collapseLongPosts;
public static boolean spectatorMode; public static boolean spectatorMode;
public static boolean autoHideFab; public static boolean autoHideFab;
public static boolean compactReblogReplyLine;
public static boolean allowRemoteLoading; public static boolean allowRemoteLoading;
public static boolean forwardReportDefault; public static boolean forwardReportDefault;
public static AutoRevealMode autoRevealEqualSpoilers; public static AutoRevealMode autoRevealEqualSpoilers;
@@ -112,7 +111,6 @@ public class GlobalUserPreferences{
collapseLongPosts=prefs.getBoolean("collapseLongPosts", true); collapseLongPosts=prefs.getBoolean("collapseLongPosts", true);
spectatorMode=prefs.getBoolean("spectatorMode", false); spectatorMode=prefs.getBoolean("spectatorMode", false);
autoHideFab=prefs.getBoolean("autoHideFab", true); autoHideFab=prefs.getBoolean("autoHideFab", true);
compactReblogReplyLine=prefs.getBoolean("compactReblogReplyLine", true);
allowRemoteLoading=prefs.getBoolean("allowRemoteLoading", true); allowRemoteLoading=prefs.getBoolean("allowRemoteLoading", true);
autoRevealEqualSpoilers=AutoRevealMode.valueOf(prefs.getString("autoRevealEqualSpoilers", AutoRevealMode.THREADS.name())); autoRevealEqualSpoilers=AutoRevealMode.valueOf(prefs.getString("autoRevealEqualSpoilers", AutoRevealMode.THREADS.name()));
forwardReportDefault=prefs.getBoolean("forwardReportDefault", true); forwardReportDefault=prefs.getBoolean("forwardReportDefault", true);
@@ -170,7 +168,6 @@ public class GlobalUserPreferences{
.putBoolean("collapseLongPosts", collapseLongPosts) .putBoolean("collapseLongPosts", collapseLongPosts)
.putBoolean("spectatorMode", spectatorMode) .putBoolean("spectatorMode", spectatorMode)
.putBoolean("autoHideFab", autoHideFab) .putBoolean("autoHideFab", autoHideFab)
.putBoolean("compactReblogReplyLine", compactReblogReplyLine)
.putBoolean("allowRemoteLoading", allowRemoteLoading) .putBoolean("allowRemoteLoading", allowRemoteLoading)
.putString("autoRevealEqualSpoilers", autoRevealEqualSpoilers.name()) .putString("autoRevealEqualSpoilers", autoRevealEqualSpoilers.name())
.putBoolean("forwardReportDefault", forwardReportDefault) .putBoolean("forwardReportDefault", forwardReportDefault)

View File

@@ -111,11 +111,9 @@ public class ReblogOrReplyLineStatusDisplayItem extends StatusDisplayItem{
text=findViewById(R.id.text); text=findViewById(R.id.text);
extraText=findViewById(R.id.extra_text); extraText=findViewById(R.id.extra_text);
separator=findViewById(R.id.separator); separator=findViewById(R.id.separator);
if (GlobalUserPreferences.compactReblogReplyLine) { parent.addOnLayoutChangeListener((v, l, t, right, b, ol, ot, oldRight, ob) -> {
parent.addOnLayoutChangeListener((v, l, t, right, b, ol, ot, oldRight, ob) -> { if (right != oldRight) layoutLine();
if (right != oldRight) layoutLine(); });
});
}
} }
private void bindLine(ReblogOrReplyLineStatusDisplayItem item, TextView text) { private void bindLine(ReblogOrReplyLineStatusDisplayItem item, TextView text) {
@@ -151,7 +149,7 @@ public class ReblogOrReplyLineStatusDisplayItem extends StatusDisplayItem{
private void layoutLine() { private void layoutLine() {
// layout line only if above header, compact and has extra // layout line only if above header, compact and has extra
if (!GlobalUserPreferences.compactReblogReplyLine || item.extra == null) return; if (item.extra == null) return;
itemView.measure( itemView.measure(
View.MeasureSpec.makeMeasureSpec(parent.getWidth(), View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(parent.getWidth(), View.MeasureSpec.EXACTLY),
View.MeasureSpec.UNSPECIFIED); View.MeasureSpec.UNSPECIFIED);

View File

@@ -130,7 +130,7 @@ public abstract class StatusDisplayItem{
String parentID = parent.getID(); String parentID = parent.getID();
String text = threadReply ? fragment.getString(R.string.sk_show_thread) String text = threadReply ? fragment.getString(R.string.sk_show_thread)
: account == null ? fragment.getString(R.string.sk_in_reply) : account == null ? fragment.getString(R.string.sk_in_reply)
: GlobalUserPreferences.compactReblogReplyLine && status.reblog != null ? account.displayName : status.reblog != null ? account.displayName
: fragment.getString(R.string.in_reply_to, account.displayName); : fragment.getString(R.string.in_reply_to, account.displayName);
String fullText = threadReply ? fragment.getString(R.string.sk_show_thread) String fullText = threadReply ? fragment.getString(R.string.sk_show_thread)
: account == null ? fragment.getString(R.string.sk_in_reply) : account == null ? fragment.getString(R.string.sk_in_reply)
@@ -165,7 +165,7 @@ public abstract class StatusDisplayItem{
if(status.reblog!=null){ if(status.reblog!=null){
boolean isOwnPost = AccountSessionManager.getInstance().isSelf(fragment.getAccountID(), status.account); boolean isOwnPost = AccountSessionManager.getInstance().isSelf(fragment.getAccountID(), status.account);
String fullText = fragment.getString(R.string.user_boosted, status.account.displayName); String fullText = fragment.getString(R.string.user_boosted, status.account.displayName);
String text = GlobalUserPreferences.compactReblogReplyLine && replyLine != null ? status.account.displayName : fullText; String text = replyLine != null ? status.account.displayName : fullText;
items.add(new ReblogOrReplyLineStatusDisplayItem(parentID, fragment, text, status.account.emojis, R.drawable.ic_fluent_arrow_repeat_all_20sp_filled, isOwnPost ? status.visibility : null, i->{ items.add(new ReblogOrReplyLineStatusDisplayItem(parentID, fragment, text, status.account.emojis, R.drawable.ic_fluent_arrow_repeat_all_20sp_filled, isOwnPost ? status.visibility : null, i->{
args.putParcelable("profileAccount", Parcels.wrap(status.account)); args.putParcelable("profileAccount", Parcels.wrap(status.account));
Nav.go(fragment.getActivity(), ProfileFragment.class, args); Nav.go(fragment.getActivity(), ProfileFragment.class, args);
@@ -193,7 +193,7 @@ public abstract class StatusDisplayItem{
.map(ReblogOrReplyLineStatusDisplayItem.class::cast) .map(ReblogOrReplyLineStatusDisplayItem.class::cast)
.findFirst(); .findFirst();
if (primaryLine.isPresent() && GlobalUserPreferences.compactReblogReplyLine) { if (primaryLine.isPresent()) {
primaryLine.get().extra = replyLine; primaryLine.get().extra = replyLine;
} else { } else {
items.add(replyLine); items.add(replyLine);