aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-10-24 21:53:37 -0400
committerAllan Wang <me@allanwang.ca>2017-10-24 21:53:37 -0400
commit9d9f0f0c375dbf4e4d7d97d097b91ace96d065cb (patch)
tree562394acaa40a9d640aa98b27a43ea1d69b40f58 /core
parent9270686be0c0ccba034648fb0cf552bafd96feb3 (diff)
downloadkau-9d9f0f0c375dbf4e4d7d97d097b91ace96d065cb.tar.gz
kau-9d9f0f0c375dbf4e4d7d97d097b91ace96d065cb.tar.bz2
kau-9d9f0f0c375dbf4e4d7d97d097b91ace96d065cb.zip
Loosen set menu icon demans
Diffstat (limited to 'core')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt
index 33bdc62..0e418ec 100644
--- a/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt
+++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ActivityUtils.kt
@@ -3,6 +3,7 @@ package ca.allanwang.kau.utils
import android.annotation.SuppressLint
import android.app.Activity
import android.app.ActivityOptions
+import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
@@ -93,7 +94,7 @@ inline var Activity.statusBarLight: Boolean
*
* Call in [Activity.onCreateOptionsMenu]
*/
-fun Activity.setMenuIcons(menu: Menu, @ColorInt color: Int = Color.WHITE, vararg iicons: Pair<Int, IIcon>) {
+fun Context.setMenuIcons(menu: Menu, @ColorInt color: Int = Color.WHITE, vararg iicons: Pair<Int, IIcon>) {
iicons.forEach { (id, iicon) ->
menu.findItem(id).icon = iicon.toDrawable(this, sizeDp = 18, color = color)
}