Repository navigation
カスタムキーボードの長押し終了処理を修正 / Fix custom keyboard long-press release handling - #1366
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
日本語
削除キーを長押ししてから上・右にフリックすると、指を離した方向のアクションで長押し終了を処理していました。空欄に見える「何もしない」や空文字の割り当てでは、開始済みの削除リピートが止まらず、その後に入力した文字も削除されることがありました。
フリック先のアクションが変わった時点で、直前に開始した長押しをキャンセルします。タッチのキャンセルやコントローラーの破棄でも、開始済みのアクションへキャンセルを通知します。
カスタムキーボード間の切り替えが長押し後に反応しない報告も修正しました。単押しの特殊キーは長押し判定後に通常のアクションを実行せず、指を離しても切り替わりませんでした。カスタムレイアウトの特殊キーで1回の操作を行うものは、指を離した時点で通常のアクションを実行します。この処理は単押しとフリックの両方に適用します。削除リピートやカーソルの連続移動などには専用の長押し処理を使います。
「空のフレキシブルレイアウト」を使った Robolectric の回帰テストで、上・右それぞれについて、割り当てなし、「何もしない」、空文字、操作の割り当てありの各ケースを検証しました。削除のキャンセル通知、指を離したときのアクション、その直後の QWERTY キー
aの入力通知を確認しました。./gradlew --offline :custom_keyboard:testDebugUnitTestは352件すべて通過しました。アプリ側では、長押しを離すと指定のカスタムキーボードが選択されること、キーの外へドラッグして単押しをキャンセルできること、フリック先の絵文字キーが離したときに1回動作すること、削除のリピートが離したときに止まることを確認しました。Android Lite 版の関連テスト38件が通過しました。
English
The controller handled the end of a long press using the action selected at key-up. An explicit no-op or empty text mapping could leave an already running backspace repeat active, allowing it to delete later input.
The controller now cancels the active long-press action when the selected action changes. Touch cancellation and controller disposal also cancel the active action.
The separate keyboard-switch report came from the long-press path skipping the regular action on a single-action key. Custom special keys that perform a one-shot action now execute the regular action once on release, including actions assigned to flick directions. Backspace repeat and other dedicated hold actions use their existing long-press handlers.
A Robolectric regression test uses the Empty 5x4 Flexible Layout with a delete key and a QWERTY
akey. It covers up and right flicks with no mapping, a no-op, empty text, and an assigned action. It checks delete cancellation, the release action, and the followingainput callback. All 352 tests passed with./gradlew --offline :custom_keyboard:testDebugUnitTest.Robolectric tests exercise the IME listener and verify selecting the destination custom keyboard on release, canceling by dragging off a single-action key, opening the emoji keyboard once after a held flick, and stopping backspace repeat on release. All 38 selected Lite app tests passed.