ArgumentDelegate
Property binding for Android Bundle arguments.
Install / Use
/learn @idapgroup/ArgumentDelegateREADME
Argument Delegate
Property binding for Android Bundle arguments. Written for simple bundle unpacking for Kotlin users.
Download
Add repository to your root build.gradle
repositories {
jcenter()
}
dependencies {
implementation 'com.idapgroup:argument-delegate:latest-version'
}
Usage sample
class ExampleActivity : Activity {
val userName: String by argumentDelegate()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// your activity setup code
Log.d("ExampleActivity", "userName - $userName")
}
}
Remember: Bundled argument name must have the same name as property have. For current example:
val bundle = Bundle().apply {
putString("userName", "John")
}
Additional info
argumentDelegate is an extension function for Fragment and Activity. If you want to use it out of the Activity/Fragment then you should implement argumentWrapper block. Example:
class Example {
private lateinit var bundle: Bundle
private val wrapper = { a: Example -> a.bundle }
val userName: String by argumentDelegate(wrapper)
}
Related Skills
node-connect
352.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
