Making my layout better looking - android

I am looking for design, look and feel suggestions based on what I currently have - which is ugly:
http://screencast.com/t/mjHawFeFnbRb
It is basically a listview as such:
*
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="#string/news_name_placeholder"
android:layout_weight="3"
style="?android:attr/listSeparatorTextViewStyle"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_marginTop="10dp"
android:layout_height="match_parent"
android:text="#string/news_date_placeholder"
android:gravity="right"
android:layout_weight="1"
style="?android:attr/listSeparatorTextViewStyle"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
It is clearly hard on the eyes, so I'm hoping I can get some great ideas on how to make it more enjoyable for the user, and really to make it look sexy.
Each line can be different depending on the data, so either I need them as they are, or another way to indicate the incoming data in 3 different states (currently red, yellow, green).
what would I call this type of element http://41.media.tumblr.com/91b9c05d7af1016675da74a7a232f39d/tumblr_mloupiH0gn1snfpwco1_400.png in order to search how to do it ?
Hopefully that gets the design ideas flowing :)
thx

I have decided to make something from scratch which you can build on, the desired look which you want to achieve (in screenshot) is professional and will be hard to get source of / make.
Here is what I've got, intead of changing the text color and making peoples eyes bleed you could have a color on the side representing the status (I'm guessing that's what it is).
Screenshot 1:
Top bar is fixed to the top, events are displayed below with their corresponding priority / status.
Screenshot 2:
Top bar stays at the top and allows you to scroll down to see all the events.
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"
android:background="#F7C26D"
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.example.testdesignapp.MainActivity"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="#eda737"
android:gravity="top"
android:orientation="horizontal"
android:padding="5dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Top bar " />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Non scrolling " />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="If needed" />
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/green" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#id/imageView1"
android:text="Spanish unemployment change 19:00"
android:textSize="13sp" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView4"
android:layout_below="#+id/textView4"
android:text="This could be extra detail about the event, such as the date 02-12-2014 19:00 GMT."
android:textColor="#595959"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/yellow" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#id/imageView2"
android:text="Spanish unemployment change 19:00"
android:textSize="13sp" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView6"
android:layout_below="#+id/textView6"
android:text="This could be extra detail about the event, such as the date 02-12-2014 19:00 GMT."
android:textColor="#595959"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/red" />
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#id/imageView3"
android:text="Spanish unemployment change 19:00"
android:textSize="13sp" />
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView8"
android:layout_below="#+id/textView8"
android:text="This could be extra detail about the event, such as the date 02-12-2014 19:00 GMT."
android:textColor="#595959"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/green" />
<TextView
android:id="#+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#id/imageView4"
android:text="Spanish unemployment change 19:00"
android:textSize="13sp" />
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView10"
android:layout_below="#+id/textView10"
android:text="This could be extra detail about the event, such as the date 02-12-2014 19:00 GMT."
android:textColor="#595959"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/yellow" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#id/imageView5"
android:text="Spanish unemployment change 19:00"
android:textSize="13sp" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView12"
android:layout_below="#+id/textView12"
android:text="This could be extra detail about the event, such as the date 02-12-2014 19:00 GMT."
android:textColor="#595959"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/red" />
<TextView
android:id="#+id/textView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#id/imageView7"
android:text="Spanish unemployment change 19:00"
android:textSize="13sp" />
<TextView
android:id="#+id/textView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView14"
android:layout_below="#+id/textView14"
android:text="This could be extra detail about the event, such as the date 02-12-2014 19:00 GMT."
android:textColor="#595959"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/green" />
<TextView
android:id="#+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#id/imageView8"
android:text="Spanish unemployment change 19:00"
android:textSize="13sp" />
<TextView
android:id="#+id/textView17"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView16"
android:layout_below="#+id/textView16"
android:text="This could be extra detail about the event, such as the date 02-12-2014 19:00 GMT."
android:textColor="#595959"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/yellow" />
<TextView
android:id="#+id/textView18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#id/imageView9"
android:text="Spanish unemployment change 19:00"
android:textSize="13sp" />
<TextView
android:id="#+id/textView19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView18"
android:layout_below="#+id/textView18"
android:text="This could be extra detail about the event, such as the date 02-12-2014 19:00 GMT."
android:textColor="#595959"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/red" />
<TextView
android:id="#+id/textView20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#id/imageView10"
android:text="Spanish unemployment change 19:00"
android:textSize="13sp" />
<TextView
android:id="#+id/textView21"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView20"
android:layout_below="#+id/textView20"
android:text="This could be extra detail about the event, such as the date 02-12-2014 19:00 GMT."
android:textColor="#595959"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
The 3 images I used (green, yellow, red) you can generate HERE
Hope I helped, good luck! ;)
Markus

