Skip to content

Commit

Permalink
change the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Leaking committed Jan 3, 2015
1 parent ca64016 commit 2278d7a
Showing 1 changed file with 34 additions and 7 deletions.
41 changes: 34 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SlideSwitch


## About this SlideSwitch

A button they you can slide to open or close something


Expand All @@ -11,9 +12,8 @@ A button they you can slide to open or close something
you can define a slideswitch in xml like the following example


{% highlight java %}

<com.leaking.slideswitch.SlideSwitch
```java
<com.leaking.slideswitch.SlideSwitch
android:id="@+id/swit"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
Expand All @@ -26,18 +26,45 @@ you can define a slideswitch in xml like the following example
</com.leaking.slideswitch.SlideSwitch>


{% endhighlight %}

you can init the state(open or close) in jave code in this way

you can initial the state(open or close) in jave code in this way

{% highlight java %}

```java
bulletSwitch.setState(true);

{% endhighlight %}

and you can listen the change of the slideswitch like this

```java
updateSwitch.setSlideListener(new SlideListener() {

@Override
public void open() {
// TODO Auto-generated method stub
app.saveAutoUpdateProp(true);
}

@Override
public void close() {
// TODO Auto-generated method stub
app.saveAutoUpdateProp(false);
}
});



## What does it look like


<img src="https://github.com/Leaking/SlideSwitch/blob/master/Example/TestLibs/res/drawable-hdpi/slide_a.png" width="140" />

<img src="https://github.com/Leaking/SlideSwitch/blob/master/Example/TestLibs/res/drawable-hdpi/slide_b.png" width="140" />


##Author

Quinn Chen

chenhuazhaoao@gmail.com

0 comments on commit 2278d7a

Please sign in to comment.