通过 Kotlin 委托属性获取 Activity/Fragment 的参数。
支持数据类型: Int/Long/Float/String/Boolean/Parcelable
获取时会偿试转换,转换失败时返回指定的默认值
repositories {
maven { url "https://gitee.com/ezy/repo/raw/cosmo/"}
}
dependencies {
implementation "me.reezy.cosmo:argument:0.8.0"
}
class MainActivity : AppCompatActivity() {
val a by ArgumentString()
val b by ArgumentInt()
val c by ArgumentLong()
val d by ArgumentFloat()
val e by ArgumentBoolean()
}
The Component is open-sourced software licensed under the Apache license.