Take two more LinearLayout instead directly put left and right TextView as direct child and set weight which can show like left as label and right as value pair data :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.30">
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/news_name_placeholder"
style="?android:attr/listSeparatorTextViewStyle"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.70"
android:layout_marginLeft="5dp">
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/news_date_placeholder"
style="?android:attr/listSeparatorTextViewStyle"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</LinearLayout>

Change your item LinearLayout orientaltion to vertical, since a single line is not enough to put your information. And change the text size of your two TextViews, I think textView1 must be larger than textView2.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="#string/news_name_placeholder"
style="?android:attr/listSeparatorTextViewStyle"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView2"
android:layout_width="match_parent"
android:layout_marginTop="5dp"
android:layout_height="wrap_content"
android:text="#string/news_date_placeholder"
android:gravity="left"
style="?android:attr/listSeparatorTextViewStyle"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>

Related

AlignTextView in the middle of Image (horizontal)

I have to align one TextView in the middle of a ImageView-->ImageButton, I know that is not difficult but my problems come because the image can have variable size , so when I got different images, the text view moves around, and don't stay aligned horizontally in the middle of the image.
A image can help to my explanation:
At this moment I set the image and text like this:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar_circuitomedico"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:elevation="12dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="fill_parent">
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:text="#string/professional"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/circ_profesionall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView1"
android:layout_alignBottom="#+id/textView1"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_toRightOf="#+id/textView1"
android:layout_toEndOf="#+id/textView1"
android:text="#string/medico_test"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_alignStart="#+id/textView1"
android:layout_below="#+id/textView1"
android:layout_marginTop="12dp"
android:text="#string/medical_service"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/circ_spin_tipus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView3"
android:layout_alignStart="#+id/textView3"
android:layout_marginTop="12dp"
android:layout_below="#+id/textView3" />
<Spinner
android:id="#+id/circ_spin_tipocons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/circ_spin_tipus"
android:layout_alignStart="#+id/circ_spin_tipus"
android:layout_marginTop="12dp"
android:layout_below="#+id/circ_spin_tipus" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/circ_spin_tipocons"
android:layout_alignStart="#+id/circ_spin_tipocons"
android:layout_below="#+id/circ_spin_tipocons"
android:text="#string/circuit_curesnafres"
android:layout_marginTop="12dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView4"
android:layout_alignStart="#+id/textView4"
android:layout_below="#+id/textView4"
android:layout_marginTop="12dp"
android:text="#string/circuit_nhc"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/circ_spin_tipolesion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView5"
android:layout_alignStart="#+id/textView5"
android:layout_below="#+id/textView5"
android:layout_marginTop="12dp" />
<Spinner
android:id="#+id/circ_spin_local"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/circ_spin_tipolesion"
android:layout_alignStart="#+id/circ_spin_tipolesion"
android:layout_below="#+id/circ_spin_tipolesion"
android:layout_marginTop="12dp" />
<Spinner
android:id="#+id/circ_spin_escalas"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/circ_spin_local"
android:layout_alignStart="#+id/circ_spin_local"
android:layout_below="#+id/circ_spin_local"
android:layout_marginTop="12dp" />
<EditText
android:id="#+id/circ_box_descrip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/circ_spin_escalas"
android:layout_alignStart="#+id/circ_spin_escalas"
android:layout_below="#+id/circ_spin_escalas"
android:layout_marginTop="12dp"
android:layout_marginRight="20dp"
android:layout_marginEnd="20dp"
android:ems="12"
android:inputType="textMultiLine" >
</EditText>
<ImageButton
android:id="#+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/circ_box_descrip"
android:layout_alignStart="#+id/circ_box_descrip"
android:layout_below="#+id/circ_box_descrip"
android:layout_marginTop="12dp"
android:src="#drawable/button_picture" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/imageButton1"
android:layout_marginTop="30dp"
android:layout_toRightOf="#+id/textView1"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
This is Best as per your Requirement :-
<?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">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#drawable/img"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="im in Center"
android:textStyle="bold"
android:textSize="30sp"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
Thank you and have a best Programming..
Try to replace your textview which you want to align with this:
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imageButton1"
android:layout_alignTop="#+id/imageButton1"
android:layout_toRightOf="#+id/imageButton1"
android:gravity="center"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
This will make your text view aligned with your imageview and text will be shown with center gravity.
Problem is that if your image will be less than the text size or text lines .
Try this-->
<RelativeLayout
android:id="#+id/relative"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/your_image" />
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#id/image"
android:layout_alignLeft="#id/image"
android:layout_alignRight="#id/image"
android:layout_alignTop="#id/image"
android:gravity="center"
android:maxLines="5"
android:textColor="#000000"
android:textSize="8dp"
android:textStyle="bold" />
</RelativeLayout>
Try this:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_weight="100">
<ImageView
android:id="#+id/image1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="50"
android:src="#drawable/clock_number"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="50"
android:layout_marginStart="12dp"
android:text="Hello World!" />
</LinearLayout>

