Claus Holst
Claus Holst
An alternative is to automatically cast to the receiver type: ```kotlin @Suppress("UNCHECKED_CAST") fun ViewGroup.inflate(@LayoutRes layoutRes: Int, attachToRoot: Boolean = true): T = LayoutInflater.from(context).inflate(layoutRes, this, attachToRoot) as T ```
It would be consistent with what was done for findViewById: https://developer.android.com/about/versions/oreo/android-8.0-changes.html#fvbi-signature
I am using: ``` implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" implementation 'com.google.android.libraries.tv:companionlibrary:0.2' implementation 'com.google.android.exoplayer:exoplayer:r2.5.1' //implementation project(':exoplayer-lib') //implementation project(':exoplayer-library') implementation 'org.jetbrains.anko:anko-sdk15:0.10.1' implementation 'com.github.bumptech.glide:glide:4.2.0' implementation "com.github.bumptech.glide:okhttp3-integration:4.2.0" implementation 'com.squareup.okhttp3:okhttp:3.9.0' implementation "com.android.support:design:$supportLibVersion" implementation "com.android.support:support-v4:$supportLibVersion" implementation "com.android.support:recyclerview-v7:$supportLibVersion" implementation 'com.android.support.constraint:constraint-layout:1.0.2'...
I guess the first step is to start using the Kotlin equivalent of the Java libs. E.g. java.util.concurrent.TimeUnit can be replaced with kotlin.time.Duration in Cache.Builder. But Duration is experimental and...
I did try kotlin.time on the Cache and tests yesterday, so I can create a PR with those changes.