Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard appears after tapping editText twice. #84

Open
Zayed007 opened this issue Jul 15, 2018 · 5 comments
Open

Keyboard appears after tapping editText twice. #84

Zayed007 opened this issue Jul 15, 2018 · 5 comments

Comments

@Zayed007
Copy link

<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>
@PemmasaniRajesh
Copy link

I'm also facing the same issue

@rohitshahane93
Copy link

rohitshahane93 commented Feb 14, 2019

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);
}
});

@thevoiceless
Copy link

I have this issue as well.

@thevoiceless
Copy link

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)
                this@FixedTextFieldBoxes.performClick()
            }
        }
    }
}

@miladyalda
Copy link

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)
                this@FixedTextFieldBoxes.performClick()
            }
        }
    }
}

Hello i have same problem and i can't change the source code, could you write your example in java please?

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

No branches or pull requests

5 participants