133 Commits

Author SHA1 Message Date
dniz
655dde062a [CollapsingToolbarLayout] Added option to add extra height when title text spans across multiple lines
PiperOrigin-RevId: 382716405
2021-07-02 08:16:09 -04:00
dniz
af35dfb86b [CollapsingToolbarLayout] Fixed multiline RTL collapsed title text position
PiperOrigin-RevId: 382073266
2021-07-01 06:46:14 -07:00
conradchen
7adfd93d80 [TooltipDrawable] Adding android:textColor support
PiperOrigin-RevId: 374887222
2021-05-20 14:03:30 -07:00
hunterstich
0ef2e910ce [TopAppBar] Fix title fade mode collapsing title position errors.
Flinging the AppBarLayout can cause a negative number to be passed to CollapsingTextHelper#calculateOffsets, causing the collapsed title in fade mode to be positioned incorrectly.

PiperOrigin-RevId: 374704850
2021-05-19 13:21:52 -07:00
dniz
841f229592 [CollapsingToolbarLayout] Fixed RTL text only laying out as RTL when actual text is RTL
PiperOrigin-RevId: 374663684
2021-05-19 11:00:25 -07:00
hunterstich
c7541833b7 [CollapsingToolbarLayout] Updated fade mode to allow expanded title to translate 1:1 with scrolling content.
PiperOrigin-RevId: 372565826
2021-05-07 12:27:54 -04:00
conradchen
5d092b75a6 [Color] Internal change
PiperOrigin-RevId: 372355438
2021-05-07 12:14:33 -04:00
dniz
f0ce498108 [CollapsingToolbarLayout] Added title line spacing and hyphenation frequency setters
PiperOrigin-RevId: 371920600
2021-05-05 09:40:38 -04:00
raajkumars
cd9e6204d8 [Dialog] Added support for full width buttons in dialogs.
PiperOrigin-RevId: 368853063
2021-04-16 18:21:25 -04:00
dniz
be85a92a73 [CollapsingToolbarLayout] Added getLineCount() method
PiperOrigin-RevId: 368630070
2021-04-16 17:48:59 -04:00
Material Design Team
7fc9df5399 Automated g4 rollback of changelist 368429312
PiperOrigin-RevId: 368474895
2021-04-16 12:44:38 -04:00
dniz
2b2c69f773 [CollapsingToolbarLayout] Added getLineCount() method
PiperOrigin-RevId: 368429312
2021-04-16 12:43:47 -04:00
dniz
f0ac362968 [CollapsingToolbarLayout] Added support for multiline RTL when using fade title mode
PiperOrigin-RevId: 368237684
2021-04-13 14:24:14 -04:00
dniz
3ad232d829 [CollapsingToolbarLayout] Updated default multiline hyphenation frequency to StaticLayout.HYPHENATION_FREQUENCY_NORMAL
PiperOrigin-RevId: 368221065
2021-04-13 14:20:48 -04:00
dniz
5a35bf7d38 [CollapsingToolbarLayout] Fixed multiline animation for fade title collapse mode
PiperOrigin-RevId: 367285477
2021-04-08 20:41:37 -04:00
dniz
9c75ad07f7 [CollapsingToolbarLayout] Added support for fade out/in title collapse mode
PiperOrigin-RevId: 365629647
2021-03-30 14:48:19 -04:00
cketcham
28c3254d2a [BottomSheet] Allow opting out of edge to edge on the top
PiperOrigin-RevId: 359525223
2021-03-03 12:40:48 -05:00
dniz
cbf528e3a6 [MaterialToolbar] Added support for centering title and subtitle
Resolves https://github.com/material-components/material-components-android/issues/2011

PiperOrigin-RevId: 359360955
2021-03-03 12:37:29 -05:00
raajkumars
be616abf49 [internal] Moved common ids from bottom navigation to central location so that it can be reused.
PiperOrigin-RevId: 340255767
2020-11-03 11:11:54 -05:00
connieshi
157d9cefd4 [Internal] Add utils class for Toolbars. Restrict it to library.
PiperOrigin-RevId: 334174563
2020-09-28 11:51:43 -07:00
dniz
89a1bf883f [Snackbar] Added ability to have Snackbar position respond to anchor view layout changes
Disabled by default to avoid changes in behavior and breakages in tests

