Grid layout has space on last column - android

I have set up a grid layout with 6 columns and there is a space between column 5 and 6. The grid contains image buttons all with the same size. I have tried to use fill_parent and wrap_content but the gap still shows. I have also tried layout gravity=1 without results.
button image dimensions 104 x 104 pixels
The device is Samsung tab A
<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:layout_gravity="center_horizontal"
tools:context=".Main">
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:id="#+id/grid"
android:columnCount="6"
>
<TextView
android:layout_width="175dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="MASTER 100"
android:id="#+id/textView_master"
android:layout_row="0"
android:layout_column="0"
android:layout_columnSpan="2"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"
android:textSize="20sp"
android:gravity="center_horizontal"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/masterup"
android:layout_row="1"
android:layout_column="0"
android:background="#drawable/masterup"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/masterdn"
android:layout_row="1"
android:layout_column="1"
android:background="#drawable/masterdn"
android:layout_margin="#dimen/button_margin"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="117dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="100"
android:id="#+id/tv_RGBAW_Value"
android:layout_row="1"
android:layout_column="2"
android:layout_columnSpan="3"
android:textSize="100dp"
android:textIsSelectable="true"
android:textColor="#0aff1f"
android:paddingTop="10dp"
android:layout_gravity="center_horizontal"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/blackout"
android:layout_row="1"
android:layout_column="5"
android:background="#drawable/blackout"
android:layout_margin="#dimen/button_margin"
/>
<TextView
android:layout_width="565dp"
android:layout_height="45dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Fixture"
android:id="#+id/tv_fixture_data"
android:layout_row="3"
android:layout_column="0"
android:layout_columnSpan="6"
android:textSize="30sp"
android:textIsSelectable="false"
android:paddingLeft="15dp"
android:paddingTop="5dp"
android:linksClickable="true"
android:singleLine="true"
android:background="#d8ffba"
android:textColor="#120dff"
/>
<Space
android:layout_width="20px"
android:layout_height="20px"
android:layout_row="4"
android:layout_column="0"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="100"
android:id="#+id/textViewred"
android:layout_row="5"
android:layout_column="0"
android:layout_gravity="center_horizontal"
android:textSize="20sp"
android:textColor="#0fff33"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="100"
android:id="#+id/textViewgreen"
android:layout_row="5"
android:layout_column="1"
android:layout_gravity="center_horizontal"
android:textSize="20sp"
android:textColor="#0fff33"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="100"
android:id="#+id/textViewblue"
android:layout_row="5"
android:layout_column="2"
android:layout_gravity="center_horizontal"
android:textSize="20sp"
android:textColor="#0fff33"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="100"
android:id="#+id/textViewamber"
android:layout_row="5"
android:layout_column="3"
android:layout_gravity="center_horizontal"
android:textSize="20sp"
android:textColor="#0fff33"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="100"
android:id="#+id/textViewwhite"
android:layout_row="5"
android:layout_column="4"
android:textSize="20sp"
android:layout_gravity="center_horizontal"
android:textColor="#0fff33"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="SLOW"
android:id="#+id/tv_speed"
android:layout_row="5"
android:layout_column="5"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"
android:textSize="20sp"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/redup"
android:layout_row="7"
android:layout_column="0"
android:background="#drawable/redup"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/greenup"
android:layout_row="7"
android:layout_column="1"
android:background="#drawable/greenup"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/blueup"
android:layout_row="7"
android:layout_column="2"
android:background="#drawable/blueup"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/amberup"
android:layout_row="7"
android:layout_column="3"
android:background="#drawable/amberup"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/whiteup"
android:layout_row="7"
android:layout_column="4"
android:background="#drawable/whiteup"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/speed"
android:layout_row="7"
android:layout_column="5"
android:background="#drawable/speed"
android:layout_margin="#dimen/button_margin"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="RED"
android:id="#+id/red_active"
android:layout_row="8"
android:layout_column="0"
android:gravity="center"
android:textAlignment="center"
android:layout_gravity="center_horizontal"
android:textColor="#fdffff"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="GREEN"
android:id="#+id/green_active"
android:layout_row="8"
android:layout_column="1"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="BLUE"
android:id="#+id/blue_Active"
android:layout_row="8"
android:layout_column="2"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="AMBER"
android:id="#+id/amber_active"
android:layout_row="8"
android:layout_column="3"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="WHITE"
android:id="#+id/white_active"
android:layout_row="8"
android:layout_column="4"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/reddn"
android:layout_row="9"
android:layout_column="0"
android:background="#drawable/reddn"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/greendn"
android:layout_row="9"
android:layout_column="1"
android:background="#drawable/greendn"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/bluedn"
android:layout_row="9"
android:layout_column="2"
android:background="#drawable/bluedn"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/amberdn"
android:layout_row="9"
android:layout_column="3"
android:background="#drawable/amberdn"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/whitedn"
android:layout_row="9"
android:layout_column="4"
android:background="#drawable/whitedn"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/full"
android:layout_row="9"
android:layout_column="5"
android:background="#drawable/full"
android:layout_margin="#dimen/button_margin"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="FIXTURES"
android:id="#+id/tv_fixturestatus"
android:layout_row="10"
android:layout_column="0"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/q1"
android:layout_row="11"
android:layout_column="0"
android:background="#drawable/q1_buttons"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/q2"
android:layout_row="11"
android:layout_column="1"
android:background="#drawable/q2_buttons"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/q3"
android:layout_row="11"
android:layout_column="2"
android:background="#drawable/q3_buttons"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/q4"
android:layout_row="11"
android:layout_column="3"
android:background="#drawable/q4_buttons"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/play"
android:layout_row="11"
android:layout_column="4"
android:background="#drawable/play_button"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/record"
android:layout_row="11"
android:layout_column="5"
android:background="#drawable/rec"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/q5"
android:layout_row="12"
android:layout_column="0"
android:background="#drawable/q5_buttons"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/q6"
android:layout_row="12"
android:layout_column="1"
android:background="#drawable/q6_buttons"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/q7"
android:layout_row="12"
android:layout_column="2"
android:background="#drawable/q7_buttons"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/q8"
android:layout_row="12"
android:layout_column="3"
android:background="#drawable/q8_buttons"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/group"
android:layout_row="12"
android:layout_column="4"
android:background="#drawable/go"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/all"
android:layout_row="12"
android:layout_column="5"
android:background="#drawable/all"
android:layout_margin="#dimen/button_margin"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="COLOR ROLL"
android:id="#+id/textView2"
android:layout_row="13"
android:layout_column="0"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/cr1"
android:layout_row="14"
android:layout_column="0"
android:background="#drawable/rc1"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/cr2"
android:layout_row="14"
android:layout_column="1"
android:background="#drawable/cr2"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/cr3"
android:layout_row="14"
android:layout_column="2"
android:background="#drawable/cr3"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/cr_stop"
android:layout_row="14"
android:layout_column="3"
android:background="#drawable/cr_stop"
android:layout_margin="#dimen/button_margin"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/shift"
android:layout_row="14"
android:layout_column="5"
android:background="#drawable/shift"
android:layout_margin="#dimen/button_margin"
/>
<Space
android:layout_width="20px"
android:layout_height="190px"
android:layout_row="15"
android:layout_column="0"/>
</GridLayout>
I use an button margin
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="button_margin">5dp</dimen>
<dimen name="image_button_height">85dp</dimen>
<dimen name="image_button_width">85dp</dimen>

