mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2026-05-16 04:52:39 +02:00
Fixed crash in TextView drag drop.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.futo.platformplayer.views.behavior
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import com.futo.platformplayer.logging.Logger
|
||||
|
||||
class SafeTextView : AppCompatTextView {
|
||||
constructor(context: Context) : super(context) {}
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {}
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
|
||||
|
||||
override fun performLongClick(): Boolean {
|
||||
try {
|
||||
return super.performLongClick()
|
||||
} catch (e: IllegalStateException) {
|
||||
Logger.w(TAG, "Swallowed exception", e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "SafeTextView"
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/topbar"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<TextView
|
||||
<com.futo.platformplayer.views.behavior.SafeTextView
|
||||
android:id="@+id/text_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user