mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 19:15:16 +00:00
13 lines
385 B
Kotlin
13 lines
385 B
Kotlin
|
package org.thoughtcrime.securesms.loki
|
||
|
|
||
|
import android.content.res.Resources
|
||
|
import android.os.Build
|
||
|
import android.support.annotation.ColorRes
|
||
|
|
||
|
fun Resources.getColorWithID(@ColorRes id: Int, theme: Resources.Theme?): Int {
|
||
|
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||
|
getColor(id, theme)
|
||
|
} else {
|
||
|
@Suppress("DEPRECATION") getColor(id)
|
||
|
}
|
||
|
}
|