Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/navasmdc/MaterialDesignLibrary

This is a library with components of Android L to you use in android 2.2
https://github.com/navasmdc/MaterialDesignLibrary

android material-design

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

![Material design library logo](images/logo.png)

# Material Design Android Library


Android app on Google Play

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Material%20Design%20Android%20Library-brightgreen.svg?style=flat)](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

![flat button](images/flat_button.png)
```xml

```

######Rectangle Button

![rectangle button](images/rectangle_button.png)
```xml

```

######Float Button

![float button](images/float_button.png)

>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

![float small button](images/float_small_button.png)

```xml

```

####Switches

######CheckBox
![checkbox](images/checkbox.png)

```xml

```

######Switch
![switch](images/switch.png)

```xml

```

####Progress indicators

######Progress bar circular indeterminate
![progress bar circular indeterminate](images/progress_bar_circular_indeterminate.png)

```xml

```

######Progress bar indeterminate
![progress bar indeterminate](images/progress_bar_indeterminate.png)

```xml

```

######Progress bar indeterminate determinate
![Progress bar indeterminate determinate](images/progress_bar_indeterminate_determinate.png)

```xml

```

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

######Progress bar determinate
![Progress bar determinate](images/progress_bar_determinate.png)

```xml

```

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

######Slider
![Slider](images/slider.png)

```xml

```

######Slider with number indicator
![Slider with number indicator](images/slider_with_number_indicator.png)

```xml

```

##Widgets

####SnackBar

![Snackbar](images/snackbar.png)

```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](images/dialog.png)

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

![Color selector](images/color_selector.png)

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