summaryrefslogtreecommitdiff
path: root/core/java/android/widget/Toolbar.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
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* 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/+20
| | | | | | | | | 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
* Move some members to the "Q blacklist".Mathew Inwood2018-09-141-1/+2
| | | | | | | | | | | | | | Based on some analysis, these fields/methods are likely false positives. Set maxTargetSdk=P so that any apps using them are required to migrate off them in future. See the bug for more details. Exempted-From-Owner-Approval: Automatic changes to the codebase affecting only @UnsupportedAppUsage annotations, themselves added without requiring owners approval earlier. Bug: 115609023 Test: m Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-211-0/+7
| | | | | | | | | | | | | | | | 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
* Add setter and getter for Toolbar's collapse icon.Daniel Santiago Rivera2018-05-021-0/+92
| | | | | | Bug: 78187236 Test: make java Change-Id: Id0faacaa95c8c4ee54b3dec66e3b16e589ebd370
* Allow cluster navigation to jump into touchscreenBlocksFocusEvan Rosky2017-03-201-0/+3
| | | | | | | | | | | | | | | | | | | Adds an exception to touchscreenBlocksFocus ViewGroups which are also keyboardNavigationClusters. The behavior we want is that cluster navigation can jump into touchscreenBlocksFocus clusters but normal keyboard navigation can't. Once focus is in a touchscreenBlocksFocus cluster; however, we allow focus navigation to move freely within that cluster. It remains in that cluster until a subsequent cluster navigation brings it back out. Adds back the touchscreenBlocksFocus attributes to Toolbar and actionbar so that they behave like they did before. Bug: 34363323 Test: Added CTS test. Verified desired behavior in a test app Change-Id: I555bf5570b16a57f0d4c8a020ae509a1e1b33910
* Converting action bars to clusters.Vadim Tryshev2017-01-111-0/+18
| | | | | | | | | | | | | | | | | | | | ActionBar keyboard navigation logic is now implemented via clusters. Old implementation using setTouchscreenBlocksFocus and Ctrl+Shift+< shortcut is removed. Looking at the code, I can’t rule out existence of all 3 categories (1) action bars with a nested toolbar, (2) action bars without a nested toolbar and (3) Toolbars outside of action bars. Because of this, I set “cluster” attribute both on action bar and toolbar, and have code to avoid nested clusters in case (1). Support lib’s action/tool bars aren’t converted, however, they didn’t regress since Ctrl+Shift+< never worked for them. Will be done after feature freeze. Bug: 32151632 Test: Manual checks. Change-Id: Ieb93980088c0fb385a9bc8a5d218ffc269b94dc5
* Make Toolbar ignore its minHeight if larger than heightChris Banes2016-06-281-1/+2
| | | | | | | | | | | | | Currently Toolbar lays out all children based on its minHeight (if set). If that minHeight is larger than the Toolbar height, then the children are laid out larger than the Toolbar and clipped. This CL fixes it back by capping the alignment height. BUG: 29049143 Change-Id: Ia3389a906b132bb0a2ae41b27116c00744d0ddf4
* Fix NPE in Toolbar - framework editionChris Banes2016-06-211-6/+15
| | | | | | | | | Caused by super constructor calling non-final methods which Toolbar overrides, and then tries to reference final variables. BUG: 28806107 Change-Id: Ieaf5f7611dbbf954e49c31e604aa2f7627248615
* Add a hidden test-only API to get Toolbar's navigation view.Kirill Grouchnikov2016-04-041-0/+10
| | | | Change-Id: I15d4d9ac7ea77ff260bccdfb9d82c85a7bafdfab
* Add contentInsetStartWithNavigation/EndWithActionsAdam Powell2016-03-291-12/+179
| | | | | | | | | | | Allow developers to set different content insets on toolbars and action bars to be used when navigation buttons or menu actions are present. Set the default values for these according to the material spec. Bug 19317855 Change-Id: I13e04e1f19f0982bf551a3027eb70904d6b4674c
* Apply menu callbacks to existing Toolbar menu viewAlan Viverette2016-01-131-0/+3
| | | | | Bug: 25872174 Change-Id: I44f4fad27e5e48a8ecdf0c63e135fbf566517cea
* Avoid NPE when ActionMenuPresenter is intialized with null MenuBuilderAlan Viverette2016-01-041-1/+1
| | | | | | | Also adds annotations to accurately reflect nullability. Bug: 26318920 Change-Id: Ia3b170dd301edfc0088a11ee5764c24bab2f10aa
* Revert "Add support for partial view layouts"Chet Haase2015-12-081-5/+0
| | | | | | | | | | | | 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-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add accessor methods for Toolbar title marginsAlan Viverette2015-09-151-1/+137
| | | | | | | | | Also adds missing attrs to public.xml so they can be documented, adds attr refs to Toolbar class docs. Many accessor methods still missing, but those can be added in subsequent CLs. Bug: 23719889 Change-Id: I09eeef65141d4af77c8813e8fac5f89bead47597
* Merge "Add matching xml attributes for existing Toolbar properties" into mnc-devAdam Powell2015-06-171-0/+18
|\
| * Add matching xml attributes for existing Toolbar propertiesAdam Powell2015-06-161-0/+18
| | | | | | | | | | | | Bug 21010256 Change-Id: I3ac9491d86dd502f7572e37a3c9b70ffb8957ced
* | Fully remove Toolbar children when action views expandAdam Powell2015-06-151-29/+45
|/ | | | | | | | | | | The previous implementation of toggling visibility resulted developer-set child visibility getting stomped. Fully detach child views that shouldn't be shown instead. This is more consistent with the coming and going of other system child views. Bug 18156260 Change-Id: I8469d45eeb950dc0232f703efe8401233241c657
* API council review feedback for ActionMenuViewChris Banes2015-06-101-145/+18
| | | | | | | | | | Reverts "MenuItem, navigation and overflow icon tinting" CL, and adds getter and setter for the overflow icon to ActionMenuView and Toolbar. BUG: 21571899 Change-Id: I591f43650356443fa3256e4d74e28b6ddd8c2b33
* Replace usages of deprecated version of TextView.setTextAppearance()Alan Viverette2015-05-081-4/+4
| | | | Change-Id: Ie501affe2e3a275d3172ce8ed584ba1cd5494da8
* Add resource type annotations to some APIsTor Norbye2015-03-131-10/+14
| | | | Change-Id: I37c8afdaea455aa92bc8270bb2dfd60616c5f9bc
* Annotate ARGB integer parameters with @ColorIntTor Norbye2015-03-051-2/+3
| | | | Change-Id: I307f72a382272cf18ddb6b07d9fcb81228568d9a
* MenuItem, navigation and overflow icon tintingChris Banes2015-02-271-1/+149
| | | | | | | | | | | | | | | - iconTint and iconTintMode attrs for MenuItem, with associated setters. - navigationTint and navigationTintMode attrs for Toolbar with associated setters. - overlflowTint and overflowTintMode attrs for Toolbar with associated setters. BUG: 18126050 BUG: 19148351 BUG: 19305408 Change-Id: Ibd1fae7cdbc7a7c42809e52541fae5d8beb18e92
* Accessibility: Ignore overlapping siblings when computing a click locationSvetoslav2015-01-231-12/+0
| | | | | | | | | | | | | To click a view we were computing a click location by ignoring overlapping views that are actionable. However, detection whether a view is actionable is not always possible as the view may handle touch events directly. This leads to unhandled edge cases. We are taking a conservative approach and ignore all overlapping siblings regardless if clickable. This is also has limitations but hopefully less frequent edge cases. bug:18889611 Change-Id: Icea0b7b3e2d4ed53e50e01cb6a99b880be560b14
* Accessibilty: Cannot click on views in a scrollable container covered by the ↵Svetoslav2015-01-221-0/+13
| | | | | | | | | | | | | | | toolbar. In accessibility mode we calculate a point where to click in the accessibility focused view as a bridge-gap solution before switching to accessibility click actions. We cannot detect whether a view is covered by another one that consumes all touch events, and therefore we may click on the wrong target. This was the case with the toolbar. As a result a partially scrolled view in a scrollable container covered by a toolbar cannot be activated and this is not an edge case. bug:18986806 Change-Id: Ib41470c39806cec13e9b00b319879cd7f3412ab5
* am cd5f3bab: Merge "Use the right layout for inflating Action Bar." into ↵Deepanshu Gupta2014-11-041-0/+11
|\ | | | | | | | | | | | | lmp-dev automerge: 84a89ed * commit 'cd5f3bab37ef1dc041489f53f565416d295916d9': Use the right layout for inflating Action Bar.
| * Use the right layout for inflating Action Bar.Deepanshu Gupta2014-10-301-0/+11
| | | | | | | | | | | | | | | | The choice of Action Bar layout depends on the theme. This also affects the widget used to render the Action Bar. Bug: http://b.android.com/77853 Change-Id: I6219a02853b4cd207a6125a5ed96fa5d16699460
* | Add content description to Toolbar collapse buttonAlan Viverette2014-10-281-0/+3
| | | | | | | | | | BUG: 17722111 Change-Id: If6caa8bc61b0d178648952c419591380f4edf4ba
* | Document Toolbar's vertical alignment strategyAlan Viverette2014-10-131-3/+6
|/ | | | | BUG: 17526065 Change-Id: I78fdd8da225c33971985d3941f54624b20248409
* Make Toolbars eat touch eventsAdam Powell2014-09-121-0/+29
| | | | | | | | | Just like action bars, toolbars shouldn't allow touches to fall through to sibling views that they overlap. Bug 17483356 Change-Id: I9068e1f9cf3c4226000e0058c371283a997b1bd0
* Vertically align toolbar child views with similar gravitiesAlan Viverette2014-09-111-25/+51
| | | | | | | Also fixes Body1 text size, action bar title size on sw600dp-land. BUG: 17266152 Change-Id: Ib686dd6e80dfcdad920c922a532f4f5d6252fa19
* Menu callbacks for ToolbarActionBars, part 2Adam Powell2014-09-041-3/+5
| | | | | | | | | Pass through the menu mode change events and make sure Activities get prepare/open/close events properly. Bug 17326424 Change-Id: I0ac2f56e4d0054ef01720b2ff1c41ded053750c7
* Dispatch more menu events to window callbacks from ToolbarActionBarAdam Powell2014-09-041-0/+11
| | | | | | | | | Wire through the callbacks that result in onPrepareOptionsMenu being called properly when an activity overflow menu is opened. Bug 17326424 Change-Id: Ifc5b67af0d215f210bb00326f82f60ba55a36d52
* Automatically supply a content description for ToolbarActionBar navAdam Powell2014-09-021-5/+6
| | | | | | | | | | | | | | | If the developer hasn't set a navigation content description on the Toolbar assigned to be an action bar or a home-action content description via the ActionBar interface, use the framework default "navigate up" string. Also make sure that the default Up description is supplied in the screen_toolbar window decor layout and that it is parsed properly in all toolbars, even if we don't have an icon set during construction. Bug 17298370 Change-Id: Ie2f9e34f92046d4d4ffb9a07e38fa89581891f7b
* Doc improvements for new Toolbar changes, now with attributes.Adam Powell2014-08-281-0/+12
| | | | Change-Id: I3f67899b4f9ab9ae4ab4f5dcbc853c08d7867947
* Don't add title margins during to Toolbar layout if titles don't fitAdam Powell2014-08-281-4/+10
| | | | | | | | | | When all space is consumed in a Toolbar by other views the special shared title/subtitle margins shouldn't be added to the running position during layout. Bug 17253638 Change-Id: I179fcbf286fa68fd8df6e25bb1879bccbf1532ed
* Add xml attributes to Toolbar for navigation iconAdam Powell2014-08-281-0/+10
| | | | | | ...to match the existing setters/getters. Change-Id: I9814c5d7f2aa0559c93fbb74881e29064473f186
* Add state save/restore for ToolbarAdam Powell2014-08-251-0/+54
| | | | | | | | | | | | | | | | | Save and restore the menu state for Toolbars. This will make sure that we remember expanded action views and opened overflow menus across state save/restore. Remove an extra event post involved in the initial population of action bar menus. Apparently at some point an extra level of this was added that isn't necessary. Process any pending menu invalidations immediately when we perform window state restoration. This makes sure individual bits of state in action views, etc. are also restored properly. Bug 12005461 Change-Id: Icf905698576b11a59641bc319adc62300857906f
* Remove duplicate Toolbar method for setting content descriptionAlan Viverette2014-07-251-55/+36
| | | | | | | | Also moves the setNavigationIcon(int) method closer to the one that takes a Drawable. BUG: 16491458 Change-Id: Ia02f05e6270c9d420f61f7ab34117b4c7e6548ec
* Update spinner asset, fix default popup context and elevationAlan Viverette2014-07-231-0/+2
| | | | | BUG: 15985882 Change-Id: Ica8c2597c35bd3012da11e315a93bbd1df2f3f38
* Add popupTheme attr, propagate from ActionBar to ToolBarAlan Viverette2014-07-221-3/+2
| | | | | BUG: 16347549 Change-Id: I934ec2469f8c136f750e2e2cf9b333e229393ac3
* Don't apply the ActionBar style to a Toolbar as a result of setActionBarAdam Powell2014-07-191-1/+1
| | | | | | | | | While this is a convenient idea, it effectively means that any styling directly applied to a Toolbar in a layout gets stomped by the theme-global ActionBar style. Obey the more local, specific styling from the Toolbar instead. Change-Id: Ief6a7cb90052bdced87f1dc0925c1dfbc0df4792
* Measure Toolbar titles lastAdam Powell2014-07-191-15/+15
| | | | | | | | | Give the maximum amount of room to "real" content views before taking up space for the title and subtitle of a toolbar. Bug 16039951 Change-Id: I10da9cdc39e84e6fb3975ee40958c57031002dd5
* Fix Toolbar title layout in RTL modeAdam Powell2014-07-191-1/+1
| | | | | | | | Welp, that one was embarrassing. Bug 16192193 Change-Id: I4e94e71ef34b4b08b5dd4c7b7f0dfb22e834ca19
* Adapt ActionBar.LayoutParams to Toolbar.LayoutParams on demandAdam Powell2014-07-191-0/+18
| | | | | | | | | | | | | | | | | When Toolbar is acting in the role of an action bar it needs to handle the case where app code calls setLayoutParams on a custom view with an ActionBar.LayoutParams instance. Run the newly set LayoutParams through the check/generate routine normally performed when adding a child view whenever LayoutParams are set on an existing child to correct for it. This might not be a bad thing to generalize someday but it would make for very confusing compatibility behavior when running code that was written to expect it on older platform versions. Bug 16219488 Change-Id: I568a335fe8ebbbaa666690d1f0e95f313abd2f1e
* API for inflating action bar menus against a different themeAlan Viverette2014-07-101-11/+45
| | | | | BUG: 16162344 Change-Id: I5bf9f133de56a1830028bca6326cc2c50888a052
* Fix a copy/paste bug in Toolbar.Adam Powell2014-07-011-1/+1
| | | | | | Bug 15868762 Change-Id: Ie2a0c492f9d7baa05d520cd2fee652245ab4b61b