Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook LoginActivity is not shown properly

I have an application that uses Facebook login. I have the FacebookSDK and I use com.facebook.LoginActivity.

The problem is that on 10" tablets the activity is not shown properly when the softkeybord is shown. I'm using a Samsung Galaxy Tab 2 (10.1) (OS 4.0.2).

This is what I see after clicking on one EditText in the Facebook LoginActivity:

enter image description here

In the manifest file I have:

<activity
    android:name="com.facebook.LoginActivity"
    android:windowSoftInputMode="adjustResize"
    android:theme="@android:style/Theme.Translucent.NoTitleBar"
    android:label="@string/app_name" >
</activity>

Is anyone else having this problem too? Is anyone using LoginActivity without having problems?

Is there anything else I need to do?

And why does not the Facebook activity take the full screen ?

like image 247
kingston Avatar asked Jan 13 '23 03:01

kingston


1 Answers

The quick fix will require you to modify the SDK code.

Look in the WebDialog.java file, in the onCreate() method, after the super.onCreate() call, add this:

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

This will pan the soft keyboard over top of the dialog. If that's still not enough, then you might want to play around with the margins in the getMargins() method. In the worst case, you can just have getMargins return:

return new Pair<Integer, Integer>(1, 1);
like image 70
Ming Li Avatar answered Jan 19 '23 07:01

Ming Li