Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 783 Bytes

README.md

File metadata and controls

29 lines (23 loc) · 783 Bytes

Fresco-Cronet

Using Cronet as Fresco network request library

Get

implementation("io.github.limuyang2:fresco-cronet:1.0.1")

Usage example:

    // 1.Create CronetEngine
    val cronetEngine = CronetEngine.Builder(applicationContext)
    // ... other config
    .build()

    // 2.Create CronetNetworkFetcher. 
    // The second parameter is the thread pool, If not parameter, the default is used
    val networkFetcher = CronetNetworkFetcher(cronetEngine, Dispatchers.IO.asExecutor())

    // Fresco config
    val config = ImagePipelineConfig.Builder(this)
        .setNetworkFetcher(networkFetcher)
    .build()

    // 3.init Fresco
    Fresco.initialize(this, config)