TextFieldBoxes
TextFieldBoxes copied to clipboard
Keyboard appears after tapping editText twice.
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes android:id="@+id/text_field_boxes1" android:layout_width="match_parent" android:layout_height="wrap_content" app:labelText="Title" app:maxCharacters="20">
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext"
android:inputType="text"
android:maxLines="1"
android:text="@string/title" />
</studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
I'm also facing the same issue
I updated the following code in the TextFieldBoxes.java, now its working fine
this.editText.setDefaultOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean b) {
if (b){
setHasFocus(true);
inputMethodManager.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
mainBody.performClick();
}
else setHasFocus(false);
}
});
I have this issue as well.
Thanks to @rohitshahane93 for the workaround. It's also possible to extend TextFieldBoxes
like so:
class FixedTextFieldBoxes @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : TextFieldBoxes(context, attrs) {
override fun onFinishInflate() {
super.onFinishInflate()
editText.setOnFocusChangeListener { view, hasFocus ->
setHasFocus(hasFocus)
if (hasFocus) {
inputMethodManager.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT)
[email protected]()
}
}
}
}
Thanks to @rohitshahane93 for the workaround. It's also possible to extend
TextFieldBoxes
like so:class FixedTextFieldBoxes @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null ) : TextFieldBoxes(context, attrs) { override fun onFinishInflate() { super.onFinishInflate() editText.setOnFocusChangeListener { view, hasFocus -> setHasFocus(hasFocus) if (hasFocus) { inputMethodManager.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT) [email protected]() } } } }
Hello i have same problem and i can't change the source code, could you write your example in java please?