Prevent a view from getting outside of the screen

I'm working with the Google Maps API v2, and I overrided getInfoContents() from InfoWindowAdapter for having a customized InfoWindow. Inside getInfoContents()I inflate an xml containing an ImageView, and three TextViews.
My problem comes when the text that is set inside the snippet is larger than the view, then the count TV it's set outside the view. This is illustrated above with some screenshots.
Here my xml layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/categoryIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignBottom="#+id/count"
android:src="#drawable/ic_launcher"/>
<LinearLayout
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toRightOf="#+id/categoryIcon"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title"
android:textStyle="bold" />
<TextView
android:id="#+id/snippet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Snippet" />
</LinearLayout>
<TextView
android:id="#+id/count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#111177"
android:text="0"
android:textSize="20sp"
android:padding="10dp"
android:textColor="#FFF"
android:layout_toRightOf="#+id/text"
android:singleLine="true" />
</RelativeLayout>
How can I change this layout for getting the count TextView inside of the screen, and the snippet in multiline?
I want to always show the count TextView.
UPDATE:
Finally with the answer of Simon Marquis I realized a way to accomplish this. Here the new code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/categoryIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignBottom="#+id/text"
android:src="#drawable/ic_launcher"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/text"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_toRightOf="#+id/categoryIcon">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title"
android:textStyle="bold" />
<TextView
android:id="#+id/snippet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Snippeta" />
</LinearLayout>
<TextView
android:id="#+id/count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#111177"
android:text="0"
android:textSize="20sp"
android:padding="10dp"
android:textColor="#FFF"
android:singleLine="true" />
</LinearLayout>
</RelativeLayout>
You should add this to the LinearLayout:
android:layout_width="0dp"
android:layout_weight="1"
The new layout file:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/categoryIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignBottom="#+id/count"
android:src="#drawable/ic_launcher"/>
<LinearLayout
android:id="#+id/text"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toRightOf="#+id/categoryIcon"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title"
android:textStyle="bold" />
<TextView
android:id="#+id/snippet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Snippet" />
</LinearLayout>
<TextView
android:id="#+id/count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#111177"
android:text="0"
android:textSize="20sp"
android:padding="10dp"
android:textColor="#FFF"
android:layout_toRightOf="#+id/text"
android:singleLine="true" />
</RelativeLayout>
One solution if you want that the count TextView always appears at right is the following:
Put the count Text View before the LinearLayout and add
android:layout_alignParentRight="true"
And add android:layout_toLeftOf="#id/count" in the Linear Layout
<TextView
android:id="#+id/count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#00F"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#id/count"
android:orientation="vertical" >
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/snippet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>

ScrollView doesn't display its content properly in lower versions of android

