summaryrefslogtreecommitdiff
path: root/core/java/android/widget/FrameLayout.java
Commit message (Collapse)AuthorAgeFilesLines
* Update javadoc error: should be gravity, not weightAlex Florescu2020-11-051-1/+1
| | | | | Test: n/a Change-Id: Idafb13858b734aaf7614e12eff4ca02549905da8
* Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-061-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: I41e12e425284e74561c6b61663241df364ae54a1
* Add @InspectableProperty annotations to LayoutParamsAshley Rose2019-03-041-0/+3
| | | | | | Change-Id: I69eb71bec8bbf36564e178a3ddf4be9e00e2d531 Fix: 126913705 Test: m framework
* Update core widgets to save attribute source info.Aurimas Liutikas2019-02-071-0/+2
| | | | | | Bug: 111439551 Test: make -j Change-Id: I72997a87122f38b32e38e42a690385acc7d0e521
* @InspectableProperty coverage for android.widgetAshley Rose2019-02-041-0/+2
| | | | | | | | | 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
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-211-0/+6
| | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | Additionally this CL removes spaces at the end of the line. Test: code still compiles. Change-Id: I1ce98b4e70aa3ae614f87966c3bc6181fa4389a4
* Target API check for margin params fixYigit Boyar2016-08-021-6/+7
| | | | | | | | | | | Prior to N, our widgets were not converting MarginLayoutParams properly between ViewGroups. The fix intrudced some issues in older apps as the broken conversion code would hide developer errors. This CL guards the change with a target API check so that we don't affect older apps. Bug: 30378230 Change-Id: I215281d261b553c3b4cedcd29ea0a861df809471
* Revert FrameLayout.LayoutParams default gravity to -1Alan Viverette2016-04-151-4/+10
| | | | | | | Documents the default value and how this is interpreted by FrameLayout. Bug: 27576632 Change-Id: Icb76c5382462184ae02e86ce1b0101c12473aee2
* Fix default gravity value for FrameLayout.LayoutParamsAlan Viverette2016-04-011-61/+32
| | | | | | | | | Sets default gravity value to the aptly-named DEFAULT_CHILD_GRAVITY. Also cleans up FrameLayout lint warnings, annotations, and whitespace. Bug: 27576632 Change-Id: I457b13791ff85f2228e61e85e44a502a28439e01
* Fix generate layout params to preserve marginsYigit Boyar2016-03-221-2/+8
| | | | | | | | | | | This CL fixes a common bug in framework's widgets where they were not converting a child's margin layout params properly. The CL fixes, FrameLayout, RelativeLayout, GridLayout and LinearLayout. Bug: 27785449 Change-Id: Icecd9181ff82107e412174fe152f35d32d36b2e6
* Revert "Add support for partial view layouts"Chet Haase2015-12-081-4/+7
| | | | | | | | | | | | This reverts commit c55d5072ac52cee1811b52406419228fa81119ce. There were several bugs related to incorrect handling of various layout issues (layout not being run on containers/views that needed it), reverting to take another run at it outside of master. Issue #25980198 requestLayout() sometimes doesn't result in measure/layout for view Change-Id: Ic0e159cbcf6171652d8fd1bee9ae44a3977cea04
* Add support for partial view layoutsAdam Powell2015-11-191-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Traditionally, when a view called requestLayout it would force recursive requestLayout calls for all parent views up the hierarchy. This meant that there was no way to determine at traversal time whether a parent view itself needed layout, or if just one of its descendants did. Add a ViewParent method requestPartialLayoutForChild(View). This lets a caller state that a particular child of a given parent needs a remeasure and relayout at its current measured size and position within that parent. This can help prevent the full-tree relayout often caused by otherwise trivial changes. Partial layouts are processed after any pending "full" relayout during ViewRoot traversals, but before drawing. Add a ViewGroup method requestLayoutForChild(View). This lets a ViewGroup decide whether it is more appropriate to request a traditional relayout or a partial layout for itself or just the child that changed. Add a ViewParent method findDependentLayoutAxes. This allows a caller to check if the ViewParent's layout is dependent on a specific direct child view along one or both axes. Called recursively, this can be used to determine if a change in a child view can be isolated to a partial layout, even if its direct parent's own layout is tied to its other ancestors. (e.g. MATCH_PARENT, LinearLayout weights) Implement ViewGroup#requestPartialLayoutForChild to call new ViewParent method findDependentLayoutAxes and based on the result, either request a full layout for itself or a partial layout for the child in question. Implement findDependentLayoutAxes for common framework ViewGroups. A private implementation in ViewGroup is available for use by framework classes that will deal with basic LayoutParams. These implementations specifically check for derived LayoutParams classes and abort the optimization if they find something beyond their expected parameter types. Change-Id: I0a1a9b79293d17d4fae8d9892b96d3586f9401ae
* Constrain child width and height to >= 0 in FrameLayout.onMeasure()Alan Viverette2015-06-251-13/+14
| | | | | Bug: 22093669 Change-Id: I55e8a0289f871b73ed07f3d73e8297786f9acac1
* Use new hierarchy viewer protocol in all View subclassesSiva Velusamy2015-05-071-0/+13
| | | | | | | | | A previous CL introduced a new way of encoding view properties for use by heirarchy viewer. This CL updates all views using the old @ExportedProperty annotation to use this new method. The older mechanism will be removed in a subsequent CL. Change-Id: I6cc23b90cd9da1c6ce89b4caffe54874db203452
* Move foreground drawable down from FrameLayout into ViewAdam Powell2015-03-241-315/+11
| | | | | | | | | | | | This will allow any View to include foreground drawables. This is useful for cases where a foreground drawable is a more appropriate place to put a state list to show focus or touch highlighting. Also add View#onDrawForeground as a public API hook for drawing decorations after primary view content and child views such as scrollbars, foreground drawables and EdgeEffects. Change-Id: If1e4700af69db6876970f8f4ad5e3eab11b8034c
* Merge "Add more @Nullable annotations"Scott Kennedy2015-03-071-3/+4
|\
| * Add more @Nullable annotationsScott Kennedy2015-03-061-3/+4
| | | | | | | | Change-Id: I5b2935eb5e63289d80ebf9bf70741800b1c0934a
* | Remove unused imports in frameworks/base.John Spurlock2015-02-281-3/+0
|/ | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* First quick implementation of auto assist data.Dianne Hackborn2015-02-061-12/+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
* Use inherited visibility to set visibility of managed drawablesAlan Viverette2015-01-301-5/+10
| | | | | | | | | | | | | | Previously we only used direct visibility, which resulted in strange behavior when a parent view with an animated child was hidden. We were also incorrectly awakening scroll bars for non-visible views, though that's a much less visible (pun intended) bug. Only handles the two most common cases for ripples. A subsequent CL will update handling of View drawable management and fix this for all managed drawables. Bug: 15350931 Change-Id: I0d0fe2c51210e8d2e0a73b0248cec3b93bfc36f5
* Fix accessibility delegationAlan Viverette2015-01-071-4/+6
| | | | | | | | | | | | | | | 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
* Update drawable state after updating tint listAlan Viverette2014-10-291-0/+6
| | | | | BUG: 18155988 Change-Id: Ic536027a54c10b2082fbc22476530165b76e2c59
* Implement missing visibility management for FrameLayout foregroundAlan Viverette2014-09-301-0/+10
| | | | | BUG: 15350931 Change-Id: I16900d0d95051489852385d682e7b5aa4adad327
* Clean up view drawable tinting methods, fix default modesAlan Viverette2014-09-141-12/+22
| | | | | | | Calling setTint now only modifies the tint. It won't force a mode change. BUG: 17494736 Change-Id: I91392634869ed23981d8e61a403bb2be42aa7a07
* Separate tint and tintMode propertiesAlan Viverette2014-08-061-32/+14
| | | | | BUG: 16054922 Change-Id: I820fb857b671faf9eb27612e470e820c5c4cd6b5
* Clean up view tinting APIs, tileModeX/Y attribute docsAlan Viverette2014-07-221-13/+16
| | | | | | BUG: 16400590 BUG: 16403307 Change-Id: Ie924815a39eb0e683d1982b08ec478ed3edbfb7b
* Fix switch & slider anim, make View drawable hotspot API publicAlan Viverette2014-06-181-4/+2
| | | | | BUG: 15287810 Change-Id: Ic7a9549dc1ba8afd07e9a196371ed349a54aaf2f
* Add attributes and accessors for tinting View drawablesAlan Viverette2014-06-171-9/+112
| | | | | | | Also cleans up handling in setters for managed drawables. BUG: 15391544 Change-Id: Idc08f7eaea0050feb6403566985a6d58185b81f8
* Support hotspots in View drawablesAlan Viverette2014-06-131-0/+10
| | | | | BUG: 15285217 Change-Id: Iad44454fe16ac27ed20b9c17ae2df69649339eed
* 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
* Add copy constructors for all widget-specific LayoutParamsAlan Viverette2013-08-071-0/+12
| | | | | BUG: 10215589 Change-Id: I4c040091e216c87f851d6b617107f43729e55b0c
* Fix bug #9302365 HorizontalScrollView is not RTL awareFabrice Di Meglio2013-06-121-7/+12
| | | | | | | | | | | | - make FrameLayout capable of forcing a Gravity.LEFT (when there will be only one child with Gravity.RIGHT and wider than its parent like for HorizontalScrollView) - fix onLayout() so that it is forcing Gravity.LEFT if needed and setting correctly the initial mScrollX - also add restore/save from an instance state (by saving if the layout is RTL and the scroll position) Change-Id: Ida7ff4654c6a54a1696c2575af46f044dd1aabc8
* Revert "Fix bug #7325234 LayoutParams are not resolved correctly (Settings ↵Fabrice Di Meglio2012-10-261-5/+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
* Revert "Revert "This restores JB MR0 behavior where the framework throws an ↵Dave Burke2012-10-181-6/+0
| | | | | | | | exception for improper layouts that are missing layout_width and/or layout_height."" This reverts commit 57fca90ac65ecfe97acd4c93d442c3db8f815e11 Change-Id: I21b007a7d150a4c23f25a706cdba5cb86198198f
* Revert "This restores JB MR0 behavior where the framework throws an ↵Justin Ho2012-10-171-0/+6
| | | | | | | | exception for improper layouts that are missing layout_width and/or layout_height." This reverts commit dcf59629beed8182759a1068ab8ee997935bef82 Change-Id: I27426a0ffe993973ffb0b05ce1ed3afe73fcd87d
* This restores JB MR0 behavior where the framework throws an exception for ↵Jim Miller2012-10-161-6/+0
| | | | | | | | | | improper layouts that are missing layout_width and/or layout_height. Revert "Revert "Revert "Fix for bug 6050753.""" This reverts commit 6868d6f349610c15256471cc3d5fa708cbfd5f1d Change-Id: I8843d92dba14c82f06d9ee59517cf11b2abbbf04
* Revert "Revert "Fix for bug 6050753.""Mathias Agopian2012-10-151-0/+6
| | | | | | | | Emergency revert -- fix reboot loop. This reverts commit 8e63bcc63fd002231f8391af8982eeb235d096c8. Change-Id: I4373b867d756de09cdf6aa0aba9e6ff8f47bcdbc
* Revert "Fix for bug 6050753."Romain Guy2012-10-151-6/+0
| | | | This reverts commit c29f031598811486d83f418fd08fbfe1fc41788a.
* Fix bug #7325234 LayoutParams are not resolved correctly (Settings apps ↵Fabrice Di Meglio2012-10-101-0/+5
| | | | | | | | | | looks broken on Manta in Arabic) Part 2 - fix remaining UI widgets by asking layout params resolution when needed Change-Id: I97c41639da645d77eeda85feec3bbcc7fc1260b9
* Fix bug #6427629 Clean up layout direction APIsFabrice Di Meglio2012-09-231-2/+2
| | | | | | - rename getResolvedLayoutDirection() to getLayoutDirection() Change-Id: I3afe56c0db0751952f5056c23893cb7455531d29
* Replace left/right with start/end for Gravity / LayoutParams / PaddingFabrice Di Meglio2012-07-191-1/+1
| | | | | | - see bug #5429822 UI should be mirrored for RTL locales (Arabic, Hebrew, farsi) Change-Id: Id9af5375fb9b0edeae5232c77e52ecd497bd2e67
* Merge "Fix for bug 6050753."Philip Milne2012-05-311-0/+6
|\
| * Fix for bug 6050753.Philip Milne2012-02-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method: TypedArray: getLayoutDimension(int, String) throws an undocumented exception when either the width and/or height attributes are undefined. See the bug report above for reasons why this was deemed unhelpful both in the tools area and to developers in general. Fix by: 1. Documenting the conditions under which the method raises an exception. 2. Deprecating the method, advising callers to supply a default instead. Additionally, redefine the: ViewGroup: setBaseAttributes(TypedArray, int, int); methods to provide the appropriate defaults in ViewGroup subclasses as advised above. For the platform layouts the default value is WRAP_CONTENT (and is defined in the ViewGroup.LayoutParams class). The special cases are accomodated in LayoutParams subclasses in the following cases: Subclass width height FrameLayout.LayoutParams: MATCH_PARENT, MATCH_PARENT TableLayout.LayoutParams: MATCH_PARENT, WRAP_CONTENT TableRow.LayoutParams: MATCH_PARENT, WRAP_CONTENT Change-Id: I335a3bd8e2d7f7866692898ed73492635a5b61ea
* | Fixes for bugs: #6103660, #6103957, #6104457 and #6104322.Philip Milne2012-03-131-0/+15
|/ | | | | | Add getters and setters to the layout widgets so as to mirror their XML apis. Change-Id: Ie2237fd55e1c3e4ec0d08b4f8154ea7e122c1e79
* AccessibilityEvent/AccessibilityNodeInfo class name property should be set ↵Svetoslav Ganov2012-01-171-0/+15
| | | | | | | | | | | | | | | 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
* Fix FrameLayout padding when foreground drawable is setMichael Jurka2011-09-081-10/+35
| | | | | The padding of the foreground drawable was being added to the padding that already existed, even if the foreground drawable was drawing within the padded region. This was preventing having a foreground drawable and a background drawable set on a FrameLayout that overlapped perfectly. Change-Id: I355ff9323fb49afc5816f47ec9e257e0ff849861
* Merge "Add FrameLayout.getMeasureAllChildren()"Steve Block2011-09-081-6/+25
|\
| * Add FrameLayout.getMeasureAllChildren()Steve Block2011-04-281-6/+25
| | | | | | | | | | | | | | | | | | Currently the counterpart to FrameLayout.setMeasureAllChildren() is FameLayout.getConsiderGoneChildrenWhenMeasuring(). This change deprecates FameLayout.getConsiderGoneChildrenWhenMeasuring() in favor of a new FrameLayout.getMeasureAllChildren() method. Change-Id: Id26ec8b3966bd1553d5fd708ad76049069fcaeef
* | cherrypick Change-Id: I213711f4b5d867ba91c961a2f098b6cc415cfcb3Scott Main2011-07-271-6/+11
| | | | | | | | | | | | | | | | | | | | | | docs: clarify framelayout class summary, issue 5055437 Conflicts: core/java/android/view/View.java core/java/android/widget/FrameLayout.java Change-Id: Ia446d2d4cc798757d7aea104cfaf75fc2315dc50