Kotlin Parcelable 自动生成配置

@Parcelize注解框架

plugins {
    id 'kotlin-parcelize'
}
import android.os.Parcelable
import kotlinx.parcelize.Parcelize

@Parcelize
data class VideoBean(var url: String?) : Parcelable

ViewBinding

buildFeatures {
    viewBinding = true
}

MVVM 依赖包


// kotlin coroutines + livedata + view model
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'