diff --git a/library/ui-strings/src/main/res/values-fr/strings_tchap.xml b/library/ui-strings/src/main/res/values-fr/strings_tchap.xml index e74e3f006f..fc220a367d 100644 --- a/library/ui-strings/src/main/res/values-fr/strings_tchap.xml +++ b/library/ui-strings/src/main/res/values-fr/strings_tchap.xml @@ -111,6 +111,7 @@ Inscrire mon compte sur liste rouge Les autres utilisateurs ne pourront pas découvrir mon compte lors de leurs recherches Pour désactiver cette option, vous devez accepter que votre adresse e\u2011mail soit visible des autres utilisateurs lors de leurs recherches. + 🎄 Joyeuses Fêtes 🎄 La vérification de votre nouvelle session a échoué. diff --git a/library/ui-strings/src/main/res/values/strings_tchap.xml b/library/ui-strings/src/main/res/values/strings_tchap.xml index c3abf1324e..89830b66b3 100644 --- a/library/ui-strings/src/main/res/values/strings_tchap.xml +++ b/library/ui-strings/src/main/res/values/strings_tchap.xml @@ -111,6 +111,7 @@ Subscribe to the red list. "Other users won't be able to find my account in their search results." To disable this option, you must accept that your email address is visible to the other users. + 🎄 Happy Holidays 🎄 Failed to verify your new session. diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt index ef3e791d91..7cf681e2d6 100755 --- a/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorPreferences.kt @@ -227,6 +227,7 @@ class VectorPreferences @Inject constructor( private const val DID_ASK_TO_ENABLE_SESSION_PUSH = "DID_ASK_TO_ENABLE_SESSION_PUSH" const val TCHAP_SETTINGS_HIDE_FROM_USERS_DIRECTORY_PREFERENCE_KEY = "TCHAP_SETTINGS_HIDE_FROM_USERS_DIRECTORY_PREFERENCE_KEY" + const val TCHAP_SETTINGS_CHRISTMAS_PREFERENCE_KEY = "TCHAP_SETTINGS_CHRISTMAS_PREFERENCE_KEY" // Location Sharing const val SETTINGS_PREF_ENABLE_LOCATION_SHARING = "SETTINGS_PREF_ENABLE_LOCATION_SHARING" diff --git a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsRootFragment.kt b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsRootFragment.kt index ff376aefa8..be6a96cd8f 100644 --- a/vector/src/main/java/im/vector/app/features/settings/VectorSettingsRootFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/VectorSettingsRootFragment.kt @@ -16,14 +16,18 @@ package im.vector.app.features.settings +import android.content.Context import android.os.Bundle import androidx.preference.Preference import dagger.hilt.android.AndroidEntryPoint import im.vector.app.R +import im.vector.app.core.extensions.singletonEntryPoint import im.vector.app.core.preference.VectorPreference import im.vector.app.core.utils.FirstThrottler import im.vector.app.core.utils.openUrlInChromeCustomTab import im.vector.app.features.analytics.plan.MobileScreen +import im.vector.app.features.navigation.Navigator +import java.util.Calendar @AndroidEntryPoint class VectorSettingsRootFragment : @@ -34,6 +38,14 @@ class VectorSettingsRootFragment : private val firstThrottler = FirstThrottler(1000) + private lateinit var navigator: Navigator + + override fun onAttach(context: Context) { + val singletonEntryPoint = context.singletonEntryPoint() + navigator = singletonEntryPoint.navigator() + super.onAttach(context) + } + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) analyticsScreenName = MobileScreen.ScreenName.Settings @@ -50,6 +62,19 @@ class VectorSettingsRootFragment : } false } + + // Tchap: Manage Christmas entry + if (Calendar.getInstance().before(Calendar.getInstance().apply { set(2024, 1, 10) })) { + findPreference(VectorPreferences.TCHAP_SETTINGS_CHRISTMAS_PREFERENCE_KEY)!!.let { + it.isVisible = true + it.onPreferenceClickListener = Preference.OnPreferenceClickListener { + if (firstThrottler.canHandle() is FirstThrottler.CanHandlerResult.Yes) { + navigator.openRoom(requireContext(), "!cDKdQyXHeWBEaKDWWV:agent.dinum.tchap.gouv.fr", null) + } + false + } + } + } } private fun tintIcons() { diff --git a/vector/src/main/res/xml/vector_settings_root.xml b/vector/src/main/res/xml/vector_settings_root.xml index 13a3022233..44064f2e60 100644 --- a/vector/src/main/res/xml/vector_settings_root.xml +++ b/vector/src/main/res/xml/vector_settings_root.xml @@ -62,4 +62,10 @@ app:fragment="im.vector.app.features.settings.legals.LegalsFragment" app:isPreferenceVisible="@bool/settings_root_legals_visible" /> + +