Skip to content

Commit 9d3bd21

Browse files
authored
Merge pull request #5 from shadowfaxtech/v1.1.1
FIX: vectorDrawable crash
2 parents f536a69 + 57358bb commit 9d3bd21

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

proswipebutton/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ext {
1313
siteUrl = 'https://github.com/shadowfaxtech/proSwipeButton'
1414
gitUrl = 'https://github.com/shadowfaxtech/proSwipeButton.git'
1515

16-
libraryVersion = '1.1'
16+
libraryVersion = '1.1.1'
1717

1818
developerId = 'developerId'
1919
developerName = 'Ishaan Garg'
@@ -30,8 +30,8 @@ android {
3030
defaultConfig {
3131
minSdkVersion 15
3232
targetSdkVersion 26
33-
versionCode 4
34-
versionName "1.1"
33+
versionCode 5
34+
versionName "1.1.1"
3535
vectorDrawables.useSupportLibrary = true
3636

3737
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

proswipebutton/src/main/java/in/shadowfax/proswipebutton/ProSwipeButton.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
import android.content.Context;
77
import android.content.res.TypedArray;
88
import android.graphics.PorterDuff;
9-
import android.graphics.drawable.Drawable;
109
import android.graphics.drawable.GradientDrawable;
1110
import android.os.Build;
1211
import android.os.Handler;
1312
import android.support.annotation.ColorInt;
1413
import android.support.annotation.Dimension;
1514
import android.support.annotation.Nullable;
1615
import android.support.v4.content.ContextCompat;
16+
import android.support.v7.widget.AppCompatImageView;
1717
import android.util.AttributeSet;
1818
import android.util.TypedValue;
1919
import android.view.LayoutInflater;
@@ -346,17 +346,17 @@ private void showProgressBar() {
346346
public void showResultIcon(boolean isSuccess) {
347347
animateFadeHide(context, progressBar);
348348

349-
final ImageView failureIcon = new ImageView(context);
349+
final AppCompatImageView failureIcon = new AppCompatImageView(context);
350350
RelativeLayout.LayoutParams icLayoutParams =
351351
new RelativeLayout.LayoutParams(dpToPx(50), dpToPx(50));
352352
failureIcon.setLayoutParams(icLayoutParams);
353353
failureIcon.setVisibility(GONE);
354-
Drawable icon;
354+
int icon;
355355
if (isSuccess)
356-
icon = ContextCompat.getDrawable(context, R.drawable.ic_check_circle_36dp);
356+
icon = R.drawable.ic_check_circle_36dp;
357357
else
358-
icon = ContextCompat.getDrawable(context, R.drawable.ic_cancel_full_24dp);
359-
failureIcon.setImageDrawable(icon);
358+
icon = R.drawable.ic_cancel_full_24dp;
359+
failureIcon.setImageResource(icon);
360360
contentContainer.addView(failureIcon);
361361
animateFadeShow(context, failureIcon);
362362

0 commit comments

Comments
 (0)