0

I'm trying to migrate my v3 of the Android Iconics to v5, but I can't seem to understand how I am supposed to change the below code to v5.

IconicsDrawable(mContext)
    .icon(icon)
    .colorRes(R.color.blue_light)
    .backgroundColorRes(R.color.primary)
    .roundedCornersRes(R.dimen.card__rounded_corner)
    .paddingRes(R.dimen.card_icon_padding)
    .sizeRes(R.dimen.card_size)
    .toBitmap();
mikepenz
  • 12,708
  • 14
  • 77
  • 117
Paulo
  • 3
  • 2

1 Answers1

0

Android-Iconics v5 is optimised and only focused at Kotlin projects. We made the choice to no longer focus on Java which allowed us to significantly simplify APIs.

If you want to migrate the above code to Kotlin with v5 it would look like:

IconicsDrawable(mContext).apply { 
        icon = icon
        colorRes = R.color.blue_light
        backgroundColorRes = R.color.primary
        roundedCornersRes = R.dimen.card__rounded_corner
        paddingRes = R.dimen.card_icon_padding
        sizeRes = R.dimen.card_size
}.toBitmap()
mikepenz
  • 12,708
  • 14
  • 77
  • 117