cavallo
cavallo

Reputation: 4414

When in Full Screen the layout does not move to y position android

I am trying to move my layout up when soft keyboard is shown, but the layout does not move when in full screen that is

when i say  this.requestWindowFeature(Window.FEATURE_NO_TITLE);

but i remove the above line the layout moves up to an desired position,

  @Override
public void onSoftKeyboardShown(boolean isShowing) {

    Display  display= ((WindowManager)  getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
    //int width = display.getWidth(); 
    int height = display.getHeight(); 
    if(height <= 900){
    if(isShowing){
        keyboard.scrollTo(0, 150);

    }else {
        keyboard.scrollTo(0, 0);
    } 


}

and the xml layout is

<net.trellisys.keyboard.DetectsSoftKeyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rellayoutlogin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_tablet"
android:orientation="vertical" >

<ImageButton
    android:id="@+id/btnSettings"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_margin="5dp"
    android:background="#66FFA500"
    android:padding="5dp"
    android:src="@drawable/settings" />

<ImageView
    android:id="@+id/ivHeader"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:background="@android:color/transparent"
    android:paddingTop="45dp"
    android:src="@drawable/papyrus_logo_small" />

<LinearLayout
    android:id="@+id/lluserdata"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/ivHeader"
    android:layout_centerHorizontal="true"
    android:layout_marginLeft="30dp"
    android:layout_marginRight="30dp"
    android:layout_marginTop="35dp"
    android:background="@drawable/curvedwhiteborder"
    android:orientation="vertical" >

    <EditText
        android:id="@+id/txtUsername"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:background="@android:color/transparent"
        android:hint="Email ID"
        android:inputType="textEmailAddress"
        android:minHeight="50dp"
        android:minWidth="500dp"
        android:paddingLeft="5dp" >

        <requestFocus />
    </EditText>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="1dp"
        android:background="#CCCCCC" />

    <EditText
        android:id="@+id/txtPassword"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/txtUsername"
        android:layout_centerHorizontal="true"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:background="@android:color/transparent"
        android:hint="Password"
        android:inputType="textPassword"
        android:minHeight="50dp"
        android:minWidth="500dp"
        android:paddingLeft="5dp" />
</LinearLayout>

<CheckBox
    android:id="@+id/cbRememberMe"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/ivHeader"
    android:layout_below="@+id/lluserdata"
    android:checked="false"
    android:text="Remember me" />

<ImageButton
    android:id="@+id/btnLogin"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/cbRememberMe"
    android:layout_centerHorizontal="true"
    android:layout_gravity="center_horizontal"
    android:layout_marginLeft="30dp"
    android:layout_marginRight="30dp"
    android:layout_marginTop="15dp"
    android:minHeight="50dp"
    android:minWidth="500dp"
    android:text="Login"
    android:textColor="#000000"
    android:textStyle="bold" />

Upvotes: 0

Views: 806

Answers (3)

user1010572
user1010572

Reputation: 479

Try putting your layout in a scroll view, and give it layout_width="fill_parent" and layout_height="fill_parent"

Also Add the following attribute to your mnaifest file in the

Upvotes: 1

Kuffs
Kuffs

Reputation: 35651

You should not need to do this manually. Add WindowSoftInputMode:AdjustPan to your manifest as described in this post

Upvotes: 2

Raj
Raj

Reputation: 1872

That is the issue in android. If you are in Full Screen mode and soft keypad is opened the the view will not scroll.

Upvotes: 1

Related Questions