Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/actions_card">

<TextView
<com.f0x1d.logfox.core.ui.view.NoDragTextView
android:id="@+id/log_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -167,7 +167,7 @@
android:layout_height="match_parent"
android:scrollbars="none">

<TextView
<com.f0x1d.logfox.core.ui.view.NoDragTextView
android:id="@+id/log_text_scrollable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down