Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version='1.0' encoding='utf-8' ?>
- <androidx.constraintlayout.widget.ConstraintLayout 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"
- android:orientation="vertical">
- <TextView
- android:id="@+id/textView"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="Simple Java Android Calculator"
- android:textAlignment="center"
- android:textColor="#ff000000"
- android:textSize="20sp"
- android:textStyle="bold"
- app:layout_constraintTop_toTopOf="parent" />
- <EditText
- android:id="@+id/num1edit_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="First number"
- app:layout_constraintTop_toBottomOf="@id/textView" />
- <EditText
- android:id="@+id/num2edit_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="Second number"
- app:layout_constraintTop_toBottomOf="@id/num1edit_text" />
- <EditText
- android:id="@+id/answer_textview"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:focusable="false"
- android:hint="Answer"
- app:layout_constraintTop_toBottomOf="@id/num2edit_text" />
- <LinearLayout
- android:id="@+id/linear"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- app:layout_constraintTop_toBottomOf="@id/answer_textview">
- <Button
- android:id="@+id/buttonmultiply"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:layout_margin="4dp"
- android:layout_marginEnd="7dp"
- android:background="@android:color/holo_orange_light"
- android:text="Multiply"/>
- <Button
- android:id="@+id/buttonadd"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:layout_margin="4dp"
- android:layout_marginStart="26dp"
- android:layout_marginEnd="12dp"
- android:text="Add" />
- <Button
- android:id="@+id/buttonsubtract"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:layout_margin="4dp"
- android:background="@android:color/holo_orange_light"
- android:text="Subtract" />
- <Button
- android:id="@+id/buttondivide"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:layout_margin="4dp"
- android:layout_marginEnd="8dp"
- android:background="@android:color/holo_orange_light"
- android:text="Divide" />
- </LinearLayout>
- <Button
- android:id="@+id/buttonclear"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@android:color/holo_blue_light"
- android:gravity="center"
- android:text="Clear"
- app:layout_constraintTop_toBottomOf="@id/linear" />
- </androidx.constraintlayout.widget.ConstraintLayout>
RAW Paste Data