1 package com.airbnb.lottie.samples 2 3 import androidx.multidex.MultiDexApplication 4 import com.airbnb.lottie.L 5 import com.google.gson.FieldNamingPolicy 6 import com.google.gson.GsonBuilder 7 import okhttp3.OkHttpClient 8 import retrofit2.Retrofit 9 import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory 10 import retrofit2.converter.gson.GsonConverterFactory 11 import java.util.concurrent.TimeUnit 12 13 class LottieApplication : MultiDexApplication() { <lambda>null14 val okHttpClient by lazy { 15 OkHttpClient.Builder() 16 .connectTimeout(30, TimeUnit.SECONDS) 17 .build() } 18 <lambda>null19 val gson by lazy { 20 GsonBuilder() 21 .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) 22 .create() 23 } 24 <lambda>null25 val retrofit by lazy { 26 Retrofit.Builder() 27 .client(okHttpClient) 28 .baseUrl("https://lottiefiles.frb.io/api/v1/") 29 .addConverterFactory(GsonConverterFactory.create(gson)) 30 .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) 31 .build() 32 } 33 <lambda>null34 val lottiefilesService by lazy { retrofit.create(LottiefilesService::class.java) } 35 onCreatenull36 override fun onCreate() { 37 super.onCreate() 38 L.DBG = true 39 } 40 }