Related

cant move the text near each other

Hello i having some problem design the app I working on
I'm trying to make the TextEdit and The TextView be near each other but they still at the same place
i'm using a grid layout because I want the app be available for all sizes of all the devices
i'm kind of a beginner so I don't understand so much on developing android apps
<GridLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnCount="3"
android:rowCount="7">
<TextView
android:id="#+id/WelcomeText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_row="0"
android:layout_gravity="left"
android:text="Welcome To My App"
android:textColor="#android:color/background_dark"
/>
<TextView
android:id="#+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_row="1"
android:layout_gravity="left"
android:text="Please fill the information"
android:textColor="#android:color/holo_blue_dark"
android:textSize="16sp" />
<TextView
android:id="#+id/nameTxt"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="left"
android:layout_column="0"
android:layout_row="2"
android:text="Name:"
android:textColor="#android:color/black"
android:textSize="16sp"/>
<EditText
android:id="#+id/Name"
style="#style/Widget.AppCompat.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:a
android:layout_toEndOf="#id/nameTxt"
android:layout_row="2"
android:layout_column="1"
android:ems="14"
android:capitalize="sentences"
android:inputType="textPersonName"
android:visibility="visible"/>
<TextView
android:id="#+id/phoneTxt"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="left"
android:layout_column="0"
android:layout_row="3"
android:text="Phone:"
android:textColor="#android:color/black"
android:textSize="16sp"/>
<EditText
android:id="#+id/Phone"
style="#style/Widget.AppCompat.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="3"
android:ems="14"
android:inputType="phone"
android:visibility="visible"/>
<TextView
android:id="#+id/emailTxt"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="left"
android:layout_column="0"
android:layout_row="4"
android:text="Email:"
android:textColor="#android:color/black"
android:textSize="16sp"/>
<EditText
android:id="#+id/Email"
style="#style/Widget.AppCompat.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="4"
android:ems="14"
android:inputType="textEmailAddress"
android:visibility="visible"/>
<TextView
android:id="#+id/ageTxt"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="left"
android:layout_column="0"
android:layout_row="5"
android:text="Age:"
android:textColor="#android:color/black"
android:textSize="16sp"/>
<EditText
android:id="#+id/Age"
style="#style/Widget.AppCompat.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="5"
android:ems="14"
android:inputType="number"
android:hint="Age:"
android:visibility="visible"/>
<Button
android:id="#+id/nextBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_row="6"
android:text="Next"
android:layout_gravity="center"
android:background="#android:color/holo_blue_dark"
/>
</GridLayout>
how it looks like
the red arrows represent where I want the EditText to be (at the end of each Text View)
You have to bring "info" and "WelcomeText" and "nextBtn" out of "GridLayout", then add LinearLayout:
<LinearLayout
android:layout_width="576dp"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:layout_editor_absoluteY="0dp"
tools:layout_editor_absoluteX="8dp">
<TextView
android:id="#+id/WelcomeText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left"
android:layout_row="0"
android:text="Welcome To My App"
android:textColor="#android:color/background_dark" />
<TextView
android:id="#+id/info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="Please fill the information"
android:textColor="#android:color/holo_blue_dark"
android:textSize="16sp" />
<GridLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnCount="3"
android:rowCount="7">
<TextView
android:id="#+id/nameTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left"
android:layout_row="2"
android:text="Name:"
android:textColor="#android:color/black"
android:textSize="16sp" />
<EditText
android:id="#+id/Name"
style="#style/Widget.AppCompat.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="2"
android:layout_toEndOf="#id/nameTxt"
android:a
android:capitalize="sentences"
android:ems="14"
android:inputType="textPersonName"
android:visibility="visible" />
<TextView
android:id="#+id/phoneTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left"
android:layout_row="3"
android:text="Phone:"
android:textColor="#android:color/black"
android:textSize="16sp" />
<EditText
android:id="#+id/Phone"
style="#style/Widget.AppCompat.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="3"
android:ems="14"
android:inputType="phone"
android:visibility="visible" />
<TextView
android:id="#+id/emailTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left"
android:layout_row="4"
android:text="Email:"
android:textColor="#android:color/black"
android:textSize="16sp" />
<EditText
android:id="#+id/Email"
style="#style/Widget.AppCompat.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="4"
android:ems="14"
android:inputType="textEmailAddress"
android:visibility="visible" />
<TextView
android:id="#+id/ageTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left"
android:layout_row="5"
android:text="Age:"
android:textColor="#android:color/black"
android:textSize="16sp" />
<EditText
android:id="#+id/Age"
style="#style/Widget.AppCompat.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="5"
android:ems="14"
android:hint="Age:"
android:inputType="number"
android:visibility="visible" />
</GridLayout>
<Button
android:id="#+id/nextBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#android:color/holo_blue_dark"
android:text="Next" />
</LinearLayout>

