Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropbox like login?

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.

like image 249
Prateek Avatar asked Apr 02 '13 12:04

Prateek


2 Answers

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>
like image 119
Brian Melton-Grace - MSFT Avatar answered Sep 28 '22 11:09

Brian Melton-Grace - MSFT


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.

like image 25
f2prateek Avatar answered Sep 28 '22 11:09

f2prateek