session-android/src/org/thoughtcrime/securesms/loki/GeneralUtilities.kt

13 lines
385 B
Kotlin
Raw Normal View History

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