diff --git a/library/src/main/java/com/telefonica/mistica/sheet/SheetModel.kt b/library/src/main/java/com/telefonica/mistica/sheet/SheetModel.kt index 2d647718d..6f417d800 100644 --- a/library/src/main/java/com/telefonica/mistica/sheet/SheetModel.kt +++ b/library/src/main/java/com/telefonica/mistica/sheet/SheetModel.kt @@ -86,14 +86,14 @@ sealed class SelectableAsset { val rowAsset: RowAsset, ) : SelectableAsset() { @Deprecated("Use primary constructor providing a RowAsset object instead") - constructor(id: Int) : this(RowAsset.DrawableIdAsset(id)) + constructor(@DrawableRes id: Int) : this(RowAsset.DrawableIdAsset(id)) } data class LargeIcon( val rowAsset: RowAsset, ) : SelectableAsset() { @Deprecated("Use primary constructor providing a RowAsset object instead") - constructor(id: Int) : this(RowAsset.DrawableIdAsset(id)) + constructor(@DrawableRes id: Int) : this(RowAsset.DrawableIdAsset(id)) } } diff --git a/library/src/main/java/com/telefonica/mistica/sheet/children/list/ListElementViewData.kt b/library/src/main/java/com/telefonica/mistica/sheet/children/list/ListElementViewData.kt index c443f18ed..411bd002e 100644 --- a/library/src/main/java/com/telefonica/mistica/sheet/children/list/ListElementViewData.kt +++ b/library/src/main/java/com/telefonica/mistica/sheet/children/list/ListElementViewData.kt @@ -39,14 +39,14 @@ internal sealed class ListElementViewData( enum class RowActionStyleViewData { Default, Destructive } -sealed class SelectableListAssetViewData { +internal sealed class SelectableListAssetViewData { data class Image(val asset: RowAssetViewData) : SelectableListAssetViewData() data class SmallImage(val asset: RowAssetViewData) : SelectableListAssetViewData() data class SmallIcon(val asset: RowAssetViewData) : SelectableListAssetViewData() data class LargeIcon(val asset: RowAssetViewData) : SelectableListAssetViewData() } -sealed class InformativeIconViewData { +internal sealed class InformativeIconViewData { data object Bullet : InformativeIconViewData() data class Icon(val asset: RowAssetViewData) : InformativeIconViewData() data class SmallIcon(val asset: RowAssetViewData) : InformativeIconViewData() @@ -56,7 +56,7 @@ interface OnClickListener { fun onClicked(id: String) } -sealed class RowAssetViewData { +internal sealed class RowAssetViewData { data class UrlAsset(val url: String) : RowAssetViewData() data class DrawableIdAsset(@DrawableRes val id: Int) : RowAssetViewData() data class DrawableAsset(val drawableRes: Drawable) : RowAssetViewData() diff --git a/library/src/main/java/com/telefonica/mistica/util/Base64DataUrlFetcher.kt b/library/src/main/java/com/telefonica/mistica/util/Base64DataUrlFetcher.kt index 188dc4b72..7636e326e 100644 --- a/library/src/main/java/com/telefonica/mistica/util/Base64DataUrlFetcher.kt +++ b/library/src/main/java/com/telefonica/mistica/util/Base64DataUrlFetcher.kt @@ -22,7 +22,7 @@ import coil.request.Options * otherwise the data would be represented using ASCII encoding. * Link to Spec: https://datatracker.ietf.org/doc/html/rfc2397 */ -class Base64DataUrlFetcher( +internal class Base64DataUrlFetcher( private val base64Data: String, private val resources: Resources, ) : Fetcher { @@ -43,7 +43,7 @@ class Base64DataUrlFetcher( null } - class Factory( + internal class Factory( private val resources: Resources, ) : Fetcher.Factory { override fun create(data: Uri, options: Options, imageLoader: ImageLoader): Fetcher? { diff --git a/library/src/main/java/com/telefonica/mistica/util/ImageLoaderProvider.kt b/library/src/main/java/com/telefonica/mistica/util/ImageLoaderProvider.kt index b34ff21f0..e09c9a7e0 100644 --- a/library/src/main/java/com/telefonica/mistica/util/ImageLoaderProvider.kt +++ b/library/src/main/java/com/telefonica/mistica/util/ImageLoaderProvider.kt @@ -4,7 +4,7 @@ import android.content.Context import coil.ImageLoader import coil.decode.SvgDecoder -object ImageLoaderProvider { +internal object ImageLoaderProvider { private var imageLoader: ImageLoader? = null diff --git a/library/src/main/java/com/telefonica/mistica/util/ImageViewUtils.kt b/library/src/main/java/com/telefonica/mistica/util/ImageViewUtils.kt index ebb31a6bd..adfb609bc 100644 --- a/library/src/main/java/com/telefonica/mistica/util/ImageViewUtils.kt +++ b/library/src/main/java/com/telefonica/mistica/util/ImageViewUtils.kt @@ -5,7 +5,7 @@ import androidx.appcompat.content.res.AppCompatResources import coil.request.ImageRequest import com.telefonica.mistica.sheet.children.list.RowAssetViewData -fun ImageView.loadRowAsset(rowAsset: RowAssetViewData) { +internal fun ImageView.loadRowAsset(rowAsset: RowAssetViewData) { when (rowAsset) { is RowAssetViewData.DrawableAsset -> this.setImageDrawable(rowAsset.drawableRes) is RowAssetViewData.DrawableIdAsset -> this.setImageDrawable(AppCompatResources.getDrawable(this.context, rowAsset.id)) @@ -13,7 +13,7 @@ fun ImageView.loadRowAsset(rowAsset: RowAssetViewData) { } } -fun ImageView.loadUrl( +internal fun ImageView.loadUrl( url: String, builder: ImageRequest.Builder.() -> Unit = {}, ) { @@ -24,5 +24,5 @@ fun ImageView.loadUrl( .apply(builder) .build() - ImageLoaderProvider.get(context).enqueue(request) + ImageLoaderProvider.get(context.applicationContext).enqueue(request) }