Use view binding instead of data binding for AddServerFragment and LoginFragment
This commit is contained in:
parent
94b3790560
commit
ee9dedd7b7
4 changed files with 156 additions and 186 deletions
|
@ -30,9 +30,6 @@ class AddServerFragment : Fragment() {
|
||||||
): View {
|
): View {
|
||||||
binding = FragmentAddServerBinding.inflate(inflater)
|
binding = FragmentAddServerBinding.inflate(inflater)
|
||||||
|
|
||||||
binding.lifecycleOwner = viewLifecycleOwner
|
|
||||||
binding.viewModel = viewModel
|
|
||||||
|
|
||||||
binding.editTextServerAddress.setOnEditorActionListener { _, actionId, _ ->
|
binding.editTextServerAddress.setOnEditorActionListener { _, actionId, _ ->
|
||||||
return@setOnEditorActionListener when (actionId) {
|
return@setOnEditorActionListener when (actionId) {
|
||||||
EditorInfo.IME_ACTION_GO -> {
|
EditorInfo.IME_ACTION_GO -> {
|
||||||
|
|
|
@ -30,9 +30,6 @@ class LoginFragment : Fragment() {
|
||||||
): View {
|
): View {
|
||||||
binding = FragmentLoginBinding.inflate(inflater)
|
binding = FragmentLoginBinding.inflate(inflater)
|
||||||
|
|
||||||
binding.lifecycleOwner = viewLifecycleOwner
|
|
||||||
binding.viewModel = viewModel
|
|
||||||
|
|
||||||
binding.editTextPassword.setOnEditorActionListener { _, actionId, _ ->
|
binding.editTextPassword.setOnEditorActionListener { _, actionId, _ ->
|
||||||
return@setOnEditorActionListener when (actionId) {
|
return@setOnEditorActionListener when (actionId) {
|
||||||
EditorInfo.IME_ACTION_GO -> {
|
EditorInfo.IME_ACTION_GO -> {
|
||||||
|
|
|
@ -1,17 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
||||||
<data>
|
|
||||||
|
|
||||||
<variable
|
|
||||||
name="viewModel"
|
|
||||||
type="dev.jdtech.jellyfin.viewmodels.AddServerViewModel" />
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:fillViewport="true"
|
android:fillViewport="true"
|
||||||
|
@ -100,6 +90,4 @@
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</layout>
|
|
||||||
|
|
|
@ -1,17 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
||||||
<data>
|
|
||||||
|
|
||||||
<variable
|
|
||||||
name="viewModel"
|
|
||||||
type="dev.jdtech.jellyfin.viewmodels.LoginViewModel" />
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:fillViewport="true"
|
android:fillViewport="true"
|
||||||
|
@ -116,6 +106,4 @@
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</layout>
|
|
||||||
|
|
Loading…
Reference in a new issue