Skip to content

Commit

Permalink
0.2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
afollestad committed Aug 30, 2016
1 parent a01bae8 commit ca9de7c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Add this in your module's `build.gradle` file:
```gradle
dependencies {
// ... other dependencies
compile 'com.afollestad:easyvideoplayer:0.2.11'
compile 'com.afollestad:easyvideoplayer:0.2.12'
}
```

Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'com.afollestad'
PUBLISH_ARTIFACT_ID = 'easyvideoplayer'
PUBLISH_VERSION = '0.2.11'
PUBLISH_VERSION = '0.2.12'
TARGET_SDK = 24
BUILD_TOOLS = "24.0.0"
GOOGLE_LIBS = "24.2.0"
Expand All @@ -16,7 +16,7 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion TARGET_SDK
versionCode 12
versionCode 13
versionName PUBLISH_VERSION
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.PorterDuff;
import android.graphics.SurfaceTexture;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
Expand All @@ -25,6 +27,7 @@
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.v4.content.ContextCompat;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.util.Log;
Expand Down Expand Up @@ -926,11 +929,39 @@ private void throwError(Exception e) {
else throw new RuntimeException(e);
}

private static void setTint(@NonNull SeekBar seekBar, @ColorInt int color) {
ColorStateList s1 = ColorStateList.valueOf(color);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
seekBar.setThumbTintList(s1);
seekBar.setProgressTintList(s1);
} else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD_MR1) {
Drawable progressDrawable = DrawableCompat.wrap(seekBar.getProgressDrawable());
seekBar.setProgressDrawable(progressDrawable);
DrawableCompat.setTintList(progressDrawable, s1);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
Drawable thumbDrawable = DrawableCompat.wrap(seekBar.getThumb());
DrawableCompat.setTintList(thumbDrawable, s1);
seekBar.setThumb(thumbDrawable);
}
} else {
PorterDuff.Mode mode = PorterDuff.Mode.SRC_IN;
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
mode = PorterDuff.Mode.MULTIPLY;
}
if (seekBar.getIndeterminateDrawable() != null)
seekBar.getIndeterminateDrawable().setColorFilter(color, mode);
if (seekBar.getProgressDrawable() != null)
seekBar.getProgressDrawable().setColorFilter(color, mode);
}
}

private void invalidateThemeColors() {
final int labelColor = Util.isColorDark(mThemeColor) ? Color.WHITE : Color.BLACK;
mControlsFrame.setBackgroundColor(Util.adjustAlpha(mThemeColor, 0.85f));
mLabelDuration.setTextColor(labelColor);
mLabelPosition.setTextColor(labelColor);
setTint(mSeeker, labelColor);

}

@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
Expand Down
4 changes: 2 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'

ext {
PUBLISH_VERSION = '0.2.11'
PUBLISH_VERSION = '0.2.12'
TARGET_SDK = 24
BUILD_TOOLS = "24.0.0"
GOOGLE_LIBS = "24.2.0"
Expand All @@ -15,7 +15,7 @@ android {
applicationId "com.afollestad.easyvideoplayersample"
minSdkVersion 14
targetSdkVersion TARGET_SDK
versionCode 13
versionCode 14
versionName PUBLISH_VERSION
}
buildTypes {
Expand Down

0 comments on commit ca9de7c

Please sign in to comment.