I have a fragment for user input,when the keyboard appears my fragment screen is shifting even above status bar and tool bar.
Without keyboard - https://www.dropbox.com/s/51gygn8z768bkp0/Screenshot_2015-10-01-15-26-37.png?dl=0
With Keyboad - https://www.dropbox.com/s/z88pegbn7a0qoht/Screenshot_2015-10-01-15-26-44.png?dl=0
screen shot of this problem can be seen in above share image urls. I am trying to use Translucent screen for app.
My activity layout is -
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!--<LinearLayout
android:id="@+id/container_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">-->
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<!-- </LinearLayout>-->
<FrameLayout
android:id="@+id/container_body"
android:layout_width="fill_parent"
android:layout_height="match_parent" />
</LinearLayout>
<fragment
android:id="@+id/fragment_navigation_drawer"
android:name="com.pace.automate.fragment.FragmentDrawer"
android:layout_width="@dimen/nav_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="@layout/fragment_navigation_drawer"
tools:layout="@layout/fragment_navigation_drawer" />
and the theme i am using for app is
<style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:typeface">monospace</item>
</style>
and tool bar is like -
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
local:popupTheme="@style/ThemeOverlay.AppCompat.Light"
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
which has the property fitsSystemWindows =true. but layout is shifting up,even i have tried to put fragment layout inside the scroll view and set the android:windowSoftInputMode="adjustPan" in manifest for this activity.but still screen it pushing upside when keyboard appears. my fragment layout is like
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:customAttrs="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp">
<com.pace.automate.Utils.CustomFonts
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:text="Please fill the Details"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#898989"
customAttrs:customFont="regular" />
<EditText
android:id="@+id/amount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/title"
android:layout_centerHorizontal="true"
android:layout_marginTop="12dp"
android:background="@android:color/transparent"
android:drawableBottom="@drawable/log_entry_keyline"
android:drawableLeft="@drawable/log_entry_icn_amount"
android:drawablePadding="7dp"
android:ems="10"
android:hint="Amount"
android:inputType="numberDecimal"
android:padding="4dp">
<requestFocus />
</EditText>
<EditText
android:id="@+id/odometer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/amount"
android:layout_marginTop="12dp"
android:background="@android:color/transparent"
android:drawableBottom="@drawable/log_entry_keyline"
android:drawableLeft="@drawable/log_entry_icn_odometer"
android:drawablePadding="7dp"
android:ems="10"
android:hint="Odometer Reading"
android:inputType="number"
android:padding="4dp">
</EditText>
<EditText
android:id="@+id/liters"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/odometer"
android:layout_marginTop="12dp"
android:background="@android:color/transparent"
android:drawableBottom="@drawable/log_entry_keyline"
android:drawableLeft="@drawable/measurement_volume_icon"
android:drawablePadding="7dp"
android:ems="10"
android:hint="Liters"
android:inputType="numberDecimal"
android:padding="4dp" />
<TextView
android:id="@+id/calendar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/liters"
android:layout_marginTop="12dp"
android:drawableBottom="@drawable/log_entry_keyline"
android:drawableLeft="@drawable/log_entry_icn_calendar"
android:drawablePadding="7dp"
android:ems="10"
android:hint="Date"
android:inputType="date"
android:padding="4dp"
android:textSize="16dp" />
<CheckBox
android:id="@+id/fulltank"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/calendar"
android:layout_marginLeft="35dp"
android:layout_marginTop="20dp"
android:button="@drawable/custom_chekbox_fuel_enter"
android:paddingLeft="4dp"
android:text="Full Tank" />
<CheckBox
android:id="@+id/partialtank"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/fulltank"
android:layout_alignBottom="@+id/fulltank"
android:layout_alignParentRight="true"
android:layout_marginRight="35dp"
android:button="@drawable/custom_chekbox_fuel_enter"
android:checked="true"
android:paddingLeft="4dp"
android:text="Partial Tank" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/partialtank"
android:layout_marginTop="12dp">
<com.pace.automate.Utils.CustomAutoComplete
android:id="@+id/tag_station"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/pb_loading_indicator"
android:background="@android:color/transparent"
android:drawableBottom="@drawable/log_entry_keyline"
android:drawableLeft="@drawable/log_entry_icn_tag_station"
android:drawablePadding="7dp"
android:ems="10"
android:hint="Tag your Fuel station"
android:padding="4dp" />
<ProgressBar
android:id="@+id/pb_loading_indicator"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical|right"
android:layout_marginRight="2dp"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
<Button
android:id="@+id/saveFuelLogs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="12dp"
android:background="#4cc1bb"
android:text="Save"
android:textColor="#fff"
android:textSize="@dimen/button_text_size" />
</RelativeLayout>
please help me in this ,It's seems very basic mistake i am doing here but couldn't able to short it out.
Toolbar overlapping below status bar
Fragment overlaps my AppCompat toolbar
tried similar kind of above suggestion but still no solution found.
also manifest have android:windowSoftInputMode="adjustPan" for this activity.