refactor(server_item): remove databinding
This commit is contained in:
parent
012a597157
commit
6ffc761972
2 changed files with 42 additions and 54 deletions
|
@ -15,8 +15,7 @@ class ServerGridAdapter(
|
|||
class ServerViewHolder(private var binding: ServerItemBinding) :
|
||||
RecyclerView.ViewHolder(binding.root) {
|
||||
fun bind(server: Server) {
|
||||
binding.server = server
|
||||
binding.executePendingBindings()
|
||||
binding.serverName.text = server.name
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,7 @@
|
|||
<?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:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="server"
|
||||
type="dev.jdtech.jellyfin.models.Server" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
|
@ -47,7 +38,6 @@
|
|||
android:id="@+id/server_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{server.name}"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -55,5 +45,4 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/server_icon"
|
||||
tools:text="JDTech" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in a new issue