0

so its a common issue i guess thats why i easily found so many related issues like this , this and i also followed google's android developer's article which is related to my problem. but nothing worked for me , i want to move up my button (which is at the bottom of screen) when keyboard appears
my activist's Xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bgfl"
android:windowSoftInputMode="stateVisible|adjustResize"> // i tried to set the windowSoftInputMode right here  

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#9bef414c">

<EditText
    android:layout_width="wrap_content"
    android:layout_height="40dp"
    android:inputType="textEmailAddress"
    android:ems="10"
    android:id="@+id/editText"
    android:layout_centerVertical="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:background="#ffffff"
    android:hint="Email" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:text="bla bla bla bla bla"
    android:id="@+id/textView6"
    android:layout_above="@+id/editText"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="40dp"
    android:textSize="17sp"
    android:textColor="@color/light_font"
    android:shadowColor="@color/text_shadow"
    android:shadowDx="1"
    android:shadowDy="1"
    android:shadowRadius="8"/>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="BLAAAAAAAAAAAAA"
    android:id="@+id/textView9"
    android:layout_above="@+id/textView6"
    android:layout_centerHorizontal="true"
    android:textAlignment="center"
    android:textIsSelectable="false"
    android:textSize="60sp"
    android:textColor="@color/light_font"
    android:shadowColor="@color/text_shadow"
    android:shadowDx="1"
    android:shadowDy="1"
    android:shadowRadius="8"/>

    <Button
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:text="Next"
        android:id="@+id/button"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:textSize="20sp"
        android:background="#ffffff"
        android:textColor="@color/colorAccent" />

</RelativeLayout>

i also tried to do it programmatically in my activity's class :

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

the above didn't worked too

i also did this in my manifest :

 <myActivity 
 android:windowSoftInputMode="stateVisible|adjustResize">

it didn't worked too.

seems like i'm missing something anyone can point it out to me ??

Community
  • 1
  • 1
remy boys
  • 2,928
  • 5
  • 36
  • 65
  • Keyboard will popup when you click on your text input, so the text input moves up right? what sense does it makes to bring up the entire screen above keyboard? Please explain – Veer3383 Aug 25 '16 at 06:19

2 Answers2

1

add android:fitsSystemWindows="true" in manifest file with activity tag

Rahul
  • 1,380
  • 1
  • 10
  • 24
1
  <activity 
         android:name=".activity.SignUpProfileDetailActivity"
         android:configChanges="orientation|keyboardHidden|screenSize|screenLayout"
         android:screenOrientation="portrait"
         android:windowSoftInputMode="adjustResize|stateAlwaysHidden"/>

And in your parent viewgroup add this,

     <RelativeLayout
           android:id="@+id/relativelayout_root"
           xmlns:android="http://schemas.android.com/apk/res/android"
           xmlns:app="http://schemas.android.com/apk/res-auto"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:fitsSystemWindows="true">
shalini
  • 355
  • 4
  • 17