diff --git a/core/ui/view/src/main/kotlin/com/f0x1d/logfox/core/ui/view/NoDragTextView.kt b/core/ui/view/src/main/kotlin/com/f0x1d/logfox/core/ui/view/NoDragTextView.kt new file mode 100644 index 00000000..76bcda14 --- /dev/null +++ b/core/ui/view/src/main/kotlin/com/f0x1d/logfox/core/ui/view/NoDragTextView.kt @@ -0,0 +1,23 @@ +package com.f0x1d.logfox.core.ui.view + +import android.content.Context +import android.util.AttributeSet +import android.view.DragEvent +import androidx.appcompat.widget.AppCompatTextView + +class NoDragTextView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = android.R.attr.textViewStyle, +) : AppCompatTextView(context, attrs, defStyleAttr) { + + // https://github.com/F0x1d/LogFox/issues/216 + override fun onDragEvent(event: DragEvent?): Boolean = false + + override fun performLongClick(): Boolean = try { + super.performLongClick() + } catch (_: IllegalStateException) { + // Drag shadow dimensions must be positive + true + } +} diff --git a/feature/crashes/presentation/src/main/res/layout/fragment_crash_details.xml b/feature/crashes/presentation/src/main/res/layout/fragment_crash_details.xml index ebd47938..bd22f887 100644 --- a/feature/crashes/presentation/src/main/res/layout/fragment_crash_details.xml +++ b/feature/crashes/presentation/src/main/res/layout/fragment_crash_details.xml @@ -152,7 +152,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/actions_card"> - -