PiperOrigin-RevId: 333299318
2020-09-23 12:10:02 -07:00
cketcham
d4a019359c Update TextAppearance and CollapsingTextHelper to respect letterSpacing set with TextAppearance styles
PiperOrigin-RevId: 328985766
2020-08-28 18:06:30 -04:00
Mattia
9914516276 [ViewOverlays] Removed re-throw of exception on ViewOverlayApi14
Resolves https://github.com/material-components/material-components-android/issues/1486
Resolves https://github.com/material-components/material-components-android/pull/1516

GIT_ORIGIN_REV_ID=c2eb7ecd99c9a7f56028510d4591cc4a60ff48ab
PiperOrigin-RevId: 323416732
2020-07-28 10:27:19 -04:00
Frantisek Nagy
8210b3ac01 [CollapsingToolbarLayout] Fix CollapsingToolbar multiline position
GIT_ORIGIN_REV_ID=7dbd8905bf58eb5811c4661ee77512d4d9c59c19

Co-authored-by: ymarian <38727469+ymarian@users.noreply.github.com>
PiperOrigin-RevId: 321294325
2020-07-15 09:49:15 -07:00
marianomartin
049ad022a6 Delete components build.gradle files
PiperOrigin-RevId: 320944144
2020-07-15 09:38:31 -07:00
Robert Williams
77a0a87fb1 [CollapsingToolbarLayout] Use correct layout to calculate expanded bounds
Resolves https://github.com/material-components/material-components-android/pull/1432

GIT_ORIGIN_REV_ID=6041d791702d16e7501289f939fa01874b16b32c
PiperOrigin-RevId: 318639226
2020-06-29 09:28:40 -04:00
marianomartin
555356b03f Internal cleanup
PiperOrigin-RevId: 318134343
2020-06-26 14:06:52 -04:00
marianomartin
20e238869c [Internal] Added a TextWatcherAdapter class
PiperOrigin-RevId: 317355871
2020-06-26 13:57:26 -04:00
Sven Obser
74508c89c8 [CollapsingToolbarLayout] Fixed slight misalignment during transition in multiline mode
Resolves https://github.com/material-components/material-components-android/pull/1408

GIT_ORIGIN_REV_ID=9b29f85a8f9e9c52b256fbb4ce3148e19ee503fc
PiperOrigin-RevId: 317322732
2020-06-19 14:09:34 -04:00
Material Design Team
342ea9ad25 Internal cleanup
PiperOrigin-RevId: 317147378
2020-06-19 13:42:35 -04:00
Material Design Team
76ffe35fef Cleanup
PiperOrigin-RevId: 313865830
2020-06-01 16:52:06 -04:00
dniz
67e9eaf341 [MaterialDatePicker] Fix check for date input keyboard separator characters for single selection mode
Pointed out in d6b2da8b50 (r39471904)

PiperOrigin-RevId: 313382685
2020-05-27 13:50:17 -04:00
hunterstich
b631ef6979 [Slider] Fix slider tooltip in popupwindows
Slider needs to find an ancestor in which it can add its tooltip overlay. When added in a PopupWindow, its possible to search up the view hierarchy and find a parent which is neither a View nor a ViewGroup. This change adds a check for this case

A note is that this change updates edge cases to return the current parent if it is any valid ancestor instead of just returning null. This allows Slider's tooltip to be added to Popup windows, but doesn't guarantee that the tooltip will be fully visible since a PopupWindow's height might be smaller than the slider + tooltip. If adding a Slider to a PopupWindow, you might need to manually add height to your popup's content view to account for the tooltip or turn of the slider's label.

PiperOrigin-RevId: 310913776
2020-05-11 16:04:03 -04:00
hunterstich
d6501c97bc [Slider] Fix attach/detach behavior when Slider is added in an overlay as part of a Transition.
Resolves https://github.com/material-components/material-components-android/issues/1195

A Visibility transition will add Slider to an overlay and then call onAttachToWindow/onDetachFromWindow which looks for an android.R.id.content view, which doen't exist, getting stuck in a loop. This adds an exit strategy for android.R.id.content not being found and fixes Slider in Visibility transitions.

