mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
chore: Set default text value to blank
This commit is contained in:
parent
05bbacda19
commit
f74c33107b
1 changed files with 4 additions and 2 deletions
|
@ -23,7 +23,7 @@ class LoadingButtonComposeView @JvmOverloads constructor(
|
||||||
defStyleAttr: Int = 0,
|
defStyleAttr: Int = 0,
|
||||||
) : AbstractComposeView(context, attrs, defStyleAttr) {
|
) : AbstractComposeView(context, attrs, defStyleAttr) {
|
||||||
|
|
||||||
var text by mutableStateOf("placeholder")
|
var text by mutableStateOf("")
|
||||||
private var onClick: () -> Unit = {}
|
private var onClick: () -> Unit = {}
|
||||||
private var isLoading by mutableStateOf(false)
|
private var isLoading by mutableStateOf(false)
|
||||||
|
|
||||||
|
@ -32,7 +32,9 @@ class LoadingButtonComposeView @JvmOverloads constructor(
|
||||||
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnDetachedFromWindowOrReleasedFromPool)
|
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnDetachedFromWindowOrReleasedFromPool)
|
||||||
attrs?.let {
|
attrs?.let {
|
||||||
val arr = context.obtainStyledAttributes(it, R.styleable.LoadingButtonComposeView)
|
val arr = context.obtainStyledAttributes(it, R.styleable.LoadingButtonComposeView)
|
||||||
text = context.getString(arr.getResourceId(R.styleable.LoadingButtonComposeView_android_text, R.string.log_in))
|
arr.getResourceId(R.styleable.LoadingButtonComposeView_android_text, -1).takeIf { it >= 0 }?.let { resId ->
|
||||||
|
text = context.getString(resId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue