summaryrefslogtreecommitdiff
path: root/core/java/android/widget/EditText.java
Commit message (Collapse)AuthorAgeFilesLines
* Scribe for View: handwriting initiation for unfocusedHaoyu Zhang2022-02-101-0/+7
| | | | | | | | | Bug: 211763729 Test: atest FrameworksCoreTests:HandwritingInitiatorTest Test: atest FrameworksCoreTests:HandwritableViewInfoTest Test: atest FrameworksCoreTests:HandwritingAreaTrackerTest Test: manually test Change-Id: Ica9ee82cf1dc41feb5e4ff0f52ee13c1e4de8ad4
* Avoid double-calling super.getText() in EditText.getText()Mark Hansen2021-10-061-1/+1
| | | | | | Just a small cleanup. TextView.getText() looks like it has some logic we might not want to repeat. Change-Id: I364458d979275ad5dff24983e4ee2b9469f91155
* Implement ACTION_LONG_CLICK for accessibilitysallyyuen2020-03-101-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to changes in R, the a11y framework no longer dispatches touch events for a long press. This prevents the activation of EditText's floating menu. We can re-enable it by implementing the proper a11y action ACTION_LONG_CLICK. The menu itself is diffult to access through TalkBack's linear navigation, but this is future work for a separate known issue. Start and stop the menu for editable TextViews, which includes EditTexts. Since touch events are no longer sent by a11y, separate the accessibility handling from the touch handling infrastructure for long clicks in Editor. We can't go through the main performLongClick code because it doesn't actually start the action mode but rather sets pending, which routes back to TextView. There's too little separation between the touch events and action logic. Whoever touches the performLongClick code may need to also make corresponding changes to the a11y path, but I suspect this won't happen often. Remove the onInitializeA11yNodeInfo override for EditText because this is handled by TextView. Bug: 148127445 Test: Tested text fields in various apps. ag/10602004. atest FrameworksCoreTests:TextViewActivityTest#testToolbarAppearsAccessibilityLongClick Change-Id: I3958e5b80e6156e03c99335e0d0b671438965ebb
* Fix crash in EditText#getTextClara Bayarri2018-01-181-0/+4
| | | | | | | | | | | | | | The fact that View's constructor may call other methods before the TextView constructor has a chance to initialize values means that getText() may return null in the rare case where it is called before the constructor. Protect getText() from running into errors when the text is null, as it just means the value is not ready yet. Bug: 71638589 Test: CTS in topic Change-Id: Ie11233416385353f78e3ee27fb0d3ec9b671512f
* Fix crash in EditText#getTextClara Bayarri2018-01-021-0/+5
| | | | | | | | | EditText#getText assumes the text is editable. However if this is called during construction, the text might still be a String. Bug: 36972818 Test: bit CtsWidgetTestCases:.EditTextTest Change-Id: I811fad057f33666692930cb60d696740f7b40a19
* docs: Update EditText JavaDoc commentsJoe Fernandez2017-04-251-4/+28
| | | | | | | | | | | | | | rework the edit text introduction and overview. - adds an example of a basic configuration - discuss the inputType attribute - cross link to relevant classes & methods - Rework the edit text introduction and overview - wrap guide link in a p to emphasize - emphasize specifying the inputType is required Test: docs only change. Verified with doc test build Change-Id: I78d8c861c51117bfd61e8c37ad83854a2aeec967
* Move autofill-specific logic from EditText to TextView.Jason Long2017-01-271-23/+0
| | | | | Change-Id: I92725144d737ed182e6ece7018a9f8d075fb5ba7 Test: Manual
* Initial IME integration.Felipe Leme2017-01-241-2/+0
| | | | | | | | | | | | | | | - Created an AutoFillManager class, which provides methods to show the auto-fill bar for views and virtual nodes. - Automatically launches an auto-fill request when the IME is shown (and an AutoFillService is set for the given user) on TextViews. - Updated VirtualNodeListener to use this new API. BUG: 31001899 BUG: 34171325 Test: CtsAutoFillServiceTestCases passes Test: manual verification Change-Id: Id72ce97da70217081b5823cfc7b138412634fcf3
* AutoSize TextView (part 7) - APIs for configuring auto-sizeAndrei Stingaceanu2017-01-201-0/+2
| | | | | | | | | | | | | | | | | | | | | Contains: * getters/setters for all auto-size config attributes * verbose JavaDocs * isolated and reused the setup part of auto-size * some variables had to become instance fields * clarified some variable names In a few words, whenever a configuration setter is called, the value is assigned and setupAutoSizeTextXY() gets called. The latter tries to build all the intermediary values that it needs, attaches default values, etc. If it is successful then it makes a call to autoSizeText(), else it throws a runtime exception with an appropriate message. Bug: 32221168 Test: attached in the same topic Change-Id: I448454ef4490102c8cc2b19e0e16e998aeb45cd0
* YAMAFFR - Yet Another Major AutoFill Framework RefactoringFelipe Leme2017-01-101-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Explicitly split View methods into Assist and AutoFill methods, rather than use an overloaded method that takes flags. - Simarly, renamed ASSIST_FLAG_SANITIZED_TEXT and ASSIST_FLAG_NON_SANITIZED_TEXT flags to AUTO_FILL_FLAG_TYPE_FILL and AUTO_FILL_FLAG_TYPE_SAVE respectively. - Created a AutoFillUI class to host the auto-fill bar and other UI affordances. - Moved the temporary notifications to AutoFillUI (eventually that class will host the real UI). - Moved FillData to android.app.view.autofill package. - Split IAutoFillCallback in 2 (IAutoFillAppCallback and IAutoFillServerCallback, residing at the app and system_server respectively), so service cannot fill the app directly (which lets the framework control the UI). - Moved assist's IResultReceiver to AutoFillServiceImpl so system_server can act as a mediator between the AutoFillService implementation and the app being auto-filled. - Replaced FillData and FillableInputFields by a bunch of new objects: - FillResponse contains a group of Datasets, each representing different values that can be used to auto-fill an activity (for example, different user accounts), optional id of fields the service is interested to save, and an optional bundle for service-side extras. - Dataset contains a name, Fields, and an optional bundle for service-side extras. - Fields contain an AutoFillId (parcelable) and a value (Bundle) - Changed the temporary notifications to emulate the new workflow: - Initial notification requests the auto-fill data but do not auto-fill. - Once service calls back, a new notification is shown with the results. - Then if the user selects a dataset, the activity is auto-filled with it. - It also shows a notification to emulate what can be saved. - Created an VirtualViewDelegate for views that uses a virtual hierarchy for assist data. - Added new methods on ViewStructure to add children with virtual ids. - Added 2 methods on View to support auto-fill: - autoFill(Bundle) to auto-fill the view. - getAutoFillType() to return how the view can be auto-filled. - AutoFillType defines the input fields that support auto-fill: - Text fields (like EditText) - Toggle fields (like CheckBox) - Lists (like RadioGroup) - AutoFillType can also have a sub-type representing its semantic (for now only text fields have it, and it's the same as getInputType()). - etc :-) Bug: 31001899 Test: manual verification Change-Id: I2dd2fdedcb3ecd1e4403f9c32fa644cb914e186f
* AutoSize TextView (part 3) - define who supports autosizeAndrei Stingaceanu2016-12-061-0/+6
| | | | | | | | | | | | | Introduces a new protected hidden method that specifies if the TextView (or descendant) widget supports the autosize feature. All direct children of TextView (besides EditText) support it. Bug: 33098425 Bug: 32221168 Test: attached in the topic Change-Id: I6f0092b4c9948afb427fe597b0515a39b1f258f6
* Fix import statements in android.widget package.Aurimas Liutikas2016-10-111-1/+0
| | | | | | | Additionally this CL removes spaces at the end of the line. Test: code still compiles. Change-Id: I1ce98b4e70aa3ae614f87966c3bc6181fa4389a4
* Fix crash with a11y set text with text filters.Phil Weaver2016-04-261-22/+0
| | | | | | | | | | | | A text filter may shorten the text, so we need to use the text that's actually in the View, not the text we requested, to move the selection. Also removing the override of performAccessibilityActionInternal, which should have been done as part of adding text actions initially. Bug: 28253708 Change-Id: I184f49dcba0238f4ccc222597cefca258393b263
* Support SET_TEXT for editable text views.Phil Weaver2016-03-161-0/+3
| | | | | Bug: 25486055 Change-Id: I38e5a65e216b7ea7da42a01040126b2c2cc8c661
* Update EditText.setEllipsize JavaDocSiyamed Sinir2016-03-021-0/+10
| | | | | | | | Update EditText.setEllipsize JavaDoc to describe that MARQUEE is not supported by EditText. Bug: 26219977 Change-Id: Ibe709f3470a749c0fbb672c8ec33f0835c5d90ec
* Do not save TextView text when freezesText is falseSiyamed Sinir2016-02-081-0/+5
| | | | | | | | | | | | | | | Currently TextView state is saved whenever selection is set even if freezesText is false. This causes inconsistencies with the described behavior for the attribute. This CL updates the behavior as: - Always save the text for EditText - Always save the selection if there are any. - Do not save the text for TextView if freezesText is false. - During onRestoreInstanceState if selection is out of the text boundaries, do not restore the selection. Bug: 22076905 Change-Id: I5e05d343e752a7d106c8881993e4d95ae21a38ce (cherry picked from commit 8535836673c801effce097c54f55814ef88448e7)
* Add the set_test a11y action to EditText's action listSvetoslav2015-11-091-0/+9
| | | | | | bug:25486055 Change-Id: Ibbc8acbc98d38e903bc65b4032ca12de7c50ba62
* Remove unused imports in frameworks/base.John Spurlock2015-02-281-1/+0
| | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* First quick implementation of auto assist data.Dianne Hackborn2015-02-061-11/+2
| | | | | | | | | | | | | | Introduce new AssistData class that contains all data the framework automatically generates for assist. Currently populated with a very simple tree structure representing the app's view hierarchy. Reworked how we populate the class name for accessibility info, so this is provided through a new method call on View that subclasses can override. This method is also used to populate the class name in AssistData. Change-Id: Ibd0acdc8354727d4291473283b5e4b70894905dc
* Fix accessibility delegationAlan Viverette2015-01-071-6/+9
| | | | | | | | | | | | | | | Ensures that delegate code is run last. Previously, calling the super method from an accessibility delegate set on a widget would only run code in the widget's parent. Next, the delegate code would run. Finally, the widget's code would run. As a result, the widget code would override any data supplied by the delegate. By moving all overridden code to internal methods, we ensure that the call chain for super includes the widget's parent code followed by the widget's code. The delegate code will always run last. BUG: 17641433 Change-Id: Ib9d403156c1fc4fb04f65f3c126d1277a44b3740
* add new accessibility action for EditText to set text contentGuang Zhu2014-02-201-0/+19
| | | | | Bug: 12872344 Change-Id: I85a3805ab0c34b96a7d4228f2382c8ff664e36e8
* Add View constructor that supplies a default style resourceAlan Viverette2013-09-091-2/+6
| | | | | | | Also updates the constructor of every class that extends View. BUG: 10676369 Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
* Revert "Simple MVC based binding mechanism for android controls."Philip Milne2013-04-181-22/+1
| | | | | | | | | | | | Fix for bug 8656899 API REVIEW: android.util.PropertyValueModel/ValueModel, android.widget.ValueEditor etc Revert the change that added this API to remove it outright. This reverts commit 989709a973448980f36dacd587b0a58f89ffa11e Change-Id: I9018cd8dadb1b1a54ad8749c816bd02bb7e7a38b
* am 7c00f816: am 2f5b61a7: Merge "docs: fix a bunch of links from javadocs to ↵Scott Main2012-07-251-2/+2
|\ | | | | | | | | | | | | api guides and add some attributes to Spinner and Switch" into jb-dev * commit '7c00f81606de1880c3f28e54cea064c3b90da3e7': docs: fix a bunch of links from javadocs to api guides and add some attributes to Spinner and Switch
| * 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
* | Simple MVC based binding mechanism for android controls.Philip Milne2012-07-201-1/+22
|/ | | | Change-Id: I80fe18e0e15f8a840d558de9863650505bd5fb00
* AccessibilityEvent/AccessibilityNodeInfo class name property should be set ↵Svetoslav Ganov2012-01-171-0/+14
| | | | | | | | | | | | | | | to only framework classes. AccessibilityEvent and AccessibilityNodeInfo have a property className which is set to the source Java class. This is problematic since leads to leaking private classes which would allow an accessibility service to load classes from other packages. This is strongly undesirable since not trusted code can be loaded, and hence executed, in the accessibility service. To address that the class name is set to the most concrete framework class extended by the info/event source. bug:5878943 Change-Id: I7b3114ece8772ea2773f5151e21b8a6f2006882a
* docs: add links from widget classes to tutorialsScott Main2010-08-191-0/+3
| | | | Change-Id: I817e885524951853182b0458df4a32dea1614243
* Force layout on TableRows when column widths are shrinked or streched.Gilles Debunne2010-02-121-2/+6
| | | | | | Also features some comment typos and import re-ordering. Change-Id: I32cb14419d7d349064032718469daf62a0a72e3a
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+110
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-110/+0
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-1/+9
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+102