diff options
author | Allan Wang <allanwang@google.com> | 2019-07-27 21:10:18 -0700 |
---|---|---|
committer | Allan Wang <allanwang@google.com> | 2019-07-27 21:10:18 -0700 |
commit | 0bab0561f071fca253b75fbcdae453dbd8790cab (patch) | |
tree | f7b4f407bd1790de37c2b6280bec777697662eb0 /core/src/main | |
parent | cb88398bdd995339ca484721d422ba42e028d423 (diff) | |
download | kau-0bab0561f071fca253b75fbcdae453dbd8790cab.tar.gz kau-0bab0561f071fca253b75fbcdae453dbd8790cab.tar.bz2 kau-0bab0561f071fca253b75fbcdae453dbd8790cab.zip |
Fix imports
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt index 52ea57d..dc7b214 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt @@ -20,8 +20,7 @@ import android.graphics.Color import android.graphics.drawable.Drawable import androidx.annotation.ColorInt import com.mikepenz.iconics.IconicsDrawable -import com.mikepenz.iconics.colorInt -import com.mikepenz.iconics.sizeDp +import com.mikepenz.iconics.dsl.iconicsDrawable import com.mikepenz.iconics.typeface.IIcon /** @@ -33,9 +32,9 @@ fun IIcon.toDrawable( sizeDp: Int = 24, @ColorInt color: Int = Color.WHITE, builder: IconicsDrawable.() -> Unit = {} -): Drawable { - val icon = IconicsDrawable(c).icon(this).colorInt(color) - if (sizeDp > 0) icon.sizeDp(sizeDp) - icon.builder() - return icon -} +): Drawable = c.iconicsDrawable(this) { + this.color = colorInt(color) + if (sizeDp > 0) { + size = sizeDp(sizeDp) + } +}.apply(builder) |