android grid layout allignment

at the moment i'm building schedule view and i have one problem. how to make grid layout take all the screen space equally?
as you can see (column), friday takes up all the space that's left. same with hours (rows), if the screen is bigger, last one will takes all the space. (damn, cannot upload pictures, because i dont have enough rep)
<?xml version="1.0" encoding="utf-8"?>
<TextView android:text="FONTYS LOGO"
android:layout_width="wrap_content"
android:layout_height="70dp"
android:layout_gravity="left"
android:id="#+id/textView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:rowCount="12"
android:columnCount="15"
android:layout_below="#+id/textView"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:layout_row="0"
android:layout_column="0"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:layout_gravity="center"
android:id="#+id/firstLessonTextView"
android:layout_row="0"
android:layout_column="1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2"
android:layout_gravity="center"
android:id="#+id/textView3"
android:layout_row="0"
android:layout_column="2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3"
android:layout_gravity="center"
android:id="#+id/textView4"
android:layout_row="0"
android:layout_column="3" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="4"
android:layout_gravity="center"
android:id="#+id/textView5"
android:layout_row="0"
android:layout_column="4" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:layout_gravity="center"
android:id="#+id/textView6"
android:layout_row="0"
android:layout_column="5" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6"
android:layout_gravity="center"
android:id="#+id/textView7"
android:layout_row="0"
android:layout_column="6" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="7"
android:layout_gravity="center"
android:id="#+id/textView8"
android:layout_row="0"
android:layout_column="7" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="8"
android:layout_gravity="center"
android:id="#+id/textView9"
android:layout_row="0"
android:layout_column="8" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9"
android:layout_gravity="center"
android:id="#+id/textView10"
android:layout_row="0"
android:layout_column="9" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10"
android:layout_gravity="center"
android:id="#+id/textView11"
android:layout_row="0"
android:layout_column="10" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="11"
android:layout_gravity="center"
android:id="#+id/textView12"
android:layout_row="0"
android:layout_column="11" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="12"
android:layout_gravity="center"
android:id="#+id/textView13"
android:layout_row="0"
android:layout_column="12" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="13"
android:layout_gravity="center"
android:id="#+id/textView14"
android:layout_row="0"
android:layout_column="13" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="08.45"
android:id="#+id/firstLessonTimeTextView"
android:layout_row="1"
android:layout_column="1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="09.35"
android:paddingLeft="3dp"
android:id="#+id/textView15"
android:layout_row="1"
android:layout_column="2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10.45"
android:paddingLeft="3dp"
android:id="#+id/textView16"
android:layout_row="1"
android:layout_column="3" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="11.35"
android:paddingLeft="3dp"
android:id="#+id/textView17"
android:layout_row="1"
android:layout_column="4" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="12.25"
android:paddingLeft="3dp"
android:id="#+id/textView18"
android:layout_row="1"
android:layout_column="5" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="13.15"
android:paddingLeft="3dp"
android:id="#+id/textView19"
android:layout_row="1"
android:layout_column="6" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="14.05"
android:paddingLeft="3dp"
android:id="#+id/textView20"
android:layout_row="1"
android:layout_column="7" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="15.15"
android:paddingLeft="3dp"
android:id="#+id/textView21"
android:layout_row="1"
android:layout_column="8" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="16.05"
android:paddingLeft="3dp"
android:id="#+id/textView22"
android:layout_row="1"
android:layout_column="9" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="16.55"
android:paddingLeft="3dp"
android:id="#+id/textView23"
android:layout_row="1"
android:layout_column="10" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="18.00"
android:paddingLeft="3dp"
android:id="#+id/textView24"
android:layout_row="1"
android:layout_column="11" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="18.50"
android:paddingLeft="3dp"
android:id="#+id/textView25"
android:layout_row="1"
android:layout_column="12" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="20.00"
android:paddingLeft="3dp"
android:id="#+id/textView26"
android:layout_row="1"
android:layout_column="13" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mon"
android:textSize="13sp"
android:layout_gravity="center"
android:layout_row="2"
android:layout_column="0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/gradesDateMondayID"
android:textSize="13sp"
android:layout_row="3"
android:layout_column="0"
android:layout_gravity="center"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tue"
android:textSize="13sp"
android:layout_gravity="center"
android:layout_row="4"
android:layout_column="0"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text=""
android:layout_row="5"
android:layout_column="0"
android:id="#+id/gradesDateTuesdayID"
android:textSize="13sp"
android:layout_gravity="center"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Wed"
android:textSize="13sp"
android:layout_gravity="center"
android:layout_row="6"
android:layout_column="0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:layout_marginLeft="3dp"
android:id="#+id/gradesDateWednesdayID"
android:textSize="13sp"
android:layout_row="7"
android:layout_column="0"
android:layout_gravity="center"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Thu"
android:textSize="13sp"
android:layout_gravity="center"
android:layout_row="8"
android:layout_column="0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:layout_marginLeft="3dp"
android:layout_gravity="center"
android:id="#+id/gradesDateThursdayID"
android:textSize="13sp"
android:layout_row="9"
android:layout_column="0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fri"
android:textSize="13sp"
android:layout_gravity="center"
android:layout_row="10"
android:layout_column="0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:layout_marginLeft="3dp"
android:id="#+id/gradesDateFridayID"
android:textSize="13sp"
android:layout_row="11"
android:layout_column="0"
android:layout_gravity="center"/>
</GridLayout>
parameters on all textviews are the same. all 15colums and 12 rows are used. hope you can help me
the solution is :
in your layout , you should declare :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<GridView
android:id="#+id/fragment_dandan_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColumns="3"
android:paddingTop="10dp"
android:listSelector="#0099f1"
android:divider="#drawable/parand_line_divider"
android:dividerHeight="1dp"
android:footerDividersEnabled="false"
android:headerDividersEnabled="false" />
</RelativeLayout>
i praper some tutorial for you , that be useful :
AndroidHive Tutorial
Mkyong Tutorial , That be Very Clear
update
you need something like this :

