eightmoons

activity_main.xml

Mar 25th, 2020
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.62 KB | None | 0 0
  1. <?xml version='1.0' encoding='utf-8' ?>
  2. <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.    xmlns:app="http://schemas.android.com/apk/res-auto"
  4.    xmlns:tools="http://schemas.android.com/tools"
  5.    android:layout_width="match_parent"
  6.    android:layout_height="match_parent"
  7.    android:orientation="vertical">
  8.  
  9.     <TextView
  10.        android:id="@+id/textView"
  11.        android:layout_width="match_parent"
  12.        android:layout_height="wrap_content"
  13.        android:text="Simple Java Android Calculator"
  14.        android:textAlignment="center"
  15.        android:textColor="#ff000000"
  16.        android:textSize="20sp"
  17.        android:textStyle="bold"
  18.        app:layout_constraintTop_toTopOf="parent" />
  19.  
  20.     <EditText
  21.        android:id="@+id/num1edit_text"
  22.        android:layout_width="match_parent"
  23.        android:layout_height="wrap_content"
  24.        android:hint="First number"
  25.        app:layout_constraintTop_toBottomOf="@id/textView" />
  26.  
  27.     <EditText
  28.        android:id="@+id/num2edit_text"
  29.        android:layout_width="match_parent"
  30.        android:layout_height="wrap_content"
  31.        android:hint="Second number"
  32.        app:layout_constraintTop_toBottomOf="@id/num1edit_text" />
  33.  
  34.     <EditText
  35.        android:id="@+id/answer_textview"
  36.        android:layout_width="match_parent"
  37.        android:layout_height="wrap_content"
  38.        android:focusable="false"
  39.        android:hint="Answer"
  40.        app:layout_constraintTop_toBottomOf="@id/num2edit_text" />
  41.  
  42.  
  43.     <LinearLayout
  44.        android:id="@+id/linear"
  45.        android:layout_width="match_parent"
  46.        android:layout_height="wrap_content"
  47.        android:orientation="horizontal"
  48.        app:layout_constraintTop_toBottomOf="@id/answer_textview">
  49.         <Button
  50.            android:id="@+id/buttonmultiply"
  51.            android:layout_width="0dp"
  52.            android:layout_height="match_parent"
  53.            android:layout_weight="1"
  54.            android:layout_margin="4dp"
  55.            android:layout_marginEnd="7dp"
  56.            android:background="@android:color/holo_orange_light"
  57.            android:text="Multiply"/>
  58.  
  59.         <Button
  60.            android:id="@+id/buttonadd"
  61.            android:layout_width="0dp"
  62.            android:layout_height="match_parent"
  63.            android:layout_weight="1"
  64.            android:layout_margin="4dp"
  65.            android:layout_marginStart="26dp"
  66.            android:layout_marginEnd="12dp"
  67.            android:text="Add" />
  68.  
  69.         <Button
  70.            android:id="@+id/buttonsubtract"
  71.            android:layout_width="0dp"
  72.            android:layout_height="match_parent"
  73.            android:layout_weight="1"
  74.            android:layout_margin="4dp"
  75.            android:background="@android:color/holo_orange_light"
  76.            android:text="Subtract" />
  77.  
  78.         <Button
  79.            android:id="@+id/buttondivide"
  80.            android:layout_width="0dp"
  81.            android:layout_height="match_parent"
  82.            android:layout_weight="1"
  83.            android:layout_margin="4dp"
  84.            android:layout_marginEnd="8dp"
  85.            android:background="@android:color/holo_orange_light"
  86.            android:text="Divide" />
  87.     </LinearLayout>
  88.  
  89.  
  90.  
  91.     <Button
  92.        android:id="@+id/buttonclear"
  93.        android:layout_width="match_parent"
  94.        android:layout_height="wrap_content"
  95.        android:background="@android:color/holo_blue_light"
  96.        android:gravity="center"
  97.        android:text="Clear"
  98.        app:layout_constraintTop_toBottomOf="@id/linear" />
  99.  
  100.  
  101. </androidx.constraintlayout.widget.ConstraintLayout>
Advertisement
Add Comment
Please, Sign In to add comment