You can see my scrollview being displayed the same in jellybean, & kitkat, very awesome:
But I am shocked to see the same thing in lower versions like 2.2, 2.3.3
It seems that it display some portion of text attached to upper & bottom portion of screen.
BTW, The lines in middle are just the textviews with gray background .
You can see my xml code, sorry its a little long code
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/stars"
android:padding="5dp"
android:scrollbars="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<EditText
android:id="#+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textColor="#fff"
android:hint="Type your Full Name here"
android:inputType="textPersonName"
android:digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz " >
<requestFocus />
</EditText>
<Button
android:id="#+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:background="#330000"
android:onClick="showresult"
android:textColor="#ffffff"
android:alpha=".8"
android:text="Show My Fortune" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceSmall" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:baselineAligned="false">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
>
<TextView
android:id="#+id/textView1"
android:layout_width="20dp"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textSize="18sp"
/>
<TextView
android:id="#+id/textView2"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1" >
<TextView
android:id="#+id/textView3"
android:layout_width="20dp"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textSize="18sp" />
<TextView
android:id="#+id/textView4"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1" >
<TextView
android:id="#+id/textView5"
android:layout_width="20dp"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textSize="18sp"/>
<TextView
android:id="#+id/textView6"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="#+id/textView7"
android:layout_width="match_parent"
android:layout_height=".5dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceSmall" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ffffff" />
<TextView
android:id="#+id/textView14"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:gravity="right"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ffffff" />
<TextView
android:id="#+id/textView15"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:gravity="right"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ffffff" />
<TextView
android:id="#+id/textView16"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:gravity="right"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<TextView
android:id="#+id/textView12"
android:layout_width="match_parent"
android:layout_height=".5dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/textView17"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView18"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<TextView
android:id="#+id/textView19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="#+id/textView20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ff0000"
android:textAppearance="?android:attr/textAppearanceLarge" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView21"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:gravity="right"
android:textColor="#ff0000"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView27"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView22"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#ffff00"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView23"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:textColor="#ff0000"
android:gravity="right"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView28"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView24"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffff00"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/textView25"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:gravity="right"
android:textColor="#ff0000"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView29"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView26"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffff00"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</LinearLayout>
</ScrollView>
Also in GraphicalLayout is shows this warning :
I hope I explained my problem clearly !
Looking for a answer,
Thanks in advance
UPDATE: After #semsamot answer the above warning was disappeared, but the problem is still not solved.
Sorry, my above code was too long but I have another layout in my app displaying the same problem
Consider this code:
<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: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="#drawable/stars"
tools:context="com.vivekwarde.numerologyfortune.MyLuckyNumber"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Button
android:id="#+id/button1"
android:layout_width="match_parent"
android:layout_height="60dp"
android:textColor="#fff"
android:gravity="center"
android:onClick="showDatePickerDialog"
android:text="Birthdate ?"
android:background="#4c0000" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:textColor="#ffffff"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
If I display this layout simply it displays as expected in jelly bean & kitkat like this
But see this output in 2.2 & 2.3.3
Why the text in TextView does not display properly as expected. ?
Don't use float values that lower than 1 in this format: ".x"
Instead use this format: "0.x"
If you change those values you see the warnings disappear!
Note:
Also note that "alpha" attribute introduced in API Level 11 so it will not work in lower API(s).
I don't think it'll work but u should try it once.
instead of using android:layout_height="60dp" use maxHeight and minHeight with same value 60dp as ur case .I think it will solve your problem.And also fill some background color to see whats wrong with the soln.
Don't use wrap_content for the ScrollView. The ScrollView should have a concrete size which is relate with the screen size, not the content. The LinearLayout inside it should keep the wrap_content. In both your examples, you should use match_parent for the ScrollView
don`t use .5dp while setting height or width
<TextView
android:id="#+id/textView7"
android:layout_width="match_parent"
android:layout_height=".5dp" // **modify** this to android:layout_height="1dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="#+id/textView12"
android:layout_width="match_parent"
android:layout_height=".5dp" // **modify** this to android:layout_height="1dp" />
Using this you can remove this error requestfocus does not set the required layout_height attribute and also might be you can solve your issue also

How to align image at extreme left of listitem?

I have an ImageView (android:id="#+id/unreadmail) which i want to show on extreme left of ListItem as shown in image. But it is not aligning properly. Any idea if i am missing anything ?
<LinearLayout
android:id="#+id/Text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="#+id/emailsubject"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:singleLine="true"
android:text="abcd"
android:textColor="#444444"
android:textSize="18sp" />
<TextView
android:id="#+id/emailcontent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/emailsubject"
android:layout_below="#id/emailsubject"
android:ellipsize="marquee"
android:gravity="center"
android:singleLine="true"
android:text="defg"
android:textColor="#444444"
android:textSize="14sp" />
</LinearLayout>
<ImageView
android:id="#+id/unreademail"
android:layout_width="2dip"
android:layout_height="wrap_content"
android:layout_toLeftOf="#id/emailsubject"
android:layout_centerVertical="true"
android:background="#8A6175"
android:visibility="invisible" />
<TextView
android:id="#+id/rcvdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingRight="20dip"
android:textColor="#313132"
android:textSize="12sp" />
Use this:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context=".MainActivity"
tools:ignore="ObsoleteLayoutParam,ContentDescription,UselessLeaf,UselessParent" >
<LinearLayout
android:id="#+id/Text"
android:layout_width="match_parent"
android:layout_height="60dp"
android:orientation="horizontal" >
<ImageView
android:id="#+id/unreademail"
android:layout_width="15dip"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#drawable/ic_launcher"
android:visibility="visible" />
<LinearLayout
android:id="#+id/Text"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_marginLeft="20dp"
android:orientation="vertical" >
<TextView
android:id="#+id/emailsubject"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:singleLine="true"
android:text="abcd"
android:textColor="#444444"
android:textSize="18sp" />
<TextView
android:id="#+id/emailcontent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/emailsubject"
android:layout_below="#id/emailsubject"
android:ellipsize="marquee"
android:gravity="center"
android:singleLine="true"
android:text="defg"
android:textColor="#444444"
android:textSize="14sp" />
</LinearLayout>
<RelativeLayout
android:id="#+id/Text1"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:gravity="right"
android:layout_gravity="right"
android:orientation="horizontal" >
<TextView
android:id="#+id/rcvdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="35dp"
android:text="Date"
android:textColor="#000"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
I think you should be using a relative layout at the top level (possibly not included in your code).
You cannot use 'to the left of' when the elements are at different levels in the heirarchy.
Thus I would start with your little icon left aligned to the parent and put the edit box (in the same relative view) 'to the right of' the icon.
This is the code sample for you there is no need to write the weight property if add the screenshot or the supported image how exactly you want then i can give you proper answer
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="#+id/Text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/unreademail"
android:layout_marginLeft="10dip"
android:orientation="vertical">
<TextView
android:id="#+id/emailsubject"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:singleLine="true"
android:text="abcd"
android:textColor="#444444"
android:textSize="18sp" />
<TextView
android:id="#+id/emailcontent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/emailsubject"
android:layout_below="#id/emailsubject"
android:ellipsize="marquee"
android:gravity="center"
android:singleLine="true"
android:text="defg"
android:textColor="#444444"
android:textSize="14sp" />
</LinearLayout>
<ImageView
android:id="#+id/unreademail"
android:layout_width="2dip"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="#8A6175"
android:visibility="invisible" />
<TextView
android:id="#+id/rcvdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingRight="20dip"
android:textColor="#313132"
android:textSize="12sp" />
</RelativeLayout>

Make page that is almost page-height scrollable

I have a page that just displays a bunch of data and has a few buttons. It is pretty much static. I want to make the page feel more responsive by giving the page the ability to move around. I know I often just scroll-up when considering a page of data.
I thought I would just surround my page with a scroll view, but that makes there be a small blank strip at the bottom of the screen (as though it is wrapping the content, but I have it set to fill-parent).
Anyway, here is my xml:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".DealerDetails">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ababab">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp">
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ffffff"
android:layout_marginLeft="15dp"
android:layout_gravity="center_vertical"
android:text="Store" />
<TextView
android:id="#+id/distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ffffff"
android:layout_marginLeft="30dp"
android:layout_gravity="center_vertical"
android:text="2 mi." />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginLeft="15dp">
<ImageView
android:id="#+id/DirectionsImage"
android:layout_weight="1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:contentDescription="#string/CD_Dealer_Location"
android:src="#drawable/device_access_location_found"
android:layout_marginRight="15dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_vertical">
<TextView
android:id="#+id/address1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#2b91af"
android:text="555 Super St. Suite 500" />
<TextView
android:id="#+id/address2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#2b91af"
android:text="San Antonio, TX 78791" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="3dp"
android:layout_marginLeft="15dp">
<ImageView
android:id="#+id/PhoneImage"
android:layout_weight="1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:contentDescription="#string/CD_Dealer_Phone_Number"
android:src="#drawable/device_access_call"
android:layout_marginRight="15dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_vertical">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_vertical">
<TextView
android:id="#+id/address1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff"
android:layout_marginRight="10dp"
android:text="Sales: " />
<TextView
android:id="#+id/address1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#2b91af"
android:text="830-626-5200" />
</LinearLayout>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_vertical">
<TextView
android:id="#+id/address1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff"
android:layout_marginRight="10dp"
android:text="Service: " />
<TextView
android:id="#+id/address1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#2b91af"
android:text="830-661-4511" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="3dp"
android:layout_marginLeft="15dp">
<ImageView
android:id="#+id/HoursImage"
android:layout_weight="1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:contentDescription="#string/CD_Dealer_Hours_Of_Operation"
android:src="#drawable/device_access_time"
android:layout_marginRight="15dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_vertical">
<TextView
android:id="#+id/ServiceHoursHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff"
android:layout_marginBottom="1dp"
android:text="Service Hours" />
<TextView
android:id="#+id/ServiceHoursDetails1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#232323"
android:layout_marginLeft="12dp"
android:text="Monday-Friday: 8:00 AM - 8:00 PM" />
<TextView
android:id="#+id/ServiceHoursDetails2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#232323"
android:layout_marginLeft="12dp"
android:text="Saturday: 8:00 AM - 5:00 PM" />
<TextView
android:id="#+id/ServiceHoursDetails3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#232323"
android:layout_marginLeft="12dp"
android:text="Sunday: CLOSED" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="3dp"
android:layout_marginLeft="15dp">
<ImageView
android:id="#+id/HoursImage"
android:layout_weight="1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:contentDescription="#string/CD_Dealer_Hours_Of_Operation"
android:src="#drawable/device_access_time"
android:layout_marginRight="15dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_vertical">
<TextView
android:id="#+id/SalesHoursHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff"
android:layout_marginBottom="1dp"
android:text="Sales Hours" />
<TextView
android:id="#+id/SalesHoursDetails1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#232323"
android:layout_marginLeft="12dp"
android:text="Monday-Friday: 8:00 AM - 6:00 PM" />
<TextView
android:id="#+id/SalesHoursDetails2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#232323"
android:layout_marginLeft="12dp"
android:text="Saturday: 8:00 AM - 3:00 PM" />
<TextView
android:id="#+id/SalesHoursDetails3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#232323"
android:layout_marginLeft="12dp"
android:text="Sunday: CLOSED" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="3dp"
android:layout_marginLeft="15dp">
<ImageView
android:id="#+id/ServicesImage"
android:layout_weight="1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:contentDescription="#string/CD_Dealer_Services_Offered"
android:src="#drawable/gear"
android:layout_marginRight="15dp" />
<LinearLayout
android:layout_width="241dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical" >
<TextView
android:id="#+id/ServiceHoursHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff"
android:layout_marginBottom="2dp"
android:text="Services" />
<TextView
android:id="#+id/ServiceHoursDetails1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:text="Body Shop, New Heavy Duty, Used Heavy Sales, Service"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#232323" />
</LinearLayout>
</LinearLayout>
<Button
android:id="#+id/MyLocationButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:background="#drawable/dark_button"
android:padding="5dp"
android:text="#string/view_inventory"
android:textColor="#FFFFFF"
android:onClick="viewInventory" />
</LinearLayout>
</ScrollView>
Sorry about the large block of text, but the important part is likely just the outer-most two elements.
Change your first LinearLayout height to android:layout_height="match_parent"
Edit: Okay give this a go". Add this to your first LinearLayout
android:fillViewport="true"

Categories

Resources