summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/ScrollView.java
Commit message (Collapse)AuthorAgeFilesLines
* First quick implementation of auto assist data.Dianne Hackborn2015-02-061-2/+5
| | | | | | | | | | | | | | 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
* Track persistent nested Y offset for fling velocityAdam Powell2014-09-221-2/+11
| | | | | | | | | | Track the nested offsets applied persistently in AbsListView and ScrollView. This allows accurate velocity to be reported to nested fling/pre-fling. Bug 17548219 Change-Id: I66199c534aca7fb81746eff6d04c931e4c4e48da
* Nested pre-fling for AbsListView and ScrollViewAdam Powell2014-08-071-3/+5
| | | | | | | Add nested pre-fling support to all framework widgets that currently support nested fling. Change-Id: Ieaf9d12938dbfeea779c2aee2f5a081c287c8e96
* New, inkier EdgeEffect visual styleAdam Powell2014-05-111-2/+4
| | | | | | | | | | | | | | | | Remove the two-part gradient and edge glow and replace it with a circular ink-like style instead. This now follows the theme color palette so that it can be more in tune with the app's overall visual design. Add API to EdgeEffect to specify a horizontal displacement for the effect. This lets the larger middle section follow relevant touch points. Fix a bug that caused EdgeEffect pulls to stutter in ListView/GridView as a result of some annoying state-fluttering. Change-Id: Ief144b06bd9d3dbe85d3154585a703fa552b0808
* Fix nested prescrolling bug in ScrollViewYorke Lee2014-05-051-2/+2
| | | | | | | | mScrollOffset should not be applied to deltaY for the current MotionEvent. Instead, it should be used to offset the y position of the next motion event instead. Change-Id: Iaed85083556d4606300d9a888662c32ab4dbf3ca
* ListViews in ScrollViews and ScrollViews in ListViewsAdam Powell2014-05-021-1/+9
| | | | | | | | | Dogs and cats, living together, mass hysteria! Add support for nested scrolling to AbsListView, granting the ability to both ListView and GridView. Change-Id: Iae5c0518c5cebe41927720a7a27916ef13ca706e
* Add support for hiding action bars on scroll.Adam Powell2014-05-011-7/+20
| | | | | | | Also tweak the nested scrolling API around nested flings and fix a bug where recursive nested scrolling would stop prematurely. Change-Id: I561226db878b2493970440a6af3e2332c56a1913
* Fix ScrollView nested scrolling with touch down on buttonsAdam Powell2014-04-251-0/+2
| | | | | | | Start ScrollView's nested scroll in onIntercept to signal nested scrolling parents not to intercept along the vertical axis. Change-Id: Ieb343ff6b8216b113d3876bf93a804e609257f2a
* Nested scrolling!Adam Powell2014-04-241-15/+61
| | | | | | | | | | | | | or, "Excuse me, Egon, you said crossing the streams was bad." Add API for driving a nested scroll from the most deeply nested applicable scrolling view. The deepest scrolling view dispatches high-level scrolling events up to cooperative parent views. Augment ScrollView to support nested scrolling. Next up, more public framework scrolling views. Change-Id: I53b5e207fcdece796e08c8592ddb4496b96f600e
* Add View constructor that supplies a default style resourceAlan Viverette2013-09-091-4/+8
| | | | | | | Also updates the constructor of every class that extends View. BUG: 10676369 Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
* Changed name of recent hasLayout() method to isLaidOut()Chet Haase2013-07-171-1/+1
| | | | | | | | | | This new method on view reflects whether the view has been laid out at least once since it was attached. hasLayout() seems too vague for that meaning; every View that has a parent has a layout (since we use container, parent, and layout interchangeably). The new version of the method is closer to the actual meaning. Change-Id: I519745739b6a6317faeb077aa61f994025cf81f3
* Merge "Fix bug #9463581 NPE observed while launching News&Weather app from ↵Fabrice Di Meglio2013-06-181-5/+5
|\ | | | | | | all apps tray"
| * Fix bug #9463581 NPE observed while launching News&Weather app from all apps ↵Fabrice Di Meglio2013-06-181-5/+5
| | | | | | | | | | | | | | | | tray - dont suppose that there will always be one child Change-Id: I51c5cdf06294af25c992cfbaacabbc29dd1b9ad3
* | Don't save ScrollView/HorizontalScrollView saved state for old appsAdam Powell2013-06-131-0/+12
|/ | | | | | | | | | | | Older apps may have given IDs to ScrollViews and views of a different class in layouts that vary by configuration. Now that ScrollViews save state this causes ClassCastExceptions when trying to restore instance state. Only save new instance state for ScrollView/HorizontalScrollView for apps targeting post-API 18. Change-Id: Icaa095cd20bef35dddc225a17c5a8e30b3faea02
* Save Scroller positionFabrice Di Meglio2013-06-121-0/+76
| | | | | | - add SaveState with scroll position and use it during the first layout Change-Id: I0806ddb9c52d70d32055f4b474d21f6e2e5a4ea8
* Prevent scroll views from sending duplicate onScrollChanged events.Alan Viverette2013-06-031-1/+5
| | | | | | | | | Moves the call to onScrollChanged from onTouchEvent into onOverScrolled, which ensures only one of scrollTo or onScrollChanged will be called in a single execution. Bug: 7584549 Change-Id: Ibccd98a30835efad75eb41bcdd4b136e1b8e0ddd
* Revert "Fix bug #7325234 LayoutParams are not resolved correctly (Settings ↵Fabrice Di Meglio2012-10-261-2/+0
| | | | | | | | | | | | | apps looks broken on Manta in Arabic)" This reverts commit 6bf6eb7d5f9207d6a3e1d6b61f17a8654d06fbdb. and also fbc21e126f329b7b7c161858c1390ccb023be07e I have also removed all unnecessary calls to resolveLayoutDirection(int). This is possible as we are resolving layout params on every child of a ViewGroup as of commit fcc3348f61b2992f0b84e8e8dcb3535fc715298f Change-Id: I262a375b03fcc3c9261cbe2edebb6ec42ec2e186
* Fix bug #7325234 LayoutParams are not resolved correctly (Settings apps ↵Fabrice Di Meglio2012-10-101-0/+2
| | | | | | | | | | looks broken on Manta in Arabic) Part 2 - fix remaining UI widgets by asking layout params resolution when needed Change-Id: I97c41639da645d77eeda85feec3bbcc7fc1260b9
* am 790d3403: am d86bebb4: am 322b0a16: Merge "Protecting more views from ↵Jean-Baptiste Queru2012-08-241-0/+14
|\ | | | | | | | | | | | | (bad) MotionEvents" * commit '790d34039df650d983c7c87a2a2e888e18edc2be': Protecting more views from (bad) MotionEvents
| * Protecting more views from (bad) MotionEventsJohan Rosengren2012-08-231-0/+14
| | | | | | | | | | | | | | | | | | | | When handling MotionEvents, the method findPointerIndex can return -1 if the current pointer id can't be translated to a pointer index. Some views are not handling this, which will lead to an out-of- index crash. In 2585e9b there were checks added, this change adds some more. Change-Id: I93ce2420afd83a06b689a1ed35ead7d170cd68f1
* | Don't let ScrollView intercept touch events if it can't scroll.Adam Powell2012-07-311-0/+7
|/ | | | | | Bug 6872104 Change-Id: Iee643e052acc37485a8ec45b7af8be0783fb1a95
* docs: fix document issue 27549Scott Main2012-07-021-2/+7
| | | | Change-Id: I17995fd70978657a46ccfc77fa2ae84c56a05255
* Exposing some accessiblity actions only for enabled views.Svetoslav Ganov2012-05-161-8/+13
| | | | | | | | | 1. Some accessibility actions should not be performed on disabled views. For example, scrolling should not be permitted while accessibility focus should be. Made a quick pass over the actions we expose now. Change-Id: I36626dfbc0d2f480309a910f58f1de64e9e05675
* Add accessibility scroll support to some widgets.Svetoslav Ganov2012-05-151-1/+4
| | | | | | | | | | | | | 1. Added support for accessibility scroll action to some widgets that are scrollable. 2. Making the super call when handling an accessibility action in the views to call super first to allow an accessibility delegate to intercept the call. bug:5932640 Change-Id: I5eb37d64bf9fba1d5c596981132e0df717e2a18a
* Adding scroll actions to accessibility node info.Svetoslav Ganov2012-05-101-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Scrolling actions are crucial for enabling a gesture based traversal of the UI and specifically scrollable containers especially lists and anything backed by an adapter. Since accessibility focus can land only attached views, it cannot visit views for adapter items not shown on the screen. Auto scrolling the list as a result of putting access focus ot a list item does not work well since the user may get trapped in a long list. Adding an accessibility node provider to emit virtual views for one view before the first and one after the last is complex and suffers the limitation of trapping the user. Accessibility service need an explicit scroll actions which may be performed upon an explicit user action. Hence, the user is informed for the start/end of the visible part of the list and he makes a deliberate choice to scroll. This will benefit also people developing Braille devices since they can scroll the content without telling the user to stop using the Braille controller and take the device out of his pocket to scroll and go back to the Braille controller. NOTE: Without these action large portions of the screen will be hard to access since users will have to touch and explore to find and scroll the list. Change-Id: Iafcf54d4967893205872b3649025a4e347a299ed
* Fix nested cross-scrolling for ScrollView/HorizontalScrollViewAdam Powell2012-05-021-5/+26
| | | | | | | | | | | Bug 6429006 Disallow intercepting touch events for parents of ScrollView/HorizontalScrollView when scrolling begins. Properly respect touch slop when the child of a ScrollView does not accept touch events. Change-Id: I2ce503ad5104d450829ed58cd2748c9163e020d3
* Invalidate for scrolling animations on the animation timerAdam Powell2012-04-111-19/+19
| | | | | | | | | | | | | | | Change View methods awakenScrollBars and scrollTo to post their invalidation on the animation timer. Since these are often used in computeScroll or similar to continue scrolling or flinging it should not prevent other posted events from being processed before the frame is actually drawn. (All changes in scroll position, etc. are immediately reflected after the calls and do not need a draw to present correct data about scroll position to apps.) Don't accumulate floating point error while dragging ScrollView/HorizontalScrollView. Change-Id: I05b57d75f89a806488e46a8fb79b85d80f56d45d
* Put back invalidate optimizationRomain Guy2012-03-201-3/+1
| | | | Change-Id: I6407e452deb44e50a50632961e960cf0bd39b09d
* Code cleanupRomain Guy2012-03-201-47/+11
| | | | Change-Id: I390e92b4a778bd9dcde6535178c1a6b204b29fe4
* Fix obvious typos under frameworks/base/coreKen Wakasa2012-03-091-2/+2
| | | | Change-Id: Ia5fc3db1bb51824e7523885553be926bcc42d736
* AccessibilityEvent/AccessibilityNodeInfo class name property should be set ↵Svetoslav Ganov2012-01-171-0/+2
| | | | | | | | | | | | | | | 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
* Fixing errors in position information of scrollable views reported for ↵Svetoslav Ganov2011-10-061-2/+7
| | | | | | | | | | | | | | | | | | | | accessibility. 1. ScrollView/HorizontalScroll view were reporting only the scroll X and Y but failed to convey the max scroll along X and Y so the position can be determined. 2. WebView was not reporting correctly its scroll position for accessibility. 3. Some descendants of AdapterView were reporting incorrect position information. 4. Updated the accessibility docs with some details about the scroll information. 5. Cleaned up duplicated code. bug:5412132 bug:5412265 Change-Id: I165e73ecde027dad811425b9f395a3f758c923ba
* The logic for not populating text to some accessibility events is scattered.Svetoslav Ganov2011-09-301-10/+0
| | | | | | | | | | | | | | | | | 1. Some accessibility evenents should not and were not dispatched for text population but there was no centralized location for enforcing this - rather the system was firing them in a specific way or there were conditions in a few places enforcing that. Now this is centralized and clean. 2. Updated the documentation with some new event types the were lacking. 3. Explicitly stated in the documentaition which events are dispatched to the sub-tree of the source for text populatation. bug:5394527 Change-Id: I86e383807d777019ac98b970c7d9d02a2f7afac6
* Fix bug 5385274 - tabs in browser can't be scrolledAdam Powell2011-09-281-8/+4
| | | | | | | Fix a regression related to optimizing invalidation in scrolling views. Change-Id: I6a39075dc830d78436a274935a904a32084defac
* Fix bug #5282141 ScrollView overscroll should not generate invalidations ↵Fabrice Di Meglio2011-09-131-14/+21
| | | | | | | | | | when not needed (ANR textview redraws constantly when touched) - check if the overscroll range is not 0 - check if we are in the correct overscroll mode - also udpate HorizontalScrollView the same way Change-Id: I0bb37f9813a5871eb856914786db5c06de59e4d3
* Make EdgeEffect public API.Adam Powell2011-08-311-7/+4
| | | | | | | | | | | This enables apps to make use of the system's visual edge effect used during overscroll in 2D content. Also un-@hide the getCurrVelocity methods from Scroller/OverScroller, without which it becomes cumbersome to obtain values to pass to the EdgeEffect#onAbsorb method. Change-Id: I40e452455f5cb5d45d1fb3687f739fc8eae65560
* Track motion events before we decide to start scrollingMichael Jurka2011-08-221-7/+38
| | | | Change-Id: I0e2de488c62814982a21b7a7debbf1cd78e5891c
* Merge "Bug 4382356: No automatic focus change in ScrollViews"Gilles Debunne2011-07-151-12/+0
|\
| * Bug 4382356: No automatic focus change in ScrollViewsGilles Debunne2011-07-151-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | The current behavior in ScrollView is inconsistent: a slow scroll will not change focus while a fling will. With this change, the focus is not moved from field to field (resulting in poup due to keyboard / suggestion bar state changes). Also made sure any new input in a TextFields scrolls back the view to make the EditText visible. Has no effect if the EditText is already visible. Change-Id: I7ff301fe85f73c27d76e4893aeab7442d0539b13
* | Remove edge slop support.Jeff Brown2011-07-141-7/+0
|/ | | | | | | | | The edge slop feature was added a long time ago for a specific device that had severe non-linear touch response issues near the edges of its touch screen. The feature is not useful on modern hardware that is property calibrated. Change-Id: I26716cbc7411c31883ddb4bb4ddd981027790d0f
* Added scroll and text selection change accessibility events.Svetoslav Ganov2011-06-261-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Added scrolling accessibility event to provicde feedback when a view is scrolled. Note: We need scroll events for ICS since even though we have touch exploration the user does not know when something is scrollable and not feedback is provided while scrolling. bug:4902097 2. Added a text selection change event to provide feedback for selection changes including cursor movement. Note: We need the text selection change events for ICS since even though the IME supports navigation in text fields the user receives no feedback for the current selection/ cursor position. bug:4586186 3. Added a scrollable property to both AccessibilityEvent and AccessibilityNodeInfo. The info has to describe the source in terms of all properties that make sense for accessibility purposes and the event has this property (kinda duplicated) since clients will aways want to know if the source is scrollable to provided clue to the user and we want to avoid pulling the info of the source for every accessibility event. Change-Id: I232d6825da78e6a12d52125f51320217e6fadb11
* Only delay pressed feedback for Views inside a scrolling parentPatrick Dubroy2011-05-051-0/+5
| | | | | | | | | | Add a method on ViewGroup to determine whether it supports scrolling. This allows us to show the pressed feedback immediately in many cases, improving responsiveness of buttons, etc. This patch also lengthens the timeout in order to reduce flashes when the user is scrolling. Change-Id: Ieb91ae7a1f8e8f7e87448f2a730381a53947996f
* Merge commit 'b737647d' (Scrolling using arrow keys with padding) into mConley Owens2011-04-291-4/+2
|\ | | | | | | | | | | | | Conflicts: core/java/android/widget/ScrollView.java Change-Id: I1cfd3f7091e92793ce9fa048a09ae08a04c10c80
| * Scolling using arrow keys with paddingMattias Petersson2011-04-071-4/+2
| | | | | | | | | | | | | | | | | | It was impossible to reach the end of a large test when scrolling down using the arrowkeys when the ScrollView had padding. A common example of this would be an AlertDialog with a text that is too long to fit on the screen. Change-Id: I55464290a0cdeabde83ccccc76fe8d015ae57a8d
| * Never drag scroll views with no children. (DO NOT MERGE)Jeff Brown2011-01-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a regression from Froyo. Previously, when a scroll view had no children, its onTouchEvent would return because the scroll view would only start dragging if the user touched one of its children. In Gingerbread, the user can drag from anywhere within the scroll view, not just by touching a child. However, it makes no sense to drag a scroll view that has no children so an empty scroll view should just ignore touches like any other empty view group would. This change fixes applications that for some reason or other happen to have empty scroll views in strange places. Bug: 3246230 Change-Id: I76c6136d3cd74968983033014d60deec1718ce30
| * DO NOT MERGE. Make sure to invalidate after pulling on an edgeglow.Mindy Pereira2010-10-191-0/+4
| | | | | | | | | | | | Fixes b/3111778 overscroll glitch in news & weather Change-Id: Ic255da1f7c4301ea3980acc4fa033c9f17a60dac
| * DO NOT MERGE Only show edge glow effect on 1 side at a time.Mindy Pereira2010-10-071-0/+6
| | | | | | | | | | | | | | | | Pulling on a side should force the opposite side into "decay". Fixes b/3061753 new list "bounce" shouldn't show on both ends This fixes scroller and horizontalscroller. Change-Id: I4d9820c7178378b793ed9a29b119943eb1f46587
| * DO NOT MERGE Fix bug 3001751 and bug 3001584 - Gingerbread API review for ↵Adam Powell2010-10-051-16/+16
| | | | | | | | | | | | over-scroll Change-Id: If34c8ea4e15697420adad0bc404f3c278efd7c1b
| * Fix bug 3052686 - ScrollView padding treated incorrectlyAdam Powell2010-10-041-4/+2
| | | | | | | | | | | | | | Also allow grabbing scrollviews for dragging outside of content bounds, which makes a difference for overscroll effects. Change-Id: I344db4490ad59f393bb6de338009e251a76e6282