diff options
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/utils/IIconUtils.kt | 15 | ||||
-rw-r--r-- | fastadapter/build.gradle | 1 | ||||
-rw-r--r-- | mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt | 3 | ||||
-rw-r--r-- | sample/build.gradle | 1 | ||||
-rw-r--r-- | searchview/build.gradle | 1 |
5 files changed, 8 insertions, 13 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) diff --git a/fastadapter/build.gradle b/fastadapter/build.gradle index 8472801..ff58fe8 100644 --- a/fastadapter/build.gradle +++ b/fastadapter/build.gradle @@ -10,6 +10,7 @@ dependencies { api project(':adapter') api Dependencies.fastAdapter + api Dependencies.fastAdapter("utils") } apply from: '../artifacts.gradle' diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt index d21b33f..dceb1df 100644 --- a/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt +++ b/mediapicker/src/main/kotlin/ca/allanwang/kau/mediapicker/MediaPickerCore.kt @@ -46,7 +46,6 @@ import com.bumptech.glide.Glide import com.bumptech.glide.RequestManager import com.mikepenz.fastadapter.GenericItem import com.mikepenz.fastadapter.adapters.ItemAdapter -import com.mikepenz.iconics.dsl.ExperimentalIconicsDSL import com.mikepenz.iconics.dsl.iconicsDrawable import com.mikepenz.iconics.typeface.IIcon import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial @@ -88,11 +87,9 @@ abstract class MediaPickerCore<T : GenericItem>( /** * Create error tile for a given item */ - @ExperimentalIconicsDSL fun getErrorDrawable(context: Context) = getIconDrawable(context, GoogleMaterial.Icon.gmd_error, accentColor) - @ExperimentalIconicsDSL fun getIconDrawable(context: Context, iicon: IIcon, color: Int): Drawable { val sizePx = computeViewSize(context) return context.iconicsDrawable(iicon) { diff --git a/sample/build.gradle b/sample/build.gradle index 9a3473d..ab98695 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -129,7 +129,6 @@ dependencies { implementation project(':mediapicker') implementation Dependencies.materialDialog("input") - implementation Dependencies.fastAdapter("utils") testImplementation Dependencies.kotlinTest testImplementation Dependencies.junit diff --git a/searchview/build.gradle b/searchview/build.gradle index e1d878f..64a88b3 100644 --- a/searchview/build.gradle +++ b/searchview/build.gradle @@ -7,7 +7,6 @@ apply from: '../android-lib.gradle' dependencies { implementation project(':core-ui') implementation project(':fastadapter') - implementation Dependencies.fastAdapter('utils') } apply from: '../artifacts.gradle' |