Small ui fixes
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package org.koitharu.kotatsu.ui.common.list
|
package org.koitharu.kotatsu.ui.common.list
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.annotation.LayoutRes
|
import androidx.annotation.LayoutRes
|
||||||
@@ -31,10 +32,15 @@ abstract class BaseViewHolder<T, E> protected constructor(view: View) :
|
|||||||
fun setOnItemClickListener(listener: OnRecyclerItemClickListener<T>?): BaseViewHolder<T, E> {
|
fun setOnItemClickListener(listener: OnRecyclerItemClickListener<T>?): BaseViewHolder<T, E> {
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
itemView.setOnClickListener {
|
itemView.setOnClickListener {
|
||||||
listener.onItemClick(boundData ?: return@setOnClickListener, adapterPosition, it)
|
listener.onItemClick(boundData ?: return@setOnClickListener, bindingAdapterPosition, it)
|
||||||
}
|
}
|
||||||
itemView.setOnLongClickListener {
|
itemView.setOnLongClickListener {
|
||||||
listener.onItemLongClick(boundData ?: return@setOnLongClickListener false, adapterPosition, it)
|
listener.onItemLongClick(boundData ?: return@setOnLongClickListener false, bindingAdapterPosition, it)
|
||||||
|
}
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
itemView.setOnContextClickListener {
|
||||||
|
listener.onItemLongClick(boundData ?: return@setOnContextClickListener false, bindingAdapterPosition, it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
|
|||||||
@@ -19,9 +19,10 @@ class AppCrashHandler(private val applicationContext: Context) : Thread.Uncaught
|
|||||||
intent.flags = (Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
|
intent.flags = (Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
try {
|
try {
|
||||||
applicationContext.startActivity(intent)
|
applicationContext.startActivity(intent)
|
||||||
} catch (e: Throwable) {
|
} catch (t: Throwable) {
|
||||||
e.printStackTrace()
|
t.printStackTrace()
|
||||||
}
|
}
|
||||||
|
e.printStackTrace()
|
||||||
exitProcess(1)
|
exitProcess(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="fitCenter"
|
||||||
app:layout_constraintDimensionRatio="13:18"
|
app:layout_constraintDimensionRatio="13:18"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
|||||||
Reference in New Issue
Block a user