diff --git a/README.md b/README.md
index 8dfbdee..f0f3ebf 100644
--- a/README.md
+++ b/README.md
@@ -94,9 +94,9 @@ allprojects {
And add our dependency to your app `bundle.gradle`.
```gradle
-implementation 'com.devrapid.jieyi:kotlinknifer:2.1.5'
+implementation 'com.devrapid.jieyi:kotlinknifer:2.1.8'
-implementation 'com.devrapid.jieyi:kotlinshaver:1.1.5'
+implementation 'com.devrapid.jieyi:kotlinshaver:1.1.8'
```
Then you can use it!!!
@@ -107,14 +107,14 @@ Then you can use it!!!
com.devrapid.jieyi
kotlinknifer
- 2.1.5
+ 2.1.8
pom
com.devrapid.jieyi
kotlinshaver
- 1.1.5
+ 1.1.8
pom
```
diff --git a/gradle.properties b/gradle.properties
index 991644f..4c02a70 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -21,7 +21,7 @@ proj_name=kotlinknifer
proj_libname=KotlinKnifer
proj_group=com.devrapid.jieyi
proj_artifactid=kotlinknifer
-proj_version=2.1.6
+proj_version=2.1.8
proj_description=For developing an Android conveniently and rapidly.
proj_websiteurl=https://github.com/pokk/KotlinKnifer
proj_issuetrackerurl=https://github.com/pokk/KotlinKnifer/issues
@@ -39,4 +39,4 @@ developer_email=pokkbaby@gmail.com
proj_kotlin_name=kotlinshaver
proj_kotlin_libname=KotlinShaver
proj_kotlin_artifactid=kotlinshaver
-proj_kotlin_version=1.1.6
+proj_kotlin_version=1.1.8
diff --git a/kotlinknifer/src/main/java/com/devrapid/kotlinknifer/View.kt b/kotlinknifer/src/main/java/com/devrapid/kotlinknifer/View.kt
index c3c2465..d1e3d75 100644
--- a/kotlinknifer/src/main/java/com/devrapid/kotlinknifer/View.kt
+++ b/kotlinknifer/src/main/java/com/devrapid/kotlinknifer/View.kt
@@ -16,6 +16,7 @@ import android.view.WindowManager
import androidx.annotation.ColorInt
import androidx.annotation.ColorRes
import androidx.appcompat.app.AlertDialog
+import androidx.core.content.ContextCompat
import com.example.kotlinknifer.R
inline fun View.resizeView(width: Int? = null, height: Int? = null) {
@@ -96,10 +97,10 @@ inline fun Activity.statusBarHeight() = Rect()
.top
fun Activity.changeStatusBarColorRes(@ColorRes colorRes: Int) =
- setStatusBarColorBy { statusBarColor = getColorBy(colorRes) }
+ setStatusBarColorBy { statusBarColor = ContextCompat.getColor(context, colorRes) }
fun Activity.changeStatusBarColor(@ColorInt color: Int, ratio: Float = 1f) =
- setStatusBarColorBy { statusBarColor = ofAlpha(color, ratio) }
+ setStatusBarColorBy { statusBarColor = color.ofAlpha(ratio) }
internal inline fun Activity.setStatusBarColorBy(block: Window.() -> Unit) {
if (Build.VERSION_CODES.LOLLIPOP <= Build.VERSION.SDK_INT)