mirror of
https://github.com/fcitx5-android/fcitx5-android.git
synced 2026-08-02 20:16:06 +08:00
remove dismissClearPopupIfAny reduandent
This commit is contained in:
parent
c1ad8f3dd5
commit
723d87b734
@ -13,7 +13,6 @@ import androidx.annotation.DrawableRes
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.children
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import org.fcitx.fcitx5.android.R
|
||||
import org.fcitx.fcitx5.android.core.FcitxKeyMapping
|
||||
import org.fcitx.fcitx5.android.core.InputMethodEntry
|
||||
import org.fcitx.fcitx5.android.core.KeyStates
|
||||
@ -95,10 +94,7 @@ abstract class BaseKeyboard(
|
||||
*/
|
||||
private val touchTarget = hashMapOf<Int, View>()
|
||||
|
||||
private fun dismissClearPopupIfAny() {
|
||||
// Dismiss lingering Backspace clear-confirm popup if present
|
||||
onPopupAction(PopupAction.DismissAction(R.id.button_backspace))
|
||||
}
|
||||
|
||||
|
||||
init {
|
||||
isMotionEventSplittingEnabled = true
|
||||
@ -232,13 +228,11 @@ abstract class BaseKeyboard(
|
||||
when (it) {
|
||||
is KeyDef.Behavior.Press -> {
|
||||
setOnClickListener { _ ->
|
||||
dismissClearPopupIfAny()
|
||||
onAction(it.action)
|
||||
}
|
||||
}
|
||||
is KeyDef.Behavior.LongPress -> {
|
||||
setOnLongClickListener { _ ->
|
||||
dismissClearPopupIfAny()
|
||||
onAction(it.action)
|
||||
true
|
||||
}
|
||||
@ -259,7 +253,6 @@ abstract class BaseKeyboard(
|
||||
when (event.type) {
|
||||
GestureType.Up -> {
|
||||
if (!event.consumed && swipeSymbolDirection.checkY(event.totalY)) {
|
||||
dismissClearPopupIfAny()
|
||||
onAction(it.action)
|
||||
true
|
||||
} else {
|
||||
@ -284,7 +277,6 @@ abstract class BaseKeyboard(
|
||||
is KeyDef.Popup.Menu -> {
|
||||
setOnLongClickListener { view ->
|
||||
view as KeyView
|
||||
dismissClearPopupIfAny()
|
||||
onPopupAction(PopupAction.ShowMenuAction(view.id, it, view.bounds))
|
||||
// do not consume this LongClick gesture
|
||||
false
|
||||
@ -307,7 +299,6 @@ abstract class BaseKeyboard(
|
||||
is KeyDef.Popup.Keyboard -> {
|
||||
setOnLongClickListener { view ->
|
||||
view as KeyView
|
||||
dismissClearPopupIfAny()
|
||||
onPopupAction(PopupAction.ShowKeyboardAction(view.id, it, view.bounds))
|
||||
// do not consume this LongClick gesture
|
||||
false
|
||||
@ -337,7 +328,6 @@ abstract class BaseKeyboard(
|
||||
showDelayMs = 300L,
|
||||
callbacks = object : BackspaceClearController.Callbacks {
|
||||
override fun showClearConfirm(danger: Boolean) {
|
||||
dismissClearPopupIfAny()
|
||||
onPopupAction(
|
||||
PopupAction.ShowClearConfirmAction(id, bounds, danger)
|
||||
)
|
||||
@ -377,7 +367,6 @@ abstract class BaseKeyboard(
|
||||
if (popupOnKeyPress) {
|
||||
when (event.type) {
|
||||
GestureType.Down -> {
|
||||
dismissClearPopupIfAny()
|
||||
onPopupAction(
|
||||
PopupAction.PreviewAction(view.id, it.content, view.bounds)
|
||||
)
|
||||
@ -405,7 +394,6 @@ abstract class BaseKeyboard(
|
||||
if (popupOnKeyPress) {
|
||||
when (event.type) {
|
||||
GestureType.Down -> {
|
||||
dismissClearPopupIfAny()
|
||||
onPopupAction(
|
||||
PopupAction.PreviewAction(view.id, it.content, view.bounds)
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user