Skip to content

Commit

Permalink
Merge pull request #77 from dev-labs-bg/fix/app-crash-pre-android-10
Browse files Browse the repository at this point in the history
Fix - app crash pre-android 10
  • Loading branch information
slavipetrov authored Feb 17, 2021
2 parents 83271c6 + 045d62c commit aa55747
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ ext.versions = [
buildTools : '28.0.3',
publishVersion : '1.1.6',
publishVersionCode: 1,
gradlePlugin : '3.6.1',
gradlePlugin : '3.6.2',
bintrayPlugin : '1.8.4',
mavenPlugin : '1.4.1',

core : '1.3.2',
appcompat : '1.1.0',
material : '1.1.0',
constraintLayout : '1.1.3',
Expand Down
1 change: 1 addition & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ android {
}

dependencies {
implementation "androidx.core:core:$versions.core"
implementation "androidx.appcompat:appcompat:$versions.appcompat"
implementation "com.google.android.material:material:$versions.material"
implementation "androidx.constraintlayout:constraintlayout:$versions.constraintLayout"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.BlendMode;
import android.graphics.BlendModeColorFilter;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
Expand All @@ -39,6 +37,8 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.BlendModeColorFilterCompat;
import androidx.core.graphics.BlendModeCompat;

import java.util.Locale;

Expand Down Expand Up @@ -568,7 +568,16 @@ private void setProgressBarDrawablesColors() {
}

private void setColorFilter(@NonNull Drawable drawable, int color) {
drawable.setColorFilter(new BlendModeColorFilter(color, BlendMode.SRC_ATOP));
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
drawable.setColorFilter(
BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
color, BlendModeCompat.SRC_ATOP
)
);
// } else {
// //noinspection deprecation
// drawable.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
// }
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ActionBarActivity : AppCompatActivity() {
val videoPath = "https://bit.ly/2wUgyUw"

fullscreenVideoView.videoUrl(videoPath)
.progressBarColor(R.color.colorAccent)
// .progressBarColor(R.color.colorAccent)
.landscapeOrientation(LandscapeOrientation.SENSOR)
.portraitOrientation(PortraitOrientation.DEFAULT)
.thumbnail(R.drawable.video_thumbnail)
Expand Down

0 comments on commit aa55747

Please sign in to comment.