Skip to content

Instantly share code, notes, and snippets.

@AasemJS
Last active June 22, 2017 17:38
Show Gist options
  • Select an option

  • Save AasemJS/1d9e333286ed157c6d2367d12a7d2a18 to your computer and use it in GitHub Desktop.

Select an option

Save AasemJS/1d9e333286ed157c6d2367d12a7d2a18 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.aasemjs.weightconverter.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/linearLayout"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_marginTop="28dp">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Enter your weight in Kilograms"
android:textSize="20sp" />
<EditText
android:id="@+id/edTxtKg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Weight (KG)"
android:inputType="number" />
<Button
android:id="@+id/btnKG"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="cnvPounds"
android:text="Convert to Pounds" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/linearLayout"
android:layout_alignParentStart="true"
android:layout_marginTop="34dp">
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Enter your weight in Pounds"
android:textSize="20sp" />
<EditText
android:id="@+id/edtTxtLbs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Weight (lbs)"
android:inputType="number" />
<Button
android:id="@+id/btnPound"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="cnvKgs"
android:text="Convert to Kilograms" />
</LinearLayout>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment