Skip to content

Commit

Permalink
Release v0.0.14 🎁
Browse files Browse the repository at this point in the history
  • Loading branch information
GwonHyeok committed Nov 21, 2017
1 parent a2bcd7b commit 40313aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ allprojects {
Add the dependency
```Groovy
dependencies {
compile 'com.github.GwonHyeok:StickySwitch:0.0.13'
compile 'com.github.GwonHyeok:StickySwitch:0.0.14'
}
```

Expand Down Expand Up @@ -98,6 +98,11 @@ stickySwitch.setOnSelectedChangeListener(new StickySwitch.OnSelectedChangeListen
```

## Direction
### Methods
```kotlin
fun setDirection(direction: Direction, isAnimate: Boolean = true, shouldTriggerSelected: Boolean = true)
```

### if you want switch button direction to left
```java
stickySwitch.setDirection(StickySwitch.Direction.LEFT);
Expand All @@ -108,6 +113,11 @@ stickySwitch.setDirection(StickySwitch.Direction.LEFT);
stickySwitch.setDirection(StickySwitch.Direction.RIGHT, false);
```

### if you want switch button direction to right with animation and prevent call selectedChangeListener
```java
stickySwitch.setDirection(StickySwitch.Direction.RIGHT, false, false);
```

### Get current Direction
```java
stickySwitch.getDirection(); // StickySwitch.Direction.LEFT
Expand Down
4 changes: 2 additions & 2 deletions stickyswitch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "0.0.13"
versionName "0.0.14"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}
Expand Down Expand Up @@ -44,7 +44,7 @@ publish {
userOrg = 'ghyeok'
groupId = 'io.ghyeok.lib'
artifactId = 'sticky-switch'
publishVersion = '0.0.13'
publishVersion = '0.0.14'
desc = 'Sticky Switch'
website = 'https://github.com/GwonHyeok/StickySwitch'
issueTracker = 'https://github.com/GwonHyeok/StickySwitch/issues'
Expand Down

1 comment on commit 40313aa

@dreamchaser96
Copy link

@dreamchaser96 dreamchaser96 commented on 40313aa Nov 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that after setting stickySwitch.setDirection(StickySwitch.Direction.RIGHT, false, false); I can't setOnclick listener, it doesn't work :/

viewHolder.mStickySwitch.setDirection(StickySwitch.Direction.LEFT, false, false); viewHolder.mStickySwitch.setOnSelectedChangeListener(new StickySwitch.OnSelectedChangeListener() { @Override public void onSelectedChange(@NotNull StickySwitch.Direction direction, @NotNull String text) {

Please sign in to comment.