Using Cronet as Fresco network request library
implementation("io.github.limuyang2:fresco-cronet:1.0.1")
// 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)