This also fixes a flaky test where items acquired from the pool were still attached to their old parent. Bug: 35422793 Bug: 35395583 Change-Id: I303d49bb4a287856baf997bd85d42fd53131c32b PiperOrigin-RevId: 150129729
Material Components for Android
Material Components for Android (MDC-Android) help developers execute Material Design. Developed by a core team of engineers and UX designers at Google, these components enable a reliable development workflow to build beautiful and functional Android apps.
Material Components for Android are based on Android’s Design support library (DesignLib) which will continue to be released as part of Android’s SDK. Development will take place on GitHub, and stable versions will be synced to Android’s SDK based on the SDK’s release schedules.
Useful Links
- All Components
- Contributing
- Class documentation (external site)
- MDC-Android on Stack Overflow (external site)
- Android Developer’s Guide (external site)
- Material.io (external site)
- Material Design Guidelines (external site)
Getting Started
Using the support library version
For most users, the Android Design support library is the best version to use in their application. The Android SDK contains the latest stable version of this library. To use it:
- Make sure you've downloaded the Android Support Repository using the SDK Manager.
- Open the
build.gradlefile for your application. - Add the Design support library to the
dependenciessection:
dependencies {
// ...
compile 'com.android.support:design:25.1.0'
// ...
}
Building from source
If you'll be contributing to the library, or need a version newer than what has been released in the Android support libraries, Material Components for Android can also be built from source. To do so:
Clone this repository:
git clone https://github.com/material-components/material-components-android.git
Then, build an AAR using Gradle:
./gradlew assembleRelease
(the AAR file will be located in lib/build/outputs/aar/)
Running tests
Material Components for Android has JVM tests as well as Emulator tests.
To run the JVM tests, do:
./gradlew test
To run the emulator tests, ensure you have a virtual device set up and do:
./gradlew connectedAndroidTest