diff --git a/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java b/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java index be4306131..8167f6ecc 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java +++ b/mastodon/src/main/java/org/joinmastodon/android/GlobalUserPreferences.java @@ -49,14 +49,12 @@ public class GlobalUserPreferences{ public static boolean compactReblogReplyLine; public static boolean confirmBeforeReblog; public static boolean allowRemoteLoading; + public static boolean forwardReportDefault; public static AutoRevealMode autoRevealEqualSpoilers; public static String publishButtonText; public static ThemePreference theme; public static ColorPreference color; - private final static Type recentLanguagesType = new TypeToken>>() {}.getType(); - private final static Type pinnedTimelinesType = new TypeToken>>() {}.getType(); - private final static Type accountsDefaultContentTypesType = new TypeToken>() {}.getType(); public static Map> recentLanguages; public static Map> pinnedTimelines; public static Set accountsWithLocalOnlySupport; @@ -64,6 +62,10 @@ public class GlobalUserPreferences{ public static Set accountsWithContentTypesEnabled; public static Map accountsDefaultContentTypes; + private final static Type recentLanguagesType = new TypeToken>>() {}.getType(); + private final static Type pinnedTimelinesType = new TypeToken>>() {}.getType(); + private final static Type accountsDefaultContentTypesType = new TypeToken>() {}.getType(); + /** * Pleroma */ @@ -131,6 +133,7 @@ public class GlobalUserPreferences{ accountsDefaultContentTypes=fromJson(prefs.getString("accountsDefaultContentTypes", null), accountsDefaultContentTypesType, new HashMap<>()); allowRemoteLoading=prefs.getBoolean("allowRemoteLoading", true); autoRevealEqualSpoilers=AutoRevealMode.valueOf(prefs.getString("autoRevealEqualSpoilers", AutoRevealMode.THREADS.name())); + forwardReportDefault=prefs.getBoolean("forwardReportDefault", true); if (prefs.contains("prefixRepliesWithRe")) { prefixReplies = prefs.getBoolean("prefixRepliesWithRe", false) @@ -191,6 +194,7 @@ public class GlobalUserPreferences{ .putString("accountsDefaultContentTypes", gson.toJson(accountsDefaultContentTypes)) .putBoolean("allowRemoteLoading", allowRemoteLoading) .putString("autoRevealEqualSpoilers", autoRevealEqualSpoilers.name()) + .putBoolean("forwardReportDefault", forwardReportDefault) .apply(); } 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 42494db3b..20da1332a 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java @@ -239,6 +239,10 @@ public class SettingsFragment extends MastodonToolbarFragment implements Provide GlobalUserPreferences.confirmBeforeReblog=i.checked; GlobalUserPreferences.save(); })); + items.add(new SwitchItem(R.string.sk_settings_forward_report_default, R.drawable.ic_fluent_arrow_forward_24_regular, GlobalUserPreferences.forwardReportDefault, i->{ + GlobalUserPreferences.forwardReportDefault=i.checked; + GlobalUserPreferences.save(); + })); items.add(new SwitchItem(R.string.sk_settings_allow_remote_loading, R.drawable.ic_fluent_communication_24_regular, GlobalUserPreferences.allowRemoteLoading, i->{ GlobalUserPreferences.allowRemoteLoading=i.checked; GlobalUserPreferences.save(); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/report/ReportCommentFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/report/ReportCommentFragment.java index 0e888c798..abe2a435f 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/report/ReportCommentFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/report/ReportCommentFragment.java @@ -15,6 +15,7 @@ import android.widget.TextView; import com.squareup.otto.Subscribe; import org.joinmastodon.android.E; +import org.joinmastodon.android.GlobalUserPreferences; import org.joinmastodon.android.R; import org.joinmastodon.android.api.requests.reports.SendReport; import org.joinmastodon.android.events.FinishReportFragmentsEvent; @@ -39,7 +40,7 @@ public class ReportCommentFragment extends MastodonToolbarFragment{ private TextView forwardReportText; private Switch forwardReportSwitch; private EditText commentEdit; - private boolean forwardReport; + private boolean forwardReport = GlobalUserPreferences.forwardReportDefault; @Override public void onCreate(Bundle savedInstanceState){ @@ -89,7 +90,7 @@ public class ReportCommentFragment extends MastodonToolbarFragment{ } else { forwardReportItem.setOnClickListener(this::onForwardReportClick); forwardReportText.setText(getActivity().getString(R.string.sk_forward_report_to, domain)); - forwardReportSwitch.setChecked(forwardReport = true); + forwardReportSwitch.setChecked(forwardReport); } return view; } diff --git a/mastodon/src/main/res/values/strings_sk.xml b/mastodon/src/main/res/values/strings_sk.xml index 9d7111204..68e378e6d 100644 --- a/mastodon/src/main/res/values/strings_sk.xml +++ b/mastodon/src/main/res/values/strings_sk.xml @@ -304,4 +304,5 @@ everyone nobody others + “Forward report” switch default \ No newline at end of file