Preventing TextView and ImageView Overlap In Relative Layout - java

I have a textView (titleTv) and an imageView (buyButton) which are sometimes have an overlap if the titleTv has a somewhat long name.
How might this be prevented? I understand this can be done using an external library - but it seems strange there isn't a simple way to accomplish this.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="7dip"
android:paddingTop="7dip" >
<TextView
android:id="#+id/titleTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/white"
android:paddingLeft="5dp"
android:text=""
android:textSize="20sp" />
<TextView
android:id="#+id/uploaderTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/titleTv"
android:paddingLeft="5dip"
android:paddingTop="5dp"
android:textColor="#color/verylightgrey"
android:textSize="16sp" />
<TextView
android:id="#+id/viewCountTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/titleTv"
android:layout_toRightOf="#id/uploaderTv"
android:paddingTop="5dp"
android:textColor="#android:color/black"
android:textSize="16sp" />
<ImageView
android:id="#+id/buyButton"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:adjustViewBounds="true"
android:paddingTop="7dip"
android:src="#drawable/buy_a_up_btn" />
</RelativeLayout>
Example:
(the overlapping fields are the video's title and the $ button)
http://i.stack.imgur.com/clpNv.png

just add your ImageView below that TextView. Add this attribute in your ImageView declaration
android:layout_below="#+id/titleTv"
Now the xml should be like this:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="7dip"
android:paddingTop="7dip" >
<TextView
android:id="#+id/titleTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#color/white"
android:paddingLeft="5dp"
android:text=""
android:textSize="20sp" />
<TextView
android:id="#+id/uploaderTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/titleTv"
android:paddingLeft="5dip"
android:paddingTop="5dp"
android:textColor="#color/verylightgrey"
android:textSize="16sp" />
<TextView
android:id="#+id/viewCountTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/titleTv"
android:layout_toRightOf="#id/uploaderTv"
android:paddingTop="5dp"
android:textColor="#android:color/black"
android:textSize="16sp" />
<ImageView
android:id="#+id/buyButton"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_below="#+id/titleTv"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:adjustViewBounds="true"
android:paddingTop="7dip"
android:src="#drawable/buy_a_up_btn" />
</RelativeLayout>

Try this:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="7dip"
android:paddingTop="7dip" >
<ImageView
android:id="#+id/buyButton"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:adjustViewBounds="true"
android:paddingTop="7dip"
android:src="#drawable/buy_a_up_btn" />
<TextView
android:id="#+id/titleTv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="#id/buyButton"
android:background="#color/white"
android:paddingLeft="5dp"
android:text=""
android:textSize="20sp" />
<TextView
android:id="#+id/uploaderTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/titleTv"
android:paddingLeft="5dip"
android:paddingTop="5dp"
android:textColor="#color/verylightgrey"
android:textSize="16sp" />
<TextView
android:id="#+id/viewCountTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/titleTv"
android:layout_toRightOf="#id/uploaderTv"
android:paddingTop="5dp"
android:textColor="#android:color/black"
android:textSize="16sp" />
</RelativeLayout>

Related

Circular dependencies cannot exist in Relative Layout

I am a newbie in android. Got stuck cannot move forward without this. I don't understand where I am doing the mistake. Looked through the code for 2 hours but cannot find the error. I need serious help. Thank u in advance.
<?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:toomove ls="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimaryDark"
android:padding="16dp"
tools:context="com.zodiac.sanghvi.jplreborn.Admin_ScoreCard">
<TextView
android:id="#+id/Vs"
android:textColor="#f8f8f9"
android:gravity="center"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="Team1 Vs Team2"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<TextView
android:id="#+id/BatsMen1"
android:textColor="#f8f8f9"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="TextView"
android:layout_below="#+id/textView7"
android:layout_centerHorizontal="true" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#f8f8f9"
android:layout_marginTop="25sp"
android:text="Batting :"
android:textSize="17sp"
android:layout_below="#+id/Vs"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="#+id/Batting"
android:gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#f8f8f9"
android:text="TextView"
android:layout_above="#+id/BatsMen1"
android:layout_toLeftOf="#+id/textView6"
android:layout_toStartOf="#+id/textView6" />
<TextView
android:id="#+id/BatsMen2"
android:textColor="#f8f8f9"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/BatsMen1"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="TextView" />
<TextView
android:id="#+id/textView5"
android:textColor="#f8f8f9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="Bowling :"
android:textSize="17sp"
android:layout_below="#+id/BatsMen2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="#+id/Bowling"
android:textColor="#f8f8f9"
android:gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView5"
android:layout_alignEnd="#+id/Batting"
android:layout_alignRight="#+id/Batting"
android:text="TextView" />
<TextView
android:id="#+id/Bowler"
android:layout_width="match_parent"
android:textColor="#f8f8f9"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="TextView"
android:layout_below="#+id/Bowling"
android:layout_centerHorizontal="true" />
<EditText
android:id="#+id/Runs"
android:layout_width="80dp"
android:layout_height="60dp"
android:background="#f8f8f9"
android:textSize="35sp"
android:padding="9dp"
android:ems="10"
android:inputType="numberSigned" />
<EditText
android:id="#+id/Wickets"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="#f8f8f9"
android:textSize="35sp"
android:padding="9dp"
android:ems="10"
android:inputType="numberSigned"
android:layout_marginRight="27dp"
android:layout_marginEnd="27dp"
android:layout_alignBaseline="#+id/Runs"
android:layout_alignBottom="#+id/Runs"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<Button
android:id="#+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_alignParentBottom="true"
android:layout_alignRight="#+id/Runs"
android:layout_alignEnd="#+id/Runs"
android:layout_marginBottom="48dp" />
<TextView
android:id="#+id/textView4"
android:textColor="#f8f8f9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/Overs"
android:layout_alignStart="#+id/Overs"
android:layout_below="#+id/Overs"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="Overs"
android:layout_alignRight="#+id/Overs"
android:layout_alignEnd="#+id/Overs" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#f8f8f9"
android:text="Runs"
android:layout_below="#+id/Runs"
android:layout_centerHorizontal="true"
android:layout_marginTop="18dp" />
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/Wickets"
android:layout_alignStart="#+id/Wickets"
android:layout_alignTop="#+id/textView6"
android:textColor="#f8f8f9"
android:text="Wickets"
android:gravity="center"
android:layout_alignRight="#+id/Wickets"
android:layout_alignEnd="#+id/Wickets" />
<TextView
android:id="#+id/Choose"
android:textColor="#f8f8f9"
android:textSize="10sp"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/Vs"
android:text="Sultan Won The Toss And Choose to Bat"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<TextView
android:id="#+id/Overs"
android:layout_width="60dp"
android:layout_height="60dp"
android:text="TextView"
android:gravity="center"
android:background="#f8f8f9"
android:layout_marginTop="71dp"
android:layout_below="#+id/Bowler"
android:layout_toRightOf="#+id/textView4"
android:layout_toEndOf="#+id/textView4" />
</RelativeLayout>
TextView with id textView4 and TextView with id Overs are creating this circular dependency because:
TextView with id textView4 is alignLeft and alignRight to the TextView with id Overs. Again, TextView with id Overs is toRightOf to the TextView with id textView4.
It's not possible because they can't be dependent on each other.

Why shows the emulator not the whole layout in Android Studio?

I'm using Android Studio since some weeks. After my first experience I'm building my first APK und have a problem with the Relative layout.
After I'm putting the stuff (ImageBtn, TextView) into it and trying to run the app in the emulator, it shows only the left side.
enter image description here
<?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">
<ImageButton
android:id="#+id/imageButton5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="30dp"
android:background="#android:color/background_light"
app:srcCompat="#drawable/beer" />
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/imageButton5"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_toEndOf="#+id/imageButton5"
android:layout_toRightOf="#+id/imageButton5"
android:text="Beer"
android:textSize="18sp" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:text="Level 0"
android:textSize="18sp"
android:layout_alignBottom="#+id/imageButton5"
android:layout_alignLeft="#+id/textView11"
android:layout_alignStart="#+id/textView11" />
<ImageButton
android:id="#+id/imageButton6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="110dp"
android:background="#android:color/background_light"
app:srcCompat="#drawable/frenchfries" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView11"
android:layout_alignStart="#+id/textView11"
android:layout_alignTop="#+id/imageButton6"
android:text="French Frits"
android:textSize="18sp" />
<TextView
android:id="#+id/textView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Level 0"
android:textSize="18sp"
android:layout_centerVertical="true"
android:layout_alignLeft="#+id/textView13"
android:layout_alignStart="#+id/textView13" />
<ImageButton
android:id="#+id/imageButton7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="190dp"
android:background="#android:color/background_light"
app:srcCompat="#drawable/icecream" />
<TextView
android:id="#+id/textView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView14"
android:layout_alignStart="#+id/textView14"
android:layout_alignTop="#+id/imageButton7"
android:text="Ice Cream"
android:textSize="18sp" />
<TextView
android:id="#+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView15"
android:layout_alignStart="#+id/textView15"
android:layout_below="#+id/textView15"
android:text="Level 0"
android:textSize="18sp" />
<ImageButton
android:id="#+id/imageButton9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/background_light"
app:srcCompat="#drawable/pizza"
android:layout_alignTop="#+id/textView11"
android:layout_toRightOf="#+id/textView13"
android:layout_toEndOf="#+id/textView13"
android:layout_marginLeft="28dp"
android:layout_marginStart="28dp" />
<TextView
android:id="#+id/textView17"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView12"
android:layout_marginLeft="14dp"
android:layout_marginStart="14dp"
android:layout_toEndOf="#+id/imageButton9"
android:layout_toRightOf="#+id/imageButton9"
android:text="Pizza"
android:textSize="18sp" />
<TextView
android:id="#+id/textView18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Level 0"
android:textSize="18sp"
android:layout_below="#+id/textView11"
android:layout_alignLeft="#+id/textView17"
android:layout_alignStart="#+id/textView17" />
<TextView
android:id="#+id/textView19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView15"
android:layout_marginLeft="102dp"
android:layout_marginStart="102dp"
android:layout_toEndOf="#+id/textView18"
android:layout_toRightOf="#+id/textView18"
android:text="TextView" />
</RelativeLayout>
Hope you can help me to fix that problem.
Greetings Phil Newman
I will present two ways I would do this if it was me. So you can also choose from this to suit your need.
METHOD ONE
You can use a LinearLayout with vertical orientation as the parent layout.
Use another LinearLayout with horizontal orientation to host a two RelativeLayouts. Each RelativeLayout will also contain the three components(ImageButton, TextViews).
Looks at an xml text I have presented here:
<LinearLayout
android:id="#+id/lay1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".50">
<ImageButton
android:id="#+id/imageButton5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="30dp"
android:background="#android:color/background_light"
app:srcCompat="#drawable/beer" />
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/imageButton5"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_toEndOf="#+id/imageButton5"
android:layout_toRightOf="#+id/imageButton5"
android:text="Beer"
android:textSize="18sp" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:text="Level 0"
android:textSize="18sp"
android:layout_alignBottom="#+id/imageButton5"
android:layout_alignLeft="#+id/textView11"
android:layout_alignStart="#+id/textView11" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".50">
<ImageButton
android:id="#+id/imageButton6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="30dp"
android:background="#android:color/background_light"
app:srcCompat="#drawable/frenchfries" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/imageButton6"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_toEndOf="#+id/imageButton6"
android:layout_toRightOf="#+id/imageButton6"
android:text="French Frits"
android:textSize="18sp" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:text="Level 0"
android:textSize="18sp"
android:layout_alignBottom="#+id/imageButton6"
android:layout_alignLeft="#+id/textView1"
android:layout_alignStart="#+id/textView1" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/lay2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".50">
<ImageButton
android:id="#+id/imageButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="30dp"
android:background="#android:color/background_light"
app:srcCompat="#drawable/icecream" />
<TextView
android:id="#+id/textView0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/imageButton2"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_toEndOf="#+id/imageButton2"
android:layout_toRightOf="#+id/imageButton2"
android:text="Ice Cream"
android:textSize="18sp" />
<TextView
android:id="#+id/textView102"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:text="Level 0"
android:textSize="18sp"
android:layout_alignBottom="#+id/imageButton2"
android:layout_alignLeft="#+id/textView0"
android:layout_alignStart="#+id/textView0" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight=".50">
<ImageButton
android:id="#+id/imageButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="30dp"
android:background="#android:color/background_light"
app:srcCompat="#drawable/pizza" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/imageButton3"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_toEndOf="#+id/imageButton3"
android:layout_toRightOf="#+id/imageButton3"
android:text="Pizza"
android:textSize="18sp" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:text="Level 0"
android:textSize="18sp"
android:layout_alignBottom="#+id/imageButton3"
android:layout_alignLeft="#+id/textView3"
android:layout_alignStart="#+id/textView3" />
</RelativeLayout>
</LinearLayout>
You can analyse it carefully and just copy and paste depending on the number of buttons(your categories) you want.
METHOD TWO
Arrange everything well in the Relative layout (linearly or preferably a LinearLayout) and put the RelativeLayout in a ScrollView layout as the parent layout. This will enable the user to scroll down and up if the widgets are out of view.
Also here is an xml for that:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/imageButton5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="30dp"
android:background="#android:color/background_light"
app:srcCompat="#drawable/beer" />
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/imageButton5"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_toEndOf="#+id/imageButton5"
android:layout_toRightOf="#+id/imageButton5"
android:text="Beer"
android:textSize="18sp" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:text="Level 0"
android:textSize="18sp"
android:layout_alignBottom="#+id/imageButton5"
android:layout_alignLeft="#+id/textView11"
android:layout_alignStart="#+id/textView11" />
<ImageButton
android:id="#+id/imageButton6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="110dp"
android:background="#android:color/background_light"
app:srcCompat="#drawable/frenchfries" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView11"
android:layout_alignStart="#+id/textView11"
android:layout_alignTop="#+id/imageButton6"
android:text="French Frits"
android:textSize="18sp" />
<!-- android:layout_marginBottom="7dp" -->
<TextView
android:id="#+id/textView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="7dp"
android:text="Level 0"
android:textSize="18sp"
android:layout_alignBottom="#+id/imageButton6"
android:layout_alignLeft="#+id/textView13"
android:layout_alignStart="#+id/textView13"/>
<ImageButton
android:id="#+id/imageButton7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="190dp"
android:background="#android:color/background_light"
app:srcCompat="#drawable/icecream" />
<TextView
android:id="#+id/textView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView14"
android:layout_alignStart="#+id/textView14"
android:layout_alignTop="#+id/imageButton7"
android:text="Ice Cream"
android:textSize="18sp" />
<TextView
android:id="#+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView15"
android:layout_alignStart="#+id/textView15"
android:layout_below="#+id/textView15"
android:text="Level 0"
android:textSize="18sp" />
<ImageButton
android:id="#+id/imageButton9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/background_light"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginTop="270dp"
app:srcCompat="#drawable/pizza" />
<TextView
android:id="#+id/textView17"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView16"
android:layout_alignStart="#+id/textView16"
android:layout_alignTop="#+id/imageButton9"
android:text="Pizza"
android:textSize="18sp" />
<TextView
android:id="#+id/textView18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Level 0"
android:textSize="18sp"
android:layout_alignLeft="#+id/textView17"
android:layout_alignStart="#+id/textView17"
android:layout_below="#+id/textView17" />
</RelativeLayout>

How to disable horizontal scrolling in crystal seek bar Android

I am using crystal seekbar for horizontal scroll but i need to disable the scrolling...I have relative layout with crystakseekbar inside relative layout with disable mode so don't want to scroll the crystalseekbar when layout in disable mode.
<RelativeLayout
android:id="#+id/adjust_card_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/adjust_card_disable_background"
android:layout_below="#+id/card_layout"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:paddingBottom="40dp"
android:paddingTop="40dp">
<RelativeLayout
android:id="#+id/adjust_text_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true">
<TextView
android:id="#+id/select_card_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/select_card"
android:layout_centerHorizontal="true"
android:textColor="#color/white"
android:textSize="15sp"
android:textStyle="bold"
android:visibility="visible"/>
<TextView
android:id="#+id/adjust_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Adjust values for"
android:textColor="#color/white"
android:textSize="15sp"
android:visibility="gone"/>
<TextView
android:id="#+id/shop_visit_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="First Shop"
android:textColor="#color/white"
android:textSize="15sp"
android:textStyle="bold"
android:layout_toRightOf="#+id/adjust_text"
android:visibility="gone"
android:layout_marginLeft="5dp"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="2"
android:layout_below="#+id/adjust_text_layout"
android:layout_marginBottom="20dp">
<RelativeLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/adjust_hours_layout"
android:layout_centerHorizontal="true">
<TextView
android:id="#+id/adjustHours"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Adjust Hours"
android:textAllCaps="true"
android:textColor="#color/white"
android:textSize="15sp"
android:paddingBottom="5dp"
android:layout_alignBottom="#+id/adjust_hours"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"/>
<TextView
android:id="#+id/adjust_hours"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:background="#A2B0BE"
android:paddingLeft="40dp"
android:paddingRight="40dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textColor="#color/white"
android:textSize="20sp"
android:layout_marginRight="20dp"
android:layout_alignParentRight="true"
android:layout_marginTop="20dp"/>
</RelativeLayout>
<com.crystal.crystalrangeseekbar.widgets.CrystalSeekbar
android:id="#+id/rangeSeekbar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/adjust_hours_layout"
android:layout_marginTop="30dp"
app:bar_color="#color/hours_back"
app:bar_highlight_color="#color/btn_back"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
app:left_thumb_color="#color/white"
app:left_thumb_color_pressed="#color/white"
app:corner_radius="05"
app:data_type="_integer"
/>
<TextView
android:id="#+id/textMin1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MIN"
android:layout_below="#id/rangeSeekbar1"
android:layout_marginTop="3dp"
android:layout_alignLeft="#+id/rangeSeekbar1"
android:layout_marginLeft="12dp"
android:textSize="13dp"
android:textColor="#color/white"/>
<TextView
android:id="#+id/textMax1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MAX"
android:layout_below="#id/rangeSeekbar1"
android:layout_marginTop="3dp"
android:textSize="13dp"
android:textColor="#color/white"
android:layout_alignRight="#+id/rangeSeekbar1"
android:layout_marginRight="12dp"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/adjust_mr_layout"
android:layout_centerHorizontal="true">
<TextView
android:id="#+id/adjustMr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Adjust Mr"
android:textAllCaps="true"
android:textColor="#color/white"
android:textSize="15sp"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:paddingBottom="5dp"
android:layout_alignBottom="#+id/adjust_mr"/>
<TextView
android:id="#+id/adjust_mr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:background="#A2B0BE"
android:paddingLeft="40dp"
android:paddingRight="40dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textColor="#color/white"
android:textSize="20sp"
android:layout_marginRight="20dp"
android:layout_alignParentRight="true"
android:layout_marginTop="20dp"/>
</RelativeLayout>
<com.crystal.crystalrangeseekbar.widgets.CrystalSeekbar
android:id="#+id/rangeSeekbar2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/adjust_mr_layout"
android:layout_marginTop="30dp"
app:bar_color="#A2B0BE"
app:bar_highlight_color="#color/btn_back"
app:left_thumb_color="#color/white"
app:left_thumb_color_pressed="#color/white"
app:corner_radius="05"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
app:data_type="_integer"
/>
<TextView
android:id="#+id/textMin2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MIN"
android:layout_below="#id/rangeSeekbar2"
android:layout_marginTop="3dp"
android:layout_alignLeft="#+id/rangeSeekbar2"
android:textSize="13dp"
android:textColor="#color/white"
android:layout_marginLeft="12dp"/>
<TextView
android:id="#+id/textMax2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MAX"
android:layout_below="#id/rangeSeekbar2"
android:layout_marginTop="3dp"
android:textSize="13dp"
android:textColor="#color/white"
android:layout_alignRight="#+id/rangeSeekbar2"
android:layout_marginRight="12dp"/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
Disabling the parent layout is OK. But this will not disable the inner children. To disable the seekbar, you have to write seekbar.setEnabled(false);

How to design in 10 inch tablet only in portrait mode in Android?

I have to design an application for 10 inch tab in Android.But when i run the application the design is in blur or not clear .I don't know why. I have also declare the android:screenOrientation="portrait" in manifest .How to design properly and where I'm doing wrong in xml file.Thanks in advance.
Here is my xml file code
<?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:background="#android:color/white" >
<ImageView
android:id="#+id/imageLogoBBT"
android:layout_width="400dp"
android:layout_height="80dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:contentDescription="#string/desc"
android:scaleType="fitXY"
android:src="#drawable/banya_tree_logo" />
<ImageView
android:id="#+id/imageButtonBack"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="15dp"
android:layout_marginTop="18dp"
android:contentDescription="#string/desc"
android:scaleType="fitCenter"
android:src="#drawable/back_img" />
<RelativeLayout
android:id="#+id/relImagLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/imageLogoBBT"
android:background="#drawable/inner_back"
android:padding="5dp" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E6E9E9" >
<TextView
android:id="#+id/textViewTitle"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="#string/APPLICATION_FOR_FUND_TRANSFER"
android:textColor="#32241F"
android:textSize="25sp"
android:textStyle="bold" >
</TextView>
<TextView
android:id="#+id/APPLICANTS_INFORMATION_Detail"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textViewTitle"
android:layout_marginLeft="10dp"
android:text="#string/APPLICANTS_INFORMATION"
android:textColor="#32241F"
android:textSize="20sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/linearScroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/lastrowLayout"
android:layout_below="#+id/APPLICANTS_INFORMATION_Detail"
android:baselineAligned="false"
android:orientation="horizontal" >
<ScrollView
android:id="#+id/scrollFormOne"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:baselineAligned="false"
android:orientation="vertical"
android:padding="2dp" >
<LinearLayout
android:id="#+id/linearlayout_One"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/linearlayout_textView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="horizontal" >
<TextView
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginTop="5dp"
android:layout_weight="0.10"
android:gravity="left"
android:text="#string/title"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<TextView
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginTop="5dp"
android:layout_weight="0.25"
android:gravity="left"
android:paddingLeft="5dp"
android:text="#string/last_name"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<TextView
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginTop="5dp"
android:layout_weight="0.25"
android:gravity="left"
android:paddingLeft="5dp"
android:text="#string/first_name"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearlayout_EditText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:baselineAligned="false"
android:orientation="horizontal" >
<Spinner
android:id="#+id/gps_spinnertitleName"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:layout_weight="0.10"
android:background="#drawable/button_shape"
android:gravity="center"
android:inputType="text"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gps_edittextLastName"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_weight="0.25"
android:background="#drawable/button_shape"
android:gravity="left"
android:inputType="text"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gps_editTextFirst"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:layout_weight="0.25"
android:background="#drawable/button_shape"
android:gravity="left"
android:inputType="text"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<ScrollView
android:id="#+id/scrollFrorm_Two"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:baselineAligned="false"
android:orientation="vertical"
android:padding="2dp" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="#string/Beneficiary_Address"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_Beneficiary_Address"
android:layout_width="fill_parent"
android:layout_height="80dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="textMultiLine"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="#string/Beneficiary_Account_No"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_Beneficiary_Account_No"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="number"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="#string/Beneficiary_Bank_Name"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_Beneficiary_Bank_Name"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="text"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="#string/Beneficiary_Bank_Address"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_Beneficiary_Bank_Address"
android:layout_width="fill_parent"
android:layout_height="80dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="textMultiLine"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="#string/BIC_Chips_ID_BSB_Code_Fed_Wire_ABA_Sort_Code"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_BIC_Chips_ID_BSB"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="text"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="#string/Intermediary_Bank_Name"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_Intermediary_Bank_Name"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="text"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="#string/Intermediary_Bank_Address"
android:textColor="#241444"
android:textSize="19sp"
android:textStyle="normal" />
<EditText
android:id="#+id/gspET_Intermediary_Bank_Address"
android:layout_width="fill_parent"
android:layout_height="80dp"
android:layout_marginTop="5dp"
android:background="#drawable/button_shape"
android:inputType="textMultiLine"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:textColor="#241444"
android:textSize="19sp" />
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:id="#+id/lastrowLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="7dp"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="10dp" >
<CheckBox
android:id="#+id/android"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.50"
android:text="#string/I_Accept_Terms_Conditions"
android:textColor="#android:color/black" />
<ImageView
android:id="#+id/buttonSubmit_Next"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_weight="0.40"
android:contentDescription="#string/desc"
android:src="#drawable/next_btton" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
Screen Shot 2014-06-24 at 4.05.30 PM
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
>
// your left side part
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
>
// your right side part
</LinearLayout>
</LinearLayout>
and also use different images for 10 inch tablets
Do not scale the images using layout_width or layout_height by your self. I can see in the ImageView you have specified dp values, this will make system to scale your image which may cause blur. Instead use size and density-specific resources inside drawable folders like
res/drawable-mdpi/icon.png //for medium-density screens
res/drawable-hdpi/icon.png //for high-density screens
You can create specific layout suitable to the screen size and palce it in res\layout-xxx folders
Wherever possible use 9-patch images
If you have only one image and have to be scaled for different screen then use highest resolution image and keep it in drawable-nodpi folder and specify either height or width and lets system decide other so that image get scaled properly.
Read : http://developer.android.com/guide/practices/screens_support.html#screen-independence
Image scaling: http://argillander.wordpress.com/2011/11/24/scale-image-into-imageview-then-resize-imageview-to-match-the-image/

Why different android versions display different GUI?

Please have a look at the following code
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/tableLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFF"
android:gravity="right"
android:padding="5dp"
android:paddingBottom="5dp"
android:stretchColumns="1,2,3"
tools:context=".MainActivity" >
<TableRow
android:id="#+id/tableRow0"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/billTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:padding="5dp"
android:text="#string/billTextView"
android:textColor="#000" />
<EditText
android:id="#+id/billEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="3"
android:layout_weight="1"
android:inputType="numberDecimal"
android:longClickable="false" >
<requestFocus />
</EditText>
</TableRow>
<TableRow
android:id="#+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/tenTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_weight="1"
android:gravity="center"
android:text="10%"
android:textColor="#000" />
<TextView
android:id="#+id/fifteenTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="15%"
android:textColor="#000" />
<TextView
android:id="#+id/twentyTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="20%"
android:textColor="#000" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/tipTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:padding="5dp"
android:text="#string/tipTxtView"
android:textColor="#000" />
<EditText
android:id="#+id/tip10EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
<EditText
android:id="#+id/tip15EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
<EditText
android:id="#+id/tip20EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/totalTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:padding="5dp"
android:text="#string/totalTextView"
android:textColor="#000" />
<EditText
android:id="#+id/total10EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
<EditText
android:id="#+id/total15EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
<EditText
android:id="#+id/total20EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/customTextView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="right|center_vertical"
android:padding="5dp"
android:text="#string/customTextView"
android:textColor="#000" />
<SeekBar
android:id="#+id/customSeekBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_span="2"
android:layout_weight="1"
android:focusable="false"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:progress="18" />
<TextView
android:id="#+id/customTipTextView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:text="a"
android:textColor="#000" />
</TableRow>
<TableRow
android:id="#+id/tableRow5"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/tipCustomTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:padding="5dp"
android:text="#string/tipCustomTextView"
android:textColor="#000" />
<EditText
android:id="#+id/tipCustomEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
<TextView
android:id="#+id/totalCustomTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center|right"
android:padding="5dp"
android:text="#string/totalCustomTextView"
android:textColor="#000" />
<EditText
android:id="#+id/totalCustomEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cursorVisible="false"
android:focusable="false"
android:gravity="center"
android:longClickable="false"
android:textSize="14sp" />
</TableRow>
</TableLayout>
The project is created using Android Version 3.2.
This is how it get displayed in Galaxy Nexus, which is set to Android version 2.3.3
This is how it get displayed in Galaxy Nexus, which is set to Android version 3.2
As you can see, in that new version one, the GUI is bit upset. It seems like the components are overlapping. That is why it doesn't show the borders of the components. Please help!
Yep, this is normal. The visual appearance of Android has been greatly polished with Android 4.0. It has nothing to do with your code directly. Android does this automatically.
If you want all your users to see the old style, you can set down the targetVersion within the <uses-sdk> tag of your manifest file. However, I discourage you from doing this.

Categories

Resources