Rewrote Theme

This commit is contained in:
NoodleMage
2016-03-12 14:22:40 +01:00
committed by NoodleMage
parent 98d420d5aa
commit 5ef5f9b45f
112 changed files with 1078 additions and 1536 deletions
@@ -0,0 +1,19 @@
package eu.kanade.tachiyomi.util
import android.content.res.Resources
import android.graphics.drawable.Drawable
import android.support.annotation.StringRes
fun Resources.Theme.getResourceColor(@StringRes resource: Int) : Int {
val typedArray = this.obtainStyledAttributes(intArrayOf(resource))
val attrValue = typedArray.getColor(0, 0)
typedArray.recycle()
return attrValue
}
fun Resources.Theme.getResourceDrawable(@StringRes resource: Int) : Drawable {
val typedArray = this.obtainStyledAttributes(intArrayOf(resource))
val attrValue = typedArray.getDrawable(0)
typedArray.recycle()
return attrValue
}