How to align buttons in Android

I want to create buttons for each "letter" A to Z. Whatever I do I can't align some of them abreast. I cant add more than 2 rows and 6 buttons for each row even though there is space on the right. How can I create buttons A to Z?
http://postimg.org/image/5h4wyfuj5/
<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"
tools:context="com.kelimeoyunu.Kelime" >
<TextView
android:id="#+id/kelime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="26dp"
android:layout_toRightOf="#+id/button1"
android:text="test" />
<Button
android:id="#+id/button2"
style="?android:attr/buttonStyleSmall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_below="#+id/kelime"
android:layout_marginLeft="24dp"
android:layout_marginTop="81dp"
android:background="#layout/mybutton"
android:gravity="center"
android:text="A"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/button4"
style="?android:attr/buttonStyleSmall"
android:gravity="center"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignBaseline="#+id/button2"
android:layout_alignBottom="#+id/button2"
android:layout_toRightOf="#+id/button2"
android:background="#layout/mybutton"
android:text="B"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/button3"
style="?android:attr/buttonStyleSmall"
android:gravity="center"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignBaseline="#+id/button4"
android:layout_alignBottom="#+id/button4"
android:layout_toRightOf="#+id/button4"
android:background="#layout/mybutton"
android:text="C"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/Button01"
style="?android:attr/buttonStyleSmall"
android:gravity="center"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignBaseline="#+id/button3"
android:layout_alignBottom="#+id/button3"
android:layout_toRightOf="#+id/button3"
android:background="#layout/mybutton"
android:text="Ç"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/Button02"
style="?android:attr/buttonStyleSmall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignBaseline="#+id/Button01"
android:layout_alignBottom="#+id/Button01"
android:layout_toRightOf="#+id/Button01"
android:background="#layout/mybutton"
android:gravity="center"
android:text="D"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/Button03"
style="?android:attr/buttonStyleSmall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignBaseline="#+id/Button02"
android:layout_alignBottom="#+id/Button02"
android:layout_toRightOf="#+id/Button02"
android:background="#layout/mybutton"
android:gravity="center"
android:text="E"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/Button06"
style="?android:attr/buttonStyleSmall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/button4"
android:layout_toLeftOf="#+id/button3"
android:background="#layout/mybutton"
android:gravity="center"
android:text="Ç"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/Button04"
style="?android:attr/buttonStyleSmall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/button2"
android:layout_toLeftOf="#+id/button4"
android:background="#layout/mybutton"
android:gravity="center"
android:text="Ç"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/Button05"
style="?android:attr/buttonStyleSmall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/button4"
android:layout_toRightOf="#+id/button4"
android:background="#layout/mybutton"
android:gravity="center"
android:text="Ç"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/Button07"
style="?android:attr/buttonStyleSmall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/Button01"
android:layout_toLeftOf="#+id/Button02"
android:background="#layout/mybutton"
android:gravity="center"
android:text="Ç"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/Button07"
android:layout_alignBottom="#+id/Button07"
android:layout_toRightOf="#+id/Button01"
android:text="Button" />
<Button
android:id="#+id/Button09"
style="?android:attr/buttonStyleSmall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/Button02"
android:layout_toRightOf="#+id/Button02"
android:background="#layout/mybutton"
android:gravity="center"
android:text="Ç"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/Button08"
style="?android:attr/buttonStyleSmall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/Button01"
android:layout_toRightOf="#+id/Button01"
android:background="#layout/mybutton"
android:gravity="center"
android:text="Ç"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/Button10"
style="?android:attr/buttonStyleSmall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignBaseline="#+id/Button11"
android:layout_alignBottom="#+id/Button11"
android:layout_toRightOf="#+id/Button11"
android:background="#layout/mybutton"
android:gravity="center"
android:text="E"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/Button12"
style="?android:attr/buttonStyleSmall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#layout/mybutton"
android:gravity="center"
android:text="E"
android:textColor="#ffffff"
android:textSize="17sp" />
<Button
android:id="#+id/Button11"
style="?android:attr/buttonStyleSmall"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignLeft="#+id/Button04"
android:layout_below="#+id/Button04"
android:background="#layout/mybutton"
android:gravity="center"
android:text="E"
android:textColor="#ffffff"
android:textSize="17sp" />
</RelativeLayout>
I'm not exactly sure what is the problem. The way i see it, i would have tried with two horizontal LinearLayouts inside a vertical LinearLayout. Something like this, you just have to give it a proper margin:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
EDIT WITH PIC:
I would put the buttons in a grid layout, thats what its for. As far as I know, for centering it you have to wrap it all in a relativelayout, so in the end its like
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/holder"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<GridLayout
android:id="#+id/grid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:columnCount="6"
android:rowCount="2" >
<Button
android:id="#+id/button0"
android:layout_column="0"
android:layout_row="0"
android:text="Button" />
<Button
android:id="#+id/button1"
android:layout_column="1"
android:layout_row="0"
android:text="Button" />
<Button
android:id="#+id/button2"
android:layout_column="2"
android:layout_row="0"
android:text="Button" />
<Button
android:id="#+id/button3"
android:layout_column="3"
android:layout_row="0"
android:text="Button" />
<Button
android:id="#+id/button4"
android:layout_column="4"
android:layout_row="0"
android:text="Button" />
<Button
android:id="#+id/button5"
android:layout_column="5"
android:layout_row="0"
android:text="Button" />
<Button
android:id="#+id/button6"
android:layout_column="0"
android:layout_row="1"
android:text="Button" />
<Button
android:id="#+id/button7"
android:layout_column="1"
android:layout_row="1"
android:text="Button" />
<Button
android:id="#+id/button8"
android:layout_column="2"
android:layout_row="1"
android:text="Button" />
<Button
android:id="#+id/button9"
android:layout_column="3"
android:layout_row="1"
android:text="Button" />
<Button
android:id="#+id/button10"
android:layout_column="4"
android:layout_row="1"
android:text="Button" />
<Button
android:id="#+id/button11"
android:layout_column="5"
android:layout_row="1"
android:text="Button" />
</GridLayout>
</RelativeLayout>
You should use gridlayout to get the same space between them.
Example:
<GridLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:columnCount="4"
android:rowCount="5">
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_view1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="1"
android:clickable="true"
android:foreground="?selectableItemBackground"
android:stateListAnimator="#anim/raise"
card_view:cardBackgroundColor="#color/md_red_400"
card_view:cardCornerRadius="4dp">
<TextView
android:id="#+id/textView1"
android:layout_width="80dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:gravity="center"
android:text="Red"
android:textColor="#color/md_text_white" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_view2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_marginLeft="24dp"
android:layout_row="1"
android:clickable="true"
android:foreground="?selectableItemBackground"
android:stateListAnimator="#anim/raise"
card_view:cardBackgroundColor="#color/md_blue_400"
card_view:cardCornerRadius="4dp">
<TextView
android:id="#+id/textView2"
android:layout_width="80dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:gravity="center"
android:text="Blue"
android:textColor="#color/md_text_white" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_view3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_marginTop="24dp"
android:layout_row="2"
android:clickable="true"
android:foreground="?selectableItemBackground"
android:stateListAnimator="#anim/raise"
card_view:cardBackgroundColor="#color/md_green_400"
card_view:cardCornerRadius="4dp">
<TextView
android:id="#+id/textView3"
android:layout_width="80dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:gravity="center"
android:text="Green"
android:textColor="#color/md_text_white" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_view4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_marginLeft="24dp"
android:layout_marginTop="24dp"
android:layout_row="2"
android:clickable="true"
android:foreground="?selectableItemBackground"
android:stateListAnimator="#anim/raise"
card_view:cardBackgroundColor="#color/md_orange_400"
card_view:cardCornerRadius="4dp">
<TextView
android:id="#+id/textView4"
android:layout_width="80dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:gravity="center"
android:text="Orange"
android:textColor="#color/md_text_white" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_view5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_marginTop="24dp"
android:layout_row="3"
android:clickable="true"
android:foreground="?selectableItemBackground"
android:stateListAnimator="#anim/raise"
card_view:cardBackgroundColor="#color/md_pink_400"
card_view:cardCornerRadius="4dp">
<TextView
android:id="#+id/textView5"
android:layout_width="80dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:gravity="center"
android:text="Pink"
android:textColor="#color/md_text_white" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_view6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_marginLeft="24dp"
android:layout_marginTop="24dp"
android:layout_row="3"
android:clickable="true"
android:foreground="?selectableItemBackground"
android:stateListAnimator="#anim/raise"
card_view:cardBackgroundColor="#color/md_indigo_400"
card_view:cardCornerRadius="4dp">
<TextView
android:id="#+id/textView6"
android:layout_width="80dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:gravity="center"
android:text="Indigo"
android:textColor="#color/md_text_white" />
</android.support.v7.widget.CardView>
<Space
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_column="1"
android:layout_row="4" />
<Space
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_column="3"
android:layout_row="1" />
</GridLayout>
Six color cards:

