navasmdc
MaterialDesignLibrary
Java

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

Last updated Jul 2, 2026
8.9k
Stars
2.2k
Forks
253
Issues
0
Stars/day
Attention Score
89
Language breakdown
Java 67.0%
HTML 19.2%
CSS 13.7%
JavaScript 0.0%
โ–ธ Files click to expand
README

Material design library logo

Material Design Android Library

Android app on Google Play

Android Arsenal

* 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 * 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:

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:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:materialdesign="http://schemas.android.com/apk/res-auto"
    android:layoutwidth="matchparent"
    android:layoutheight="matchparent"
    >
</RelativeLayout>

>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: >

><com.gc.materialdesign.views.ScrollView  >    xmlns:android="http://schemas.android.com/apk/res/android" >    xmlns:materialdesign="http://schemas.android.com/apk/res-auto" >    android:id="@+id/scroll" >    android:layoutwidth="matchparent" >    android:layoutheight="matchparent"> ></com.gc.materialdesign.views.ScrollView> >

##Components

####Buttons

######Flat Button

flat button

<com.gc.materialdesign.views.ButtonFlat                 android:id="@+id/buttonflat"                 android:layoutwidth="wrapcontent"                 android:layoutheight="wrapcontent"                 android:background="#1E88E5"                 android:text="Button" />

######Rectangle Button

rectangle button

<com.gc.materialdesign.views.ButtonRectangle                 android:id="@+id/button"                 android:layoutwidth="wrapcontent"                 android:layoutheight="wrapcontent"                 android:background="#1E88E5"                 android:text="Button" />

######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.

<pre><code class="lang-xml">&lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; xmlns:materialdesign=&quot;http://schemas.android.com/apk/res-auto&quot; android:layoutwidth=&quot;matchparent&quot; android:layoutheight=&quot;matchparent&quot; &gt; &lt;!-- ... XML CODE --&gt; &lt;com.gc.materialdesign.views.ButtonFloat android:id=&quot;@+id/buttonFloat&quot; android:layoutwidth=&quot;wrapcontent&quot; android:layoutheight=&quot;wrapcontent&quot; android:layout_alignParentRight=&quot;true&quot; android:layout_alignParentBottom=&quot;true&quot; android:layout_marginRight=&quot;24dp&quot; android:background=&quot;#1E88E5&quot; materialdesign:animate=&quot;true&quot; materialdesign:ic /&gt; &lt;/RelativeLayout&gt;</code></pre>

######Float small button

float small button

<pre><code class="lang-xml">&lt;com.gc.materialdesign.views.ButtonFloatSmall android:id=&quot;@+id/buttonFloatSmall&quot; android:layoutwidth=&quot;wrapcontent&quot; android:layoutheight=&quot;wrapcontent&quot; android:background=&quot;#1E88E5&quot; materialdesign:ic /&gt;</code></pre>

####Switches

######CheckBox checkbox

<pre><code class="lang-xml">&lt;com.gc.materialdesign.views.CheckBox android:id=&quot;@+id/checkBox&quot; android:layoutwidth=&quot;wrapcontent&quot; android:layoutheight=&quot;wrapcontent&quot; android:background=&quot;#1E88E5&quot; materialdesign:check=&quot;true&quot; /&gt;</code></pre>

######Switch switch

<pre><code class="lang-xml">&lt;com.gc.materialdesign.views.Switch android:id=&quot;@+id/switchView&quot; android:layoutwidth=&quot;wrapcontent&quot; android:layoutheight=&quot;wrapcontent&quot; android:background=&quot;#1E88E5&quot; materialdesign:check=&quot;true&quot; /&gt;</code></pre>

####Progress indicators

######Progress bar circular indeterminate progress bar circular indeterminate

<pre><code class="lang-xml">&lt;com.gc.materialdesign.views.ProgressBarCircularIndeterminate android:id=&quot;@+id/progressBarCircularIndeterminate&quot; android:layout_width=&quot;32dp&quot; android:layout_height=&quot;32dp&quot; android:background=&quot;#1E88E5&quot; /&gt;</code></pre>

######Progress bar indeterminate progress bar indeterminate

<pre><code class="lang-xml">&lt;com.gc.materialdesign.views.ProgressBarIndeterminate android:id=&quot;@+id/progressBarIndeterminate&quot; android:layoutwidth=&quot;fillparent&quot; android:layoutheight=&quot;wrapcontent&quot; android:background=&quot;#1E88E5&quot; /&gt;</code></pre>

######Progress bar indeterminate determinate Progress bar indeterminate determinate

<pre><code class="lang-xml">&lt;com.gc.materialdesign.views.ProgressBarIndeterminateDeterminate android:id=&quot;@+id/progressBarIndeterminateDeterminate&quot; android:layoutwidth=&quot;fillparent&quot; android:layoutheight=&quot;wrapcontent&quot; android:background=&quot;#1E88E5&quot; /&gt;</code></pre>

>If you begin progrees, you only have to set progress it > ><pre><code class="lang-java">&gt;progressBarIndeterminateDeterminate.setProgress(progress); &gt;</code></pre>

######Progress bar determinate Progress bar determinate

<pre><code class="lang-xml">&lt;com.gc.materialdesign.views.ProgressBarDeterminate android:id=&quot;@+id/progressDeterminate&quot; android:layoutwidth=&quot;fillparent&quot; android:layoutheight=&quot;wrapcontent&quot; android:background=&quot;#1E88E5&quot; /&gt;</code></pre>

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

######Slider Slider

<pre><code class="lang-xml">&lt;com.gc.materialdesign.views.Slider android:id=&quot;@+id/slider&quot; android:layoutwidth=&quot;fillparent&quot; android:layoutheight=&quot;wrapcontent&quot; android:background=&quot;#1E88E5&quot; materialdesign:max=&quot;50&quot; materialdesign:min=&quot;0&quot; /&gt;</code></pre>

######Slider with number indicator Slider with number indicator

<pre><code class="lang-xml">&lt;com.gc.materialdesign.views.Slider android:id=&quot;@+id/slider&quot; android:layoutwidth=&quot;fillparent&quot; android:layoutheight=&quot;wrapcontent&quot; android:background=&quot;#1E88E5&quot; materialdesign:max=&quot;50&quot; materialdesign:min=&quot;0&quot; materialdesign:showNumberIndicator=&quot;true&quot;/&gt;</code></pre>

##Widgets

####SnackBar

Snackbar

<pre><code class="lang-java">SnackBar snackbar = new SnackBar(Activity activity, String text, String buttonText, View.OnClickListener onClickListener); snackbar.show();</code></pre>

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

####Dialog

Dialog

Dialog dialog = new Dialog(Context context,String title, String message);
dialog.show();

>You can set the accept and cancel button on the event listener or change it's text >

> // Set accept click listenner >dialog.setOnAcceptButtonClickListener(View.OnClickListener onAcceptButtonClickListener); > // Set cancel click listenner >dialog.setOnCancelButtonClickListener(View.OnClickListener onCancelButtonClickListener); > // Acces to accept button >ButtonFlat acceptButton = dialog.getButtonAccept(); > // Acces to cancel button >ButtonFlat cancelButton = dialog.getButtonCancel(); >

####Color selector

Color selector

ColorSelector colorSelector = new ColorSelector(Context context,int intialColor, OnColorSelectedListener onColorSelectedListener);
colorSelector.show();

ยฉ 2026 GitRepoTrend ยท navasmdc/MaterialDesignLibrary ยท Updated daily from GitHub