Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec0556ce authored by tibbi's avatar tibbi
Browse files

add a helper function for checking if the device is Oreo+

parent 0e16e9b7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.0.22'
        propVersionName = '3.0.23'
        kotlin_version = '1.2.0'
        support_libs = '27.0.2'
    }
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ fun Context.isKitkatPlus() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
fun Context.isLollipopPlus() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
fun Context.isMarshmallowPlus() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
fun Context.isNougatPlus() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
fun Context.isOreoPlus() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O

fun Context.updateTextColors(viewGroup: ViewGroup, tmpTextColor: Int = 0, tmpAccentColor: Int = 0) {
    val textColor = if (tmpTextColor == 0) baseConfig.textColor else tmpTextColor