Hello,
I am trying to get use to android xml
I am making tip calculator for android
I am trying to make layout first, I got it layout done somewhat
I need some help, if someone can give it touch and make it better
like I want space between each layout and I want EditText box on right of screen and text on left and fit_parent
here is the code
and image of how ugly it looks right now lol
please do not modify my xml code too much just modify to fix it
so I have better understand of it
thank you
I am trying to get use to android xml
I am making tip calculator for android
I am trying to make layout first, I got it layout done somewhat
I need some help, if someone can give it touch and make it better
like I want space between each layout and I want EditText box on right of screen and text on left and fit_parent
here is the code
and image of how ugly it looks right now lol
please do not modify my xml code too much just modify to fix it
so I have better understand of it
thank you
Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_height="wrap_content" android:layout_width="wrap_content">
<LinearLayout
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_weight="1">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:text="Amount of Bill"
android:layout_height="wrap_content">
</TextView>
<EditText android:layout_width="100px"
android:text="@string/enter_amount"
android:id="@+id/editText1"
android:layout_height="50px"></EditText>
</LinearLayout>
<LinearLayout
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_weight="1">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:text="Tip Percent"
android:layout_height="wrap_content">
</TextView>
<EditText android:layout_width="100px"
android:text="@string/enter_amount"
android:id="@+id/editText1"
android:layout_height="50px"></EditText>
</LinearLayout>
<LinearLayout
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_width="wrap_content" android:layout_weight="1">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:text="Number of People"
android:layout_height="wrap_content">
</TextView>
<EditText android:layout_width="100px"
android:text="@string/enter_amount"
android:id="@+id/editText1"
android:layout_height="50px"></EditText>
</LinearLayout>
<LinearLayout
android:orientation="horizontal" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1">
<Button
android:layout_width="100px"
android:text="Calculate"
android:layout_height="50px">
</Button>
<Button
android:layout_width="100px"
android:text="Reset"
android:layout_height="50px">
</Button>
</LinearLayout>
<LinearLayout
android:orientation="horizontal" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:text="Tip Amount:"
android:layout_height="wrap_content">
</TextView>
<EditText
android:layout_width="100px"
android:text="@string/enter_amount"
android:id="@+id/editText1"
android:layout_height="50px">
</EditText>
</LinearLayout>
<LinearLayout
android:orientation="horizontal" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:text="Total to Pay:"
android:layout_height="wrap_content">
</TextView>
<EditText
android:layout_width="100px"
android:text="@string/enter_amount"
android:id="@+id/editText1"
android:layout_height="50px"></EditText>
</LinearLayout>
<LinearLayout
android:orientation="horizontal" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_weight="1">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:text="Total per Person:"
android:layout_height="wrap_content">
</TextView>
<EditText
android:layout_width="100px"
android:text="@string/enter_amount"
android:id="@+id/editText1"
android:layout_height="50px">
</EditText>
</LinearLayout>
</LinearLayout>