How to make child TextViews stay in position in Relative Layout?

Here I have a RelativeLayout with TextViews, Spinners ect. The TextViews change according to the progress value of the respective Spinner. I want my TextViews to remain in the current position and not shift the match the length of the growing parents progress value.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Space
android:id="#+id/Space1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
<Space
android:id="#+id/Space2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/Space1" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="42dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="42dp"
android:layout_marginTop="50dp"
android:scaleType="fitXY"
android:src="#drawable/primaryneedsbg" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/imageView2"
android:layout_alignTop="#+id/imageView2"
android:layout_marginLeft="41dp"
android:layout_marginTop="79dp"
android:text="#string/housing"
android:textAppearance="?android:attr/textAppearanceLarge"
android:includeFontPadding="false"/>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView1"
android:layout_marginTop="26dp"
android:text="#string/debt"
android:textAppearance="?android:attr/textAppearanceLarge"
android:includeFontPadding="false" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView2"
android:layout_below="#+id/textView2"
android:layout_marginTop="25dp"
android:text="#string/child"
android:textAppearance="?android:attr/textAppearanceLarge"
android:includeFontPadding="false" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView3"
android:layout_below="#+id/textView3"
android:layout_marginTop="25dp"
android:text="#string/edu"
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_below="#+id/textView4"
android:layout_marginTop="30dp"
android:text="#string/exp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView5"
android:layout_below="#+id/textView5"
android:layout_marginTop="25dp"
android:text="#string/special"
android:textAppearance="?android:attr/textAppearanceLarge" />
<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:layout_marginTop="25dp"
android:text="#string/surv"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView1"
android:layout_marginLeft="176dp"
android:layout_toRightOf="#+id/textView1"
android:freezesText="true"
android:text="$0"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView2"
android:layout_alignBottom="#+id/textView2"
android:layout_alignParentStart="false"
android:layout_alignRight="#+id/textView8"
android:freezesText="true"
android:text="$0"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView3"
android:layout_alignBottom="#+id/textView3"
android:layout_alignLeft="#+id/textView9"
android:text="$0"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView4"
android:layout_alignBottom="#+id/textView4"
android:layout_alignLeft="#+id/textView10"
android:text="$0"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView5"
android:layout_alignBottom="#+id/textView5"
android:layout_alignLeft="#+id/textView11"
android:text="$0"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView6"
android:layout_alignBottom="#+id/textView6"
android:layout_alignLeft="#+id/textView12"
android:text="$0"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView7"
android:layout_alignBottom="#+id/textView7"
android:layout_alignLeft="#+id/textView13"
android:text="$0"
android:textAppearance="?android:attr/textAppearanceLarge" />
<SeekBar
android:id="#+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/textView2"
android:layout_toLeftOf="#+id/imageView1"
android:layout_toRightOf="#+id/button1" />
<Button
android:id="#+id/button2"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView9"
android:layout_alignRight="#+id/imageView2"
android:layout_alignTop="#+id/button1"
android:layout_marginRight="219dp"
android:background="#null"
android:text="+"
android:textStyle="bold" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignLeft="#+id/button2"
android:layout_alignTop="#+id/seekBar1"
android:layout_marginLeft="48dp"
android:scaleType="fitXY"
android:src="#drawable/cross" />
<Button
android:id="#+id/button4"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView2"
android:layout_alignRight="#+id/imageView2"
android:text="#string/Perm" />
<Button
android:id="#+id/Button01"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView9"
android:layout_alignBottom="#+id/textView9"
android:layout_alignLeft="#+id/button1"
android:background="#null"
android:text="-"
android:textSize="25dp"
android:textStyle="bold" />
<Button
android:id="#+id/Button04"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView10"
android:layout_alignBottom="#+id/textView10"
android:layout_toLeftOf="#+id/seekBar1"
android:background="#null"
android:text="-"
android:textSize="25dp"
android:textStyle="bold" />
<Button
android:id="#+id/Button06"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView14"
android:layout_alignBottom="#+id/textView14"
android:layout_toLeftOf="#+id/seekBar1"
android:background="#null"
android:text="-"
android:textSize="25dp"
android:textStyle="bold" />
<Button
android:id="#+id/Button05"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView13"
android:layout_alignBottom="#+id/textView13"
android:layout_alignLeft="#+id/Button06"
android:background="#null"
android:text="-"
android:textSize="25dp"
android:textStyle="bold" />
<Button
android:id="#+id/Button02"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView12"
android:layout_alignBottom="#+id/textView12"
android:layout_toLeftOf="#+id/seekBar1"
android:background="#null"
android:text="-"
android:textSize="25dp"
android:textStyle="bold" />
<Button
android:id="#+id/Button03"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView11"
android:layout_alignBottom="#+id/textView11"
android:layout_toRightOf="#+id/textView8"
android:background="#null"
android:textSize="25dp"
android:textStyle="bold" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView9"
android:layout_alignLeft="#+id/seekBar1"
android:layout_alignRight="#+id/seekBar1" />
<SeekBar
android:id="#+id/SeekBar04"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/seekBar2"
android:layout_alignTop="#+id/textView10"
android:layout_toLeftOf="#+id/button2" />
<SeekBar
android:id="#+id/SeekBar03"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/SeekBar04"
android:layout_alignRight="#+id/SeekBar04"
android:layout_alignTop="#+id/textView11" />
<SeekBar
android:id="#+id/SeekBar02"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/SeekBar03"
android:layout_alignTop="#+id/textView12"
android:layout_toLeftOf="#+id/button2" />
<SeekBar
android:id="#+id/SeekBar01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/SeekBar02"
android:layout_alignRight="#+id/SeekBar02"
android:layout_alignTop="#+id/textView13" />
<SeekBar
android:id="#+id/seekBar3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/Button06"
android:layout_alignLeft="#+id/SeekBar01"
android:layout_alignRight="#+id/SeekBar01" />
<Button
android:id="#+id/Button12"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/Button01"
android:layout_alignBottom="#+id/Button01"
android:layout_alignLeft="#+id/button2"
android:background="#null"
android:text="+"
android:textStyle="bold" />
<Button
android:id="#+id/Button11"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/Button04"
android:layout_alignBottom="#+id/Button04"
android:layout_alignLeft="#+id/Button12"
android:background="#null"
android:text="+"
android:textStyle="bold" />
<Button
android:id="#+id/Button07"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/Button08"
android:layout_alignTop="#+id/seekBar3"
android:background="#null"
android:text="+"
android:textStyle="bold" />
<Button
android:id="#+id/Button08"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/Button05"
android:layout_alignBottom="#+id/Button05"
android:layout_alignLeft="#+id/Button09"
android:background="#null"
android:text="+"
android:textStyle="bold" />
<Button
android:id="#+id/Button09"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/Button10"
android:layout_alignTop="#+id/SeekBar02"
android:background="#null"
android:text="+"
android:textStyle="bold" />
<Button
android:id="#+id/Button10"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/Button02"
android:layout_alignLeft="#+id/Button11"
android:background="#null"
android:text="+"
android:textStyle="bold" />
<ImageView
android:id="#+id/ImageView07"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignTop="#+id/textView9"
android:layout_toRightOf="#+id/Button12"
android:scaleType="fitXY"
android:src="#drawable/cross" />
<ImageView
android:id="#+id/ImageView06"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignBottom="#+id/textView10"
android:layout_alignLeft="#+id/ImageView07"
android:scaleType="fitXY"
android:src="#drawable/cross" />
<ImageView
android:id="#+id/ImageView05"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignTop="#+id/SeekBar03"
android:layout_toRightOf="#+id/Button10"
android:scaleType="fitXY"
android:src="#drawable/cross" />
<ImageView
android:id="#+id/ImageView04"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignBottom="#+id/Button02"
android:layout_alignLeft="#+id/ImageView05"
android:scaleType="fitXY"
android:src="#drawable/cross" />
<ImageView
android:id="#+id/ImageView03"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignBottom="#+id/textView13"
android:layout_alignLeft="#+id/ImageView04"
android:scaleType="fitXY"
android:src="#drawable/cross" />
<ImageView
android:id="#+id/ImageView02"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignBottom="#+id/seekBar3"
android:layout_alignLeft="#+id/ImageView03"
android:scaleType="fitXY"
android:src="#drawable/cross" />
<Button
android:id="#+id/Button16"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/SeekBar03"
android:layout_toLeftOf="#+id/button4"
android:text="Temporary" />
<Button
android:id="#+id/button3"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/button1"
android:layout_toLeftOf="#+id/button4"
android:text="Temporary" />
<Button
android:id="#+id/Button18"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView3"
android:layout_toLeftOf="#+id/button4"
android:text="Temporary" />
<Button
android:id="#+id/Button17"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/SeekBar04"
android:layout_toLeftOf="#+id/button4"
android:text="Temporary" />
<Button
android:id="#+id/Button15"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/Button02"
android:layout_toLeftOf="#+id/button4"
android:text="Temporary" />
<Button
android:id="#+id/Button14"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView7"
android:layout_alignLeft="#+id/Button15"
android:text="Temporary" />
<Button
android:id="#+id/Button13"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/Button05"
android:layout_toLeftOf="#+id/button4"
android:text="Temporary" />
<Button
android:id="#+id/Button23"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/Button17"
android:layout_alignRight="#+id/imageView2"
android:layout_alignTop="#+id/Button17"
android:text="#string/Perm" />
<Button
android:id="#+id/Button21"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/Button14"
android:layout_alignRight="#+id/imageView2"
android:layout_alignTop="#+id/Button15"
android:text="#string/Perm" />
<Button
android:id="#+id/Button24"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView3"
android:layout_alignRight="#+id/imageView2"
android:layout_alignTop="#+id/Button18"
android:text="#string/Perm" />
<Button
android:id="#+id/Button22"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/Button21"
android:layout_alignRight="#+id/imageView2"
android:layout_alignTop="#+id/Button16"
android:text="#string/Perm" />
<Button
android:id="#+id/Button20"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/Button14"
android:layout_alignBottom="#+id/Button14"
android:layout_alignLeft="#+id/Button21"
android:text="#string/Perm" />
<Button
android:id="#+id/Button19"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/Button13"
android:layout_toRightOf="#+id/Button13"
android:text="#string/Perm" />
<Button
android:id="#+id/button1"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView8"
android:layout_alignBottom="#+id/textView8"
android:layout_marginLeft="182dp"
android:layout_toRightOf="#+id/Button03"
android:background="#null"
android:text="-"
android:textSize="25dp"
android:textStyle="bold" />
<Button
android:id="#+id/Button25"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/Button03"
android:layout_alignBottom="#+id/Button03"
android:layout_toLeftOf="#+id/SeekBar03"
android:background="#null"
android:text="-"
android:textSize="25dp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView7"
android:layout_below="#+id/Button07"
android:text="#string/permNeeds"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView15"
android:layout_below="#+id/textView15"
android:layout_marginTop="21dp"
android:text="#string/tempNeeds"
android:textAppearance="?android:attr/textAppearanceMedium" />
<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:layout_marginTop="21dp"
android:text="#string/tNeeds:"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView15"
android:layout_alignBottom="#+id/textView15"
android:layout_alignLeft="#+id/textView14"
android:text="$0"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<TextView
android:id="#+id/textView19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView17"
android:layout_alignLeft="#+id/textView18"
android:text="$0"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<TextView
android:id="#+id/textView20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView17"
android:layout_alignLeft="#+id/textView19"
android:text="$0"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />
<TextView
android:id="#+id/textView21"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/imageView2"
android:layout_toRightOf="#+id/imageView1"
android:text="#string/typeNeed"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView1"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:scaleType="fitXY"
android:src="#drawable/lifebar" />
<TextView
android:id="#+id/textView22"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imageView3"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="#string/lifebar4"
android:textAppearance="?android:attr/textAppearanceLarge" />

