summaryrefslogtreecommitdiff
path: root/core/java/android/widget/AutoCompleteTextView.java
Commit message (Collapse)AuthorAgeFilesLines
* Migrate AutoCompleteTextView to use OnBackInvokedDispatcher.Shan Huang2022-05-181-0/+47
| | | | | | | | | | | | With ag/17952046 we now actively intercept KEYCODE_BACK before they are sent to IME when new back flow is used. This requires us to migrate AutoCompleteTextView#onKeyPreIme, and is also what causes the test failure in b/231960630. Test: atest AutoCompleteTextView test. Test: Test back behavior of AutoCompleteTextView in BackTestApp. Bug: 231960630 Change-Id: I1a5e01c9a4f8f0e762b493284650854a230aecd3
* Clear popups on KEYCODE_ESCAPE as well as KEYCODE_BACKMatthew Duggan2021-07-061-2/+2
| | | | | | | | | | | | On desktop devices, users expect that the Escape key will clear various popup windows in the same way as the Back button will on mobile devices. This adds support for Escape to places the Back button currently clears ListPopupWindow, AutoCompleteTextView, PopupWindow, and ScrollView. Bug: 174164194 Test: Open popups of each type on a device with a physical keyboard and press escape. Change-Id: I32e65ce4317db7de043c8a050d87126b0f38acce
* Provide AutoCompleteTextView as an accessibility class nameHiroki Sato2020-11-241-0/+5
| | | | | | | | | | This helps AccessibilityService to detect if an EditText is capable of showing an auto complete or not. Bug: 173744816 Bug: 150827488 Test: manual. Change-Id: I47636bf9491fdbfc1fbca3c24f4ea5a551578cfd
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-3/+3
| | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-3/+3
| | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-3/+3
| | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* Process numpad enter key along with enter key.Byungsung You2020-04-151-0/+1
| | | | | | | | | | | | Some views define only KEYCODE_ENTER action not KEYCODE_NUMPAD_ENTER. because of this, when numpad enter key is pressed expected result is not shown. We are adding KEYCODE_NUMPAD_ENTER to be processed in the same way as KEYCODE_ENTER. Test: Check that adb shell input KEYCODE_NUMPAD_ENTER and adb shell input KEYCODE_ENTER Bug: b/141329038 Change-Id: I87b5159c4fe71eaf8501059249c79b7cfd1752fc
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I5be7335b23a92b8ac80d2fd890198273b66ad644
* Addressing API review comments for AutoCompleteTextViewRalston Da Silva2019-03-121-2/+16
| | | | | | | Bug: 126376225 Test: Ran android.widget.cts.AutoCompleteTextViewTest Change-Id: I3c665debb29a82075a39ddaef493dea288f0507c
* Removing hidden api usage from AutoCompleteTextViewRalston Da Silva2019-02-141-3/+35
| | | | | | | | | | ensureImeVisible() was added to show the keyboard in SearchDialog go/ensureImeVisible-added. A better fix would be to expose a function to setInputMethodMode(), as showDropDown() is public and can be called externally. Adding this new API in this CL. Bug: 123768913 Test: Added tests to android.widget.AutoCompleteTextViewTest. Change-Id: I07e53c6d5e93d1e33381f8f87f75a7dee2f2f5a5
* Merge "Update core widgets to save attribute source info."Aurimas Liutikas2019-02-111-0/+4
|\
| * Update core widgets to save attribute source info.Aurimas Liutikas2019-02-071-0/+4
| | | | | | | | | | | | Bug: 111439551 Test: make -j Change-Id: I72997a87122f38b32e38e42a690385acc7d0e521
* | Removing hidden api usage from AutoCompleteTextViewRalston Da Silva2019-02-091-29/+51
|/ | | | | | | | | | | | | | | | | | | | doBeforeTextChanged() and doAfterTextChanged() were being called to trigger a refresh of the autocomplete suggestions when the refresh was not automatically triggered by text input. An androidx usage example is in SearchView, where we need to trigger the autocomplete results manually. https://cs.corp.google.com/aosp-kitkat/frameworks/support/v7/appcompat/src/android/support/v7/widget/SearchView.java?rcl=197708fc4fc0a6a5ede2da2479613382b561f028&l=1199 https://cs.corp.google.com/aosp-kitkat/frameworks/support/v7/appcompat/src/android/support/v7/widget/SearchView.java?rcl=197708fc4fc0a6a5ede2da2479613382b561f028&l=895 I feel this is a valid use case and added a new public api refreshAutoCompleteResults() Bug: 123768711 Bug: 123768433 Test: Added new CTS tests for newly added api Change-Id: Icfa6287889b4f63c00aa2ad6450e47942a9adda5
* @InspectableProperty coverage for android.widgetAshley Rose2019-02-041-15/+28
| | | | | | | | | A few getters for view properties have been added where they were missing. CTS tests for the new APIs are pending in b/123894719. Test: m framework Bug: 120492712 Change-Id: I743ce693d384eaf749ced3db7f81bda7d19ed275
* Always use Context.getSystemService() to get IMMYohei Yukawa2018-09-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparation to deprecate the following two methods. * InputMethodManager#getInstance() * InputMethodManager#peekInstance() Since we soon need to stop relying on the current per-process InputMethodManager singleton model to fully support multi-display, those two methods really need to be deprecated. With this CL, framework code no longer depends on InputMethodManager#peekInstance(), which is also marked as deprecated in this CL. InputMethodManager#getInstance() is a bit tricky because it also works as a constructor of such a per-process singleton instance. Remaining two call-sites of this method will be migrated in a subsequent CL. This is a mechanical refactoring, which in theory should have no observable logical behavior difference. There could be a small performance regression, but it is basically not avoidable to correctly support multi-display scenarios. Bug: 115891476 Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases Test: atest CtsWidgetTestCases:android.widget.cts.EditTextTest Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest Test: atest FrameworksCoreTests:com.android.internal.inputmethod Test: atest FrameworksServicesTests:com.android.server.textservices Change-Id: I5db31491f3d47d3ad4a621e956995135c72e007b
* Move some members to the "Q blacklist".Mathew Inwood2018-09-141-1/+2
| | | | | | | | | | | | | | Based on some analysis, these fields/methods are likely false positives. Set maxTargetSdk=P so that any apps using them are required to migrate off them in future. See the bug for more details. Exempted-From-Owner-Approval: Automatic changes to the codebase affecting only @UnsupportedAppUsage annotations, themselves added without requiring owners approval earlier. Bug: 115609023 Test: m Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-211-0/+14
| | | | | | | | | | | | | | | | For packages: android.widget This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Ic61019b1df85448a158fc2ba55c326353222c6b9
* Fix import statements in android.widget package.Aurimas Liutikas2016-10-111-52/+54
| | | | | | | Additionally this CL removes spaces at the end of the line. Test: code still compiles. Change-Id: I1ce98b4e70aa3ae614f87966c3bc6181fa4389a4
* Unhide View#dispatch{Start,Finish}TemporaryDetach()Yohei Yukawa2016-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to fix Bug 18920212, we have to track when a View enters temporarily detached state and when it exits from that state. To do that, ListView needs to use View#dispatchStartTemporaryDetach() instead of directly calling View#onStartTemporaryDetach() because there is no guarantee that existing applications have internally followed Call-Super pattern. With this CL, we are going to expose temporary detach state and its dispatching methods as public APIs. Major changes are: 1. ListView's indirect children will start receiving temporary dispatch callbacks. Previously only direct children have received View#on{Start, Finish}TemporaryDetach() callbacks. 2. TextView can no longer assume that ListView never calls View#View#dispatchStartTemporaryDetach() but directly call View#onStartTemporaryDetach() instead. See the commit message of [1] for details. This also enables us to do the following fixes, which will be handled in subsequent CLs. A. ViewCompat support lib is finally able to rely on temporary dispatch mechanism without reflection. B. InputMethodManager is now able to ignore focus-in events from temporarily detached Views. This will be done in the next CL [2]. [1]: a440b002aa59e1455bdfa2c5a1ca51c74bbc19ac [2]: Ia79bbd8468f768d546354382b47b39dd31ef7bb5 Bug: 18920212 Bug: 27905921 Change-Id: If8f780f8b71754f7533a65097304113ae1f5cf12
* Add popup theme to AutoCompleteTextView, clean up constructorAlan Viverette2015-08-121-33/+142
| | | | | Bug: 22912507 Change-Id: I48d8b1ccae980847c743020d3f2a0d2eb6017e40
* Add @ResourceInt annotations on APIsTor Norbye2015-02-181-1/+2
| | | | Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
* Don't dismiss AutoCompleteTextView on focus change while temp detachedAlan Viverette2014-11-131-0/+6
| | | | | | | | | | This is consistent with how TextView handles focus changes while temporarily detached and prevents the suggestion popup from being dismissed during layout when the AutoCompleteTextView is used within a ListView. BUG: 18364277 Change-Id: I8ca6fb9dba63b49a84a60a606bc441446c083cee
* Fix docs buildAlan Viverette2014-08-281-2/+10
| | | | Change-Id: Id7b961ebcfffe536992208a157f625b5a1b1e1b6
* Merge "Update action bar item widths, overflow menu, button, and spinner ↵Alan Viverette2014-08-281-16/+8
|\ | | | | | | styles" into lmp-dev
| * Update action bar item widths, overflow menu, button, and spinner stylesAlan Viverette2014-08-281-16/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Manually modifies the overflow button hotspot bounds so that the ripple appears to be centered on the overflow icon. Adds styleable and parsing for list popup window offsets. Updates spinner text appearance to be consistent with drop down item text appearance. Also updates horizontal inner padding in buttons. BUG: 17305079 BUG: 17304391 BUG: 17302567 Change-Id: Iafddfef290078de968894a3b443ba9f60f84c6d4
* | Use a weak observable in AutoCompleteTextViewYigit Boyar2014-08-271-15/+33
|/ | | | | | | | | If adapter has longer life span than AutoCompleteTextView, it may leak the View. This change prevents it by using a static observer with a weak reference to the actual TextView. Bug: 11287688 Change-Id: I2c9db94dfa1be3b3f5368406e557f3e8e34bbce9
* Add APIs for obtaining themed Drawable from Theme, ContextAlan Viverette2014-02-031-1/+1
| | | | | BUG: 12611005 Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
* Add View constructor that supplies a default style resourceAlan Viverette2013-09-091-5/+9
| | | | | | | Also updates the constructor of every class that extends View. BUG: 10676369 Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
* Fix bug #7363252 Popup and Dialog UI widgets should be RTL awareFabrice Di Meglio2012-10-161-1/+0
| | | | | | | - set the Configuration's layout direction in ViewRootImpl instead of PhoneWindow$DecorView - then remove unecessary API on ListPopupWindow for passing the layout direction Change-Id: Ia2c6e4aa8cb82aed9b088bc3b8004ea0a1ded1f3
* Fix bug #6427629 Clean up layout direction APIsFabrice Di Meglio2012-09-231-2/+1
| | | | | | - rename getResolvedLayoutDirection() to getLayoutDirection() Change-Id: I3afe56c0db0751952f5056c23893cb7455531d29
* Add an OnDismissListener to AutoCompleteTextViewAdam Powell2012-08-301-0/+31
| | | | | | Bug 4551310 Change-Id: I702301ad3360828ec6637b6c09789e00d9661271
* Make AutoCompleteTextView#setText(CharSequence, boolean) publicAdam Powell2012-08-021-2/+0
| | | | | | | | | | | Bug 6807326 Public bug http://code.google.com/p/android/issues/detail?id=34690 Make this available for use by applications that wish to make programmatic changes to the AutoCompleteTextView without filtering. Change-Id: I889452d3b19b378258ad9247f3d254afee1e8408
* Make SearchView RTL awareFabrice Di Meglio2012-07-271-0/+1
| | | | | | - see bug #5429822 UI should be mirrored for RTL locales (Arabic, Hebrew, farsi) Change-Id: I7e7b51dccdd3b111e0594509334579b0502d24c8
* docs: fix a bunch of links from javadocs to api guidesScott Main2012-07-241-2/+2
| | | | | | and add some attributes to Spinner and Switch Change-Id: If015ad000c1a36e19904c132e98ebff1ceaf718b
* API fix, AutoCompleteTextViewGilles Debunne2012-04-301-1/+18
| | | | | | | | Bug 6102885 Didn't fix dropDownSelector nor completionHintView at that point. Change-Id: If080cbefd5189b79e4fa042e28dfa6a71524b93d
* Prevent AutoCompleteTextView from opening a popup when it shouldn'tRomain Guy2012-02-151-1/+3
| | | | | | | | | | | | Bug #5553515 The People app is forcing ACTV to show the IME which had the side effect of showing the drop down popup. ACTV was unfortunately not ready to show the drop down if the filtering resulted in no results. Doing so was putting ACTV in a weird state that in turn caused a window to be leaked and really bad behavior to occur in the lower graphics levels. Change-Id: I2ff146d5ae4e4a28edf6ea17039c9f8fdb710e4f
* AOOB in AutoCompleteGilles Debunne2012-01-181-2/+3
| | | | | | | | | | | | | | | | | Bug 5749557 Not clear how we can get an AOOB in that case. tmp will always have the right length, and indeed the stack trace attached to that bug shows a correct size of 10. However, there is an index issue when we build the new completion array. i is not the correct index to use. Note however that the original buildDropDown method mentioned is no longer present in the file. I tried to backtrack, but the use of arraycopy always seemed correct. Change-Id: Idf749c74b38923b5d18596c8e8f6ea887cc897d6
* Merge "Bug 5319091: Completions delayed in AutoComplete in landscape"Gilles Debunne2011-09-151-6/+7
|\
| * Bug 5319091: Completions delayed in AutoComplete in landscapeGilles Debunne2011-09-151-8/+9
| | | | | | | | | | | | | | | | | | The filtering is an async process. We need to re-update completion when it is finished. Changed loogic to mimic the way it was done in GB. Change-Id: If49048d786b3b9529da55c7247e7ef5f3d0fc8b5
* | Bug 5299484: Recipient address in to field is doubled when entering in ↵Gilles Debunne2011-09-141-6/+2
|/ | | | | | | | | | | landscape mode A tap on a completion in the keyboard calls onCommitCompletion, which in turn calls performCompletion because of the DropDownItemClickListener. As a result, the text is replaced twice. Removing the first text replacement. Change-Id: I4974d23c68ab25ca0ad0cda5abf25f30129b28ee
* Fix bug 3413800 - Revise AutoCompleteTextView dropdown behaviorAdam Powell2011-02-161-0/+4
| | | | | | | | | | | | | | Be more conservative with when we let an AutoCompleteTextView's dropdown box of completion suggestions cover the IME. Disable the expand-when-touched behavior of the dropdown list when more than 3 items can be seen at a time without it. Don't let a ListPopupWindow that is expanding in response to touch scroll the anchor view within its parent and slide the dropdown out from under the user's finger. Change-Id: I009accfd4e841c9a5e1072735d8a0b067a0bc06a
* AutoComplete list does not hide the IME when it re-appears.Gilles Debunne2011-02-091-2/+6
| | | | | | | | | | | | | | | | | Bug 3415891 With the current behavior, as soon as the list is expanded by 'long' pressing on or scrolling its content, it will always further appear in its long state, thus hiding the IME. This fix changes this behavior so that the default state is always compact, not hiding the IME, and an explicit expansion is always required. Also fixes a bug in ListPopupWindow that prevented the timer that expands the list from being started. Change-Id: I896e92d54961769c10b276c36f6510e91ff096a2
* The tab key completes text in AutoCompleteTextView.Gilles Debunne2011-02-091-0/+10
| | | | | | | | | | | | | | Bug 3330651. The first item in the list is not selected by default. From discussions in other related bugs, there does not seem to be an agreement on this. Supporting the actual token separator has also been punted. This would require a new method in the Tokenizer, which could be ill-defined for exotic tokenizer, plus typing a comma (for instance) to achieve a completion is not a common pattern. Change-Id: I30baf62077c412256175f871d21f4841e104f212
* New fix for popup behavior in AutoCompleteTextViews.Gilles Debunne2011-01-231-10/+18
| | | | | | | | | | | | | Bug 3374144 The fix in https://android-git.corp.google.com/g/#change,91880 is not sufficient. An updated adapter needs to be able to force an update of the poup result list. Addded a flag that prevents the popup from being re-opened when it has previously been closed by a user action. Change-Id: I45fab056c8ebd6dc4317430213f2bc37b51b79e3
* Race condition patched in Email autocompletion.Gilles Debunne2011-01-191-8/+15
| | | | | | | | | | | | | | | | | | | | | | | Bug 3347962 Root cause of this problem: if the adapter's content gets updated by a backgroung thread, the PopupDataSetObserver will call showDropDown which will popup the list. Added a flag to make this call show the popup iif it is already visible. This relayout is needed to clear the mDataChanged flag set when the content was modified and which otherwise prevents touch events on the result list. ArrayAdapter didn't use its lock to protect access to mObject. ------------------------------------------------- However, the study of the this race conditions revealed an other bug: Updated adapter's content is not displayed in filtered AutoCompleteTextView Bug 3369097 Change-Id: Icd90d452f98231866f4d8a1f6994c1492febecb9
* Fix NPEs in detached views.Jeff Brown2011-01-101-2/+8
| | | | | Bug: 3297518 Change-Id: Ife1384f3a5bebbd28a29f97dc6d519f8a0b10ba9
* Add initial support for TAB navigation.Jeff Brown2010-12-171-2/+7
| | | | | Bug: 3286652 Change-Id: I813a0318b3b8d9c9bc791ea6a2427be11c08de00
* am bb8d314b: am 70c9ffbc: am 11a72482: Merge "docs: add links from widget ↵Scott Main2010-08-211-0/+3
|\ | | | | | | | | | | | | | | | | classes to tutorials" into froyo Merge commit 'bb8d314b6c5ff9b51af29daa687d66dfd996914f' * commit 'bb8d314b6c5ff9b51af29daa687d66dfd996914f': docs: add links from widget classes to tutorials
| * docs: add links from widget classes to tutorialsScott Main2010-08-191-0/+3
| | | | | | | | Change-Id: I817e885524951853182b0458df4a32dea1614243
* | Added ListPopupWindow. Refactored AutoCompleteTextView and SpinnerAdam Powell2010-06-041-590/+90
| | | | | | | | | | | | | | | | | | (optionally) to use it. Added associated styles. ListPopupWindow allows apps to present a popup window of options to the user that will correctly dodge the IME if needed. Change-Id: I509c6c45036856daab686a6edeb7a9de1e72eb0a