0

I have made a chat that looks as follows:

enter image description here

Then, when I click on the EditText, the keyboard opens and hides the bottomNavigationView by using:

    final EditText editText = findViewById(R.id.et_Message);
    editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View v, boolean hasFocus) {
            if (!isVisibleWhileSoftKeyboardShowing(editText) && hasFocus) {
                sView.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        //sView.smoothScrollBy(0, 5000);
                        bottomNavigationView.setVisibility(View.GONE);
                    }
                }, 200);
            }
        }
    });

enter image description here

Then, when the user clicked on the arrow to close the keyboard:

I had liked it to show the bottomNavigationView again.

I tried to override onBackPressed() however it doesn't work since it seems like the arrow has a different name.

Any idea how to find when this arrow IsClicked?

Thank you

Community
  • 1
  • 1
Ben
  • 1,737
  • 2
  • 30
  • 61

1 Answers1

0

I have a chat project like you. I added this to activity:

android:windowSoftInputMode="adjustPan"

in the manifest file. Now bottomNavigationView hide and show automatic as you wish.

Kasım Özdemir
  • 5,414
  • 3
  • 18
  • 35
  • It is not what I'm looking mate since I played a lot in order to try hiding it manually. I specifically look for the name of that down arrow button – Ben Mar 22 '20 at 15:21
  • I get it. If you can't find maybe you can look [this](https://stackoverflow.com/a/4365637/8956604). Good luck – Kasım Özdemir Mar 22 '20 at 15:34