mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-22 15:50:51 +01:00
Adding edit text into the screen
This commit is contained in:
parent
54aec63f6c
commit
c3d359e58f
@ -3296,6 +3296,9 @@
|
||||
<string name="device_manager_session_details_session_last_activity">Last activity</string>
|
||||
<string name="device_manager_session_details_device_ip_address">IP address</string>
|
||||
<string name="device_manager_session_rename">Rename session</string>
|
||||
<string name="device_manager_session_rename_edit_hint">Session name</string>
|
||||
<string name="device_manager_session_rename_description">Custom session names can help you recognize your devices more easily.</string>
|
||||
<string name="device_manager_session_rename_warning">Please be aware that session names are also visible to people you communicate with.</string>
|
||||
|
||||
<!-- Note to translators: %s will be replaces with selected space name -->
|
||||
<string name="home_empty_space_no_rooms_title">%s\nis looking a little empty.</string>
|
||||
|
@ -40,6 +40,8 @@ class RenameSessionFragment :
|
||||
|
||||
@Inject lateinit var viewNavigator: RenameSessionViewNavigator
|
||||
|
||||
private var renameEditTextInitialized = false
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentSessionRenameBinding {
|
||||
return FragmentSessionRenameBinding.inflate(inflater, container, false)
|
||||
}
|
||||
@ -66,7 +68,10 @@ class RenameSessionFragment :
|
||||
}
|
||||
}
|
||||
|
||||
override fun invalidate() = withState(viewModel) { _ ->
|
||||
// TODO
|
||||
override fun invalidate() = withState(viewModel) { state ->
|
||||
if(renameEditTextInitialized.not()) {
|
||||
views.renameSessionEditText.setText(state.deviceName)
|
||||
renameEditTextInitialized = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/renameSessionInputLayout"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/layout_horizontal_margin"
|
||||
android:layout_marginTop="28dp"
|
||||
android:hint="@string/device_manager_session_rename_edit_hint"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/renameSessionEditText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/renameSessionDescription"
|
||||
style="@style/TextAppearance.Vector.Body.DevicesManagement"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/layout_horizontal_margin"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/device_manager_session_rename_description"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/renameSessionInputLayout" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
Loading…
Reference in New Issue
Block a user