how to make ScrollView for the whole layout? - android-layout

I want to add Scroll View to this layout, but don't know how? When i add scrollview to the whole layout, the size of each relative layout increases and the second relative layout is so long. I want both the layout to fit the screen perfectly.
activity_main.xml
<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"
tools:context="com.example.android.ridhwan.MainActivity"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ViewFlipper
android:id="#+id/viewflipper2"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/main1"
android:scaleType="centerCrop" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/main2"
android:scaleType="centerCrop" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/masjid"
android:scaleType="centerCrop" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/main3"
android:scaleType="centerCrop" />
</ViewFlipper>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="DUBAI"
android:textSize="40sp"
android:textColor="#ffffff"
android:id="#+id/dubaibutton"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:clickable="true"
android:background="#49000000"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<ViewFlipper
android:id="#+id/viewflipper3"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/india1"
android:scaleType="centerCrop" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/india2"
android:scaleType="centerCrop" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/india3"
android:scaleType="centerCrop" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/india"
android:scaleType="centerCrop" />
</ViewFlipper>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="INDIA"
android:textSize="40sp"
android:textColor="#ffffff"
android:id="#+id/indiabutton"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:clickable="true"
android:background="#49000000"
/>
</RelativeLayout>
</LinearLayout>

Related

Layouts not visible despite the views being set to VIEW.VISIBLE

I have a working map fragment with a working navigation drawer in it.The 2 linear layouts are not visible despite being set to visible in the xml.Kind give me some help.what would be hiding those layouts?Where can i place for them to work.
I have tried a few solutions on line but none seemed to do the trick for me.
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:orientation="vertical"
android:padding="5dp"
android:weightSum="0">
<Button
android:id="#+id/CanelRide"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Cancel Ride"
android:visibility="visible" />
</LinearLayout>
<LinearLayout
android:id="#+id/customerInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#color/white"
android:orientation="horizontal"
android:padding="10dp"
android:visibility="visible">
<ImageView
android:id="#+id/customerProfileImage"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="5dp"
android:padding="20sp"
android:src="#drawable/mainicon" />
<TextView
android:id="#+id/customerName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:layout_marginTop="2dp"
android:gravity="left"
android:paddingBottom="3dp"
android:paddingLeft="5dp"
android:paddingRight="3dp"
android:text="Both Names"
android:textColor="#color/black"
android:textSize="19dp" />
</LinearLayout>
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<android.support.design.widget.NavigationView
android:id="#+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="#layout/driver_nav_header"
app:menu="#menu/driver_menu">
</android.support.design.widget.NavigationView>
<android.support.design.widget.AppBarLayout
android:id="#+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/black">
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.design.widget.AppBarLayout>
</android.support.v4.widget.DrawerLayout>
Try to use the below layout, I have changed frame layout as child & drawer layout as parent
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<FrameLayout
android:id="#+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:orientation="vertical"
android:padding="5dp"
android:weightSum="0">
<Button
android:id="#+id/CanelRide"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Cancel Ride"
android:visibility="visible" />
</LinearLayout>
<LinearLayout
android:id="#+id/customerInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#color/white"
android:orientation="horizontal"
android:padding="10dp"
android:visibility="visible">
<ImageView
android:id="#+id/customerProfileImage"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="5dp"
android:padding="20sp"
android:src="#drawable/mainicon" />
<TextView
android:id="#+id/customerName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:layout_marginTop="2dp"
android:gravity="left"
android:paddingBottom="3dp"
android:paddingLeft="5dp"
android:paddingRight="3dp"
android:text="Both Names"
android:textColor="#color/black"
android:textSize="19dp" />
</LinearLayout>
<android.support.design.widget.NavigationView
android:id="#+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="#layout/driver_nav_header"
app:menu="#menu/driver_menu"/>
<android.support.design.widget.AppBarLayout
android:id="#+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/black"/>
</FrameLayout>
</android.support.v4.widget.DrawerLayout>

Gravity in LinearLayout - android?

I created bellow Layout :
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/relativeStart"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/back"
tools:context=".SongsActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/header"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#null"
android:src="#drawable/felesh_m" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal|center_vertical"
android:gravity="center_horizontal|center_vertical"
android:orientation="vertical">
<ImageButton
android:id="#+id/imbCenter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:background="#null"
android:src="#drawable/hosein_hlarge" />
</LinearLayout>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#null"
android:src="#drawable/felesh_m" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4" />
</LinearLayout>
</RelativeLayout>
See bellow Image :
Change your layout like this. You don't need to take multiple Linear Layouts. That is bad for performance. So I have changed it to single Linear Layout with some Weight properties.
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/relativeStart"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/common_ic_googleplayservices">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/common_ic_googleplayservices"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:orientation="horizontal">
<ImageButton
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:background="#null"
android:src="#drawable/common_ic_googleplayservices" />
<ImageButton
android:id="#+id/imbCenter"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:background="#null"
android:src="#drawable/common_ic_googleplayservices" />
<ImageButton
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:background="#null"
android:src="#drawable/common_ic_googleplayservices" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4" />
</LinearLayout>
</RelativeLayout>

How can I design an activity with this apparence which work on any device with any resolution

I want to design a software which is work on any device with any screen-resolution.
would you help me?
I used android:layout_weight but it made me crazy
If you have any other suggestion, please tell me.
This is the XML code but is tooooo long.
<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:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin" tools:context=".TTT">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="#string/Titre2"
android:id="#+id/txtTitre2"
android:layout_alignParentStart="false"
android:layout_alignParentTop="false"
android:layout_alignParentBottom="false"
android:layout_alignParentRight="true"
android:layout_alignParentLeft="true"
android:gravity="center"
android:textColor="#000000"
android:textStyle="bold"
android:textSize="16sp"
android:textIsSelectable="false"
android:layout_weight="1" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/textView"
android:layout_below="#+id/txtTitre2"
android:textSize="16sp"
android:layout_weight="1" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/B0"
android:layout_row="0"
android:layout_column="0"
android:layout_weight="1"/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/B1"
android:layout_row="0"
android:layout_column="1"
android:layout_weight="1"/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/B2"
android:layout_row="0"
android:layout_column="2"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/B3"
android:layout_row="1"
android:layout_column="0"
android:layout_weight="1"/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/B4"
android:layout_row="1"
android:layout_column="1"
android:layout_weight="1"/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/B5"
android:layout_row="1"
android:layout_column="2"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/B6"
android:layout_row="2"
android:layout_column="0"
android:layout_weight="1"/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/B7"
android:layout_row="2"
android:layout_column="1"
android:layout_weight="1"/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/B8"
android:layout_row="2"
android:layout_column="2"
android:layout_weight="1"/>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="#+id/textView5"
android:layout_weight="2"/>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceSmall"
android:id="#+id/textView7"
android:text="12121212"
android:layout_weight="1" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="#+id/textView6" />
<Button
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="#string/New"
android:id="#+id/button"
android:layout_row="4"
android:layout_column="2"
android:onClick="newGame" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="#+id/textView8"
android:layout_weight="3" />
</LinearLayout>
</RelativeLayout>
I solved it.
When we use android:layout_weight=Value we should set the value of android:layout_weight to 0dp if we use vertical linearlayout and
if we use horizontal linearlayout we should set the value of android:layout_height to 0dp
The value of six layout in top should be 1, 1, 3, 1, 1 ,3 respectively.
And for having a distance of 40% from left in 5th layout, we should define it like vertical linearLayout and set the weight of first TextView which is empty to 2 and button 3 and the last Empty TextView 1
I put the XML code which is necessairy
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3">
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2" />
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3" />
</LinearLayout>

Toolbar Showing on load, but dissappearing

