1 verticalLayout { 2 textView("注册") { 3 textSize = dip(22).toFloat() 4 textColor = Color.BLUE 5 gravity = Gravity.CENTER_HORIZONTAL 6 } 7 editText { 8 hint = "请输入姓名" 9 } 10 11 // 水平线性布局 12 linearLayout { 13 t
editText { hint ="Name" textSize =24f }.textChangedListener { onTextChanged { str, _, _, _ -> println(str) } } editText { hint ="Password" textSize =24f }.textChangedListener { onTextChanged { str, _, _, _ -> println(str) } } button("跳转到其它界面") { textSize =26f ...
<style name="simple_button_grey" parent="simple_button"> <item name="android:background"> @drawable/selector_button_grey</item> </style> <style name="edit_text_transparent"> <item name="android:textSize">14sp</item> <item name="android:padding">19dp</item> <item name="android:textC...
selector("Where are you from", countries) { ds, i -> toast("So you're living in ${countries[i]},right?") } } private fun makeAndShowDialog() { alert("this is the msg") { customTitle { verticalLayout { imageView(R.mipmap.ic_launcher) editText { hint = "hint_title" } } } ...
verticalLayout { var title = editText { id = R.id.todo_title hintResource = R.string.title_hint } button { textResource = R.string.add_todo onClick { view -> { // do something here title.text = "Foo" } } } } 可以看到 DSL 的一个主要优点在于,它需要很少的时间即可理解和传达某个...
alert { customView { editText() } }.show() Selectors selector() shows an alert dialog with a list of text items: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 val countries = listOf("Russia", "USA", "Japan", "Australia") selector("Where are you from?", countries, { dialogIn...
val password = editText() name.hint = "请输入账号" password.hint = "请输入密码" button("登录") { onClick { toast("登录成功") } } } 我们来运行看一下 b.Intent 优化 intent跳转也相对的简化了 //需要设置FLAG startActivity(intentFor<FirstActivity>("id" to 5).singleTop()) ...
You can group multiple views into a List or array. @BindViews({R.id.first_name,R.id.middle_name,R.id.last_name}) List<EditText> nameViews; The apply method allows you to act on all the views in a list at once. ButterKnife.apply(nameViews, DISABLE); ...
contentEditText = editText { hint ="what's going on..."setHorizontallyScrolling(false) }.lparams(width = matchParent) {// height = matchParenttopMargin = dip(5) } button(R.string.button_select_time) { gravity = Gravity.CENTER
Show comments Edit file Delete file Binary file not shown. 1 change: 1 addition & 0 deletions 1 app/release/output.json Show comments Edit file Delete file This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, ope...