mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Rename sessions screen learn more
This commit is contained in:
parent
20a24162f4
commit
28dee84aee
@ -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) {
|
||||
|
@ -60,6 +60,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/renameSessionInputLayout" />
|
||||
|
||||
<im.vector.app.features.settings.devices.v2.SessionWarningInfoView
|
||||
android:id="@+id/renameSessionInfo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/layout_horizontal_margin"
|
||||
@ -68,6 +69,6 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/renameSessionDescription"
|
||||
app:sessionsWarningInfoDescription="@string/device_manager_session_rename_warning"
|
||||
app:sessionsWarningInfoHasLearnMore="false" />
|
||||
app:sessionsWarningInfoHasLearnMore="true" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
Loading…
Reference in New Issue
Block a user