diff --git a/.idea/misc.xml b/.idea/misc.xml index be75660..01d38cd 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,8 @@ + + + diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 6564d52..94a25f7 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/sample/src/main/java/pl/aprilapps/switchersample/MainActivity.java b/sample/src/main/java/pl/aprilapps/switchersample/MainActivity.java index 5deacac..6ea4f36 100644 --- a/sample/src/main/java/pl/aprilapps/switchersample/MainActivity.java +++ b/sample/src/main/java/pl/aprilapps/switchersample/MainActivity.java @@ -76,7 +76,7 @@ protected void onError() { .subscribe(new Subscriber() { @Override public void onCompleted() { - switcher.showErrorView("Error. Click this to make it dissapear.", MainActivity.this, 0); + switcher.showErrorView("Error. Click this to make it dissapear.", MainActivity.this); } @Override @@ -118,7 +118,7 @@ public void onNext(Object o) { @Override - public void onErrorViewClicked(int errorCode) { + public void onErrorViewClicked() { switcher.showContentView(); } } diff --git a/switcher-library/build.gradle b/switcher-library/build.gradle index e7a8407..36b09fb 100644 --- a/switcher-library/build.gradle +++ b/switcher-library/build.gradle @@ -8,8 +8,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 22 - versionCode 9 - versionName "1.0.9" + versionCode 10 + versionName "1.1.0" renderscriptTargetApi 22 renderscriptSupportModeEnabled true } diff --git a/switcher-library/src/main/java/pl/aprilapps/switcher/OnErrorViewListener.java b/switcher-library/src/main/java/pl/aprilapps/switcher/OnErrorViewListener.java index e8c114f..9dd0573 100644 --- a/switcher-library/src/main/java/pl/aprilapps/switcher/OnErrorViewListener.java +++ b/switcher-library/src/main/java/pl/aprilapps/switcher/OnErrorViewListener.java @@ -4,5 +4,5 @@ * Created by Jacek KwiecieĊ„ on 18.03.15. */ public interface OnErrorViewListener { - public void onErrorViewClicked(int errorCode); + public void onErrorViewClicked(); } diff --git a/switcher-library/src/main/java/pl/aprilapps/switcher/Switcher.java b/switcher-library/src/main/java/pl/aprilapps/switcher/Switcher.java index 1bc1341..f0da3dc 100644 --- a/switcher-library/src/main/java/pl/aprilapps/switcher/Switcher.java +++ b/switcher-library/src/main/java/pl/aprilapps/switcher/Switcher.java @@ -23,8 +23,6 @@ public class Switcher { private TextView errorLabel; private TextView progressLabel; - private int errorCode; - private Pair currentAnimators; private Switcher() { @@ -232,26 +230,24 @@ public void showErrorView(String errorMessage) { showErrorView(); } - public void showErrorView(final OnErrorViewListener listener, final int errorCode) { - this.errorCode = errorCode; - + public void showErrorView(final OnErrorViewListener listener) { errorView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - listener.onErrorViewClicked(errorCode); + listener.onErrorViewClicked(); view.setOnClickListener(null); } }); showErrorView(); } - public void showErrorView(String errorMessage, final OnErrorViewListener listener, final int errorCode) { + public void showErrorView(String errorMessage, final OnErrorViewListener listener) { if (errorLabel == null) { throw new NullPointerException("You have to build Switcher using withErrorLabel() method"); } errorLabel.setText(errorMessage); - showErrorView(listener, errorCode); + showErrorView(listener); } public void showProgressView(String errorMessage) {