4

I have an EditText in the bottom of the layout like this image bellow enter image description here

I need exactly 50dp gap between soft-keyboard and edittext when soft-keyboard appears in the screen. The final output will be like this image

enter image description here

How can I achieve this? AdjustPan or AdjustResize in manifest does not give me specific gap.

androidcodehunter
  • 21,567
  • 19
  • 47
  • 70

1 Answers1

1

AdjustResize dynamically calculates the size of each view so that it can fit as much of them as possible into the screen when soft keyboard is visible. The whole point of this is that the developer shouldn't have to worry about the resizing of the views and the relative distance between them. The system will automatically resize the views for you so that the user can see as much of the views as possible.

So, unless you are willing to look at the Android source and figure out a way to override the default behavior (maybe there is a way to subclass input method classes), what you are asking for is not possible.

Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84
  • It is possible in iOS but what about Android. Are you sure that it is not possible? – androidcodehunter Jun 26 '13 at 07:45
  • Firstly, don't compare iOS and Android. iOS uses fixed size devices. All the code is written for specific hardware. It's philosophy is inherently different from android which is meant to run on almost any device you can think of. Dynamic sizes, free flowing layouts etc are of prime importance in android. If you want to fight the framework, you might come up with some hack to achieve this but I don't advise it. If you're asking if there is a public API provided by the SDK to do this, then the answer is no. – Anup Cowkur Jun 26 '13 at 07:50
  • @ Anup Cowkur you are right. I tried it by following this solution http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android but it did not works exactly what I want. Actually my client want this so now what can I do? Is there any possible way to overcome this problem. – androidcodehunter Jun 26 '13 at 08:52
  • You could try explaining to your client that it's a platform limitation and that Android is different from iOS. Or you could try hacking the system somehow as I said earlier. I don't have any ideas about how to do it though. – Anup Cowkur Jun 26 '13 at 08:56
  • Thanks anup for your nice explanation. – androidcodehunter Jun 26 '13 at 09:03