summaryrefslogtreecommitdiff
path: root/core/java/android/widget/RelativeLayout.java
Commit message (Collapse)AuthorAgeFilesLines
* 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 @UnsupportedAppUsage annotations for greylist.Artur Satayev2019-11-191-0/+5
| | | | | | | | | | | | | go/cleanup-greylist-txt These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code. This is partial merge of aosp/Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09. Telephony greylist cleanup has been done separately. Note that annotations outside of frameworks/base/ have been merged from AOSP. Bug: 137350495 Test: m Exempt-From-Owner-Approval: merge Change-Id: I015c466e8b69cc0fed5e9d394ba865aad11d8ba6
* docs: fix typoJoshua Baxter2019-11-061-1/+1
| | | | | | Change-Id: I2e8f28a917d0b09c0bf0a11f0db863ae7bf03ac8 test: make ds-docs bug: 79156293
* docs: Fix broken link.Nick Cook2019-07-181-4/+4
| | | | | | | Test: make ds-docs Bug: 132635673 Change-Id: I9e6a493112418f7b1467d9d2926a1b2c106d4ad0
* Fix RelativeLayout rulesRyan Mitchell2019-05-101-1/+1
| | | | | | | | | | | A previous change restricted rules that are added to the rule dependency graph to resource ids rather than just integers greater that zero. Restore the previous behavior and also allow for negative resource ids to work as expected. Bug: 132447676 Test: loaded maps and view looks as expected Change-Id: I88d86c77c696d1e494a743fdd2e398283383c64e
* Fix RelativeLayout checking of resource ids greater than 0x80Ryan Mitchell2019-04-111-1/+2
| | | | | | | | | | | | For splits with package id 0x80 and higher, the resource ids are negative. RelativeLayout builds a dependency graph to indicate in which order the layout height and width need to be processed. Since the ids are less than 0, RelativeLayout is incorrectly assuming the layouts are not order dependent. Bug: 72869300 Test: manual Change-Id: I98f58f11733c2976fc5c1b4152949cf80660f657
* Custom inspection companion for RelativeLayoutAshley Rose2019-03-081-1/+143
| | | | | | Test: atest StaticInspectionCompanionProviderTest Bug: 126913705 Change-Id: I2f4d5ccf38b77af9d1a4c21318475baec44e9a1c
* Add @InspectableProperty annotations to LayoutParamsAshley Rose2019-03-041-0/+1
| | | | | | 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/+12
| | | | | | | | | 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
* Restrict unsupported usage of Linear/RelativeLayout APIsClara Bayarri2018-11-221-1/+1
| | | | | | | | These internal accesses can be done by existing public API Bug: 117521217, 117521667 Test: make Change-Id: I31116551f6e5a4f8c84a811f62419302fee91c2c
* 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
* Code reformatting for upcoming automated code changes.Mathew Inwood2018-08-161-1/+4
| | | | | | | | | | | | Adding annotations to individual fields cannot be easily done when there are two fields defined in a single statement. Put each definition in a statement of its own. See go/UnsupportedAppUsage for more context. Bug: 110868826 Test: m Change-Id: I7756185bdfdca15fa8f73ef4b76c4f70abcd8ea6
* docs: Fixing broken hyperlinksAndrew Solovay2018-03-141-2/+2
| | | | | | | | | | | A couple of links were badly formatted. Updated doc staged to: go/dac-stage/reference/android/widget/RelativeLayout.LayoutParams.html Test: make ds-docs Bug: 72624598 Change-Id: I197f5ef52f2476134db674d342dee812ceebec2a Exempt-From-Owner-Approval: Doc-only change
* Fix calculation of RelativeLayout width in RTL modeRoozbeh Pournader2017-07-131-1/+1
| | | | | | | Fixes: 37035671 Test: Manual Test: bit CtsWidgetTestCases:.RelativeLayoutTest Change-Id: I82feecdba7d1ed1198580758ab1f68932bb50aa7
* Fix RTL issue in RelativeLayoutChet Haase2017-07-051-9/+12
| | | | | | | | | | | | | | | | | | | | | | | A long-standing bug in RelativeLayout meant that items inside a RelativeLayout with layout centering (layout_centerHorizontal) and WRAP_CONTENT would cause the surrounding RelativeLayout to be sized incorrectly, resulting in bad layouts overall (the RelativeLayout could end up much too large, pushing other layouts out of view). This artifact was visible in TimePicker in landscape mode, but worked around in the O release by forcing LTR on the parent layout of the RelativeLayout. The problem was that the case of center/wrap would end up positioning the view on the left of the layout, instead of the RTL-friendly right side. The fix is to do the correct thing in RTL mode (position relative to the right side of the layout instead). Bug: 63003526 TimePicker RTL issue Bug: 62846484 TimePicker layout is broken in RTL landscape mode Test: manual (run Clock app in RTL and non-RTL modes and observe layout behavior in both portrait and landscape modes). Change-Id: I9033857a39f422e3d6fb6e4d313d1739ae3f5c63
* docs: Update RelativeLayout.LayoutParams JavaDoc commentsJoe Fernandez2017-04-251-1/+13
| | | | | | | | | | | | | | | | Added changes to make purpose/usage of RelativeLayout.LayoutParams more clear: - clarify the attributes are set on a view contained in a relative layout - clarify that relative layout uses these values to position the view - add note that these values are ignored if view is not contained in a relative layout - cross-link code sample in Relative Layout guide - cross-link guide Layout guide to clarify layout params vs regular attributes Test: docs change only. Tested with a docs test build. Change-Id: I4fe1088594c998cee4ff0b2f6295579956c19d6f
* Fix for endless loop in RelativeLayout.Yura2017-01-301-1/+2
| | | | | | | | | | | | | | | | | | | | | getRelatedView(int[] rules, int relation) is stuck in the loop, when a view is GONE, and references itself. There is already a check in: getSortedViews(View[] sorted, int... rules) { to make sure there are no loops of ViewA -> ViewB -> ViewA BUT, there was a change made in findRoots(int[] rulesFilter) to "Remove exception throw when a view has a self dependency inside a RelativeLayout." so this means we must allow this case. Other change git commit sha: da3003e1d71d66a1c936489025f8db314a2a4588 Bug: http://b/android.com/231353 Change-Id: Icc26b86ebbb19e482c3afe6a39db996ec493586d
* Fix import statements in android.widget package.Aurimas Liutikas2016-10-111-11/+11
| | | | | | | 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
* 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
* Ensure layout resolution occurs when relative rules are removedAlan Viverette2015-08-181-37/+79
| | | | | Bug: 23295655 Change-Id: Ic46b018859c5af8cabf2fa0677e002de7cb6a996
* Use correct param for heightMode in RelativeLayout horizontal measureAlan Viverette2015-08-121-1/+1
| | | | | Bug: 22824701 Change-Id: Ia0afd3edc20b8127605aef2653fa9b5472f41be2
* Ensure maxHeight is at least 0 during measureChildHorizontal()Alan Viverette2015-07-291-16/+25
| | | | | Bug: 22613599 Change-Id: I11f70ed1f7221874bef0f00f006e0ae294c4bdfa
* Fix handling of RelativeLayout measurement using UNSPECIFIED specAlan Viverette2015-07-221-3/+4
| | | | | Bug: 22613599 Change-Id: Ibdac9de1d5b53a46b29ae916e5dcc8b5c4bc9c27
* Avoid negative childSpecSize in RelativeLayoutAlan Viverette2015-06-241-11/+10
| | | | | Bug: 22071351 Change-Id: I951fd7c7973c49581d3ea30bae64d6c20bc362be
* Revert "Revert "Work around inconsistent views in RelativeLayout.onMeasure()""Alan Viverette2015-06-221-9/+9
| | | | | | | | Turns out this was actually fine. This reverts commit 9355533bf6f3bcd3fb72fc840253d08ca7dad379. Change-Id: I30c66fd423b569958244685098511d4ba08fbf37
* Revert "Work around inconsistent views in RelativeLayout.onMeasure()"Alan Viverette2015-06-191-9/+9
| | | | | | This reverts commit 3e2e064a1f989228f48e8faf588393a1a5ee1e31. Change-Id: Ib3712076585cba507ef1666e3fb6abb2bedb016f
* Work around inconsistent views in RelativeLayout.onMeasure()Alan Viverette2015-06-171-9/+9
| | | | | | | | | | | Previously, RelativeLayout's measure pass could crash if the view's children were modified without calling requestLayout() prior to the next measure pass. This avoids the issue by only looking at the most recent set of sorted views and preserves the previous behavior where onMeasure() could return incorrect data. Bug: 21123292 Change-Id: If471d071d1d2e2729cf13854d95b1f517c1fe73a
* Use new hierarchy viewer protocol in all View subclassesSiva Velusamy2015-05-071-0/+9
| | | | | | | | | 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
* Revert RelativeLayout's baseline view to API 22 and below behaviorAlan Viverette2015-03-091-15/+31
| | | | | | | | | The previous behavior used the top-start-most view, rather than the view with the bottom-most baseline. Which doesn't really make sense, but that's what it did. Bug: 19653790 Change-Id: Ia23476f1d2de5313fd82aac037e90d45b0af8972
* Remove unused imports in frameworks/base.John Spurlock2015-02-281-1/+0
| | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* Implement landscape layout for time picker dialogAlan Viverette2015-02-261-0/+19
| | | | | | | | | | | | | | | Adds support overriding default alert dialog panel elements by including them in the dialog's custom content view, but no public API (yet!) since the panel IDs have never been public. Some minor cleanup and refactoring in TimePickerDialog. Removes Holo styles for "clock" and "calendar" style pickers since they are new in Material. If the new styles are used against Holo they will match Material but with Holo primary/accent colors. Also implements themed color state lists to resolve TODOs in both time and date pickers. Bug: 19431361 Change-Id: I095fd8d653e02d9e5d20d66611432a08a7a5685e
* Update time picker to match latest Material specAlan Viverette2015-02-201-5/+7
| | | | | | | | Also removes saveLayerAlpha() call from radial time picker's disabled drawing path. Bug: 19431361 Change-Id: I18641bb9544107bb8704fc43d0dd6c5b18ff99ce
* 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
* Allow views to be positioned relative to baseline-aligned viewsAlan Viverette2015-01-141-64/+39
| | | | | | | | | Previously baseline alignment was handled as a separate pass after normal bottom/top/etc. alignment, but this prevented views from being laid out relative to baseline-aligned views. BUG: 17938274 Change-Id: I5965110f012f3b27149b437ba3524cda84e9daf4
* Fix accessibility delegationAlan Viverette2015-01-071-5/+8
| | | | | | | | | | | | | | | 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
* Fix some documentation typos.Newton Allen2014-09-301-1/+1
| | | | Change-Id: I747a0ade5c7b9c45d4465bf327952338bbc1cfaa
* Fix alignParentRight/End in RelativeLayoutAlan Viverette2014-08-191-1/+1
| | | | | BUG: 17136816 Change-Id: If7edb2e0216384429f4caf7e9aae01c09ddd8be4
* Fix corner case of RelativeLayout with pinned edgesChet Haase2014-07-241-31/+27
| | | | | | | | | | | | | | | | | | | | | | | LayoutParams without a specified layout_width value automatically get a default of 0. This works in most cases, when the view is pinned by various constraints (such as alignParentLeft and alignParentRight), but breaks down when the child lies in negative coordinates. Negative coordinates are supposed to be a signal, in RelativeLayout, that that coordinate is variable. However, negative margins can cause a negative value to be calculated, at which point it should be used as a concrete value, not a behavior trigger. The fix is to use Integer.MIN_VALUe as the tirgger instead, to distinguish that impossible value from negative values which could reasonably have been computed during measurement. Also, removes dead code from earlier attempt at rtl. Issue #10606777 Time picker can't display 10, 11, or 12 oclock when font size is huge Issue #16516577 resolveLayoutDirection doesn't act as intended Change-Id: Ia564603012f3c45636e69cd3776205fb544fda48
* Fix RelativeLayout measurementAlan Viverette2014-02-121-5/+5
| | | | | BUG: 12993953 Change-Id: Idf82734eb9a06ea7610e8eb42705da9f4a4639e9
* Fix handling of constraints for unspecified height RelativeLayoutsAlan Viverette2013-12-041-8/+19
| | | | | BUG: 11897546 Change-Id: If26c4be3763072f53f889574a51af16bbd6532c7
* Merge "Clean up layout constructors, make them consistent"Alan Viverette2013-09-141-11/+8
|\
| * Clean up layout constructors, make them consistentAlan Viverette2013-09-101-11/+8
| | | | | | | | | | | | | | | | | | All constructors now flow through to each class's own 4-argument constructor. This ensures that theme attributes are applied even if a base AttributeSet is not provided. BUG: 10680863 Change-Id: I727d2961bf017c6a5e0206367081670782583394
* | am db34f3d1: am 50e5814c: Merge "Check RelativeLayout\'s access of its own ↵Adam Powell2013-09-131-2/+2
|\ \ | |/ |/| | | | | | | | | LayoutParams during measurement" into klp-dev * commit 'db34f3d17d0d2b6eaad8369536dcbb1025d0a00c': Check RelativeLayout's access of its own LayoutParams during measurement
| * Check RelativeLayout's access of its own LayoutParams during measurementAdam Powell2013-09-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RelativeLayout's use of its own LayoutParams is really old behavior and something it probably never should have done in the first place. However at this point it's enshrined compatibility behavior as fixing this would change the end results of measurement in some cases, and we've found that apps really love doing strange things with RelativeLayout that hit all of those edge cases. The existing behavior ignores this code path if set to MATCH_PARENT or WRAP_CONTENT, so we'll simply treat missing LayoutParams as the same case. Bug 10733375 Change-Id: I8b40b8557d19695ebcd5329aefc1603e2bf4234e
* | Add View constructor that supplies a default style resourceAlan Viverette2013-09-091-2/+8
|/ | | | | | | Also updates the constructor of every class that extends View. BUG: 10676369 Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
* Change build version from KEY_LIME_PIE to KITKATChet Haase2013-09-051-3/+3
| | | | | | Issue #10631619 Change build version to KitKat Change-Id: I6ad13f6169ad74204078d36929479998b498ad8b
* Fix bug #10514694 Specifying android:gravity="center_vertical|left" results ↵Fabrice Di Meglio2013-09-041-3/+16
| | | | | | | | | | | | in negative vertical positioning of child - related to "wrap_content" - self bounds should include childs horizontal / vertical margin too - so make height / width computation follow similar pattern as top / bottom computation Passing CTS tests: RelativeLayoutTest / RelativeLayout_LayoutParamsTest Change-Id: Id019c2536e89d2d8a4991aaabf6de60aae2e263b
* Add copy constructors for all widget-specific LayoutParamsAlan Viverette2013-08-071-0/+18
| | | | | BUG: 10215589 Change-Id: I4c040091e216c87f851d6b617107f43729e55b0c