Android layout with equal spacing between elements I am trying to make a nice set of items, which are equally spaced from each other. 
On example below, I set buttons between empty textview. Every button and text view has height = 0dip and weight=1. And it looks pretty nice. However, is there a way to clean up the layout file?

&lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:orientation="vertical" &gt;

            &lt;TextView
                android:id="@+id/textView2"
                android:layout_width="wrap_content"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:text="" /&gt;

            &lt;Button
                android:id="@+id/btn_distance_walked"
                android:layout_width="match_parent"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:clickable="false"
                android:text="Distance walked = " /&gt;

            &lt;TextView
                android:id="@+id/textView3"
                android:layout_width="wrap_content"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:text="" /&gt;

            &lt;Button
                android:id="@+id/btn_exersise_time"
                android:layout_width="match_parent"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:clickable="false"
                android:text="Exercise time = " /&gt;

            &lt;TextView
                android:id="@+id/textView4"
                android:layout_width="wrap_content"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:text="" /&gt;

            &lt;Button
                android:id="@+id/btn_average_speed"
                android:layout_width="match_parent"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:clickable="false"
                android:text="Average speed = " /&gt;

            &lt;TextView
                android:id="@+id/textView5"
                android:layout_width="wrap_content"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:text="" /&gt;

            &lt;Button
                android:id="@+id/btn_calories_burned"
                android:layout_width="match_parent"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:clickable="false"
                android:text="Callories burned = " /&gt;

            &lt;TextView
                android:id="@+id/textView6"
                android:layout_width="wrap_content"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:clickable="false"
                android:text="" /&gt;

            &lt;Button
                android:id="@+id/btn_back"
                android:layout_width="match_parent"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:text="Back" /&gt;

            &lt;TextView
                android:id="@+id/textView1"
                android:layout_width="wrap_content"
                android:layout_height="0dip"
                android:layout_weight="1"
                android:text="" /&gt;
        &lt;/LinearLayout&gt;
I don't know what the standards are for Layout Naming on Android, but I can tell you that these names are not very good.


textView2
btn_distance_walked
textView3


none of these accurately describes what they do.

you should probably look for naming schemes on Google.

btn_distance_walked doesn't tell us what the button is going to do. What is it going to do with the distance walked? It should be something like calculate_Distance or calculateDistance (my preferred naming scheme camelCasing) 

Update:

I recently answered a question similar to this one and came up with a name scheme for buttons, action_ObjectActedUpon  this may be more specific to the naming issue in your code as well.



Your indentation seems to be off as well, it should look like this

&lt;LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:orientation="vertical" &gt;

    &lt;TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:text="" /&gt;

    &lt;Button
        android:id="@+id/btn_distance_walked"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:clickable="false"
        android:text="Distance walked = " /&gt;

    &lt;TextView
        android:id="@+id/textView3"
        android:layout_width="wrap_content"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:text="" /&gt;

    &lt;Button
        android:id="@+id/btn_exersise_time"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:clickable="false"
        android:text="Exercise time = " /&gt;

    &lt;TextView
        android:id="@+id/textView4"
        android:layout_width="wrap_content"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:text="" /&gt;

    &lt;Button
        android:id="@+id/btn_average_speed"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:clickable="false"
        android:text="Average speed = " /&gt;

    &lt;TextView
        android:id="@+id/textView5"
        android:layout_width="wrap_content"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:text="" /&gt;

    &lt;Button
        android:id="@+id/btn_calories_burned"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:clickable="false"
        android:text="Callories burned = " /&gt;

    &lt;TextView
        android:id="@+id/textView6"
        android:layout_width="wrap_content"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:clickable="false"
        android:text="" /&gt;

    &lt;Button
        android:id="@+id/btn_back"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:text="Back" /&gt;

    &lt;TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:text="" /&gt;
&lt;/LinearLayout&gt;




I just answered a similar question and I think that I should add a little bit of that answer to this one..

Another way that you can reduce clutter in the layout is to define some styles by creating an xml file in the res/values/ folder of your project and do this

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;resources&gt;
    &lt;style name="MyStyle1"&gt;
        &lt;item name="android:layout_width"&gt;match_parent&lt;/item&gt;
        &lt;item name="android:layout_height"&gt;0dip&lt;/item&gt;
        &lt;item name="android:layout_weight"&gt;1&lt;/item&gt;
        &lt;!-- etc. --&gt;
    &lt;/style&gt;
&lt;/resources&gt;


and then in your Layout XML you add the style to the layout element like this

&lt;LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:orientation="vertical" &gt;

    &lt;TextView
        style="@style/MyStyle1"
        android:id="@+id/textView2"
        android:text="" /&gt;

    &lt;Button
        style="@style/MyStyle1"
        android:id="@+id/btn_distance_walked"
        android:clickable="false"
        android:text="Distance walked = " /&gt;

    &lt;TextView
        style="@style/MyStyle1"
        android:id="@+id/textView3"
        android:text="" /&gt;

    &lt;Button
        style="@style/MyStyle1"
        android:id="@+id/btn_exersise_time"
        android:clickable="false"
        android:text="Exercise time = " /&gt;

    &lt;TextView
        style="@style/MyStyle1"
        android:id="@+id/textView4"
        android:text="" /&gt;

    &lt;Button
        style="@style/MyStyle1"
        android:id="@+id/btn_average_speed"
        android:clickable="false"
        android:text="Average speed = " /&gt;

    &lt;TextView
        style="@style/MyStyle1"
        android:id="@+id/textView5"
        android:text="" /&gt;

    &lt;Button
        style="@style/MyStyle1"
        android:id="@+id/btn_calories_burned"
        android:clickable="false"
        android:text="Callories burned = " /&gt;

    &lt;TextView
        style="@style/MyStyle1"
        android:id="@+id/textView6"
        android:clickable="false"
        android:text="" /&gt;

    &lt;Button
        style="@style/MyStyle1"
        android:id="@+id/btn_back"
        android:text="Back" /&gt;

    &lt;TextView
        style="@style/MyStyle1"
        android:id="@+id/textView1"
        android:text="" /&gt;
&lt;/LinearLayout&gt;


note that I am not a professional, but I found Styles and Themes from doing a quick search for styles.xml android example

Don't forget about Developer.Android.com it can be very helpful.