summaryrefslogtreecommitdiff
path: root/core/java/android/widget/GridLayout.java
Commit message (Collapse)AuthorAgeFilesLines
* Expose GridView/Layout APIs via @RemotableViewMethodStevie Kideckel2021-04-211-0/+4
| | | | | | | Bug: 185972660 Test: Built and ran locally, annotation change only Change-Id: I85fc00ae62b124653e20fd53f9179493463933e0
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-1/+2
| | | | | | | | | | | | | | | | | | | 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-2/+1
| | | | | | | | | 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-1/+2
| | | | | | | | | | 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
* Add @Nullable annotation to the parameter of Object.equals() methods.Roman Kalukiewicz2020-10-151-3/+4
| | | | | | | | | | | | | | | | | | Those annotations could be inferred by some tools (like Kotlin), but the https://checkerframework.org/ doesn't check inherited annotations complaining about all equals() invocations that get nullable argument. The change was generated by running find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /' in the frameworks/base directory and by automatically adding and formatting required imports if needed. No manual edits. Bug: 170883422 Test: Annotation change only. Should have not impact. Exempt-From-Owner-Approval: Mechanical change not specific to any component. Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
* 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
* Rename @EnumEntry and @FlagEntryAshley Rose2019-03-181-4/+4
| | | | | | | Test: atest CtsViewInspectorAnnotationProcessorTestCases Bug: 127531820 Exempt-From-Owner-Approval: Annotation-only change Change-Id: Id293e2b2ac9cf7bf2aaeb28645471ea227bb587b
* 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/+14
| | | | | | | | | 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/+2
| | | | | | | | | | | | | | | | 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 broken links in @see tags in framework docs.Aurimas Liutikas2018-06-041-4/+4
| | | | | | | | | | doclava was accidentally suppressing all these broken links in @see tags. This CL fixes issues so we can start enfocing checks for broken @see links. Test: make docs Change-Id: If7830ece85f8d1f27c991eae282230814726e115 Exempt-From-Owner-Approval: Fixing @see javadoc link issues that are currently completely broken
* Revert "Remove @hide from ViewGroup debug methods"Alan Viverette2018-02-051-0/+6
| | | | | | | | This reverts commit 1244815e8faa6881a9d7256a5a292f88cd7b8108. Bug: 71555179 Test: make Change-Id: Ibfd97660e5f91fc7fac13b66efa8aa587ba20b4e
* Add more IntDef prefixes for auto-documenting.Jeff Sharkey2017-12-131-2/+8
| | | | | | | Test: builds, boots Bug: 70177949 Exempt-From-Owner-Approval: annotation-only changes Change-Id: I76dde6054e06f52240bd4b1a0f196dcb74623608
* Remove @hide from ViewGroup debug methodsAndrei Stingaceanu2017-07-251-6/+0
| | | | | | | | | Allow developers to easily add their own debugging info when developing custom ViewGroups. Bug: 30117235 Test: tests still pass Change-Id: Ia83005b4dc727c7b959a50e7b0130582f6e89762
* Fix import statements in android.widget package.Aurimas Liutikas2016-10-111-6/+15
| | | | | | | 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
* Prevent infinite loop in case of integer overflow.Deepanshu Gupta2016-01-071-1/+2
| | | | | Bug: 26331754 Change-Id: I29068159204ecd2e03e44fbb2375d2e116774e07
* Un-hide ViewGroup#onViewAdded/onViewRemovedAdam Powell2015-06-181-10/+2
| | | | | | | | | | | | | | | These methods are generally useful for writing custom views, and by exposing them we make it easier for custom view authors to still allow app developers to use an OnHierarchyChangedListener since it will not be occupied by a custom view's implementation. Also move the actual dispatch to package-scoped dispatch methods so that a developer forgetting to call super won't stop a listener from functioning. Bug 21866523 Change-Id: Ie2bb5e241d7c5a02a5033f33ecdaeb40aceb20b5
* Merge "Remove original movements record from GridLayout"Yigit Boyar2015-03-071-20/+2
|\
| * Remove original movements record from GridLayoutYigit Boyar2015-03-051-20/+2
| | | | | | | | Change-Id: Iebb761d0195b9d123dada1262090a71c4c175c5e
* | Fix build. getAlingment should not be publicYigit Boyar2015-03-051-1/+1
|/ | | | Change-Id: I4abde1ddc78367795601215106388d6eb535cbca
* Fix some weight bugs in grid layoutYigit Boyar2015-03-051-14/+30
| | | | | | | | | | | | | | | | This CL also changes how GONE views are considered. Previously, they would still participate in weight calculations. Now, they are ignored. Bug: 19546781 Sub bugs: Bug: 19571249 Bug: 19571653 Bug: 19571319 Bug: 19571841 Change-Id: I7344f757d3a76be98bb92660f07d2a0cafa9ac12
* Remove unused imports in frameworks/base.John Spurlock2015-02-281-2/+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-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
* Improve GridLayout's weight calculationsYigit Boyar2014-11-191-24/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL improves the method by which excess space is distributed in GridLayout. Previously, GridLayout would assume weights were arranged in a 'line' and sum the weights in the assumed line to figure out the proportional allocation to each view. The system involved running GridLayout's internal constraint solver twice. Behavior was unspecified (and surprising) when weights appeared in views that were not linked together linearly, typically leaving the last view in each axis with more space than expected (in GridLayout's Bellman-Ford constraint solver, remaining space goes to the last span of the axis). This CL changes the weight distribution mechanism to effectively integrate it with the Bellman-Ford constraint resolution algorithm. It does this by returning a boolean value from the constraint solver saying whether or not the constraints could be solved and then using a binary chop to find a maximum amount of space that can be distributed without violating the constraints. This implementation runs the solver log(<axis size> * <number of Views>) times until finding the maximum amount of space that can be distributed according to the weights without causing a contradiction. We expect the cost of this variation to be around a factor of 10 worse than the previous implementation but to provide a simple and general definition of space distribution via weights that will be open to many future optimizations. As a side effect, this CL also fixes a bug in GridLayout where remaining space was distributed only along the major axis. Bug: 17485996 Change-Id: I120f39e95e90b5b35072ef8a6c348ec541aae42a
* More on weights in GridLayoutPhilip Milne2014-05-241-1/+1
| | | | | | | | Chance as little as possible from existing. If weights are defined only a subset of the views in a layout (the normal case) leave the layout of the remaining views unaffected. Change-Id: I27473e303c0666930e2fb515b794df96a8b97272
* More on adding support for weights to GridLayoutPhilip Milne2014-05-241-5/+1
| | | | | Remove fields that are not needed with view-based allocation. Change-Id: I23dc75fea47c532ad46e23b7fb14ff8e46c68db1
* More on weighted space distribution in GridLayoutPhilip Milne2014-05-231-58/+77
| | | | | | | | This CL changes the weight distribution algorithm to act on views rather than rows/columns. This is a more general mechanism that is simpler to define. Change-Id: Ifa5adbe0b0a9a9ae271616321385f8e926aba054
* Support for weights in GridLayoutPhilip Milne2014-05-221-33/+176
| | | | Change-Id: I31993cb7da331e0bcf404e858f2438a579093e7d
* Merge "Clean up layout constructors, make them consistent"Alan Viverette2013-09-141-18/+8
|\
| * Clean up layout constructors, make them consistentAlan Viverette2013-09-101-18/+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
* | Add typedefs and nullness annotations.Tor Norbye2013-09-111-2/+17
|/ | | | | | | | | | | This changeset adds in typedef annotations (custom annotations marked with @IntDef) for various int parameters and return values in the API. It also adds nullness annotations for cases where the documentation explicitly mentioned null policy, or where it was blindingly obvious from the context. Also fixed some typos in the documentation. Change-Id: Ica27c01368895818e26237544edd8483007155bb
* Add View constructor that supplies a default style resourceAlan Viverette2013-09-091-3/+8
| | | | | | | Also updates the constructor of every class that extends View. BUG: 10676369 Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
* GridLayout changes for API councilAdam Powell2013-08-291-60/+64
| | | | | | | | | | | * Hide set/getPrinter methods. A change/addition like this should happen for all views if it happens, not just for one specific view. * Follow Android style guidelines for fields. Bug 10549037 Change-Id: I1823d7bbbd8bcc678c5be2358ca23a8dc6dbfd15 (cherry picked from commit 916159461bf17e13c245a709935a0d1133e0ed91)
* Add copy constructors for all widget-specific LayoutParamsAlan Viverette2013-08-071-5/+9
| | | | | BUG: 10215589 Change-Id: I4c040091e216c87f851d6b617107f43729e55b0c
* am a1ea8019: am 61527436: Merge "Fix for bug 8272673: GridLayout in battery ↵Philip Milne2013-04-161-16/+27
|\ | | | | | | | | | | | | details is cut off." into jb-mr2-dev * commit 'a1ea801956c4727656ef25177b1bb4c5b788cde7': Fix for bug 8272673: GridLayout in battery details is cut off.
| * Fix for bug 8272673: GridLayout in battery details is cut off.Philip Milne2013-04-161-16/+27
| | | | | | | | Change-Id: Iabcc2d2c486162cf88990eb1a25aca2e7558a57c
* | GridLayout diagnostics.Philip Milne2013-03-051-2/+8
| | | | | | | | | | | | | | | | Add null check for: https://googleplex-android-review.git.corp.google.com/#/c/183792/ Change-Id: Ic8ef7b6749b6d2568ed4e4b3b1fa4ad6659c70eb
* | Provide (general) mecahnism for users of GridLayout to either suppress or ↵Philip Milne2013-03-041-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | react to diagnostics. GridLayout uses a constraint solver to perform its layout operation. Some layout problems result in systems of constraints that are inconsistent and so cannot be solved. GridLayout detects this condition and makes corrections so as to always guarantee that the layout operation will complete. In those cases where corrections are made, GridLayout issues a warning to the Log. This CL allows (internal) clients of GridLayout to both swtich off the logging and/or detect when this condition is encountered. Change-Id: I5b871003381f81cf0a76ad3de767e7f8b8349923
* | Fix for bug: 8184401 - GridLayout accounts for child's size/measurements ↵Philip Milne2013-02-261-1/+17
|/ | | | | | | | | | | | | | | | | | | | | | | | even when a child is "GONE" The original fix: https://googleplex-android-review.googlesource.com/#/c/273122/1 was incorrect as it left GridLayout to simply ignore views with GONE status. Instead, views with GONE status must cause their corresponding rows and columns to collapse to zero width/height in the case where the rows/columns are not flexible. The actual bug is the result of the fact that getBaseLine() is not parameterized by the height/size of the view for which the baseline is being requested. In the case of a view that is GONE, GridLayout will request the baseline of a component that has zero height, and get results other than 0 (which is doesn't make sense). Prevent this with a specific check. This CL should fix 8184401 without causing: https://b.corp.google.com/issue?id=8192858 Change-Id: Ic74888b499466bbfac5fb97d49eede5b6c343127
* Revert "Fix for bug: 8184401 - GridLayout accounts for child's ↵Philip Milne2013-02-131-2/+0
| | | | | | | | | | size/measurements even when a child is "GONE"" Suspected cause of: http://b.corp.google.com/issue?id=8192858 This reverts commit e5e0b7f191b64380e9231a2b755ecd3738598dec Change-Id: I1a35c12c3ca0b1eacfb0c1a4d6ba03601dab664b
* Fix for bug: 8184401 - GridLayout accounts for child's size/measurements ↵Philip Milne2013-02-121-0/+2
| | | | | | | | even when a child is "GONE" Added a check for GONE status in measurement calculations. Change-Id: I3ec82b03f3089730f10dbd6916f6245188cd8452
* Bug #6110465. Optical bounds support for all ViewGroup subclasses.Philip Milne2012-09-211-41/+36
| | | | | | | | | | | | | | This CL generalizes the optical bounds support previously contained in the GridLayout implementation and then incorporates the new form directly into the base View and ViewGroup implementations. After this change, GridLayout is returned to an 'optical bounds' unaware state, and all layouts (including non-platform ones) inherit the ability to perform their layout operation by optical (rather than clip) bounds using their existing implementations. The "layoutMode" property of ViewGroup and its associated constants are made public in this CL. Change-Id: Ic1bba0e1c6fc14da4aeab0b28c975d562b5f82dd
* Doc changes for GridLayout.Philip Milne2012-05-211-2/+27
| | | | | | Add some javadoc to explain orientation property properly. Change-Id: I1e2092f32fe2f524eda7d1c46c6daad571733c1f
* Add validation code for GridLayout.LayoutParamsPhilip Milne2012-05-141-15/+49
| | | | | | | | | | | | | | Bug 6404882. The supplied code in this bug sets up a table with 2 columns and then tries to add a component in column 5. Earlier attempts to fix this by 'doing what the user meeant' had unwanted side-effects. This CL is intended to defend against all ways to register invalid LayoutParams and throw IllegalArgumentExcpetion when any column index falls outside the range [0 .. N] where N is the number of columns. It also includes the symmetrical check for rows. Change-Id: I958a6d16035889cd954b78108773426e8b6b6d95
* Revert "Fix for layout parameter validation bug in GridLayout."Jim Miller2012-05-021-1/+1
| | | | | | | This reverts commit 8a36e05443f13edde1eae0cf6ea01b3b2da6e637 which was causing keyguard_screen_tab_unlock.xml to have a bad layout. Change-Id: I50bdc6dbdf8d7b98ef77eae532860d375574213e
* Fix for layout parameter validation bug in GridLayout.Philip Milne2012-05-011-1/+1
| | | | | | | | | | | | | | | | Bug 6404882. When a cell has an unspecified row and a column that is specified as greater than the specified number of columns, GridLayout fails to report or correct the error and loops indefinitely searching for a valid row to place the cell. There is a cyclic dependency between the validation of layout parameters (and allocation of undefined cell indexes) and the maximum column/row counts. A performance optimization in layout paramter allocation caused this dependency to be handled in correctly. The problem is fixed in this CL for this bug and the symmetric problem for rows. Change-Id: I0392343bc8a721a0ca7163f58f233ba8046c22e2
* Fixes for optical bounds feature.Philip Milne2012-04-271-33/+42
| | | | | | | | | | 1. Make the feature opt-in (ViewGroup::layoutMode defaults to CLIP_BOUNDS) without inheritance. 2. Rename COMPONENT_BOUNDS to CLIP_BOUNDS. 3. Rename LAYOUT_BOUNDS to OPTICAL_BOUNDS. 4. Complete GridLayout implementation. 5. Change the default_gap between components to 8dp, to align with the Style Guide. Change-Id: I8d40dfc5f4ca469f6424eb3ff60d07bec56e3a9f