add option to always reveal content warnings

This commit is contained in:
sk 2022-11-17 00:53:41 +01:00
parent 5c9e41f4ff
commit 753624a185
5 changed files with 11 additions and 1 deletions

View File

@ -7,6 +7,7 @@ public class GlobalUserPreferences{
public static boolean playGifs;
public static boolean useCustomTabs;
public static boolean trueBlackTheme;
public static boolean alwaysExpandContentWarnings;
public static ThemePreference theme;
private static SharedPreferences getPrefs(){
@ -18,6 +19,7 @@ public class GlobalUserPreferences{
playGifs=prefs.getBoolean("playGifs", true);
useCustomTabs=prefs.getBoolean("useCustomTabs", true);
trueBlackTheme=prefs.getBoolean("trueBlackTheme", false);
alwaysExpandContentWarnings=prefs.getBoolean("alwaysExpandContentWarnings", false);
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
}
@ -26,6 +28,7 @@ public class GlobalUserPreferences{
.putBoolean("playGifs", playGifs)
.putBoolean("useCustomTabs", useCustomTabs)
.putBoolean("trueBlackTheme", trueBlackTheme)
.putBoolean("alwaysExpandContentWarnings", alwaysExpandContentWarnings)
.putInt("theme", theme.ordinal())
.apply();
}

View File

@ -102,6 +102,10 @@ public class SettingsFragment extends MastodonToolbarFragment{
GlobalUserPreferences.useCustomTabs=i.checked;
GlobalUserPreferences.save();
}));
items.add(new SwitchItem(R.string.settings_always_reveal_content_warnings, R.drawable.ic_fluent_chat_warning_24_regular, GlobalUserPreferences.alwaysExpandContentWarnings, i->{
GlobalUserPreferences.alwaysExpandContentWarnings=i.checked;
GlobalUserPreferences.save();
}));
items.add(new HeaderItem(R.string.settings_notifications));
items.add(notificationPolicyItem=new NotificationPolicyItem());

View File

@ -1,5 +1,6 @@
package org.joinmastodon.android.model;
import org.joinmastodon.android.GlobalUserPreferences;
import org.joinmastodon.android.api.ObjectValidationException;
import org.joinmastodon.android.api.RequiredField;
import org.joinmastodon.android.events.StatusCountersUpdatedEvent;
@ -78,7 +79,7 @@ public class Status extends BaseModel implements DisplayItemsParent{
if(reblog!=null)
reblog.postprocess();
spoilerRevealed=!sensitive;
spoilerRevealed=GlobalUserPreferences.alwaysExpandContentWarnings || !sensitive;
}
@Override

View File

@ -380,4 +380,5 @@
<string name="privacy_policy_title">Mastodon und Ihre Privatsphäre</string>
<string name="privacy_policy_subtitle">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.</string>
<string name="i_agree">Ich stimme zu</string>
<string name="settings_always_reveal_content_warnings">Inhaltswarnungen immer ausklappen</string>
</resources>

View File

@ -388,4 +388,5 @@
<string name="privacy_policy_subtitle">Although the Mastodon app does not collect any data, the server you sign up through may have a different policy. Take a minute to review and agree to the Mastodon app privacy policy and your server\'s privacy policy.</string>
<string name="i_agree">I Agree</string>
<string name="empty_list">This list is empty</string>
<string name="settings_always_reveal_content_warnings">Always reveal content warnings</string>
</resources>