All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.seiko.imageloader.component.SetupComponents.kt Maven / Gradle / Ivy

There is a newer version: 1.8.3
Show newest version
package com.seiko.imageloader.component

import com.seiko.imageloader.component.fetcher.Base64Fetcher
import com.seiko.imageloader.component.fetcher.BitmapFetcher
import com.seiko.imageloader.component.fetcher.ByteArrayFetcher
import com.seiko.imageloader.component.fetcher.OkioPathFetcher
import com.seiko.imageloader.component.mapper.StringToUriMapper
import com.seiko.imageloader.component.mapper.UriToPathMapper
import com.seiko.imageloader.util.defaultFileSystem
import okio.FileSystem

fun ComponentRegistryBuilder.setupBase64Components() {
    add(Base64Fetcher.Factory())
}

fun ComponentRegistryBuilder.setupCommonComponents(fileSystem: FileSystem? = defaultFileSystem) {
    add(StringToUriMapper())
    add(UriToPathMapper())
    add(BitmapFetcher.Factory())
    add(ByteArrayFetcher.Factory())
    if (fileSystem != null) {
        add(OkioPathFetcher.Factory(fileSystem))
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy