Place EditText/TextView Over MapView Android - android

I am building an app that needs a mapview and a textview to enable a place/location picker. It is to be like "uber" where the mapview fills the whole screen and then the editext views for choosing a location are superimposed on top of the map view. The issue is that my design xml file places the textviews "behind" the mapview so that they are covered by the map and not visible. How can i do it that they appear over the mapview ; while the mapview still covers 100% of the screen height?. My xml file is shown below:
<?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:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
>
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:textColor="#color/colorPrimary"
android:text="Pickup Location"
android:id="#+id/pickup"
android:textSize="15sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:textColor="#color/colorPrimary"
android:text="Drop Location"
android:id="#+id/drop"
android:textSize="15sp"
android:layout_alignParentLeft="true"
android:layout_below="#id/pickup"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/ride_start"
android:layout_margin="10dp"
android:textSize="15sp"
android:visibility="gone"
android:textColor="#color/colorPrimary"
android:layout_below="#+id/drop"
android:text="Start"/>
</LinearLayout>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="MainActivity"
/>
<LinearLayout
android:layout_width="match_parent"
android:id="#+id/info"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#F8CA2B"
android:gravity="center_vertical" >
<TextView
android:id="#+id/totaldistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:textColor="#000" />
<View
android:layout_width="2dp"
android:layout_height="25dp"
android:layout_marginLeft="10dp"
android:background="#fff" />
<TextView
android:id="#+id/cost"
android:padding="3dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000" />
</LinearLayout>

set map fragement first then overlay of relative layout might be helpful.
<?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:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="MainActivity"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:textColor="#color/colorPrimary"
android:text="Pickup Location"
android:id="#+id/pickup"
android:textSize="15sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:textColor="#color/colorPrimary"
android:text="Drop Location"
android:id="#+id/drop"
android:textSize="15sp"
android:layout_alignParentLeft="true"
android:layout_below="#id/pickup"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/ride_start"
android:layout_margin="10dp"
android:textSize="15sp"
android:visibility="gone"
android:textColor="#color/colorPrimary"
android:layout_below="#+id/drop"
android:text="Start"/>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:id="#+id/info"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#F8CA2B"
android:gravity="center_vertical" >
<TextView
android:id="#+id/totaldistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:textColor="#000" />
<View
android:layout_width="2dp"
android:layout_height="25dp"
android:layout_marginLeft="10dp"
android:background="#fff" />
<TextView
android:id="#+id/cost"
android:padding="3dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000" />
</LinearLayout>

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:circular="http://schemas.android.com/tools"
android:id="#+id/content_frame"
xmlns:app="http://schemas.android.com/apk/res-auto">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/content_frame_child">
<!--Your map fragment-->
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="MainActivity"/>
<!--Your map fragment ends-->
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:id="#+id/info"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#F8CA2B"
android:gravity="center_vertical" >
<TextView
android:id="#+id/totaldistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:textColor="#000" />
<View
android:layout_width="2dp"
android:layout_height="25dp"
android:layout_marginLeft="10dp"
android:background="#fff" />
<TextView
android:id="#+id/cost"
android:padding="3dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000" />
</LinearLayout>
</FrameLayout>
Use frame layout for overlay

Use Following code
<?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:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:orientation="vertical">
<TextView
android:id="#+id/pickup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Pickup Location"
android:textColor="#color/colorPrimary"
android:textSize="15sp" />
<TextView
android:id="#+id/drop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#id/pickup"
android:layout_margin="10dp"
android:text="Drop Location"
android:textColor="#color/colorPrimary"
android:textSize="15sp" />
<TextView
android:id="#+id/ride_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/drop"
android:layout_margin="10dp"
android:text="Start"
android:textColor="#color/colorPrimary"
android:textSize="15sp"
android:visibility="gone" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="MainActivity"
/>
<LinearLayout
android:id="#+id/info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/map"
android:layout_centerHorizontal="true"
android:layout_marginBottom="15dp"
android:background="#F8CA2B"
android:gravity="center_vertical">
<TextView
android:id="#+id/totaldistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:textColor="#000" />
<View
android:layout_width="2dp"
android:layout_height="25dp"
android:layout_marginLeft="10dp"
android:background="#fff" />
<TextView
android:id="#+id/cost"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:textColor="#000" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>

Related

Put a Linearlayout under the ListView

I'm facing problem to put a linearlayout under the listview like what is shown in this image link:
I want the layout with the Add icon and text:"Add New Members" to be displayed under the listview. What am I doing wrong? Pls help me to solve the problem. Thank you very much.
This is the xml file for the layout
<LinearLayout 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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
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="com.thomasbrown.myapplication.MemberActivity"
android:background="#android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/groupID"
android:textSize="20sp"
android:layout_marginBottom="15dp" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ListView
android:id="#+id/ListView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#android:color/white"
android:layout_weight="1" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
app:srcCompat="#drawable/add"
android:id="#+id/imageView2"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_width="80dp"
android:layout_height="60dp"
android:layout_weight="1" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/addMember"
android:text="Add New Members"
android:textSize="18sp"
android:textColor="#android:color/holo_red_dark"
android:layout_weight="1"
android:layout_gravity="center_vertical" />
</LinearLayout>
</LinearLayout>
<Button
android:text="Leave this group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/leaveGroupButton"
android:background="#color/colorPrimary"
android:layout_gravity="bottom|end" />
</LinearLayout>
Problem is you have android:layout_weight="1" on your ListView which will make it expand to full and give no space to your LinearLayout
If you want to make "Add New Members" button scrollable and relative to ListView height, use NestedScrollView as a container of ListView and "Add New Members" custom button LinearLayout.
Here is full XML code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:background="#android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/groupID"
android:textSize="20sp"
android:layout_marginBottom="15dp" />
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="#+id/ListView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/white" />
<LinearLayout
android:id="#+id/layout_add_new_member"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
app:srcCompat="#drawable/add"
android:id="#+id/imageView2"
android:layout_marginLeft="16dp"
android:layout_width="80dp"
android:layout_height="60dp"
android:layout_weight="1" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:id="#+id/addMember"
android:text="Add New Members"
android:textSize="18sp"
android:textColor="#android:color/holo_red_dark"
android:layout_weight="1"
android:layout_gravity="center_vertical" />
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<Button
android:text="Leave this group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/leaveGroupButton"
android:background="#color/colorPrimary"
android:layout_gravity="bottom|end" />
</LinearLayout>
OUTPUT:
If you want to make "Add New Members" button fixed at bottom, use RelativeLayout as a container of ListView and "Add New Members" custom button LinearLayout.
Here is full XML code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:background="#android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/groupID"
android:textSize="20sp"
android:layout_marginBottom="15dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<LinearLayout
android:id="#+id/layout_add_new_member"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<ImageView
app:srcCompat="#drawable/add"
android:id="#+id/imageView2"
android:layout_marginLeft="16dp"
android:layout_width="80dp"
android:layout_height="60dp"
android:layout_weight="1" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:id="#+id/addMember"
android:text="Add New Members"
android:textSize="18sp"
android:textColor="#android:color/holo_red_dark"
android:layout_weight="1"
android:layout_gravity="center_vertical" />
</LinearLayout>
<ListView
android:id="#+id/ListView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_above="#id/layout_add_new_member"
android:background="#android:color/white" />
</RelativeLayout>
<Button
android:text="Leave this group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/leaveGroupButton"
android:background="#color/colorPrimary"
android:layout_gravity="bottom|end" />
</LinearLayout>
OUTPUT:
Hope this will help~
<ScrollView ..
<RelativeLayout..
<LinearLayout // vertical orientation
<ListView ../>
<LinearLayout // your linear layout
layout_below="#+id/listviewid"
</LinearLayout>
</RelativeLayout>
</ScrollView>
Try this view hierarchy.
Try RelativeLayout and use android:layout_above as shown below:
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ListView
android:id="#+id/your_listview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="#+id/your_layout_with_buttons" />
<LinearLayout
android:layout_alignParentBottom="true"
android:id="#+id/your_layout_with_buttons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
//your buttons come here
</LinearLayout>
</RelativeLayout>
You have to make changes in you list view item for this, check this.
Add below lines into Adapter get view method:
#Override
public View getView(int i, View view, ViewGroup viewGroup) {
view = LayoutInflater.from(TestListActivity.this).inflate(R.layout.dummy, viewGroup,false);
LinearLayout layout = (LinearLayout)view.findViewById(R.id.add_bottom_ll);
if(i==getCount()-1){
layout.setVisibility(View.VISIBLE);
}else{
layout.setVisibility(View.GONE);
}
return view;
}
List view Item view xml
<?xml version="1.0" encoding="utf-8"?>
<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="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp">
<ImageView
android:id="#+id/profile"
android:layout_width="72dp"
android:layout_height="72dp"
android:src="#drawable/arrow" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/profile"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#id/profile"
android:gravity="center_vertical"
android:text="user Name"
android:textSize="18sp" />
</RelativeLayout>
<LinearLayout
android:id="#+id/add_bottom_ll"
android:layout_width="363dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView2"
android:layout_width="80dp"
android:layout_height="60dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_weight="1"
android:src="#drawable/index" />
<TextView
android:id="#+id/addMember"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:text="Add New Members"
android:textColor="#android:color/holo_red_dark"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
View(Activity or Fragment) xml:
<LinearLayout 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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
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="com.thomasbrown.myapplication.MemberActivity"
android:background="#android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/groupID"
android:textSize="20sp"
android:layout_marginBottom="15dp" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ListView
android:id="#+id/ListView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#android:color/white"
/>
</LinearLayout>
<Button
android:text="Leave this group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/leaveGroupButton"
android:background="#color/colorPrimary"
android:layout_gravity="bottom|end" />
</LinearLayout>
I haven't tried but you try this and let me know:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/white">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/groupID"
android:textSize="20sp"
android:layout_marginBottom="15dp" />
<Button
android:text="Leave this group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/leaveGroupButton"
android:background="#color/colorPrimary"
android:layout_alignParentBottom="true" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#id/leaveGroupButton"
android:layout_below="#id/groupID">
<ListView
android:id="#+id/ListView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#android:color/white" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/ListView1">
<ImageView
app:srcCompat="#drawable/add"
android:id="#+id/imageView2"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_width="80dp"
android:layout_height="60dp"
android:layout_weight="1" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/addMember"
android:text="Add New Members"
android:textSize="18sp"
android:textColor="#android:color/holo_red_dark"
android:layout_weight="1"
android:layout_gravity="center_vertical" />
</LinearLayout>
</RelativeLayout>

