Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

Commit

Permalink
Correction in NullPointerException in onStateChangeListener
Browse files Browse the repository at this point in the history
  • Loading branch information
leandroBorgesFerreira committed Jun 5, 2017
1 parent 628a08e commit 546e47d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
app:inner_text_size="16sp"
app:inner_text_top_padding="18dp"
app:inner_text_bottom_padding="18dp"
app:inner_text_background="@drawable/shape_rounded2"
app:inner_text_background="@drawable/shape_rounded"
app:button_image_disabled="@drawable/ic_lock_open_black_24dp"
app:button_image_enabled="@drawable/ic_lock_outline_black_24dp"
app:button_left_padding="20dp"
Expand Down
4 changes: 2 additions & 2 deletions swipe-button/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'gnag'

version = '0.4.0'
version = '0.4.1'
group = 'com.ebanx'

android {
Expand Down Expand Up @@ -103,7 +103,7 @@ install {
packaging 'aar'
groupId 'com.ebanx'
artifactId 'swipe-button'
version '0.4.0'
version '0.4.1'

licenses {
license {
Expand Down
10 changes: 8 additions & 2 deletions swipe-button/src/main/java/com/ebanx/swipebtn/SwipeButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ public void onAnimationEnd(Animator animation) {

active = true;
slidingButton.setImageDrawable(enabledDrawable);
onStateChangeListener.onStateChange(active);

if(onStateChangeListener != null) {
onStateChangeListener.onStateChange(active);
}
}
});

Expand Down Expand Up @@ -306,7 +309,10 @@ public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
active = false;
slidingButton.setImageDrawable(disabledDrawable);
onStateChangeListener.onStateChange(active);

if(onStateChangeListener != null) {
onStateChangeListener.onStateChange(active);
}
}
});

Expand Down

0 comments on commit 546e47d

Please sign in to comment.