navasmdc /MaterialDesignLibrary

This is a library with components of Android L to you use in android 2.2

★ 8,908⑂ 2,181👁 495⑃ 93● 337▤ 3
JavaApache-2.0Created 2014-09-30
Download: Add ProgressDialog and fix bugsAdd-1.3 ↓1.32015-01-15
+0
Daily
8,908
stars
2,181
forks
495
watchers
93
prs
337
issues
3
releases

README

!Material design library logo

 Material Design Android Library


  





 How to use
 Components
     Buttons
         Flat Button
         Rectangle Button
         Float Button
         Float small button
     Switches
         CheckBox
         Switch
     Progress indicators
         Progress bar circular indeterminate
         Progress bar indeterminate
         Progress bar indeterminate determinate
         Progress bar determinate
         Slider
         Slider with number indicator
 Widgets
     SnackBar
     Dialog
     Color selector

 How to use

If you want use this library, you only have to download MaterialDesign project, import it into your workspace and add the project as a library in your android project settings.

If you prefer it, you can use the gradle dependency, you have to add these lines in your build.gradle file:

xml
repositories {
    jcenter()
}

dependencies {
    compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
}


Some components have custom attributes, if you want use them, you must add this line in your xml file in the first component:

xml




If you are going to use a ScrollView, it is recommended that you use the CustomScrollView provided in this library to avoid problems with the custom components.
To use this component:
xml
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:materialdesign="http://schemas.android.com/apk/res-auto"
    android:id="@+id/scroll"
    android:layout_width="match_parent"
    android:layout_height="match_parent"



Components

Buttons

Flat Button

!flat button
xml



Rectangle Button

!rectangle button
xml



Float Button

!float button

It is recommended to put this component in the right-bottom of the screen. To use this component write this code in your xml file.
If you dont want to start this component with animation set the animate attribute to false.
Put your icon in the icon attribute to set the drawable icon for this component.

xml

    
    



Float small button

!float small button

xml



Switches

CheckBox
!checkbox

xml



Switch
!switch

xml



Progress indicators

Progress bar circular indeterminate
!progress bar circular indeterminate

xml



Progress bar indeterminate
!progress bar indeterminate

xml



Progress bar indeterminate determinate
!Progress bar indeterminate determinate


xml



If you begin progrees, you only have to set progress it

java
progressBarIndeterminateDeterminate.setProgress(progress);


Progress bar determinate
!Progress bar determinate


xml



You can custom max and min progress values with materialdesign:max="50" and materialdesign:min="25" attributes.

Slider
!Slider


xml



Slider with number indicator
!Slider with number indicator


xml



Widgets

SnackBar

!Snackbar


java
SnackBar snackbar = new SnackBar(Activity activity, String text, String buttonText, View.OnClickListener onClickListener);
snackbar.show();


 If you don't want to show the button, put null in buttonText attribute

Dialog

!Dialog

ja

Top issues

Latest release

Add ProgressDialog and fix bugs 1.3 2015-01-15

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON