dniz 48a07e1df9 Update library version to 1.0.0
PiperOrigin-RevId: 214972819
2018-09-28 17:04:13 -04:00

2.8 KiB
Raw Blame History

{% contentfor benefits %}

  • Accurate & up to date

    Implement Material Design with pixel-perfect components, maintained by Google engineers and designers

  • Latest Android APIs

    Access components that use of the latest Android APIs and features, with graceful degradation for older Android versions

  • Industry standards

    Take advantage of the same components used in Googles Android apps, which meet industry standards for internationalization and accessibility

{% endcontentfor %}

Material Components for Android

Material Components for Android provides modular and customizable UI components to help developers easily create beautiful apps.

Getting Started

  1. {: .step-list-item } ### Modify build.gradle To use the Material Components library with the Gradle build system, include the library in the build.gradle dependencies for your app.

    dependencies {
      compile 'com.google.android.material:material:1.0.0'
    }
    
  2. {: .step-list-item } ### Update your Layout Add a reference to the component (widget) that you want to use in your XML layout. (You can also dynamically instantiate a widget in Java.)

    <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@id/fab" />
    
  3. {: .step-list-item } ### Use the Component You can then reference that widget in your Java class. First import it,

    import com.google.android.material.floatingactionbutton.FloatingActionButton;
    

    then use it.

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
      public void onClick(View v) {
        // Do something!
      }
    });
    
  4. {: .step-list-item } ### What's next?