8

So, I want to create a responsive Login Screen for my app, that would adjust itself with my choice when the android softkeyboard gets visible.

My Research:

Note: I know android:windowSoftInputMode="adjustResize" this already so please don't suggest this only.

I have gone through a number of famous android apps like facebook etc. just to confirm weather it is a limitation to adjust screen with choice when softkeyboard gets visible.

Then I get across with Dropbox android app on my Samsung galaxy tab 2 which is a xlarge screen. Now, when I tried to enter the email the screen adjusted itself in a very smooth and responsive manner. Similarly when I tried to enter the password then again the same thing happened. But I couldn't find any other opensource project which confirms such responsivity when softkeyboard appears.

Below are the screens which explain what I want to achieve in a similar fashion:

Please excuse me for the large sizes of images as I want to make my point clear. :)

  • Login screen without keyboard

Login screen without keyboard

  • Login screen when email edittext is pressed

Login screen when email edittext is pressed

  • Login screen when password edittext is pressed

Login screen when password edittext is pressed

Please note the responsiveness of screens. If you have the app installed. Also there is a size difference between password and email screens below.

0

3 Answers 3

5

The effect you're trying to achieve can done by setting android:scaleType="fitXY" on an ImageView background.

Edit- also you might want to set in your manifest

<activity name=".YourActivity"
    android:windowSoftInputMode="stateVisible|adjustResize">
</activity>
9
  • but how could I use it when keyboard appears on screen?
    – Prateek
    Commented Apr 2, 2013 at 12:59
  • But I have already set stateHidden as I only want the softkeyboard to appear when the activity created.
    – Prateek
    Commented Apr 2, 2013 at 13:01
  • Ok, I am using your answer with android:windowSoftInputMode="stateHidden|adjustResize".
    – Prateek
    Commented Apr 2, 2013 at 13:03
  • This is not making a difference to my layout as the edittext is there in the bottom of the screen.
    – Prateek
    Commented Apr 2, 2013 at 13:05
  • when I put focus on the edittext that is similar to the password screen above then the keyboard overlays 1/5th of editext and it looks less intuitive.
    – Prateek
    Commented Apr 2, 2013 at 13:12
1

Right of the top I can think of using a LinearLayout with weights so that the widgets stretch appropriately. Use WRAP_CONTENT for the heights of all the text widgets, and fill the remaining width with the ImageButton by setting the width = 0dp and layout_weight = 1.

1
  • Can you help it with some opensource project?
    – Prateek
    Commented Apr 9, 2013 at 10:28
1
android:windowSoftInputMode="stateHidden|adjustResize"

Here is complete design of login screen:

http://www.androidhive.info/2011/10/android-login-and-registration-screen-design/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.