Skip to content

Commit

Permalink
1. FIX: app would crash on android < 21 due to vectorDrawable incompa…
Browse files Browse the repository at this point in the history
…tibility.

2. Bumped versions
  • Loading branch information
ishaangarg committed Apr 6, 2018
1 parent 1c46d67 commit 57358bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions proswipebutton/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext {
siteUrl = 'https://github.com/shadowfaxtech/proSwipeButton'
gitUrl = 'https://github.com/shadowfaxtech/proSwipeButton.git'

libraryVersion = '1.1'
libraryVersion = '1.1.1'

developerId = 'developerId'
developerName = 'Ishaan Garg'
Expand All @@ -30,8 +30,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 26
versionCode 4
versionName "1.1"
versionCode 5
versionName "1.1.1"
vectorDrawables.useSupportLibrary = true

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Build;
import android.os.Handler;
import android.support.annotation.ColorInt;
import android.support.annotation.Dimension;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -346,17 +346,17 @@ private void showProgressBar() {
public void showResultIcon(boolean isSuccess) {
animateFadeHide(context, progressBar);

final ImageView failureIcon = new ImageView(context);
final AppCompatImageView failureIcon = new AppCompatImageView(context);
RelativeLayout.LayoutParams icLayoutParams =
new RelativeLayout.LayoutParams(dpToPx(50), dpToPx(50));
failureIcon.setLayoutParams(icLayoutParams);
failureIcon.setVisibility(GONE);
Drawable icon;
int icon;
if (isSuccess)
icon = ContextCompat.getDrawable(context, R.drawable.ic_check_circle_36dp);
icon = R.drawable.ic_check_circle_36dp;
else
icon = ContextCompat.getDrawable(context, R.drawable.ic_cancel_full_24dp);
failureIcon.setImageDrawable(icon);
icon = R.drawable.ic_cancel_full_24dp;
failureIcon.setImageResource(icon);
contentContainer.addView(failureIcon);
animateFadeShow(context, failureIcon);

Expand Down

0 comments on commit 57358bb

Please sign in to comment.