refactor(discovered_server_item): remove databinding
This commit is contained in:
parent
270f7decaa
commit
5a8b75194d
2 changed files with 43 additions and 55 deletions
|
@ -17,8 +17,7 @@ class DiscoveredServerListAdapter(
|
||||||
class DiscoveredServerViewHolder(private var binding: DiscoveredServerItemBinding) :
|
class DiscoveredServerViewHolder(private var binding: DiscoveredServerItemBinding) :
|
||||||
RecyclerView.ViewHolder(binding.root) {
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
fun bind(server: DiscoveredServer) {
|
fun bind(server: DiscoveredServer) {
|
||||||
binding.server = server
|
binding.serverName.text = server.name
|
||||||
binding.executePendingBindings()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout 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="server"
|
|
||||||
type="dev.jdtech.jellyfin.models.DiscoveredServer" />
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="64dp"
|
android:layout_width="64dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="12dp"
|
android:layout_marginHorizontal="12dp"
|
||||||
|
@ -44,8 +35,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:maxLines="1"
|
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
android:text="@{server.name}"
|
android:text="@{server.name}"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
|
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
|
||||||
|
@ -55,5 +46,3 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/server_icon"
|
app:layout_constraintTop_toBottomOf="@id/server_icon"
|
||||||
tools:text="server name" />
|
tools:text="server name" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</layout>
|
|
Loading…
Reference in a new issue