Use view binding instead of data binding for AddServerFragment and LoginFragment

This commit is contained in:
jarnedemeulemeester 2021-11-27 18:56:55 +01:00
parent 94b3790560
commit ee9dedd7b7
No known key found for this signature in database
GPG key ID: 60884A0C1EBA43E5
4 changed files with 156 additions and 186 deletions

View file

@ -30,9 +30,6 @@ class AddServerFragment : Fragment() {
): View {
binding = FragmentAddServerBinding.inflate(inflater)
binding.lifecycleOwner = viewLifecycleOwner
binding.viewModel = viewModel
binding.editTextServerAddress.setOnEditorActionListener { _, actionId, _ ->
return@setOnEditorActionListener when (actionId) {
EditorInfo.IME_ACTION_GO -> {

View file

@ -30,9 +30,6 @@ class LoginFragment : Fragment() {
): View {
binding = FragmentLoginBinding.inflate(inflater)
binding.lifecycleOwner = viewLifecycleOwner
binding.viewModel = viewModel
binding.editTextPassword.setOnEditorActionListener { _, actionId, _ ->
return@setOnEditorActionListener when (actionId) {
EditorInfo.IME_ACTION_GO -> {

View file

@ -1,17 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView 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">
<data>
<variable
name="viewModel"
type="dev.jdtech.jellyfin.viewmodels.AddServerViewModel" />
</data>
<ScrollView
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
@ -100,6 +90,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</layout>
</ScrollView>

View file

@ -1,17 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView 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">
<data>
<variable
name="viewModel"
type="dev.jdtech.jellyfin.viewmodels.LoginViewModel" />
</data>
<ScrollView
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
@ -116,6 +106,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</layout>
</ScrollView>