Skip to content

Commit

Permalink
Update display duration of the new entry in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed Dec 11, 2023
1 parent 6ff3d30 commit b37c68d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<string name="tchap_settings_hide_from_users_directory_title">Inscrire mon compte sur liste rouge</string>
<string name="tchap_settings_hide_from_users_directory_summary">Les autres utilisateurs ne pourront pas découvrir mon compte lors de leurs recherches</string>
<string name="tchap_settings_show_external_user_in_users_directory_prompt">Pour désactiver cette option, vous devez accepter que votre adresse e\u2011mail soit visible des autres utilisateurs lors de leurs recherches.</string>
<string name="tchap_settings_christmas_title">Joyeuses Fêtes</string>
<string name="tchap_settings_christmas_title">🎄 Joyeuses Fêtes 🎄</string>

<!-- Verification -->
<string name="tchap_verification_conclusion_not_secure">La vérification de votre nouvelle session a échoué.</string>
Expand Down
2 changes: 1 addition & 1 deletion library/ui-strings/src/main/res/values/strings_tchap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<string name="tchap_settings_hide_from_users_directory_title">Subscribe to the red list.</string>
<string name="tchap_settings_hide_from_users_directory_summary">"Other users won't be able to find my account in their search results."</string>
<string name="tchap_settings_show_external_user_in_users_directory_prompt">To disable this option, you must accept that your email address is visible to the other users.</string>
<string name="tchap_settings_christmas_title">Happy Holidays</string>
<string name="tchap_settings_christmas_title">🎄 Happy Holidays 🎄</string>

<!-- Verification -->
<string name="tchap_verification_conclusion_not_secure">Failed to verify your new session.</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ 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 :
Expand Down Expand Up @@ -63,12 +64,16 @@ class VectorSettingsRootFragment :
}

// Tchap: Manage Christmas entry
findPreference<VectorPreference>(VectorPreferences.TCHAP_SETTINGS_CHRISTMAS_PREFERENCE_KEY)!!
.onPreferenceClickListener = Preference.OnPreferenceClickListener {
if (firstThrottler.canHandle() is FirstThrottler.CanHandlerResult.Yes) {
navigator.openRoom(requireContext(), "!cDKdQyXHeWBEaKDWWV:agent.dinum.tchap.gouv.fr", null)
if (Calendar.getInstance().before(Calendar.getInstance().apply { set(2024, 1, 10) })) {
findPreference<VectorPreference>(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
}
}
false
}
}

Expand Down
5 changes: 3 additions & 2 deletions vector/src/main/res/xml/vector_settings_root.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@
app:isPreferenceVisible="@bool/settings_root_legals_visible" />

<im.vector.app.core.preference.VectorPreference
android:icon="@drawable/ic_settings_root_help_info"
android:icon="@drawable/ic_notification"
android:key="TCHAP_SETTINGS_CHRISTMAS_PREFERENCE_KEY"
android:title="@string/tchap_settings_christmas_title" />
android:title="@string/tchap_settings_christmas_title"
app:isPreferenceVisible="@bool/false_tchap_hidden" />

</androidx.preference.PreferenceScreen>

0 comments on commit b37c68d

Please sign in to comment.