# MaterialDesignLibrary
**Repository Path**: yanglh/MaterialDesignLibrary
## Basic Information
- **Project Name**: MaterialDesignLibrary
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2015-08-07
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README

# Material Design Android Library
[](https://android-arsenal.com/details/1/1156)
* [How to use](#howtouse)
* [Components](#components)
* [Buttons](#buttons)
* [Flat Button](#flat-button)
* [Rectangle Button](#rectangle-button)
* [Float Button](#float-button)
* [Float small button](#float-small-button)
* [Switches](#switches)
* [CheckBox](#checkbox)
* [Switch](#switch)
* [Progress indicators](#progress-indicators)
* [Progress bar circular indeterminate](#progress-bar-circula-rindeterminate)
* [Progress bar indeterminate](#progress-bar-indeterminate)
* [Progress bar indeterminate determinate](#progress-bar-indeterminate-determinate)
* [Progress bar determinate](#progress-bar-determinate)
* [Slider](#slider)
* [Slider with number indicator](#slider-with-number-indicator)
* [Widgets](#widgets)
* [SnackBar](#snackbar)
* [Dialog](#dialog)
* [Color selector](#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

```xml
```
######Rectangle Button

```xml
```
######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 don`t 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

```xml
```
####Switches
######CheckBox

```xml
```
######Switch

```xml
```
####Progress indicators
######Progress bar circular indeterminate

```xml
```
######Progress bar indeterminate

```xml
```
######Progress bar indeterminate determinate

```xml
```
>If you begin progrees, you only have to set progress it
>
>```java
>progressBarIndeterminateDeterminate.setProgress(progress);
>```
######Progress bar determinate

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

```xml
```
######Slider with number indicator

```xml
```
##Widgets
####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

```java
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
>```java
> // 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

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