diff --git a/changelog.d/913.misc b/changelog.d/913.misc new file mode 100644 index 0000000000..64653c0360 --- /dev/null +++ b/changelog.d/913.misc @@ -0,0 +1 @@ +Rendre la FAQ plus visible et accessible \ No newline at end of file diff --git a/library/ui-strings/src/main/res/values-fr/strings.xml b/library/ui-strings/src/main/res/values-fr/strings.xml index 4c8a753117..01f01f5eb7 100644 --- a/library/ui-strings/src/main/res/values-fr/strings.xml +++ b/library/ui-strings/src/main/res/values-fr/strings.xml @@ -877,7 +877,7 @@ URL : Format : Voix et vidéo - Aide et à propos + À propos Inscrire le jeton Faire une suggestion Saisissez votre suggestion ci-dessous. diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt index fdf3f9e0e3..2dda27d429 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt @@ -46,6 +46,7 @@ import im.vector.app.core.extensions.validateBackPressed import im.vector.app.core.platform.VectorBaseActivity import im.vector.app.core.platform.VectorMenuProvider import im.vector.app.core.pushers.UnifiedPushHelper +import im.vector.app.core.utils.openUrlInChromeCustomTab import im.vector.app.core.utils.registerForPermissionsResult import im.vector.app.core.utils.startSharePlainTextIntent import im.vector.app.databinding.ActivityHomeBinding @@ -676,6 +677,11 @@ class HomeActivity : launchQrCode() true } + // Tchap : new faq entry + R.id.menu_home_faq -> { + openUrlInChromeCustomTab(this, null, VectorSettingsUrls.HELP) + true + } else -> false } } 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 0b3dcfa2ac..60e7a15ebe 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 @@ -17,9 +17,12 @@ package im.vector.app.features.settings import android.os.Bundle +import androidx.preference.Preference import dagger.hilt.android.AndroidEntryPoint import im.vector.app.R 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 @AndroidEntryPoint @@ -29,6 +32,8 @@ class VectorSettingsRootFragment : override var titleRes: Int = R.string.title_activity_settings override val preferenceXmlRes = R.xml.vector_settings_root + private val firstThrottler = FirstThrottler(1000) + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) analyticsScreenName = MobileScreen.ScreenName.Settings @@ -36,6 +41,15 @@ class VectorSettingsRootFragment : override fun bindPref() { tintIcons() + + // Tchap : Manage new FAQ entry + findPreference(VectorPreferences.SETTINGS_HELP_PREFERENCE_KEY)!! + .onPreferenceClickListener = Preference.OnPreferenceClickListener { + if (firstThrottler.canHandle() is FirstThrottler.CanHandlerResult.Yes) { + openUrlInChromeCustomTab(requireContext(), null, VectorSettingsUrls.HELP) + } + false + } } private fun tintIcons() { diff --git a/vector/src/main/res/menu/menu_new_home.xml b/vector/src/main/res/menu/menu_new_home.xml index 0993ae6d33..6d9ee4bf61 100644 --- a/vector/src/main/res/menu/menu_new_home.xml +++ b/vector/src/main/res/menu/menu_new_home.xml @@ -17,6 +17,12 @@ android:title="@string/add_by_qr_code" app:showAsAction="never" /> + + + + xmlns:tools="http://schemas.android.com/tools" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + android:title="@string/preference_help" + app:isPreferenceVisible="false"> - \ No newline at end of file + diff --git a/vector/src/main/res/xml/vector_settings_root.xml b/vector/src/main/res/xml/vector_settings_root.xml index 040083020c..96e5543a95 100644 --- a/vector/src/main/res/xml/vector_settings_root.xml +++ b/vector/src/main/res/xml/vector_settings_root.xml @@ -44,6 +44,12 @@ app:fragment="im.vector.app.features.settings.VectorSettingsAdvancedSettingsFragment" app:isPreferenceVisible="@bool/settings_root_advanced_visible" /> + + +