Skip to content

Commit

Permalink
Update: updated the new version.
Browse files Browse the repository at this point in the history
  • Loading branch information
pokk committed Feb 28, 2019
1 parent 30da947 commit 1733680
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!!!
Expand All @@ -107,14 +107,14 @@ Then you can use it!!!
<dependency>
<groupId>com.devrapid.jieyi</groupId>
<artifactId>kotlinknifer</artifactId>
<version>2.1.5</version>
<version>2.1.8</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.devrapid.jieyi</groupId>
<artifactId>kotlinshaver</artifactId>
<version>1.1.5</version>
<version>1.1.8</version>
<type>pom</type>
</dependency>
```
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -39,4 +39,4 @@ [email protected]
proj_kotlin_name=kotlinshaver
proj_kotlin_libname=KotlinShaver
proj_kotlin_artifactid=kotlinshaver
proj_kotlin_version=1.1.6
proj_kotlin_version=1.1.8
5 changes: 3 additions & 2 deletions kotlinknifer/src/main/java/com/devrapid/kotlinknifer/View.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1733680

Please sign in to comment.