refactor(server_address_list_item): remove databinding

This commit is contained in:
Jarne Demeulemeester 2023-07-31 23:44:21 +02:00
parent 5a8b75194d
commit 012a597157
No known key found for this signature in database
GPG key ID: 1E5C6AFBD622E9F5
3 changed files with 19 additions and 33 deletions

View file

@ -15,8 +15,7 @@ class ServerAddressAdapter(
class ServerAddressViewHolder(private var binding: ServerAddressListItemBinding) : class ServerAddressViewHolder(private var binding: ServerAddressListItemBinding) :
RecyclerView.ViewHolder(binding.root) { RecyclerView.ViewHolder(binding.root) {
fun bind(address: ServerAddress) { fun bind(address: ServerAddress) {
binding.address = address binding.serverAddress.text = address.address
binding.executePendingBindings()
} }
} }

View file

@ -37,7 +37,6 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text="@{server.name}"
android:textAlignment="center" android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium" android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"

View file

@ -1,15 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools"
<data>
<variable
name="address"
type="dev.jdtech.jellyfin.models.ServerAddress" />
</data>
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp" android:layout_marginHorizontal="24dp"
@ -20,15 +11,12 @@
android:foreground="@drawable/ripple_background"> android:foreground="@drawable/ripple_background">
<TextView <TextView
android:id="@+id/user_name" android:id="@+id/server_address"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="12dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text="@{address.address}"
android:layout_margin="12dp"
android:textAppearance="@style/TextAppearance.Material3.BodyLarge" android:textAppearance="@style/TextAppearance.Material3.BodyLarge"
tools:text="https://..." /> tools:text="https://..." />
</LinearLayout> </LinearLayout>
</layout>