I am currently using Material Design TextInputLayout OutlinedBox as shown below:
I solved my problem using this: in XML:
in code:
layout.keyListener=null ArrayAdapter(it, android.R.layout.simple_list_item_1, list).also { adapter -> layout.setAdapter(adapter) }
Credits:How to make EditText not editable through XML in Android?