Commit Graph

34 Commits

Author SHA1 Message Date
Andy Wickham
a601341ff5 Add a WindowInsetsAnimationCallback to listen to IME changes.
This handles cases that were previously ignored, such as dismissing
the IME with the back key/gesture.

Removed extraneous manual state updates that were used for specific
cases previously. The only remaining state updates are from our
controlled IME animation in KeyboardInsetsHandler, as that correctly
handles the case where you start closing the IME but end up keeping
it open (or vice versa).

Bug: 277738379
Fix: 320659754
Test: Manually go through various IME transitions on Launcher,
open and close apps, lock/unlock, etc to verify keyboard state
is correctly updated. And verify b/320659754 steps do not repro.
Flag: NA

Change-Id: I4787afbb37eed815b909a0215d8afeb3894ab985
2024-01-23 15:56:37 -08:00
Anushree Ganjam
f6e1c01b6b Merge "Move the cursor to the end of the text in edit text." into main 2023-11-15 22:57:26 +00:00
Anushree Ganjam
c3bf394009 Move the cursor to the end of the text in edit text.
Before fix: https://b.corp.google.com/issues/301625831#comment9

After fix: https://b.corp.google.com/issues/301625831#comment10

Bug: 301625831
Test: Manual
Flag: NA, Fixing for hardware keyboard.
Change-Id: I817836a0a76b8677eb65c65720f436882fe6431f
2023-11-15 13:31:26 -08:00
Luca Zuccarini
6ab61069f3 Refine way to trigger the keyboard for a controlled insets animation.
Before we did it as normal just without requesting focus. However, we
also need to not log the new state, as this must happen only after the
controlled animation has completed (or been cancelled).

Bug: 309756056
Flag: NA
Test: manual
Change-Id: I7f1564d2b29d91c9fdb0afce586fe5cc1148bac0
2023-11-14 08:20:40 +00:00
Pat Manning
b53d8d6360 Fix focus navigation of All Apps when using external keyboard.
- All apps icons do not show the focus rectangle when focused as mIconFocusListener is null in BaseAllAppsAdapter when onCreateViewHolder is called.
- All apps recyclerview does not scroll down when focus goes from top to bottom of list, as AllAppsToastUiDelegate calls hideKeyboard which clears focus.
- Focus goes behind AllApps into hotseat, so update hotseat setDescendantFocusability.

Flag: NONE
Fix: 296844600
Test: TaplKeyboardFocusTest
Change-Id: I65f6fbb6f4df0be4b4ff922dda267d27da16effe
2023-10-31 13:47:12 +00:00
Andy Wickham
336c6669b0 Remove unnecessary hide keyboard call in onKeyPreIme.
The default handling of back in this preIme case already closes
the keyboard if we return false, so adding it before our own key
handling was stomping on our existing syncronized keyboard.

We should still handle other cases where the system ime animation
coincides with our control, but we at least shouldn't force it on
ourselves.

This fixes the back issue in 3 button mode, and also closes all
apps on the first back gesture as intended (if you hadn't entered
0 state that is).

Demo after fix: https://drive.google.com/file/d/1pK18iEdgxQ0HQmilAMFzn66LVyCH5Ma1/view?usp=drive_link&resourcekey=0-kW4BOC-Pj-wZ_DZL51z6Rg

Bug: 270144901
Bug: 277738379
Test: Manual with 3 button mode and gesture nav, with always on
keyboard on and off
Flag: N/A

Change-Id: I9b1c525494b49cde3307df8b0a73d6143ac9c616
2023-08-25 17:26:33 -07:00
Luca Zuccarini
95bc2ce2cc Update usage of ExtendedEditText.showSoftInput().
Fix: 276637107
Flag: N/A
Test: manual

