mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 11:42:22 +08:00
perf: click
This commit is contained in:
parent
e41064c3d9
commit
0c1a13c392
|
@ -57,7 +57,16 @@ val clickCenter: ActionFc = { context, node ->
|
|||
}
|
||||
|
||||
val click: ActionFc = { context, node ->
|
||||
if (node.isClickable) clickNode(context, node) else clickCenter(context, node)
|
||||
if (node.isClickable) {
|
||||
val result = clickNode(context, node)
|
||||
if (result.result) {
|
||||
result
|
||||
} else {
|
||||
clickCenter(context, node)
|
||||
}
|
||||
} else {
|
||||
clickCenter(context, node)
|
||||
}
|
||||
}
|
||||
|
||||
val longClickNode: ActionFc = { _, node ->
|
||||
|
@ -96,7 +105,16 @@ val longClickCenter: ActionFc = { context, node ->
|
|||
|
||||
|
||||
val longClick: ActionFc = { context, node ->
|
||||
if (node.isLongClickable) longClickNode(context, node) else longClickCenter(context, node)
|
||||
if (node.isLongClickable) {
|
||||
val result = longClickNode(context, node)
|
||||
if (result.result) {
|
||||
result
|
||||
} else {
|
||||
longClickCenter(context, node)
|
||||
}
|
||||
} else {
|
||||
longClickCenter(context, node)
|
||||
}
|
||||
}
|
||||
|
||||
val backFc: ActionFc = { context, _ ->
|
||||
|
|
Loading…
Reference in New Issue
Block a user