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

Commit

Permalink
added error feedback to user
Browse files Browse the repository at this point in the history
  • Loading branch information
leandroBorgesFerreira committed Aug 7, 2017
1 parent ec173b4 commit ca43031
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
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.8.1'
version = '0.8.2'
group = 'com.ebanx'

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

licenses {
license {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ private void init(Context context, AttributeSet attrs, int defStyleAttr, int def
trailEnabled = typedArray.getBoolean(R.styleable.SwipeButton_button_trail_enabled,
false);
Drawable trailingDrawable = typedArray.getDrawable(R.styleable.SwipeButton_button_trail_drawable);

if (trailEnabled && trailingDrawable == null) {
throw new IllegalArgumentException(getContext().getString(
R.string.error_need_to_add_trailing_effect_drawable));
}

Drawable drawable = typedArray.getDrawable(R.styleable.SwipeButton_inner_text_background);

if (drawable != null) {
Expand Down
2 changes: 2 additions & 0 deletions swipe-button/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<resources>
<string name="app_name">swipebtn</string>

<string name="error_need_to_add_trailing_effect_drawable"> If you set trail enabled, you must set a value to button_trail_drawable. </string>
</resources>

0 comments on commit ca43031

Please sign in to comment.