Change-Id: I61eeff5fb69d00b44e7987458a808f59998be676
2023-08-08 15:05:44 +00:00
Holly Sun
196d55aa77 [QL-v2] Reset input state on scroll and restore state on scrolling back.
Bug: 261872461
Test: see video in bug
Change-Id: I18e1923bdd4c40e84e46579296b69268d46c9fa1
2022-12-12 14:03:31 -08:00
Luca Zuccarini
0a3d67f34f Add support for multiple focus listeners to ExtendedEditText.
Bug: 249952937
Test: manual, see other bug in the topic
Change-Id: I8cc6f525d1a895cc9ee6c6087b51af330d4f25a6
2022-11-17 13:07:16 +00:00
Sunny Goyal
8958a7078a Simplifying hideKeyboardAsync method
Bug: 246000321
Test: Presubmit
Change-Id: I2851c49b61b662d4a5b7cd0a863f690fd74a8bd0
Merged-In: I2851c49b61b662d4a5b7cd0a863f690fd74a8bd0
2022-09-10 04:01:48 +00:00
Anushree Ganjam
a461660fa8 Introduce KeyboardStateManager to maintain keyboardstate as show or hide.
- Add a feature flag for IME Latency logging.

- Removed mShowImeAfterFirstLayout from ExtendedEditText.

   http://ag/1414509 added `mShowImeAfterFirstLayout`and cl description
   says "Show IME when search query != null after rotation".

   I verified the behavior by turning on "Allow home screen rotation".
   Keyboard is not getting dismissed on rotation in AA+ screen in a-z list
   or even in the search screen.
   Video : https://drive.google.com/file/d/1BWUTrW9OSEo6ojErj8INMwjFCPArVD4B/view?usp=sharing&resourcekey=0-SXTcKyUw1wCSi8Bm37ktow

Bug: 240192346
Test: Manual.

Verified by setting `ENABLE_KEYBOARD_TRANSITION_SYNC` to false and for
following usecases.

- All apps entry with ime enabled, scrolling a-z list to hide keyboard
- Folder name change - showing and dismissing keyboard
- Toast entry from Allapps and QSB - showing and dismissing keyboard

Change-Id: I1a6b5759b8e71e77744f58677b6d1b73e2f633e8
2022-09-09 04:32:33 +00:00
hyunyoungs
d7a02ec7ae Fix IME hiding animation being delayed after unlocking the device
Hide keyboard with WindowInsetsController if could. In case
hideSoftInputFromWindow may ignored by input connection being finished
when the screen is off.

Bug: 233158645
Test: manual as steps:
  1.  Launch AllApps.
  2.  Tap search bar to invoke IME.
  3.  Screen off.
  4.  Screen on.
And all other keyboard hide cases such as back gesture, swipe down, etc.

Change-Id: I4154f38f94b6760a430f7510a650422020d8f59a
2022-06-03 14:19:45 -07:00
sfufa@google.com
b0ec41285b [Search] Avoiding hiding keyboard when clearing search text
Bug: 199555357
Test: manual
Change-Id: I7bc9b7097427aed3b526c8d75956d323e819e79b
2021-10-04 14:23:14 -07:00
Samuel Fufa
47f80b5c9a [Search] Apply background to entire SearchInput view instead of just EditText
Bug: 199555357
Test: visual
Change-Id: Ice966416e901e7c601b44529d0422798e943e222
2021-09-10 16:29:53 -07:00
y
8dcd7e0ce7 [Search] Update AllApps header protection
- Disables header protection on AOSP
- Fades in/out search box pill instead of sudden movements
- Work tabs protection shows and hides based on scroll position

Bug: 194106968 [APK attached]
Test: Manual
Change-Id: I5532847ddba3d4555003b0934b8fc846dc5a5cc7
2021-08-29 22:56:54 -07:00
Hyunyoung Song
011f438c97 When KEYCODE_BACK is received, hide keyboard
Bug: 191845409
Bug: 190351740

Test: manual
Change-Id: I9e3a55f7eb81b2c2a668532ebb991cefbf248163
2021-06-25 01:28:27 -07:00
Hyunyoung Song
7d3b25734a Hide searchbox when header protection is on.
Bug: 191726215
Test: manual
Change-Id: I086a05654faf718683ebe5dfbcf64b6bd6347ca8
2021-06-23 00:44:49 -07:00
Sunny Goyal
5996937798 Removing Launcher dependency from Folders
This allows opening/closing folders without a Launcher context

Bug: 187353581
Test: Manual
Change-Id: Id73a40445a23004eb554f0422d286aa0ff6b3c41
2021-05-10 14:01:43 -07:00
Hyunyoung Song
e25ee1ed98 Check IME visibility check before calling IMM.hide()
Bug: 183062683
Bug: 185558351

