android – Help with EditText and the keyboard that pops it out

Question:

Hello everyone. Such a problem. I use this theme in my app:

<style name="Theme.TransparencyDemo" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:windowTranslucentNavigation">true</item>
    </style>

There is a TextView at the top of the screen and an EditText at the bottom of the screen. I click on EditText and open the keyboard. The EditText is pushed up by the keyboard. this is cool, that's what i want. but the TextView that goes off the top of the screen. I don't want this. I tried to shove all the content that should be spinning in the ScrollView, but when pushed out by the keyboard, the ScrollView itself is pushed out and not scrolled. In general, here is a video of how it works now: video Here is a video from a working project

The question is, how do I get my EditText to be pushed out by the keyboard while the rest of the top content stays in place? or how to padding between the EditText and the keyboard when the EditText is pushed by the keyboard?

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout 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:orientation="vertical"
              android:weightSum="1"
                android:background="#142e06" >


    <TextView
        android:layout_width="100dp"
        android:layout_height="30dp"
        android:text="New Text"
        android:id="@+id/textView"
        android:background="#ff4018"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"/>

    <EditText
        android:layout_width="300dp"
        android:layout_height="wrap_content"
        android:id="@+id/editText"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="150dp"/>

</RelativeLayout>

Here is the manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="ip696.com.skipwhite" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/Theme.TransparencyDemo" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Answer:

I think a replacement would help.

android:windowSoftInputMode="adjustPan"

in manifest on

android:windowSoftInputMode="adjustResize"
Scroll to Top