alignParentBottom working in emulator but not on device

I have a RelativeLayout with a LinearLayout inside it which should stick to the bottom of the screen. I have added the android:layout_alignParentBottom="true" property to it, and this works fine in the emulator, but on a real device this LinearLayout falls partially outside of the screen (I can only see the ImageViews but not the TextViews).
Screenshot from emulator
Screenshot from device
This is the full XML layout file:
<?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: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"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="com.test.app.MainActivity"
>
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/cityTextView"
android:fontFamily="sans-serif-medium"
android:textSize="25sp"
android:textColor="#37404d"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/summaryTextView"
android:fontFamily="sans-serif-light"
android:textSize="18sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/detailsView"
android:fontFamily="sans-serif-light"
android:textSize="60sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Not bad"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"/>
<ImageView
android:id="#+id/mainImageView"
android:layout_width="230dp"
android:layout_height="230dp"
android:layout_gravity="center"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_alignParentBottom="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
<ImageView
android:id="#+id/mainOneImageView"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginRight="5dp"
android:src="#drawable/notbad"/>
<TextView
android:id="#+id/mainOneView"
android:fontFamily="sans-serif-light"
android:textSize="30dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Not bad" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/mainTwoImageView"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"
android:src="#drawable/notbad"/>
<TextView
android:id="#+id/mainTwoView"
android:fontFamily="sans-serif-light"
android:textSize="30sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Not bad" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/mainThreeImageView"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginRight="5dp"
android:src="#drawable/notbad"/>
<TextView
android:id="#+id/mainThreeView"
android:fontFamily="sans-serif-light"
android:textSize="30dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Not bad" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
That is because of the scrolling behaviour, in that case, the last items of whatever will be scrolling are out of the screen actually. I guess what you could do is add a marginBottom to the root linearlayout?
Try this one
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
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"
>
<android.support.v4.view.ViewPager
android:id="#+id/pager"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<LinearLayout
android:id="#+id/layout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/layout2"
android:orientation="vertical">
<TextView
android:id="#+id/cityTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:textColor="#37404d"
android:textSize="25sp"/>
<TextView
android:id="#+id/summaryTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:textSize="18sp"/>
<TextView
android:id="#+id/detailsView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:fontFamily="sans-serif-light"
android:text="Not bad"
android:textSize="60sp"/>
<ImageView
android:id="#+id/mainImageView"
android:layout_width="230dp"
android:layout_height="230dp"
android:layout_gravity="center"
android:src="#drawable/notbad"
/>
</LinearLayout>
<LinearLayout
android:id="#+id/layout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/mainOneImageView"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginRight="5dp"
android:src="#drawable/notbad"/>
<TextView
android:id="#+id/mainOneView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="Not bad"
android:textSize="30dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/mainTwoImageView"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"
android:src="#drawable/notbad"/>
<TextView
android:id="#+id/mainTwoView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="Not bad"
android:textSize="30sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/mainThreeImageView"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginRight="5dp"
android:src="#drawable/notbad"/>
<TextView
android:id="#+id/mainThreeView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:text="Not bad"
android:textSize="30dp"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

SoftKeyboard pushes up the layout in android