Test: manual
Change-Id: Ib3bee0f895cc03c6faeb662d078d013ac4d6e406
2021-05-01 01:50:19 -07:00
Hyunyoung Song
a907a995c9 Hide keyboard only when scrolling happens
Bug: 179307221
Test: see attached video

Change-Id: I9b13c8f62122a6d7bf56a28c830be9a9dbfee52a
2021-03-16 00:05:04 -07:00
Hyunyoung Song
b9f9d69f67 Hide IME when scrolling happens on all apps screen/scroller
Bug: 161594550

TL;DR;;
- draging an item closes the IME
- clearing a searchbox to empty string has no effect on IME

Change-Id: Ic3a91d1b22434dcb78347dd8b12b5ceab14eb928
2020-08-19 01:20:06 -07:00
Hyunyoung Song
48e6489871 Introduce folder name type (auto vs manual).
Bug: 147769158

- Use both InputConnectionWrapper and TextWatcher to detect
manual input
- Also fix a bug in FolderNameProvider

Change-Id: I7bc0f380c6641481d934a53e9feb77caa19c674a
2020-01-26 22:34:31 -08:00
Hyunyoung Song
54d1f88ae6 Show suggestion when user taps on folder's edit text
Also, enabled preloading of the folder name db
Bug: 147523650
Bug: 147359653

Change-Id: Ia77e12d2b2bc428263c2b2821a96894a6004d82e
2020-01-11 23:39:02 -08:00
Hyunyoung Song
9153ff7eed Move the cursor to the end after accepting gboard selection
Bug: 146909183

Change-Id: Ic7868d6d98f0b5a1798178cbaf512be1d347a962
2019-12-27 06:16:26 -08:00
Hyunyoung Song
5fcd8f9647 Provide up to 3 folder name suggestions to active IME
Bug: 144973594

Change-Id: I92078fffd68a1230fd87d2387404c8a2fed55bc0
2019-11-22 08:19:17 +00:00
Mehdi Alizadeh
25b4dfee29 Hides the keyboard when qsb loses focus in All apps
Bug: 80190879
Change-Id: I88da6ef7a88b9dd4fce06e4f2b4592ee6ce39195
2018-06-05 16:22:35 -07:00
Sunny Goyal
326403e958 Moving some calls off the UI thread
This saves ~5ms in onNewIntent

Bug: 67305604
Change-Id: Ic97727b1c526e50bd3c8a1d8f511e1d7fd5e05e7
2017-10-02 14:50:09 -07:00
Jon Miranda
54d4e645b3 Enable suggestions for Folder names.
We turn on suggestions, turn off auto complete, and disable the
default behavior where red lines appear under typos.

Bug: 30055146
Change-Id: Ia151b7a4db1dfc6908504e6ea82a1f6989f05ca5
2017-02-24 15:51:09 -08:00
Sunny Goyal
740ac7f00e Refactoring floating view opening/closing logic
> Creating a base view for floating panels with some common methods
> Moving the getOpen method to individual classes
> Moving the folder icon animation logic to folder icon
> Moving all the logic related for opening folder to Folder class

Change-Id: I898dfb6870b857cb921d2729b89618bc43ff2e88
2016-10-10 13:36:03 -07:00
Hyunyoung Song
7e83ab90ae Make IME less sticky when launching a new app
b/31382106

Change-Id: Iee60a2f7e6a70858623e80d4b8b68154d1941210
2016-09-21 17:03:56 -07:00
Hyunyoung Song
3f9d647de6 Fix ExtendedEditText not handling touch correctly
b/31555902

Change-Id: Ife23cf6af29ac47315aee4abc0ffe2dbcde352f9
2016-09-20 12:37:41 -07:00
Hyunyoung Song
c2fe1147f9 Show IME when search query != null after rotation
Change-Id: Ia35fba140a5addc21bf347cd63b72dc4e357421e
2016-09-09 15:02:20 -07:00
Winson
4e7a1018bc Merge commit '97b0d08d' into manualmerge
Change-Id: Iac7e46fb2ac364c983beec6460f99ee1d6b11d32
2015-08-13 16:50:14 -07:00
Winson
97b0d08d92 Refactoring to ExtendedEditText. 2015-08-13 15:58:51 -07:00