Ga\u00ebtan Muller
b3fe6a7f61
[Cleanup] Remove redundant version checks for api <= 19.
...
Resolves https://github.com/material-components/material-components-android/pull/3849
GIT_ORIGIN_REV_ID=47bb2fcc8031740e5a7d4f741f1ada2af025e126
PiperOrigin-RevId: 632154861
2024-05-09 18:46:02 +00:00
leticiars
500dae836c
[Tabs] Fix selected text appearance not being applied correctly.
...
Fixes https://github.com/material-components/material-components-android/issues/4161
PiperOrigin-RevId: 631847488
2024-05-09 14:11:40 +00:00
leticiars
ef60931e2b
[Tab][a11y] Fix title being announced twice when there's a badge in TalkBack mode.
...
Resolves https://github.com/material-components/material-components-android/issues/3985
PiperOrigin-RevId: 600854666
2024-01-23 20:07:04 +00:00
pubiqq
0663019f45
[Color] Add ColorStateListDrawable support
...
Resolves https://github.com/material-components/material-components-android/pull/3538
GIT_ORIGIN_REV_ID=1bf9e320dc148e1bc959e7577372d3a393f35574
PiperOrigin-RevId: 563258432
2023-09-07 12:37:54 +00:00
rightnao
e3b255b3a0
[Docs] Crosslink github docs in javadocs
...
PiperOrigin-RevId: 546393704
2023-07-11 19:37:37 +00:00
rightnao
34d6a14700
[TabLayout] Fix issue with indicator not being drawn when viewpager starts scrolling before onLayout is called
...
PiperOrigin-RevId: 512062664
2023-02-27 20:45:19 +00:00
rightnao
e9246ed636
[TabLayout] Fix scrolling issue when using scrollable tab layout with viewpager
...
Resolves https://github.com/material-components/material-components-android/issues/3138
PiperOrigin-RevId: 508444050
2023-02-09 20:53:59 +00:00
pubiqq
2465192173
[TabLayout] Fix confusing documentation
...
Resolves https://github.com/material-components/material-components-android/pull/3098
GIT_ORIGIN_REV_ID=200a9d2f97bffa86a2b8ee3c3746fc7b5718b7a5
PiperOrigin-RevId: 495029269
2022-12-13 13:37:50 -05:00
dsn5ft
87ce239b01
[Docs] Remove smart characters from doc comments
...
PiperOrigin-RevId: 494733732
2022-12-12 16:40:01 -05:00
leticiars
997feacfd8
Automated g4 rollback of changelist 493122430
...
PiperOrigin-RevId: 493140204
2022-12-06 15:23:48 -05:00
pubiqq
139600418b
[TabLayout] Fix confusing documentation
...
Resolves https://github.com/material-components/material-components-android/pull/3098
GIT_ORIGIN_REV_ID=200a9d2f97bffa86a2b8ee3c3746fc7b5718b7a5
PiperOrigin-RevId: 493122430
2022-12-06 15:23:12 -05:00
rightnao
319467123f
[TabLayout] Fix bug with setScrollPosition not updating indicator due to onLayout call drawing the indicator below the selected tab.
...
Resolves https://github.com/material-components/material-components-android/issues/3101
PiperOrigin-RevId: 492562100
2022-12-02 18:38:40 -05:00
rightnao
84b7bc3320
[TabLayout] Fixing bug with animation flicker when using tabs with ViewPager2
...
PiperOrigin-RevId: 491460655
2022-11-29 15:21:12 -05:00
rightnao
4a0e1a0cdb
[TabLayout] Fix bug with selected tab text appearance when swiping in viewpager.
...
PiperOrigin-RevId: 489559352
2022-11-18 22:36:16 +00:00
pubiqq
cb1905dbff
[TabLayout] Fix default tabTextAppearance
...
Resolves https://github.com/material-components/material-components-android/pull/3085
GIT_ORIGIN_REV_ID=5c801bb6b6e9df227094106dedc5defa24b99077
PiperOrigin-RevId: 489517504
2022-11-18 16:57:53 -05:00
rightnao
857f481edd
[TabLayout] Fixing bug with animation cancelling if tab is double-tapped
...
resolves https://github.com/material-components/material-components-android/issues/3069
PiperOrigin-RevId: 487376299
2022-11-10 18:22:41 +00:00
rightnao
f9a37c5077
[TabLayout] Fix tab indicator animation
...
resolves https://github.com/material-components/material-components-android/issues/3047
PiperOrigin-RevId: 486241080
2022-11-07 16:00:53 +00:00
pekingme
34a1dde7b6
[Tabs] Fixed potential NPE when updating tab view.
...
PiperOrigin-RevId: 479643436
2022-10-11 14:03:44 +00:00
rightnao
00220d0ad6
[TabLayout] Add selectedTabTextAppearance attribute
...
Resolves https://github.com/material-components/material-components-android/issues/2159
PiperOrigin-RevId: 477238120
2022-09-27 23:56:23 +00:00
rightnao
3c0c9e75f5
[TabLayout] Setting a custom view on the tab should replace the current custom view
...
PiperOrigin-RevId: 473057129
2022-09-12 12:25:10 -04:00
pubiqq
d68c0f8dc5
[TabLayout] Do not impose margins in custom tab views
...
Resolves https://github.com/material-components/material-components-android/pull/2910
GIT_ORIGIN_REV_ID=d9ba645464601814cccff5c30118807e8f3f4ef6
PiperOrigin-RevId: 471814138
2022-09-02 13:01:35 -07:00
rightnao
d1c5a52cf4
[TabLayout] Update motion attributes for tab layout
...
PiperOrigin-RevId: 468736364
2022-08-22 15:23:26 -04:00
Material Design Team
44cc9b745c
Add @CanIgnoreReturnValue to some APIs that return this.
...
PiperOrigin-RevId: 468721442
2022-08-22 15:22:27 -04:00
pubiqq
cebf5919ad
[TabLayout] Fix icon position in icon-only tabs
...
Resolves https://github.com/material-components/material-components-android/issues/2767
Resolves https://github.com/material-components/material-components-android/pull/2768
GIT_ORIGIN_REV_ID=8dd880e76b80172e57573a600f3d65de846a55c0
PiperOrigin-RevId: 465559826
2022-08-05 20:26:07 +00:00
conradchen
d1895cdd35
[Tab] Mutate selected indicator drawable when it's being set
...
Wrapping and mutating a given drawable which is supposed to be tinted is a standard practice across the Material library. This CL applies the same logic to Tab's selected indicator drawables and also refactoring the relevant logic a bit to make it cleaner.
Resolves https://github.com/material-components/material-components-android/issues/2794
PiperOrigin-RevId: 460765659
2022-07-13 19:53:29 +00:00
pekingme
2fc2e6a167
[Tab] Fixed indicator not updating when a tab to the start/left of the selected tab is removed.
...
PiperOrigin-RevId: 456322731
2022-06-23 18:34:24 +00:00
pubiqq
3ca41be8f0
[General] Fix typos
...
Resolves https://github.com/material-components/material-components-android/pull/2654
GIT_ORIGIN_REV_ID=b8f6728979875629f2c813ef90d2f671cf56b4eb
PiperOrigin-RevId: 442852630
2022-04-19 14:48:55 -04:00
jeremymuhia
9c2df2811c
[TabLayout] tabs with padding in fixed mode shouldn't scroll
...
Resolves https://github.com/material-components/material-components-android/issues/2410
PiperOrigin-RevId: 432032683
2022-03-03 09:56:30 -05:00
hunterstich
a295de9728
[TabLayout] Added fade inidcator animation mode.
...
PiperOrigin-RevId: 417842993
2021-12-22 14:48:54 -05:00
Material Design Team
cfc00aa5a3
Update android core class definitions across material
...
PiperOrigin-RevId: 414839941
2021-12-08 14:56:25 +00:00
Material Design Team
a487c89185
Internal change
...
PiperOrigin-RevId: 412135443
2021-11-29 17:35:39 +00:00
conradchen
823c34a90c
[Tab] Fix NPE caused by set a position less than 0
...
If somehow scroll position is set to -1 with and position offset greater than 0.5, we will decide it's a valid scroll position which causes NPE for selected child not found.
Fixes this by checking if position is valid regardless the offset and falling back to 0 if a negative position is given.
Resolves https://github.com/material-components/material-components-android/issues/2464
PiperOrigin-RevId: 408894188
2021-11-10 16:12:49 -05:00
conradchen
328d269e6d
[Tab] Fix NPE caused by null tab indicator
...
PiperOrigin-RevId: 397841987
2021-09-21 08:22:49 -07:00
conradchen
868f8aaba3
[Tab] Fix setting tab indicator and its full-width flag
...
1. When a new tab indicator drawable is set, we didn't correctly restore the previous set indicator height to the new drawable, or set the drawing bound to the intrinsic height of the drawable, if the indicator height was not specified. This result in a 0-height drawing bound after setting the tab indicator, which makes it disappear and can never go back if the tab indicator gravity is not "stretch" (which will recalculate the height after moving the indicator). Fixes this by correctly set the drawing bounds after a new tab indicator drawable is set.
2. After we set full-width flag of tab indicator, the width won't be updated until we move the tab indicator. Fixes this by explicitly triggering the recalculation of tab indicator's drawing bound after changing the flag.
Resolves: https://github.com/material-components/material-components-android/issues/2354
PiperOrigin-RevId: 397823617
2021-09-21 08:14:25 -07:00
conradchen
8a1f221e39
[Tab] Fix isSelected() may returns incorrect result
...
Resolves https://github.com/material-components/material-components-android/issues/2379
PiperOrigin-RevId: 397394397
2021-09-20 12:16:44 -07:00
conradchen
126df4c082
[Tab] Fix icon tint not applied on lower SDKs
...
On SDK < 23 if the icon is not a TintAwareDrawable, DrawableCompat.wrap() will return a new drawable which wraps the original drawable. However in the original logic after we set the tint to the icon, we didn't really set the tinted icon back to the tab or the image view, therefore the tint is not showing.
Moves the tint logic to updateTextAndIcon() to ensure tinted icons will be used in the image view.
Resolves https://github.com/material-components/material-components-android/issues/785
PiperOrigin-RevId: 391368322
2021-08-18 10:02:28 -07:00
conradchen
e92ebdef09
[Tab] Redraw indicators after their color is updated
...
Also supports setting indicator color to transparent.
Resolves https://github.com/material-components/material-components-android/issues/2136
PiperOrigin-RevId: 381541396
2021-06-28 13:07:40 -07:00
connieshi
da2d8264d1
[Tabs][BottomNav] Do not show tooltip on long press for L and M devices to avoid freezing devices on repeated long press.
...
PiperOrigin-RevId: 355428951
2021-02-04 20:54:30 -05:00
connieshi
fd3639092e
[Tabs] Show tooltip with tab text or content description (if tab is icon only) when long press.
...
PiperOrigin-RevId: 342411547
2020-11-14 10:16:08 -05:00
Material Design Team
cf9027f098
[TabLayout] Add a localized a11y string for a tab
...
PiperOrigin-RevId: 338706340
2020-10-23 12:31:51 -07:00
hunterstich
0afcb48f14
[TabLayout] Automated g4 rollback of changelist 337128442.
...
*** Reason for rollback ***
[TabLayout] Roll forward with dot indicator fix
*** Original change description ***
Automated g4 rollback of changelist 337092676
PiperOrigin-RevId: 337484043
2020-10-16 05:54:50 -07:00
hunterstich
91589f4c24
Automated g4 rollback of changelist 337092676
...
PiperOrigin-RevId: 337128442
2020-10-15 13:28:59 -07:00
hunterstich
f0a80c4e41
[TabLayout] Automated g4 rollback of changelist 336764852.
...
*** Reason for rollback ***
Roll forward with fix
*** Original change description ***
Automated g4 rollback of changelist 336704515
PiperOrigin-RevId: 337092676
2020-10-15 13:25:34 -07:00
connieshi
9487c33b8a
Automated g4 rollback of changelist 336347365
...
PiperOrigin-RevId: 336978123
2020-10-15 13:23:56 -07:00
hunterstich
f743057941
Automated g4 rollback of changelist 336704515
...
PiperOrigin-RevId: 336764852
2020-10-15 13:16:16 -07:00
hunterstich
f8f3d9086e
[TabLayout] Added initial indicator interpolation extensibility.
...
Added a linear and elastic interpolator to handle specing the indicator at any point between two tabs.
PiperOrigin-RevId: 336704515
2020-10-15 13:14:22 -07:00
Material Design Team
0f717f8cce
Automated g4 rollback of changelist 336306885
...
PiperOrigin-RevId: 336347365
2020-10-15 13:01:02 -07:00
connieshi
5e35d14c18
[Badge] Update badge to support being anchored to any view in pre 18.
...
In <API18, BadgeDrawable will dynamically 1) wrap the anchor in a FrameLayout and 2) replace the anchor with the FrameLayout in the anchor' view hierarchy. BadgeDrawable will set itself as foreground on the FrameLayout.
If the user does not want BadgeDrawable to manipulate its view hierarchy, the user can pass in an instance of FrameLayout `customBadgeParent` in #attachBadgeDrawable instead.
Labeled BadgeUtils as experimental and removed the RestrictedTo(Scope.Library) annotation.
Updated TopAppBar main demo to show a badge on a toolbar menu item.
PiperOrigin-RevId: 336306885
2020-10-15 12:31:14 -07:00
David Sucharda
84fd465cea
[TabLayout] Added support for preserving the indicator drawable's intrinsic color
...
Setting app:tabIndicatorColor="@null" (or app:tabIndicatorColor="@android:color/transparent") will now result in the intrinsic color of the indicator drawable being respected. To hide the indicator completely, instead set app:tabIndicator="@null".
Resolves https://github.com/material-components/material-components-android/issues/1481
Resolves https://github.com/material-components/material-components-android/pull/1483
GIT_ORIGIN_REV_ID=7926b2671fb119a6472cc180b77ea6fe1b63fbd1
PiperOrigin-RevId: 323928586
2020-07-30 00:21:33 -04:00
marianomartin
4e62f960ec
[TabLayout] Add a setId method that can be used for espresso
...
PiperOrigin-RevId: 323570079
2020-07-29 09:14:46 -04:00