0

I have AdjustPan on all my layouts set as:

<style name="AppTheme" parent="AppBaseTheme">


    <item name="android:windowActionBar">false</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowSoftInputMode">adjustPan</item>
</style>

But there is one layout that contains a couple of static fragments where if I click the textbox inside the fragment, the background image resizes and the views that are aligned to the parents bottom go up.

I tried to set the manifest to:

<activity
        android:name=".CaptureVisitActivity"
        android:label="@string/title_activity_capture_visit"
        android:windowSoftInputMode="adjustPan" >

But again, the window is resized.

This is the layout:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background_landscape"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".CaptureVisitActivity" >

    <TextView
        android:id="@+id/tv_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:text="@string/title_activity_capture_visit"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/tv_title"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="90dp"
        android:baselineAligned="false" >

        <ScrollView
            android:id="@+id/sv1"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.3" >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

                <fragment
                    android:id="@+id/frag_summary"
                    android:name="com.vancert.activities.CaptureVisitActivity$JobSummaryFragment"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    tools:layout="@layout/fragment_job_summary" />

                <fragment
                    android:id="@+id/frag_further_work"
                    android:name="com.vancert.activities.CaptureVisitActivity$JobFurtherWorkFragment"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    tools:layout="@layout/fragment_further_work" />
            </LinearLayout>
        </ScrollView>

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.3"
            android:orientation="vertical" >

            <fragment
                android:id="@+id/fragment1"
                android:name="com.vancert.activities.CaptureVisitActivity$JobReportsFragment"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                tools:layout="@layout/fragment_job_reports" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.3"
            android:orientation="vertical" >

            <FrameLayout
                android:id="@+id/container_job_appliances"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" >
            </FrameLayout>
        </LinearLayout>
    </LinearLayout>

    <include
        android:layout_width="match_parent"
        android:layout_height="90dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        layout="@layout/layout_footer" />

</RelativeLayout>

and the fragment_job_summary is:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/textView2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/summary"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/tv_summary"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/activity_horizontal_margin"
            android:layout_marginStart="@dimen/activity_horizontal_margin" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/ll_comment"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/engineer_notes_label" />

            <Button
                android:id="@+id/btn_fast_text"
                android:layout_width="wrap_content"
                android:layout_height="40dp"
                android:layout_marginLeft="10dp"
                android:layout_marginStart="10dp"
                android:background="@drawable/background_button4"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:text="@string/fasttext" />
        </LinearLayout>

        <EditText
            android:id="@+id/et_eng_notes"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:inputType="textMultiLine"
            android:maxLines="3" >
        </EditText>
    </LinearLayout>

</LinearLayout>

Any suggestions?

Vancert Staff
  • 205
  • 1
  • 3
  • 12

1 Answers1

1

Im terribly sorry. I just didn't google enough.

Refer to: EditText, adjustPan, ScrollView issue in android

It has the answer to this problem.

Community
  • 1
  • 1
Vancert Staff
  • 205
  • 1
  • 3
  • 12