I am trying to create a multiline EditText by code. This is what I use:
EditText txt = new EditText(this);
lp = new LinearLayout.LayoutParams(LayoutParam
On my phone, changing imeOptions and inputType does nothing; setting movementMethod and/or scrollBarStyle will screw the component so badly so that the user will be unable to select any text; isVerticalScrollBarEnabled and isHorizontalScrollBarEnabled does nothing; the best I could do is to use
txt.setSingleLine(false);
(txt.setImeOptions(EditorInfo.IME_FLAG_NO_ENTER_ACTION);
seems to be unnecessary) but that won't display any scrollbars in the god-damn EditText. Ultimately I gave up and I'm inflating a layout snippet anytime I need a multi-line EditText. Here's the layout:
And here's Anko snippet:
fun ViewManager.multiLineEditText(@StyleRes theme: Int = 0, init: EditText.() -> Unit): EditText = ankoView(
{ ctx -> ctx.layoutInflater.inflate(R.layout.util_multilineedittext, this@multiLineEditText as ViewGroup, false) as EditText }, theme, init)
Development on Android sucks so hard.