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 tools:context=".MainActivity"> 8 9 <Button 10 android:id="@+id/button" 11 android:layout_width="wrap_content" 12 android:layout_height="wrap_content" 13 android:layout_marginStart="16dp" 14 android:layout_marginLeft="16dp" 15 android:layout_marginTop="16dp" 16 android:onClick="goRed" 17 android:text="red" 18 app:layout_constraintStart_toStartOf="parent" 19 app:layout_constraintTop_toTopOf="parent" /> 20 21 <Button 22 android:id="@+id/button4" 23 android:layout_width="wrap_content" 24 android:layout_height="wrap_content" 25 android:layout_marginTop="16dp" 26 android:layout_marginEnd="16dp" 27 android:layout_marginRight="16dp" 28 android:onClick="goYellow" 29 android:text="YELLOW" 30 app:layout_constraintEnd_toEndOf="parent" 31 app:layout_constraintTop_toTopOf="parent" /> 32 33 <Button 34 android:id="@+id/button6" 35 android:layout_width="wrap_content" 36 android:layout_height="wrap_content" 37 android:layout_marginStart="16dp" 38 android:layout_marginLeft="16dp" 39 android:layout_marginTop="32dp" 40 android:onClick="goGreen" 41 android:text="GREEN" 42 app:layout_constraintStart_toStartOf="parent" 43 app:layout_constraintTop_toBottomOf="@+id/button" /> 44 45 <Button 46 android:id="@+id/button7" 47 android:layout_width="wrap_content" 48 android:layout_height="wrap_content" 49 android:layout_marginStart="165dp" 50 android:layout_marginLeft="165dp" 51 android:layout_marginTop="115dp" 52 android:layout_marginEnd="165dp" 53 android:layout_marginRight="165dp" 54 android:onClick="goViolet" 55 android:text="VIOLET" 56 app:layout_constraintEnd_toEndOf="parent" 57 app:layout_constraintHorizontal_bias="0.428" 58 app:layout_constraintStart_toStartOf="parent" 59 app:layout_constraintTop_toBottomOf="@+id/button8" /> 60 61 <Button 62 android:id="@+id/button10" 63 android:layout_width="wrap_content" 64 android:layout_height="wrap_content" 65 android:layout_marginStart="165dp" 66 android:layout_marginLeft="165dp" 67 android:layout_marginTop="32dp" 68 android:layout_marginEnd="165dp" 69 android:layout_marginRight="165dp" 70 android:onClick="goBlue" 71 android:text="BLUE" 72 app:layout_constraintEnd_toEndOf="parent" 73 app:layout_constraintStart_toStartOf="parent" 74 app:layout_constraintTop_toBottomOf="@+id/button8" /> 75 76 <Button 77 android:id="@+id/button8" 78 android:layout_width="wrap_content" 79 android:layout_height="wrap_content" 80 android:layout_marginStart="165dp" 81 android:layout_marginLeft="165dp" 82 android:layout_marginTop="16dp" 83 android:layout_marginEnd="165dp" 84 android:layout_marginRight="165dp" 85 android:onClick="goOrange" 86 android:text="ORANGE" 87 app:layout_constraintEnd_toEndOf="parent" 88 app:layout_constraintStart_toStartOf="parent" 89 app:layout_constraintTop_toTopOf="parent" /> 90 91 <Button 92 android:id="@+id/button11" 93 android:layout_width="wrap_content" 94 android:layout_height="wrap_content" 95 android:layout_marginTop="32dp" 96 android:layout_marginEnd="16dp" 97 android:layout_marginRight="16dp" 98 android:onClick="goIndigo" 99 android:text="INDIGO" 100 app:layout_constraintEnd_toEndOf="parent" 101 app:layout_constraintTop_toBottomOf="@+id/button4" /> 102 103 <Button 104 android:id="@+id/button12" 105 android:layout_width="wrap_content" 106 android:layout_height="wrap_content" 107 android:layout_marginStart="162dp" 108 android:layout_marginLeft="162dp" 109 android:layout_marginTop="25dp" 110 android:layout_marginEnd="161dp" 111 android:layout_marginRight="161dp" 112 android:onClick="goCyan" 113 android:text="CYAN" 114 app:layout_constraintEnd_toEndOf="parent" 115 app:layout_constraintStart_toStartOf="parent" 116 app:layout_constraintTop_toBottomOf="@+id/button7" /> 117 118 <Button 119 android:id="@+id/button13" 120 android:layout_width="wrap_content" 121 android:layout_height="wrap_content" 122 android:layout_marginStart="162dp" 123 android:layout_marginLeft="162dp" 124 android:layout_marginTop="25dp" 125 android:layout_marginEnd="161dp" 126 android:layout_marginRight="161dp" 127 android:onClick="goBlack" 128 android:text="BLACK" 129 app:layout_constraintEnd_toEndOf="parent" 130 app:layout_constraintStart_toStartOf="parent" 131 app:layout_constraintTop_toBottomOf="@+id/button12" /> 132</androidx.constraintlayout.widget.ConstraintLayout>