/argument

通过 Kotlin 委托属性获取 Activity/Fragment 的参数

Primary LanguageKotlinApache License 2.0Apache-2.0

Argument

通过 Kotlin 委托属性获取 Activity/Fragment 的参数。

支持数据类型: Int/Long/Float/String/Boolean/Parcelable

获取时会偿试转换,转换失败时返回指定的默认值

Gradle

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()  
}

LICENSE

The Component is open-sourced software licensed under the Apache license.