diff --git a/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java b/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java index 175c4a550..ca83ffaad 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java +++ b/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java @@ -12,9 +12,10 @@ public class GlobalUserPreferences{ public static boolean loadNewPosts; public static boolean showInteractionCounts; public static boolean alwaysExpandContentWarnings; + public static boolean disableMarquee; public static ThemePreference theme; - private static SharedPreferences getPrefs(){ + private static SharedPreferences getPrefs(){ return MastodonApp.context.getSharedPreferences("global", Context.MODE_PRIVATE); } @@ -28,6 +29,7 @@ public class GlobalUserPreferences{ loadNewPosts=prefs.getBoolean("loadNewPosts", true); showInteractionCounts=prefs.getBoolean("showInteractionCounts", false); alwaysExpandContentWarnings=prefs.getBoolean("alwaysExpandContentWarnings", false); + disableMarquee=prefs.getBoolean("disableMarquee", false); theme=ThemePreference.values()[prefs.getInt("theme", 0)]; } @@ -41,6 +43,7 @@ public class GlobalUserPreferences{ .putBoolean("trueBlackTheme", trueBlackTheme) .putBoolean("showInteractionCounts", showInteractionCounts) .putBoolean("alwaysExpandContentWarnings", alwaysExpandContentWarnings) + .putBoolean("disableMarquee", disableMarquee) .putInt("theme", theme.ordinal()) .apply(); } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java index 575481a05..8837ac7e6 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java @@ -19,6 +19,7 @@ import android.view.WindowInsets; import android.widget.Toolbar; import org.joinmastodon.android.E; +import org.joinmastodon.android.GlobalUserPreferences; import org.joinmastodon.android.R; import org.joinmastodon.android.api.requests.accounts.GetAccountRelationships; import org.joinmastodon.android.api.requests.polls.SubmitPollVote; @@ -81,6 +82,10 @@ public abstract class BaseStatusListFragment exten @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); + if(GlobalUserPreferences.disableMarquee){ + setTitleMarqueeEnabled(false); + setSubtitleMarqueeEnabled(false); + } if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N) setRetainInstance(true); } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java index cde536dbd..31287d319 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java @@ -94,6 +94,10 @@ public class SettingsFragment extends MastodonToolbarFragment{ items.add(new HeaderItem(R.string.settings_theme)); items.add(themeItem=new ThemeItem()); items.add(new SwitchItem(R.string.theme_true_black, R.drawable.ic_fluent_dark_theme_24_regular, GlobalUserPreferences.trueBlackTheme, this::onTrueBlackThemeChanged)); + items.add(new SwitchItem(R.string.disable_marquee, R.drawable.ic_fluent_text_more_24_regular, GlobalUserPreferences.disableMarquee, i->{ + GlobalUserPreferences.disableMarquee=i.checked; + GlobalUserPreferences.save(); + })); items.add(new HeaderItem(R.string.settings_behavior)); items.add(new SwitchItem(R.string.settings_gif, R.drawable.ic_fluent_gif_24_regular, GlobalUserPreferences.playGifs, i->{ diff --git a/mastodon/src/main/res/drawable/ic_fluent_text_more_24_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_text_more_24_regular.xml new file mode 100644 index 000000000..18eef7cbb --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_text_more_24_regular.xml @@ -0,0 +1,3 @@ + + + diff --git a/mastodon/src/main/res/values-de-rDE/strings.xml b/mastodon/src/main/res/values-de-rDE/strings.xml index c44afa107..121f89592 100644 --- a/mastodon/src/main/res/values-de-rDE/strings.xml +++ b/mastodon/src/main/res/values-de-rDE/strings.xml @@ -414,4 +414,5 @@ Obwohl die Mastodon-App keine Daten sammelt, kann der Server, über den Sie sich anmelden, eine andere Richtlinie haben. Nehmen Sie sich eine Minute Zeit, um die Mastodon-Datenschutzrichtlinien und die Datenschutzrichtlinien Ihres Servers zu lesen und zu akzeptieren. Ich stimme zu Inhaltswarnungen immer ausklappen + Laufschrift in Titelleisten deaktivieren diff --git a/mastodon/src/main/res/values/strings.xml b/mastodon/src/main/res/values/strings.xml index b3f041419..f588dd394 100644 --- a/mastodon/src/main/res/values/strings.xml +++ b/mastodon/src/main/res/values/strings.xml @@ -422,4 +422,5 @@ Lists with %s This list is empty Always reveal content warnings + Disable scrolling text in title bars