211 Commits

Author SHA1 Message Date
Material Design Team
54df381127 Migrate viewpager android support libraries to androidx.
PiperOrigin-RevId: 247499141
2019-05-16 12:39:13 -04:00
dniz
fde196d8ab Add Catalog Choose "Light/Dark/System default" Theme to Theme Switcher
Also refactor theme preferences saving and selected item color in choose theme popup menu

PiperOrigin-RevId: 247421563
2019-05-16 12:37:11 -04:00
melaniegoetz
3560a3afb3 Allow Bottomsheet to settle to Half-expanded state on drag
PiperOrigin-RevId: 247061538
2019-05-07 17:28:56 -04:00
leticiars
4e38a97dda Updating Dropdown Menu demo.
PiperOrigin-RevId: 246869846
2019-05-06 19:26:25 -04:00
dniz
9f692ecb16 Update Catalog dark theme toggle to be a menu with System default option
PiperOrigin-RevId: 246841272
2019-05-06 12:51:48 -04:00
dniz
8f622283d1 Remove CSL theme attribute workarounds
Also update androidx dependencies to get latest fixes: appcompat to 1.1.0-alpha04 and core to 1.1.0-alpha05

PiperOrigin-RevId: 246804285
2019-05-06 10:34:04 -04:00
dniz
2735069208 Update Catalog Dark Theme toggle to switch between MODE_FOLLOW_SYSTEM and MODE_YES
PiperOrigin-RevId: 246514518
2019-05-03 12:59:49 -04:00
dniz
cd24d3f528 Add Dark Theme toggle to Catalog
PiperOrigin-RevId: 246397450
2019-05-03 11:03:24 -04:00
leticiars
c71b6ccb13 Exposed Dropdown Menu (https://material.io/design/components/menus.html#exposed-dropdown-menu).
An AutoCompleteTextView should be used in the place of a TextInputEditText, along with with a Widget.MaterialComponents.TextInputLayout.(...).ExposedMenuDropdown style.

PiperOrigin-RevId: 246343749
2019-05-03 10:58:36 -04:00
gauthams
566a4bc797 Add statusBarForeground back to cat_topappbar_scrolling_transparent_statusbar_activity.xml
PiperOrigin-RevId: 245860094
2019-04-30 12:52:32 -04:00
gauthams
0aa08f25c5 Fix crash in Catalog
PiperOrigin-RevId: 245858537
2019-04-30 12:50:41 -04:00
dniz
e4f4d9d4f5 Update Card List Drag Demo to use app:srcCompat for drag handle vector drawable
PiperOrigin-RevId: 245743179
2019-04-29 16:01:06 -07:00
marianomartin
a47475da0d Support drag actions for A11y in draggable card demo
PiperOrigin-RevId: 245418849
2019-04-29 15:53:28 -07:00
dniz
34a3a46f61 Update Tabs to default to surface style in Dark Theme
PiperOrigin-RevId: 245217332
2019-04-29 15:39:42 -07:00
connieshi
9a52cebdd3 Remove extra line + ;
PiperOrigin-RevId: 245118587
2019-04-29 15:37:37 -07:00
connieshi
4831d696d0 Fix NPE in Bottom Navigation catalog demo.
PiperOrigin-RevId: 245086884
2019-04-29 15:36:00 -07:00
dniz
263ffa7353 Remove hardcoded background from Auto Tabs demo to fix demo in Dark Theme
PiperOrigin-RevId: 245048022
2019-04-29 15:32:43 -07:00
dniz
d5ab5910dc Update Bottom Navigation to default to surface style in Dark Theme
PiperOrigin-RevId: 245041248
2019-04-29 15:31:01 -07:00
dniz
5249f54ab1 Update AppBarLayout and ActionBar to default to surface style in Dark Theme
Also update Dark Theme colorPrimaryDark to be #000000 to match

PiperOrigin-RevId: 245028116
2019-04-29 15:30:11 -07:00
marianomartin
a4c17bec62 Add context menus to catalog
Simple demo of context menu in a text view, options to copy text and highlight it.

PiperOrigin-RevId: 244897462
2019-04-29 15:27:09 -07:00
dniz
d25a92eb83 Update MDC Catalog table of contents icons
PiperOrigin-RevId: 244691244
2019-04-29 15:24:13 -07:00
dniz
18f30248c1 Add ElevationOverlayProvider util method for getting surface color with overlay
Also rename getColorSurface method to getSurfaceColor

PiperOrigin-RevId: 244392744
2019-04-19 22:00:45 -04:00
connieshi
3c85d22c72 Update the BottomNavigationView demo in MDC catalog to include badging.
PiperOrigin-RevId: 244246968
2019-04-19 21:56:45 -04:00
melaniegoetz
3db852c67a Update BottomSheetBehavior elevation
PiperOrigin-RevId: 244101048
2019-04-19 21:41:24 -04:00
Material Design Team
2f3e1c4cf4 Add new MODE_AUTO setting for TabLayout. MODE_AUTO behaves like MODE_FIXED with GRAVITY_CENTER while the tabs fit in the content view. Once the tabs expand beyond the TabLayout width, the TabLayout behaves as MODE_SCROLLABLE.
PiperOrigin-RevId: 243852684
2019-04-19 21:21:27 -04:00
afohrman
e23891ef1f Add side navigation drawer demo to catalog.
PiperOrigin-RevId: 243331049
2019-04-19 16:21:31 -04:00
dniz
1889b9fed6 Add support for translationZ to MaterialShapeDrawable
Useful for animating elevation shadows in Light themes and elevation overlays in Dark Themes

PiperOrigin-RevId: 243260129
2019-04-19 15:54:27 -04:00
ricknout
d0724dd590 Add halfExpandedOffset to BottomSheet catalog demo
GIT_ORIGIN_REV_ID=da446b5182eaf192d75c81b552f30e95373c5598
PiperOrigin-RevId: 243127218
2019-04-19 15:46:20 -04:00
dniz
550e727edf Fix elevation values in Catalog demo
PiperOrigin-RevId: 243092394
2019-04-19 15:41:05 -04:00
dniz
249e6f5281 Implement new MaterialToolbar class that provides support for Dark Theme elevation overlays, if not using AppBarLayout
PiperOrigin-RevId: 243054730
2019-04-19 15:37:34 -04:00
Chris Banes
5b94ec83a7 Add statusBarForeground functionality to AppBarLayout
Currently AppBarLayout lacks the functionality which
CollapsingToolbarLayout does, to draw a drawable behind
the status bar. This CL adds that functionality.

Also added related functionality to Catalog

PiperOrigin-RevId: 242949840
2019-04-19 15:31:25 -04:00
dniz
df85470134 Remove Catalog title text color resource
PiperOrigin-RevId: 242747592
2019-04-19 13:25:41 -04:00
dniz
3fd054086c Add demo for Drag-and-Drop of Material Cards in a List and clear ripple when drag starts
PiperOrigin-RevId: 242474750
2019-04-19 12:53:43 -04:00
ldjesper
35a1401a52 Switch from multiple related extends to an interface
PiperOrigin-RevId: 241870753
2019-04-05 15:50:05 -04:00
dniz
6d4ffa29e3 AppBarLayout Dark Theme Elevation Overlays support, including animated overlay for Lift On Scroll
PiperOrigin-RevId: 241791205
2019-04-05 15:47:39 -04:00
ldjesper
12a4f2cff5 Switch from Dialog to DialogFragment for Pickers since future view paging changes will require nested Fragments
PiperOrigin-RevId: 241387847
2019-04-05 15:22:59 -04:00
dniz
f9f322bd7a Use colorAccent for Catalog Favorite Toggle
PiperOrigin-RevId: 241322598
2019-04-05 15:20:56 -04:00
dniz
760a99f883 Enable Elevation Overlays for Dark Themes and update surface colors to match spec
PiperOrigin-RevId: 240425682
2019-03-26 17:35:50 -04:00
Chris Banes
0425d3b475 Fix CollapsingToolbarLayout title bounds
Caused by AppBarLayout + WindowInset commit, which breaks some incorrect
assumptions in CTL. Fixed by breaking apart ViewOffsetHelper
so that its tracking of layout coordinates, and applying
offsets, are done at different times.

Also fixed catalog's AppBar sample layouts to set IDs,
enabling state restoration to work.

PiperOrigin-RevId: 239592953
2019-03-22 17:02:58 -04:00
afohrman
9405a52851 Split icon text field demos into their own demos.
Now that there are a nice amount of text fields in the controllable text field demos, the controls are hidden in almost all cases. Splitting the icon text field demos into their own demos to avoid hiding the text field demo controls.

PiperOrigin-RevId: 239257310
2019-03-22 16:56:22 -04:00
afohrman
b4bc4fc7b0 Add missing icon text field demos and bring the demos to parity with each other.
This is pre-work for splitting the icon text fields into their own controllable demo screens. This commit:

- Adds an outline toggle password demo
- Removes unnecessary ids
- Reformats layout files
- Cleans up the demos

PiperOrigin-RevId: 239215370
2019-03-22 16:53:38 -04:00
afohrman
cd9923fde9 Remove unnecessary overrides of onCreateDemoView() in the text field catalog demos.
PiperOrigin-RevId: 239055607
2019-03-22 16:38:39 -04:00
afohrman
dcc68fa27e Use "outlined" naming for the outlined text field catalog demo.
The naming in spec changed for outlined text fields, and we changed the style name to reflect that a while back. This commit cleans up old references to "outline" text fields.

PiperOrigin-RevId: 239027786
2019-03-22 16:25:12 -04:00
melaniegoetz
a192f47036 Add dark-theme/elevation overlay support for BottomSheet
PiperOrigin-RevId: 239016572
2019-03-22 16:24:17 -04:00
leticiars
2642ff2697 Adding support for TextInputLayout start icon. It can be set to be just a drawable or, if a OnClickListener is set to it, a button.
For that reason, users should opt to use the start icon API instead of setting a start/left compound drawable on the text field's edit text.

PiperOrigin-RevId: 238984066
2019-03-22 16:19:36 -04:00
afohrman
b15e5ae3a4 Fix legacy bottom navigation catalog demo.
The catalog was setting the legacy bottom nav's android:background, which was overriding the background and ruining the contrast ratios.

PiperOrigin-RevId: 238539046
2019-03-22 16:13:42 -04:00
Chris Banes
78054fe4ea AppBarLayout + WindowInset handling fixes
When AppBarLayout is used with a CollapsingToolbarLayout
child, it currently does not handle WindowInsets
very well. This commit fixes that by properly handling
insets.

The primary issue is when an AppBarLayout is used
with a single Toolbar (very common use case), where
the Toolbar will currently be displayed behind the status bar.

Another issue is with HeaderScrollingViewBehavior.
To workaround CoordinatorLayout using its 'compatible measuring'
for insets, the behavior manually sets the scrolling view to fit
system windows. This has other issues though because
that view will get padded in. Fixed by manually adding the insets
back into the measured dimensions.

Also updated the catalog layouts to make use of
android:fitsSystemWindows=true

Resolves https://github.com/material-components/material-components-android/pull/299

PiperOrigin-RevId: 238396626
2019-03-22 16:08:28 -04:00
dniz
7b594393c8 Dark Theme Elevation Overlay system
PiperOrigin-RevId: 237829773
2019-03-22 16:02:26 -04:00
isabellekim
27fad954b6 Move the color theme overlay attributes to the ThemeSwitcherResourceProvider.
PiperOrigin-RevId: 237352384
2019-03-08 10:10:45 -05:00
ldjesper
0aa32c1ce6 Adds a bare implementation of a date picker not yet ready for use
PiperOrigin-RevId: 237052095
2019-03-08 10:06:25 -05:00