Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrannp committed May 30, 2015
1 parent f3d078e commit 6359c6c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ Making straightforward to create a preference screen on pre-Lollipop devices loo

## Install (Gradle dependency)

Uploading...
compile 'com.fnp:material-preferences:0.1.3'

## Features
- Material look (title, summary, widgets...) on pre-Lollipop
- Nested PreferenceScreen with Toolbar and handling configuration change correctly (restore state)
- No API change
- No API change (trick for [SwitchPreference](README.md#switchpreference))

## Usage
### SettingsActivity
Expand Down Expand Up @@ -48,6 +48,17 @@ public class SettingsActivity extends com.fnp.materialpreferences.PreferenceActi
</PreferenceScreen>
```

### SwitchPreference
There is a trick for ```SwitchPreference```, instead, use a ```CheckBoxPreference``` and use the ```mp_preference_layout```as a widget layout. For now, this is the only way to style it.

```xml
<CheckBoxPreference
android:defaultValue="true"
android:key="some_key"
android:title="Hooray!"
android:widgetLayout="@layout/mp_preference_switch"/>
```

### Result
<img src=assets/result-1.png width=500 height=845 />

Expand Down

0 comments on commit 6359c6c

Please sign in to comment.