From 28dee84aee99ca1047a8d17efe8abe88298afa35 Mon Sep 17 00:00:00 2001 From: Maxime NATUREL Date: Wed, 28 Sep 2022 14:01:09 +0200 Subject: [PATCH] Rename sessions screen learn more --- .../devices/v2/rename/RenameSessionFragment.kt | 17 +++++++++++++++++ .../main/res/layout/fragment_session_rename.xml | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/settings/devices/v2/rename/RenameSessionFragment.kt b/vector/src/main/java/im/vector/app/features/settings/devices/v2/rename/RenameSessionFragment.kt index df92bee100..2f671492e3 100644 --- a/vector/src/main/java/im/vector/app/features/settings/devices/v2/rename/RenameSessionFragment.kt +++ b/vector/src/main/java/im/vector/app/features/settings/devices/v2/rename/RenameSessionFragment.kt @@ -24,9 +24,11 @@ import androidx.core.widget.doOnTextChanged import com.airbnb.mvrx.fragmentViewModel import com.airbnb.mvrx.withState import dagger.hilt.android.AndroidEntryPoint +import im.vector.app.R import im.vector.app.core.extensions.showKeyboard import im.vector.app.core.platform.VectorBaseFragment import im.vector.app.databinding.FragmentSessionRenameBinding +import im.vector.app.features.settings.devices.v2.more.SessionLearnMoreBottomSheet import javax.inject.Inject /** @@ -51,6 +53,7 @@ class RenameSessionFragment : initEditText() initSaveButton() initWithLastEditedName() + initInfoView() } private fun initToolbar() { @@ -75,6 +78,20 @@ class RenameSessionFragment : viewModel.handle(RenameSessionAction.InitWithLastEditedName) } + private fun initInfoView() { + views.renameSessionInfo.onLearnMoreClickListener = { + showLearnMoreInfo() + } + } + + private fun showLearnMoreInfo() { + val args = SessionLearnMoreBottomSheet.Args( + title = getString(R.string.device_manager_learn_more_session_rename_title), + description = getString(R.string.device_manager_learn_more_session_rename), + ) + SessionLearnMoreBottomSheet.show(childFragmentManager, args) + } + private fun observeViewEvents() { viewModel.observeViewEvents { when (it) { diff --git a/vector/src/main/res/layout/fragment_session_rename.xml b/vector/src/main/res/layout/fragment_session_rename.xml index 12b8af00f0..cbca907353 100644 --- a/vector/src/main/res/layout/fragment_session_rename.xml +++ b/vector/src/main/res/layout/fragment_session_rename.xml @@ -60,6 +60,7 @@ app:layout_constraintTop_toBottomOf="@id/renameSessionInputLayout" /> + app:sessionsWarningInfoHasLearnMore="true" />