1

I have footer bar in my activity. I used fragment for footer bar. here is screen shot. screen_1. When I add the text into the EditText, the keyboard show like this. screen_2. I would like to hide the footer when the keyboard appear. I used android:windowSoftInputMode="adjustPan" in activity. I would like to know any suggestion.

Thanks.

user1156041
  • 2,155
  • 5
  • 24
  • 54
  • Add `onTouchListener` to the `EditText` and when touched, hide the footer programmatically (`setVisibility = "GONE"`). If you can't manage to do it, let me know and paste the XML of this layout. – g00dy Jul 19 '13 at 09:21
  • Yes. it's ok using `onTouchListener`. But when the keyboard hide, the footer should be shown again. – user1156041 Jul 19 '13 at 09:28
  • The keyboard hides on which event? I would guess when the Enter key is pressed - right (or the arrow down)? You can detect those easily, try it in google I immediatley found tons of examples for detecting those events. – g00dy Jul 19 '13 at 09:30
  • Could u please give me example of usage? I found this http://stackoverflow.com/q/16159802/1156041 question but no suitable answer. – user1156041 Jul 19 '13 at 09:59
  • Ok, I didn't find anything regarding this button in particular, but here's what you can do: `public boolean onKey(View v, int keyCode, KeyEvent event) { //Log the keyCode and the KeyEvent here, return with the results return true; }` After the log you did, please return with the results of it and will post a complete answer. – g00dy Jul 19 '13 at 10:33
  • Thank you for reply. The result is nothing. I haven't got key code when I touch arrow down. I have no idea why? When I touch other key, I got key code. – user1156041 Jul 19 '13 at 10:57
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/33764/discussion-between-user1156041-and-g00dy) – user1156041 Jul 19 '13 at 11:03
  • I found suitable solution for me here http://stackoverflow.com/a/8827112/1156041. Thanks. – user1156041 Jul 19 '13 at 12:06

3 Answers3

1

i have faced same situation, and dont have finded any solution,so just started another activity on touch of textview. on completion of activity again in this activity gotted result back from the textview of next activity and placed the text in current activity's textview. it works

0

i got the same problem i just removed android:windowSoftInputMode="adjustPan" from my manifest file and i got the desired output

Ruban
  • 1,514
  • 2
  • 14
  • 21
-1
var originalHeight = document.documentElement.clientHeight;
var originalWidth = document.documentElement.clientWidth;
$(window).resize(function() {
    // Control landscape/portrait mode switch
    if (document.documentElement.clientHeight == originalWidth &&
         document.documentElement.clientWidth == originalHeight) {
        originalHeight = document.documentElement.clientHeight;
        originalWidth = document.documentElement.clientWidth;
    }`enter code here`
    // Check if the available height is smaller (keyboard is shown) so we hide the footer.
   if (document.documentElement.clientHeight < originalHeight) {
       $('.footer').hide();
   } else {
       $('.footer').show();
   }
});

try this it will work and  give  class="footer"