Skip to content

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

License

Notifications You must be signed in to change notification settings

czy1121/argument

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages