Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout 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:id="@+id/llyBackGround"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_margin="16dp"
- android:orientation="vertical"
- tools:context=".MainActivity">
- <TextView
- android:id="@+id/textView2"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="16dp"
- android:background="#F57F17"
- android:text="My Calculator"
- android:textAlignment="center"
- android:textColor="#004D40"
- android:textSize="34sp"
- android:textStyle="bold" />
- <EditText
- android:id="@+id/etNo1"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="16dp"
- android:ems="10"
- android:gravity="center"
- android:hint="first number"
- android:inputType="numberDecimal"
- android:minHeight="48dp"
- android:textAlignment="center" />
- <RadioGroup
- android:id="@+id/rgOperation"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginEnd="16dp"
- android:orientation="horizontal">
- <RadioButton
- android:id="@+id/rbAdd"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:layout_weight="1"
- android:gravity="start|center_horizontal|center_vertical"
- android:text="+"
- android:textSize="20sp"
- android:textStyle="bold" />
- <RadioButton
- android:id="@+id/rbSub"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:layout_weight="1"
- android:gravity="start|center_horizontal|center_vertical"
- android:text="-"
- android:textSize="20sp"
- android:textStyle="bold" />
- <RadioButton
- android:id="@+id/rbMul"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:layout_weight="1"
- android:gravity="start|center_horizontal|center_vertical"
- android:text="*"
- android:textSize="20sp"
- android:textStyle="bold" />
- <RadioButton
- android:id="@+id/rbDiv"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:layout_weight="1"
- android:gravity="start|center_horizontal|center_vertical"
- android:text="/"
- android:textSize="20sp"
- android:textStyle="bold" />
- </RadioGroup>
- <EditText
- android:id="@+id/etNo2"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="16dp"
- android:ems="10"
- android:hint="second number"
- android:inputType="numberDecimal"
- android:minHeight="48dp"
- android:textAlignment="center" />
- <Button
- android:id="@+id/btnCalculate"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="16dp"
- android:onClick="btnClicked"
- android:text="="
- android:textSize="20sp"
- android:textStyle="bold" />
- <TextView
- android:id="@+id/tvResult"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="16dp"
- android:singleLine="false"
- android:text="TextView"
- android:textAlignment="center"
- android:textColor="#311B92"
- android:textSize="20sp" />
- </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement