Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
师春雷 committed Dec 10, 2017
1 parent 625cc67 commit 80ee9b8
Showing 1 changed file with 49 additions and 49 deletions.
98 changes: 49 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,54 @@ Get the current state.

===========================================================================================

### SwitchIconView 用法

<img src="/screenshot/SwitchIconView.gif">

SwitchIconView extends from AppCompatImageView so you can set icon with ```app:srcCompat```

Set any icon (vector or image) to SwitchIconView and enjoy switchable icon in your app :)

Use ```app:siv_tint_color``` to set color to icon. Default color is black;

Use ```app:siv_disabled_color``` to set color when icon disabled. Default color is equals with ```app:siv_tint_color```;

Use ```app:siv_disabled_alpha``` to set alpha when icon disabled. Default alpha is ```.5```;

Use ```app:siv_no_dash``` if you don't want to draw dash, when icon disabled;

Use ```app:siv_animation_duration``` if you want to change switching state animation duration;

Use ```app:siv_enabled``` to set initial icon state;

Fully customized implementation:

<chingtech.library.widget.SwitchIconView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
app:si_animation_duration="500"
app:si_disabled_alpha=".3"
app:si_disabled_color="#b7b7b7"
app:si_tint_color="#ff3c00"
app:si_enabled="false"
app:si_no_dash="true"
app:srcCompat="@drawable/ic_cloud"/>

Public methods:

public void setIconEnabled(boolean enabled);

public void setIconEnabled(boolean enabled, boolean animate);

public boolean isIconEnabled();

public void switchState();

public void switchState(boolean animate);

===========================================================================================

### SmoothCheckBox 用法

<img src="/screenshot/smoothcb.gif">
Expand Down Expand Up @@ -581,7 +629,7 @@ Attrs 属性

### DecimalRulerView 用法

<img src="/screenshot/rulerveiw.png">
<img src="/screenshot/rulerview.png">

Attrs 属性

Expand Down Expand Up @@ -800,54 +848,6 @@ Java

===========================================================================================

### SwitchIconView 用法

<img src="/screenshot/SwitchIconView.gif">

SwitchIconView extends from AppCompatImageView so you can set icon with ```app:srcCompat```

Set any icon (vector or image) to SwitchIconView and enjoy switchable icon in your app :)

Use ```app:siv_tint_color``` to set color to icon. Default color is black;

Use ```app:siv_disabled_color``` to set color when icon disabled. Default color is equals with ```app:siv_tint_color```;

Use ```app:siv_disabled_alpha``` to set alpha when icon disabled. Default alpha is ```.5```;

Use ```app:siv_no_dash``` if you don't want to draw dash, when icon disabled;

Use ```app:siv_animation_duration``` if you want to change switching state animation duration;

Use ```app:siv_enabled``` to set initial icon state;

Fully customized implementation:

<chingtech.library.widget.SwitchIconView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
app:si_animation_duration="500"
app:si_disabled_alpha=".3"
app:si_disabled_color="#b7b7b7"
app:si_tint_color="#ff3c00"
app:si_enabled="false"
app:si_no_dash="true"
app:srcCompat="@drawable/ic_cloud"/>

Public methods:

public void setIconEnabled(boolean enabled);

public void setIconEnabled(boolean enabled, boolean animate);

public boolean isIconEnabled();

public void switchState();

public void switchState(boolean animate);

===========================================================================================

### Sample 中使用到的第三方框架包括

- _[Gson](https://github.com/google/gson)_
Expand Down

0 comments on commit 80ee9b8

Please sign in to comment.