13 lines
385 B
Kotlin
Raw Normal View History

2019-06-21 14:18:38 +10:00
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)
}
}