PiperOrigin-RevId: 305886706
2020-04-13 10:21:36 -07:00
Material Design Team
6ad240dfc0 Pass the item ID through to the item view which is created by the RecyclerView if the ID is greater than zero.
PiperOrigin-RevId: 298611118
2020-03-05 13:00:06 -08:00
Material Design Team
4f21f83708 Automated g4 rollback of changelist 296479321
PiperOrigin-RevId: 296521978
2020-02-24 18:26:36 -05:00
Material Design Team
c5908974c6 Pass the item ID through to the item view which is created by the RecyclerView.
PiperOrigin-RevId: 296479321
2020-02-24 18:25:08 -05:00
marianomartin
83e4e47d22 Initial support for Multiline CollapsingToolbarLayout
This cl adds the capabilities to set multiline on CollapsingToolbarLayout while keeping single line toolbars unchanged.

Co-Authored-By: johan12345 <johan.forstner@gmail.com>
PiperOrigin-RevId: 294256516
2020-02-10 14:32:15 -05:00
haodong
d6b2da8b50 [DatePicker] Added workaround for Samsung and LG devices to show URL keyboard when enter date in text.
PiperOrigin-RevId: 294219052
2020-02-10 14:31:45 -05:00
connieshi
4ffc1efebc Add comment explaining why certain attributes should remain private.
PiperOrigin-RevId: 293816051
2020-02-10 09:34:59 -05:00
connieshi
cd7d38854a Add private attributes that should be public to public.xml.
PiperOrigin-RevId: 293608989
2020-02-06 17:25:29 -05:00
marianomartin
50b020aec7 Resubmit Modify CollapsingTextHelper to use a StaticLayout instead of canvas.drawText.
PiperOrigin-RevId: 293443677
2020-02-05 17:30:20 -05:00
marianomartin
1673924a23 Automated g4 rollback of changelist 293151496
PiperOrigin-RevId: 293184366
2020-02-04 17:33:05 -05:00
marianomartin
7822b6d05e Modify CollapsingTextHelper to use a StaticLayout instead of canvas.drawText.
This will allow to support multiple lines.

PiperOrigin-RevId: 293151496
2020-02-04 17:32:07 -05:00
haodong
b1c4f539e1 Made LG devices exceptions for using date type of keyboard for date picker text input.
Resolves https://github.com/material-components/material-components-android/issues/901

- Check if the device is LG, and change the keyboard type if yes.
- Remove the exception for Samsung devices, they updated their date type keyboard with "." and "/".

PiperOrigin-RevId: 290753487
2020-01-21 09:13:23 -08:00
Material Design Team
253cdc2114 Add CollectionInfos and CollectionItemInfos to ChipGroup and Chip for accessibility.
PiperOrigin-RevId: 288944549
2020-01-10 09:05:36 -08:00
Anoop
60483b53e9 [TextInputEditText] meizu to manufacture utils
Resolves https://github.com/material-components/material-components-android/pull/884

GIT_ORIGIN_REV_ID=24aef1fe592b2ce08c8a9ad7e33e396cc4eb6dd0
Co-authored-by: pekingme <pekingme@gmail.com>
PiperOrigin-RevId: 288726292
2020-01-08 12:11:02 -08:00
Material Design Team
6405635df4 Handle horizontal system insets for BottomAppBar.
Previously only the bottom inset (navigation bar) would add extra padding to the BottomAppBar which avoided overlapping with the bottom inset when drawing edge-to-edge. A problem arises if the device is rotated horizontally. The FAB (or sometimes the ActionMenuView in RtL layouts) would overlap with the right inset, making usage impossible.

This CL adjusts the FAB and ActionMenuView X translations when necessary to avoid the horizontal system insets. Two new stylable attributes have been added to enable/disable this behavior, analogous to the existing attribute for bottom padding.

PiperOrigin-RevId: 286419669
2019-12-19 15:45:44 -05:00
johan12345
8dd8acecd9 Mutate gravity horizontal value on setExpandedTextGravity and setCollapsedTextGravity, so the code can assume they are set.
PiperOrigin-RevId: 286392235
2019-12-19 15:41:45 -05:00
marianomartin
d49fff38ef Add a StaticLayoutCompat class that supports Max Lines
PiperOrigin-RevId: 286223820
2019-12-18 15:56:04 -05:00