Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

I cannot set dynamic value to KeyboardButtonView #176

Open
mainaviTech opened this issue May 25, 2018 · 1 comment
Open

I cannot set dynamic value to KeyboardButtonView #176

mainaviTech opened this issue May 25, 2018 · 1 comment

Comments

@mainaviTech
Copy link

mainaviTech commented May 25, 2018

Hi,
Thanks for this superb lib. Its working fine with my application.
I would like to set random key values to the KeyboardButtonView objects so that formation of the keyboard keeps changing every time the user gets back to the app. Unfortunately, its not allowing me to set any value to it like other views.
Could you please guide me on that? Or any suggestion?

@Madina-S
Copy link

Madina-S commented Aug 9, 2019

Try this.

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
for (i in 0 until 10) {
val idStr = String.format(Locale.getDefault(), "pin_code_button_%d", i)
val id = resources.getIdentifier(idStr, "id", packageName)
val button = mKeyboardView.findViewById(id)
val txt = button.findViewById(R.id.keyboard_button_textview)
txt.setText("some random")
}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants