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
19 changes: 6 additions & 13 deletions common/src/main/java/com/itsaky/androidide/utils/ViewExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,12 @@ fun View.applyLongPressRecursively(listener: (View) -> Boolean) {

setOnLongClickListener { listener(it) }
isLongClickable = true
if (this is ViewGroup) {
for (i in 0 until childCount) {
val currentView = getChildAt(i)
if (currentView is Slider) {
currentView.setupGestureHandling(
onLongPress = { view -> listener(view) },
onDrag = {},
)
} else {
currentView.applyLongPressRecursively(listener)
}
}
}
if (this is ViewGroup) {
for (i in 0 until childCount) {
val currentView = getChildAt(i)
currentView.applyLongPressRecursively(listener)
}
}
}

@SuppressLint("ClickableViewAccessibility")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,11 @@ abstract class DialogPreference : SimplePreference() {
val alertDialog = dialog.create()
alertDialog.show()

val listView = alertDialog.listView
listView?.setOnItemLongClickListener { _, view, position, _ ->
TooltipManager.showIdeCategoryTooltip(preference.context, view, tooltipTag)
alertDialog.window?.decorView?.applyLongPressRecursively {
TooltipManager.showIdeCategoryTooltip(preference.context, it, tooltipTag)
true
}

alertDialog.window?.decorView?.applyLongPressRecursively {
TooltipManager.showIdeCategoryTooltip(preference.context, it, tooltipTag)
true
}

return true
}

Expand Down