diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/settings/FragmentComposeSettings.java b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/settings/FragmentComposeSettings.java index 232d731c..e0022092 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/settings/FragmentComposeSettings.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/settings/FragmentComposeSettings.java @@ -18,9 +18,12 @@ import android.annotation.SuppressLint; import android.content.SharedPreferences; import android.os.Bundle; +import androidx.navigation.NavOptions; +import androidx.navigation.Navigation; import androidx.preference.EditTextPreference; import androidx.preference.ListPreference; import androidx.preference.MultiSelectListPreference; +import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceManager; import androidx.preference.SwitchPreferenceCompat; @@ -67,6 +70,17 @@ public class FragmentComposeSettings extends PreferenceFragmentCompat implements } + Preference SET_CUSTOMIZE_COLORS_VISIBILITY = findPreference(getString(R.string.SET_CUSTOMIZE_COLORS_VISIBILITY)); + if (SET_CUSTOMIZE_COLORS_VISIBILITY != null) { + SET_CUSTOMIZE_COLORS_VISIBILITY.setOnPreferenceClickListener(preference -> { + NavOptions.Builder navBuilder = new NavOptions.Builder(); + navBuilder.setEnterAnim(R.anim.enter).setExitAnim(R.anim.exit).setPopEnterAnim(R.anim.pop_enter).setPopExitAnim(R.anim.pop_exit); + + Navigation.findNavController(requireActivity(), R.id.fragment_container).navigate(R.id.FragmentCustomLightSettings, null, navBuilder.build()); + return true; + }); + } + MultiSelectListPreference SET_SELECTED_LANGUAGE = findPreference(getString(R.string.SET_SELECTED_LANGUAGE)); if (SET_SELECTED_LANGUAGE != null) { diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/settings/FragmentCustomVisibilityColorsSettings.java b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/settings/FragmentCustomVisibilityColorsSettings.java new file mode 100644 index 00000000..95c19177 --- /dev/null +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/fragment/settings/FragmentCustomVisibilityColorsSettings.java @@ -0,0 +1,57 @@ +package app.fedilab.android.mastodon.ui.fragment.settings; +/* Copyright 2025 Thomas Schneider + * + * This file is a part of Fedilab + * + * This program is free software; you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation; either version 3 of the + * License, or (at your option) any later version. + * + * Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Fedilab; if not, + * see . */ + + +import android.content.SharedPreferences; +import android.os.Bundle; + +import androidx.preference.PreferenceFragmentCompat; + +import app.fedilab.android.R; + +public class FragmentCustomVisibilityColorsSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { + + @Override + public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { + addPreferencesFromResource(R.xml.pref_custom_visibility_colors); + createPref(); + } + + private void createPref() { + } + + @Override + public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { + + } + + @Override + public void onResume() { + super.onResume(); + + getPreferenceScreen().getSharedPreferences() + .registerOnSharedPreferenceChangeListener(this); + } + + @Override + public void onPause() { + super.onPause(); + getPreferenceScreen().getSharedPreferences() + .unregisterOnSharedPreferenceChangeListener(this); + } + + +} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 09547944..336eb37a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1194,6 +1194,7 @@ SET_CUSTOMIZE_LIGHT_COLORS SET_CHAT_FOR_CONVERSATION + SET_CUSTOMIZE_COLORS_VISIBILITY SET_CUSTOMIZE_LIGHT_COLORS_ACTION SET_CUSTOMIZE_DARK_COLORS SET_CUSTOMIZE_DARK_COLORS_ACTION @@ -1219,6 +1220,10 @@ SET_LIGHT_LINK SET_LIGHT_ICON + SET_COLOR_VISIBILITY_PUBLIC + SET_COLOR_VISIBILITY_UNLISTED + SET_COLOR_VISIBILITY_PRIVATE + SET_COLOR_VISIBILITY_DIRECT SYSTEM SET_AUTO_PLAY_GIG_MEDIA @@ -1312,6 +1317,7 @@ SET_VIDEO_CACHE SET_WATERMARK SET_UNLISTED_REPLIES + SET_COLORIZE_FOR_VISIBILITY SET_SELECTED_LANGUAGE SET_WATERMARK_TEXT SET_MATHS_COMPOSER @@ -1351,6 +1357,12 @@ Notification sounds Disable notifications During this time slot + + Color for the public visibility + Color for the unlisted visibility + Color for the private visibility + Color for the direct visibility + Base of the theme Choose if the base of the theme should be dark or light Allow to create your custom theme @@ -1889,6 +1901,8 @@ Edited at %1$s Created at %1$s Max indentation in threads + Underline visibility + The visibility button and the bottom of the compose area will have different colors depending of the visibility selected when composing. Unlisted replies It only concerns \"public\" replies. When enabled, your replies will automatically have the visibility \"unlisted\" instead of \"public\" Notifications have been removed from cache. @@ -2019,6 +2033,8 @@ Customize Dark Theme Allows to customize some elements in messages for the dark theme. Set custom colors + Set custom colors for the visibility + Light - Custom colors Dark - Custom colors Display remote conversation diff --git a/app/src/main/res/xml/pref_compose.xml b/app/src/main/res/xml/pref_compose.xml index 6facecb4..310717fb 100644 --- a/app/src/main/res/xml/pref_compose.xml +++ b/app/src/main/res/xml/pref_compose.xml @@ -66,6 +66,22 @@ app:summary="@string/set_unlisted_replies_indication" app:title="@string/set_unlisted_replies" /> + + + + + + + + + + + + + + + \ No newline at end of file