My Toolbar shows when loading, but then my mapfragment covers it and it is no longer visible. Here is my layout:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<android.support.v7.widget.Toolbar
android:id="#+id/top_bar"
android:layout_width="match_parent"
android:layout_height="60dp"/>
<fragment
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:name="com.google.android.gms.maps.MapFragment"/>
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:background="#color/white_80_opacity">
<ImageView
android:id="#+id/play_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_play_icon"
android:adjustViewBounds="true"
android:maxHeight="50dp" />
<ImageView
android:id="#+id/reduce_screen_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_fullscreen_exit_48dp"
android:adjustViewBounds="true"
android:maxHeight="50dp"
android:layout_gravity="right"
android:paddingRight="8dp" />
</android.support.v7.widget.Toolbar>
</RelativeLayout>
<ImageView
android:id="#+id/adview"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#708090" />
In code I set the first toolbar:
Toolbar toolbar = (Toolbar) findViewById(R.id.top_bar);
toolbar.setTitle("State College");
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
Any ideas?
I needed to move my Toolbar to the bottom of the layout file. I assume it is like a z-index factor. Here is my updated file.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<fragment
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:name="com.google.android.gms.maps.MapFragment"/>
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:background="#color/white_80_opacity">
<ImageView
android:id="#+id/play_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_play_icon"
android:adjustViewBounds="true"
android:maxHeight="50dp" />
<ImageView
android:id="#+id/reduce_screen_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_fullscreen_exit_48dp"
android:adjustViewBounds="true"
android:maxHeight="50dp"
android:layout_gravity="right"
android:paddingRight="8dp" />
</android.support.v7.widget.Toolbar>
<android.support.v7.widget.Toolbar
android:id="#+id/top_bar"
android:layout_width="match_parent"
android:layout_height="60dp"/>
</RelativeLayout>
<ImageView
android:id="#+id/adview"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#708090" />

keyboard overlap custom edittext

Greetings to all. What time I struggle with the problem. By clicking
on the EditText my keyboard covers half EditText. Tried to put in
Manifest adjustSpan - keyboard covers half EditTekst and adjustResize
- displays the top panel also RelativeLayout. Help solve the problem.
main activity layout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/layout_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/color_background_1">
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/linear_bottom_panel" >
<FrameLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#5c4768" >
</FrameLayout>
<ListView
android:id="#+id/right_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#android:color/darker_gray"
android:dividerHeight="0.1dp"/>
<ListView
android:id="#+id/new_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:choiceMode="singleChoice"
android:divider="#android:color/darker_gray"
android:background="#5c4768"
android:dividerHeight="0.1dp"/>
</android.support.v4.widget.DrawerLayout>
<LinearLayout
android:id="#+id/linear_bottom_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="#color/color_bottom_panel"
android:orientation="horizontal" >
<ImageView
android:id="#+id/image_main_news"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="#drawable/ic_main_news_selector" />
<ImageView
android:id="#+id/image_main_chat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="#drawable/ic_main_chat_selector" />
<ImageView
android:id="#+id/image_main_add_mp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="#drawable/ic_main_add_mp_selector" />
<ImageView
android:id="#+id/image_main_map"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:src="#drawable/ic_main_map_selector" />
<ImageView
android:id="#+id/image_main_user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:src="#drawable/ic_main_user_selector" />
</LinearLayout>
<ProgressBar
android:id="#+id/progress_load"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="invisible"
android:indeterminateDrawable="#drawable/load_progress" />
</RelativeLayout>
this fragment layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/color_background_1" >
<include
android:id="#+id/discus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
layout="#layout/layout_discus_view"
/>
<ListView
android:id="#+id/list_chat"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentLeft="true"
android:layout_below="#+id/discus"
android:layout_above="#+id/add_message"
android:listSelector="#drawable/listview_item_selector"
>
</ListView>
<include
android:id="#+id/add_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
layout="#layout/layout_add_new_message"
/>
</RelativeLayout>
where adjustSpan layout #+id/add_message keyboard overlap

Resources