Why layout appears different in devices?

I am not sure why the views are different but not stable.
<?xml version="1.0" encoding="utf-8"?>
<Button
android:id="#+id/b"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/a"
android:layout_alignBottom="#+id/a"
android:layout_toRightOf="#+id/a"
android:gravity="center"
android:text="B"
android:textSize="25dp" />
<Button
android:id="#+id/c"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/b"
android:layout_alignBottom="#+id/b"
android:layout_toRightOf="#+id/b"
android:gravity="center"
android:text="C"
android:textSize="25dp" />
<Button
android:id="#+id/d"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/c"
android:layout_alignBottom="#+id/c"
android:layout_toRightOf="#+id/c"
android:gravity="center"
android:text="D"
android:textSize="25dp" />
<Button
android:id="#+id/e"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/d"
android:layout_alignBottom="#+id/d"
android:layout_toRightOf="#+id/d"
android:gravity="center"
android:text="E"
android:textSize="25dp" />
<Button
android:id="#+id/h"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/g"
android:layout_alignBottom="#+id/g"
android:layout_toLeftOf="#+id/c"
android:gravity="center"
android:text="H"
android:textSize="25dp" />
<Button
android:id="#+id/i"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/m"
android:layout_toRightOf="#+id/h"
android:gravity="center"
android:text="I"
android:textSize="25dp" />
<Button
android:id="#+id/j"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/n"
android:layout_toRightOf="#+id/i"
android:gravity="center"
android:text="J"
android:textSize="25dp" />
<Button
android:id="#+id/m"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/g"
android:layout_below="#+id/g"
android:gravity="center"
android:text="M"
android:textSize="25dp" />
<Button
android:id="#+id/n"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/m"
android:layout_alignBottom="#+id/m"
android:layout_toRightOf="#+id/m"
android:gravity="center"
android:text="N"
android:textSize="25dp" />
<Button
android:id="#+id/k"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/n"
android:layout_toLeftOf="#+id/f"
android:gravity="center"
android:text="K"
android:textSize="25dp" />
<Button
android:id="#+id/l"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/n"
android:layout_toRightOf="#+id/w"
android:gravity="center"
android:text="L"
android:textSize="25dp" />
<Button
android:id="#+id/o"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/n"
android:layout_alignBottom="#+id/n"
android:layout_toRightOf="#+id/n"
android:gravity="center"
android:text="O"
android:textSize="25dp" />
<Button
android:id="#+id/s"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/m"
android:layout_below="#+id/m"
android:gravity="center"
android:text="S"
android:textSize="25dp" />
<Button
android:id="#+id/t"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/n"
android:layout_toLeftOf="#+id/o"
android:gravity="center"
android:text="T"
android:textSize="25dp" />
<Button
android:id="#+id/p"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/t"
android:layout_toRightOf="#+id/o"
android:gravity="center"
android:text="P"
android:textSize="25dp" />
<Button
android:id="#+id/r"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/t"
android:layout_alignLeft="#+id/l"
android:gravity="center"
android:text="R"
android:textSize="25dp" />
<Button
android:id="#+id/u"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/z"
android:layout_alignLeft="#+id/o"
android:gravity="center"
android:text="U"
android:textSize="25dp" />
<Button
android:id="#+id/v"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/p"
android:layout_toLeftOf="#+id/q"
android:gravity="center"
android:text="V"
android:textSize="25dp" />
<Button
android:id="#+id/w"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/p"
android:layout_toLeftOf="#+id/f"
android:gravity="center"
android:text="W"
android:textSize="25dp" />
<Button
android:id="#+id/q"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/k"
android:layout_toRightOf="#+id/p"
android:gravity="center"
android:text="Q"
android:textSize="25dp" />
<Button
android:id="#+id/x"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/z"
android:layout_toRightOf="#+id/q"
android:gravity="center"
android:text="X"
android:textSize="25dp" />
<Button
android:id="#+id/z"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/v"
android:layout_toLeftOf="#+id/q"
android:gravity="center"
android:text="Z"
android:textSize="25dp" />
<Button
android:id="#+id/f"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/e"
android:layout_alignBottom="#+id/e"
android:layout_toRightOf="#+id/e"
android:gravity="center"
android:text="F"
android:textSize="25dp" />
<Button
android:id="#+id/y"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/z"
android:layout_alignBottom="#+id/z"
android:layout_toLeftOf="#+id/z"
android:gravity="center"
android:text="Y"
android:textSize="25dp" />
<TextView
android:id="#+id/six"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/five"
android:layout_alignBottom="#+id/five"
android:layout_alignRight="#+id/d"
android:text=""
android:textColor="#B40404"
android:textSize="30sp" />
<TextView
android:id="#+id/five"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/four"
android:layout_alignBottom="#+id/four"
android:layout_toRightOf="#+id/c"
android:text=""
android:textColor="#B40404"
android:textSize="30sp" />
<TextView
android:id="#+id/four"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/three"
android:layout_alignBottom="#+id/three"
android:layout_alignLeft="#+id/c"
android:layout_marginLeft="14dp"
android:text=""
android:textColor="#B40404"
android:textSize="30sp" />
<TextView
android:id="#+id/three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/two"
android:layout_alignBottom="#+id/two"
android:layout_alignRight="#+id/b"
android:text=""
android:textColor="#B40404"
android:textSize="30sp" />
<TextView
android:id="#+id/two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/one"
android:layout_alignBottom="#+id/one"
android:layout_toRightOf="#+id/a"
android:text=""
android:textColor="#B40404"
android:textSize="30sp" />
<TextView
android:id="#+id/seven"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/six"
android:layout_alignBottom="#+id/six"
android:layout_alignRight="#+id/e"
android:layout_marginRight="15dp"
android:text=""
android:textColor="#B40404"
android:textSize="30sp" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/three"
android:layout_alignParentLeft="true"
android:text="Chances:"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/a"
android:layout_alignParentLeft="true"
android:layout_marginLeft="14dp"
android:text=""
android:textColor="#B40404"
android:textSize="30sp" />
<TextView
android:id="#+id/nine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/f"
android:layout_alignRight="#+id/f"
android:text=""
android:textColor="#B40404"
android:textSize="30sp" />
<TextView
android:id="#+id/eight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/seven"
android:layout_alignBottom="#+id/seven"
android:layout_toRightOf="#+id/seven"
android:text=""
android:textColor="#B40404"
android:textSize="30sp" />
<Button
android:id="#+id/a"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:gravity="center"
android:text="A"
android:textSize="25dp" />
<Button
android:id="#+id/g"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/b"
android:layout_toLeftOf="#+id/h"
android:gravity="center"
android:text="G"
android:textSize="25dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:orientation="horizontal" >
<ImageView
android:id="#+id/imgI"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignTop="#+id/imgD"
android:layout_centerHorizontal="true"
android:src="#drawable/i" />
<ImageView
android:id="#+id/imgL"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignTop="#+id/imgI"
android:layout_toRightOf="#+id/imgI"
android:src="#drawable/l" />
<ImageView
android:id="#+id/imgD"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_marginTop="115dp"
android:layout_toLeftOf="#+id/imgI"
android:src="#drawable/d" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/imgD"
android:layout_alignRight="#+id/imgL"
android:layout_below="#+id/imgI"
android:text=" ___ ___ ___"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/tCoins"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/ImageView01"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/imgL"
android:text=" "
android:textColor="#B40404"
android:textSize="25dp" />
<ImageView
android:id="#+id/ImageView01"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_toLeftOf="#+id/tCoins"
android:src="#drawable/coins" />
</RelativeLayout>
To set your theme:
setTheme(android.R.style.Theme_Translucent_NoTitleBar); // Example theme;
Holo - Theme_Holo_NoTitleBar
You must call it before:
setContentView(...);
Or add this to your manifest:
android:theme="#android:style/Theme.Holo.NoActionBar.Fullscreen"
You can remove NoActionBar, and Fullscreen, to get different things. Also you can add stuff. If you do it with code, there is autocomplete and you can see all themes and options.
Hope this helps.
The first one uses the holo theme. The second devices uses the pre holo theme.
Just use your custom theme, so you can have a "standard" theme across any Android version. http://developer.android.com/guide/topics/ui/themes.html

Categories

Resources