16 Commits

Author SHA1 Message Date
dniz
ade4df00cb Change Gradle build to output single Maven artifact
PiperOrigin-RevId: 190774454
2018-04-03 11:49:01 -04:00
Material Design Team
98c248d5d7 Update Chip content description to announce chip's label without "Chip." prefix.
User doesn't need to know the implementation detail that this is the Chip.

PiperOrigin-RevId: 189722701
2018-04-03 11:45:11 -04:00
Material Design Team
315954df45 Fix an accessibility tree-node cycle that caused the Accessibility Scanner to crash when scanning the Chips accessibility.
PiperOrigin-RevId: 188120065
2018-03-12 12:55:27 -04:00
afohrman
644c3d77bd Implement pared down version of Flexbox.
Remove dependency on flexbox to avoid pulling in the entire library.

PiperOrigin-RevId: 186699263
2018-03-12 12:49:22 -04:00
markwei
2e2c348e6f Add new enforceMaterialTheme attribute that you can set in any style to denote that the style uses a new attribute that must exist in the app theme.
Update ThemeEnforcement to read this new attribute, and check for Material theme.
Change the ThemeEnforcement API to replace Context#obtainStyledAttributes().

See followup CL for how this attribute is used.

PiperOrigin-RevId: 184074635
2018-03-02 15:36:20 -05:00
dniz
c31ef1f1d7 Update Gradle and Maven configurations
PiperOrigin-RevId: 183872033
2018-03-02 14:58:51 -05:00
gauthams
f93f5abe17 Update chip background and stroke drawing to no longer draw background outside stroke
PiperOrigin-RevId: 183033077
2018-01-25 18:23:20 -05:00
markwei
35261ca224 Rename base Chip style Base.Widget.MaterialComponents.Chip.
PiperOrigin-RevId: 183026249
2018-01-25 18:21:57 -05:00
Material Design Team
6404d1badf Fix RTL outBounds on material chip
PiperOrigin-RevId: 182831674
2018-01-25 18:17:04 -05:00
travisc
04bf0a7c42 Move themes into theme package, invert dependency structures around components.
Previously [most of] the components were either in `widget` or depended on it,
and all theme-related resources (attributes, styles, etc.) were placed there.
This structure doesn't really work for our goals, and makes it harder to split
components by functional area. In this commit, I move all the theme definitions
to `theme` (as well as `dialog` and `bottomsheet` since they also have relevant
themes, and splitting them into separate packages is the only way to make the
dep tree non-circular). Component packages declare their own theme attributes
(e.g. `chip` declares all the theme attributes necessary for chips), as well as
styles, colors, dimens, drawables, etc.

This move isn't entirely complete in this commit, but it is enough to get
things building with this setup. I'll move the rest of the components' resources
in follow-up commits.

PiperOrigin-RevId: 182611275
2018-01-25 18:12:31 -05:00
dniz
7825a4f80f Fix Chip and MaterialSwitch lint issues
PiperOrigin-RevId: 181742611
2018-01-12 11:37:02 -05:00
travisc
1ef167edc2 Move ThemeUtils to internal package and rename to ThemeEnforcement.
This is a first step in reversing the dependency flow around the `theme`
package in MDC. In a future commit, I'll make theme contain all the various
MaterialComponents theme definitions, and it will thus depend on the various
packages containing our components (widget, button, toggle, etc.).

The theme package will be empty as of this commit, but since I plan to use it
in the next one I've left the build infrastructure in place.

PiperOrigin-RevId: 180737806
2018-01-11 11:09:46 -05:00
travisc
b7fb904d18 Make internal its own package.
This gives internal its own res directory, and pushes the build files down into
the source directory (as it is with all our other non-widget packages). Ideally
new things don't really get added to this package (instead they can be added to
feature/component-specific packages as package private). A few new packages had
to be created in order to break circular dependencies between widget and
internal.

This commit also fixes a number of problems with the Gradle build, as they were
mostly related to dependency issues or things not being included in
settings.gradle.

The next step here is to do the same for the widget package, and turn the lib
build files into something that just exports the other library packages.

PiperOrigin-RevId: 179866428
2018-01-11 10:58:06 -05:00
markwei
61375f7e97 Implement ChipGroup selection exclusivity.
New singleSelection attribute to control whether the ChipGroup has a multiple-exclusion scope for its chips.
When set to true, the ChipGroup acts as a RadioGroup.

ChipGroup can be used purely for layout purposes when singleSelection is set to false.

PiperOrigin-RevId: 178466966
2018-01-11 10:55:26 -05:00
markwei
46d1a6f070 New ChipGroup widget.
Uses FlexboxLayout to allow either:
- Reflowed multiline chips (default)
- Singleline chips

PiperOrigin-RevId: 178151061
2018-01-11 10:53:50 -05:00
travisc
ab2fec6da4 Move lib/src/ to lib/java/, and lib/jvmtests/javatests/ to lib/javatests/.
Bazel is happier if Java/Java test roots are named 'java' and 'javatests', and
this will mean that once we create a BUILD file for
android/support/design/{widget,internal}/ we'll no longer need a custom package
specified in our build (which tends to cause build problems that manifest quite
weirdly). This commit doesn't attempt to refactor the build at all yet, and is
just a pure move.

PiperOrigin-RevId: 178060739
2018-01-11 10:50:18 -05:00