Skip to content

Commit

Permalink
Merge pull request #946 from tchapgouv/940-xsss-amelioration-ux-wordi…
Browse files Browse the repository at this point in the history
…ng-et-organisation-des-settings-securite-partie-ii-multidevice

Amélioration UX, wording et organisation des settings sécurité (parti…
  • Loading branch information
NicolasBuquet authored Jul 12, 2023
2 parents b9b2955 + 271cc6f commit 5bc3c48
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 21 deletions.
1 change: 1 addition & 0 deletions changelog.d/940.improvements
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Amélioration UX, wording et organisation des settings sécurité (partie II, multidevice) (#940)
2 changes: 1 addition & 1 deletion library/ui-strings/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@
<string name="settings_silent_notifications_preferences">Configurer les notifications silencieuses</string>
<string name="settings_system_preferences_summary">Choisir la couleur de la LED, les vibrations, le son…</string>
<string name="settings_cryptography_manage_keys">Clés Tchap</string><!-- Tchap: Use custom string -->
<string name="encryption_settings_manage_message_recovery_summary">Gérer la sauvegarde</string><!-- Tchap: Use custom string -->
<string name="encryption_settings_manage_message_recovery_summary">Récupérer mes messages</string><!-- Tchap: Use custom string -->
<string name="notification_silent">Silencieuse</string>
<string name="passphrase_empty_error_message">Veuillez saisir une phrase secrète</string>
<string name="passphrase_passphrase_too_weak">La phrase secrète est trop faible</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ class KeysBackupSettingsRecyclerViewController @Inject constructor(
textButton1(host.stringProvider.getString(R.string.keys_backup_settings_restore_backup_button))
clickOnButton1 { host.listener?.didSelectRestoreMessageRecovery() }

textButton2(host.stringProvider.getString(R.string.keys_backup_settings_delete_backup_button))
clickOnButton2 { host.listener?.didSelectDeleteSetupMessageRecovery() }
// Tchap : hide "Suppress backup" button
// textButton2(host.stringProvider.getString(R.string.keys_backup_settings_delete_backup_button))
// clickOnButton2 { host.listener?.didSelectDeleteSetupMessageRecovery() }
} else {
textButton1(host.stringProvider.getString(R.string.keys_backup_setup))
clickOnButton1 { host.listener?.didSelectSetupMessageRecovery() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,18 @@ class VectorSettingsSecurityPrivacyFragment :
} else {
// just hide all, you can't setup from here
// you should synchronize to get gossips
secureBackupCategory.isVisible = false
// Tchap : here, the section is hidden on Element.
// In Tchap, we want to show it.
secureBackupCategory.isVisible = true
secureBackupPreference.title = getString(R.string.settings_secure_backup_enter_to_setup)
secureBackupPreference.onPreferenceClickListener = Preference.OnPreferenceClickListener {
vectorActivity.let {
it.navigator.requestSelfSessionVerification(it)
}
true
}
// Tchap : remove "Manage backup" button because Secure backup is not activated
manageBackupPref.isVisible = false
}
} else {
// so here we know that 4S is setup
Expand Down Expand Up @@ -372,7 +383,7 @@ class VectorSettingsSecurityPrivacyFragment :
mCrossSigningStatePreference.summary = getString(R.string.encryption_information_dg_xsigning_trusted)
}
xSigningIsEnableInAccount -> {
mCrossSigningStatePreference.setIcon(R.drawable.ic_shield_black)
mCrossSigningStatePreference.setIcon(R.drawable.ic_tchap_cancel) // Tchpa icon
mCrossSigningStatePreference.summary = getString(R.string.encryption_information_dg_xsigning_not_trusted)
}
else -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ class CrossSigningSettingsController @Inject constructor(
titleIconResourceId(R.drawable.ic_shield_trusted)
title(host.stringProvider.getString(R.string.encryption_information_dg_xsigning_complete).toEpoxyCharSequence())
}
genericButtonItem {
id("Reset")
text(host.stringProvider.getString(R.string.reset_cross_signing))
textColor(host.colorProvider.getColor(R.color.palette_tchap_coral)) // Tchap
buttonClickAction {
host.interactionListener?.didTapInitializeCrossSigning()
}
}
// Tchap : don't display "Reset cross-signing" button
// genericButtonItem {
// id("Reset")
// text(host.stringProvider.getString(R.string.reset_cross_signing))
// textColor(host.colorProvider.getColor(R.color.palette_tchap_coral)) // Tchap
// buttonClickAction {
// host.interactionListener?.didTapInitializeCrossSigning()
// }
// }
}
data.xSigningKeysAreTrusted -> {
genericItem {
Expand All @@ -77,7 +78,7 @@ class CrossSigningSettingsController @Inject constructor(
data.xSigningIsEnableInAccount -> {
genericItem {
id("enable")
titleIconResourceId(R.drawable.ic_shield_black)
titleIconResourceId(R.drawable.ic_tchap_cancel) // Tchap icon
title(host.stringProvider.getString(R.string.encryption_information_dg_xsigning_not_trusted).toEpoxyCharSequence())
}
genericButtonItem {
Expand Down
5 changes: 5 additions & 0 deletions vector/src/main/res/drawable/ic_tchap_cancel.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#9B9B9B"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM15.59,7L12,10.59 8.41,7 7,8.41 10.59,12 7,15.59 8.41,17 12,13.41 15.59,17 17,15.59 13.41,12 17,8.41z"/>
</vector>
13 changes: 6 additions & 7 deletions vector/src/main/res/xml/vector_settings_security_privacy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@
android:focusable="false"
android:persistent="false"
android:summary="@string/settings_secure_backup_section_info" />
<im.vector.app.core.preference.VectorPreference
app:icon="@drawable/ic_shield_trusted"
android:key="SETTINGS_SECURE_MESSAGE_RECOVERY_PREFERENCE_KEY"
android:persistent="false"
android:title="@string/encryption_settings_manage_message_recovery_summary"
app:isPreferenceVisible="@bool/tchap_is_key_backup_enabled" />

<im.vector.app.core.preference.VectorPreference
android:icon="@drawable/ic_secure_backup"
android:key="SETTINGS_SECURE_BACKUP_RECOVERY_PREFERENCE_KEY"
android:persistent="false"
android:title="@string/settings_secure_backup_setup" />

<im.vector.app.core.preference.VectorPreference
app:icon="@drawable/ic_shield_trusted"
android:key="SETTINGS_SECURE_MESSAGE_RECOVERY_PREFERENCE_KEY"
android:persistent="false"
android:title="@string/encryption_settings_manage_message_recovery_summary"
app:isPreferenceVisible="@bool/tchap_is_key_backup_enabled" />

</im.vector.app.core.preference.VectorPreferenceCategory>

<!-- devices list entry point -->
Expand Down

0 comments on commit 5bc3c48

Please sign in to comment.