I have an activity in which I am using the fragment. In fragment I have custom toolbar, a list and a EditTextView. When Keyboard visible in this Activity, it pushes up layout. How can I prevent the toolbar to be at its original position.
Following code is written in my fragment:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/layout_alert_main_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/bg_hexa">
<TextView
android:id="#+id/channel_title"
android:paddingLeft="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:background="#color/black"
android:textColor="#color/white"
android:textSize="16sp"
android:visibility="gone"
android:layout_below="#id/layout_alert_top"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:id="#+id/layout_alert_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
android:background="#color/app_blue"
android:orientation="horizontal">
<RelativeLayout
android:id="#+id/layout_channel_back_view"
android:layout_width="50dp"
android:layout_height="50dp"
android:clickable="true"
android:focusable="true">
<ImageView
android:id="#+id/title_bar_left_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/ic_menu_white_32"/>
</RelativeLayout>
<TextView
android:id="#+id/tv_screen_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="#string/channel_title"
android:layout_centerInParent="true"
android:textSize="24sp"
android:textColor="#color/white_text"/>
<RelativeLayout
android:id="#+id/channels_sliding_menu"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:clickable="true"
android:focusable="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/ic_tab_channels_white"/>
</RelativeLayout>
</RelativeLayout>
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_below="#+id/channel_title"
android:isScrollContainer="false"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/layout_list_alerts"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<TextView
android:id="#+id/zero_conversation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#color/dark_gray_text"
android:layout_centerInParent="true"
android:text="Empty"
android:visibility="gone"/>
<RelativeLayout
android:id="#+id/layout_type_message"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:background="#color/gray">
<EditText
android:id="#+id/et_type_message"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toLeftOf="#+id/layout_send_message"
android:background="#drawable/square_round_corners"
android:hint="Type your message.."
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:padding="5dp"
android:singleLine="true"
android:textColor="#color/black"
android:textColorHint="#color/black"
android:textSize="16sp"/>
<Button
android:id="#+id/layout_send_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_alignParentRight="true"
android:padding="5dp"
android:textSize="16sp"
android:textStyle="bold"
android:background="#color/transparent"
android:textColor="#color/dark_gray_text"
android:layout_centerInParent="true"
android:text="Send"/>
</RelativeLayout>
<ListView
android:id="#+id/conversation_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#id/layout_type_message"
android:divider="#null"
android:listSelector="#color/transparent"
android:stackFromBottom="true"
android:transcriptMode="normal"
/>
</RelativeLayout>
<FrameLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false" >
</FrameLayout>
<ListView
android:id="#+id/channels_list"
android:background="#color/gray"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#null"
android:layout_gravity="right"
android:choiceMode="singleChoice" />
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
Hello, Try to apply this attribute in Activity Tag in Manifest file and let me know if you
can get your desired output or not. Okay.
android:windowSoftInputMode="stateAlwaysHidden|adjustResize"
> XML file` :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/layout_alert_main_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFF">
<RelativeLayout
android:id="#+id/layout_alert_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#000000"
android:orientation="horizontal"
android:visibility="visible">
<RelativeLayout
android:id="#+id/layout_channel_back_view"
android:layout_width="50dp"
android:layout_height="50dp"
android:clickable="true"
android:focusable="true">
<ImageView
android:id="#+id/title_bar_left_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#FFFFFF" />
</RelativeLayout>
<TextView
android:id="#+id/tv_screen_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:text="Title"
android:textColor="#FFFFFF"
android:textSize="24sp" />
<RelativeLayout
android:id="#+id/channels_sliding_menu"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:clickable="true"
android:focusable="true">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/ic_logo" />
</RelativeLayout>
</RelativeLayout>
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:isScrollContainer="false">
<RelativeLayout
android:id="#+id/layout_list_alerts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/zero_conversation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Empty"
android:textColor="#000000"
android:textSize="16sp"
android:visibility="gone" />
<RelativeLayout
android:id="#+id/layout_type_message"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="#000000"
android:orientation="horizontal">
<EditText
android:id="#+id/et_type_message"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_toLeftOf="#+id/layout_send_message"
android:background="#FFFFFF"
android:hint="Type your message.."
android:padding="5dp"
android:singleLine="true"
android:textColor="#000000"
android:textColorHint="#000000"
android:textSize="16sp" />
<Button
android:id="#+id/layout_send_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:background="#000000"
android:padding="5dp"
android:text="Send"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
<ListView
android:id="#+id/conversation_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#id/layout_type_message"
android:divider="#null"
android:stackFromBottom="true"
android:transcriptMode="normal" />
</RelativeLayout>
<FrameLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"></FrameLayout>
<ListView
android:id="#+id/channels_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right"
android:background="#000000"
android:choiceMode="singleChoice"
android:divider="#null"
tools:listtem="#layout/demo_layout" />
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
Use Scroll view in Ur Layout or Use the code in the manifest.xml.
<activity android:windowSoftInputMode="adjustPan">
Read this :
http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
and use adjustPan

Not getting color value from MainActivity

I am trying to copy a Pie Chart from sample which I have downloaded from internet and add it in my project but i am not getting the colors
This Actual view of downloaded source code
https://goo.gl/o27nsQ
this is what I am getting.
https://goo.gl/UpQojP
Original Code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/com.benliger.chart"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_weight="0.6"
android:layout_marginTop="7dp" >
<com.benliger.chart.view.PieDonutChart
android:id="#+id/pie"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:padding="10dp"
custom:colorCircleInside="#android:color/white"
custom:highlightStrength="1.15"
custom:ratioCircleInside="0.8" />
</LinearLayout>
<Button
android:id="#+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="#string/change_data" />
<LinearLayout
android:id="#+id/seekBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/button"
android:gravity="center_vertical" >
<TextView
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/radius" />
<SeekBar
android:id="#+id/seekBar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:max="100"
android:progress="80" />
</LinearLayout>
My code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/com.example.apptitude"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_weight="0.6"
android:layout_marginTop="7dp" >
<com.example.chart.view.PieDonutChart
android:id="#+id/pie"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:padding="10dp"
custom:colorCircleInside="#android:color/white"
custom:highlightStrength="1.15"
custom:ratioCircleInside="0.8" />
</LinearLayout>
<Button
android:id="#+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="#string/change_data" />
<LinearLayout
android:id="#+id/seekBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/button"
android:gravity="center_vertical" >
<TextView
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/radius" />
<SeekBar
android:id="#+id/seekBar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:max="100"
android:progress="80" />
</LinearLayout>

Android map with custom layout

I' am trying to achieve sth like this:
But the ListView is overlaps my bottom bar. What is the best way to prevent such a behaviour? As you can see in the picture there is a map under bottom bar. This bottom bar is like target/destination window in Google Maps app.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<com.google.android.gms.maps.MapView
android:id="#+id/map"
tools:layout="#layout/fragmentMap"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
android:orientation="vertical">
<EditText
android:id="#+id/mapEditT"
android:layout_width="fill_parent"
android:layout_height="53dp"
android:layout_alignParentTop="true"
android:gravity="center|left"
android:paddingLeft="2dp"
android:paddingRight="0dp"/>
<ListView
android:id="#+id/listVi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/white"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical">
<ImageButton
android:id="#+id/draweR"
android:layout_width="wrap_content"
android:src="#drawable/draweR"/>
<LinearLayout
android:id="#+id/infoBox"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginTop="40dp"
android:alpha="0.1"
android:background="#android:color/black"
android:orientation="horizontal">
<TextView
android:id="#+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="20dp"
android:text="Info"
/>
<TextView
android:id="#+id/text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_toRightOf="#id/text2"
android:text="Info/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
Use LinearLayout or RelativeLayout as top most parent instead of FrameLayout.
Here is the code snippet using LinearLayout.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<EditText
android:id="#+id/textView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
<ListView
android:id="#+id/listView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
</ListView>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageButton
android:id="#+id/draweR"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="left|center_vertical"
android:src="#drawable/draweR"/>
<com.google.android.gms.maps.MapView
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="#layout/fragmentMap" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="100" >
<TextView
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_weight="75" />
<TextView
android:id="#+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_weight="25" />
</LinearLayout>
</LinearLayout>
You can mess around with the margins. I got it to look like the image you wanted.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.google.android.gms.maps.MapView
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="#layout/fragmentMap" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
android:orientation="vertical"
android:paddingBottom="160dp" >
<EditText
android:id="#+id/mapEditT"
android:layout_width="fill_parent"
android:layout_height="53dp"
android:layout_alignParentTop="true"
android:gravity="center|left"
android:paddingLeft="2dp"
android:paddingRight="0dp" />
<ListView
android:id="#+id/listVi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical" >
<ImageButton
android:id="#+id/draweR"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/draweR" />
<LinearLayout
android:id="#+id/infoBox"
android:layout_width="match_parent"
android:layout_height="100dp"
android:alpha="0.1"
android:background="#android:color/black"
android:orientation="horizontal" >
<TextView
android:id="#+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="20dp"
android:text="Info" />
<TextView
android:id="#+id/text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_toRightOf="#id/text2"
android:text="Info" />
</LinearLayout>
</LinearLayout>

Categories

Resources