diff options
Diffstat (limited to 'app/src/main/res/layout')
-rwxr-xr-x | app/src/main/res/layout/activity_game.xml | 184 | ||||
-rwxr-xr-x | app/src/main/res/layout/activity_main.xml | 40 | ||||
-rwxr-xr-x | app/src/main/res/layout/game_over.xml | 60 |
3 files changed, 284 insertions, 0 deletions
diff --git a/app/src/main/res/layout/activity_game.xml b/app/src/main/res/layout/activity_game.xml new file mode 100755 index 0000000..b39b7b7 --- /dev/null +++ b/app/src/main/res/layout/activity_game.xml @@ -0,0 +1,184 @@ +<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" + tools:context=".GameActivity"> + + <Button + android:id="@+id/button9" + android:layout_width="@dimen/button_size" + android:layout_height="@dimen/button_size" + android:layout_marginBottom="@dimen/button_margin" + android:textSize="13pt" + android:background="@drawable/round_button" + android:onClick="onClick" + android:text="9" + app:layout_constraintBottom_toTopOf="@+id/button6" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/button8" /> + + <Button + android:id="@+id/button8" + android:layout_width="@dimen/button_size" + android:layout_height="@dimen/button_size" + android:layout_marginBottom="@dimen/button_margin" + android:textSize="13pt" + android:background="@drawable/round_button" + android:onClick="onClick" + android:text="8" + app:layout_constraintBottom_toTopOf="@+id/button5" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <Button + android:id="@+id/button7" + android:layout_width="@dimen/button_size" + android:layout_height="@dimen/button_size" + android:layout_marginBottom="@dimen/button_margin" + android:textSize="13pt" + android:background="@drawable/round_button" + android:onClick="onClick" + android:text="7" + app:layout_constraintBottom_toTopOf="@+id/button4" + app:layout_constraintEnd_toStartOf="@+id/button8" + app:layout_constraintStart_toStartOf="parent" /> + + <Button + android:id="@+id/button6" + android:layout_width="@dimen/button_size" + android:layout_height="@dimen/button_size" + android:layout_marginBottom="@dimen/button_margin" + android:textSize="13pt" + android:background="@drawable/round_button" + android:onClick="onClick" + android:text="6" + app:layout_constraintBottom_toTopOf="@+id/button3" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/button5" /> + + <Button + android:id="@+id/button5" + android:layout_width="@dimen/button_size" + android:layout_height="@dimen/button_size" + android:layout_marginBottom="@dimen/button_margin" + android:textSize="13pt" + android:background="@drawable/round_button" + android:onClick="onClick" + android:text="5" + app:layout_constraintBottom_toTopOf="@+id/button2" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <Button + android:id="@+id/button4" + android:layout_width="@dimen/button_size" + android:layout_height="@dimen/button_size" + android:layout_marginBottom="@dimen/button_margin" + android:textSize="13pt" + android:background="@drawable/round_button" + android:onClick="onClick" + android:text="4" + app:layout_constraintBottom_toTopOf="@+id/button1" + app:layout_constraintEnd_toStartOf="@+id/button5" + app:layout_constraintStart_toStartOf="parent" /> + + <Button + android:id="@+id/button3" + android:layout_width="@dimen/button_size" + android:layout_height="@dimen/button_size" + android:layout_marginBottom="@dimen/button_margin" + android:textSize="13pt" + android:background="@drawable/round_button" + android:onClick="onClick" + android:text="3" + app:layout_constraintBottom_toTopOf="@+id/button_empty2" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/button2" /> + + <Button + android:id="@+id/button2" + android:layout_width="@dimen/button_size" + android:layout_height="@dimen/button_size" + android:layout_marginBottom="@dimen/button_margin" + android:textSize="13pt" + android:background="@drawable/round_button" + android:onClick="onClick" + android:text="2" + app:layout_constraintBottom_toTopOf="@+id/button0" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <Button + android:id="@+id/button1" + android:layout_width="@dimen/button_size" + android:layout_height="@dimen/button_size" + android:layout_marginBottom="@dimen/button_margin" + android:textSize="13pt" + android:background="@drawable/round_button" + android:onClick="onClick" + android:text="1" + app:layout_constraintBottom_toTopOf="@+id/button_empty1" + app:layout_constraintEnd_toStartOf="@+id/button2" + app:layout_constraintStart_toStartOf="parent" /> + + <Space + android:id="@+id/button_empty2" + android:layout_width="@dimen/button_size" + android:layout_height="@dimen/button_size" + android:layout_marginBottom="@dimen/button_margin" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/button0" /> + + <Button + android:id="@+id/button0" + android:layout_width="@dimen/button_size" + android:layout_height="@dimen/button_size" + android:layout_marginBottom="@dimen/button_margin" + android:textSize="13pt" + android:background="@drawable/round_button" + android:onClick="onClick" + android:text="0" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <Space + android:id="@+id/button_empty1" + android:layout_width="@dimen/button_size" + android:layout_height="@dimen/button_size" + android:layout_marginBottom="@dimen/button_margin" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/button0" + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/input" + android:layout_width="wrap_content" + android:layout_height="0dp" + android:fontFamily="monospace" + android:gravity="center" + android:maxLines="1" + android:minWidth="100dp" + app:autoSizeMaxTextSize="180dp" + app:autoSizeMinTextSize="50dp" + app:autoSizeStepGranularity="2dp" + app:autoSizeTextType="uniform" + app:layout_constraintBottom_toTopOf="@+id/button8" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <Button + android:id="@+id/button" + android:layout_width="40dp" + android:layout_height="40dp" + android:layout_marginStart="16dp" + android:layout_marginTop="16dp" + android:background="@drawable/ic_baseline_arrow_back_ios_24" + android:backgroundTint="@color/design_default_color_primary" + android:onClick="onBack" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100755 index 0000000..2fb1ba1 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,40 @@ +<?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" + tools:context=".MainActivity"> + + <LinearLayout + android:layout_width="300dp" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> + + <Button + android:id="@+id/play_golden" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="onClick" + android:text="Golden ratio" /> + + <Button + android:id="@+id/play_e" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="onClick" + android:text="Euler" /> + + <Button + android:id="@+id/play_pi" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:onClick="onClick" + android:text="Pi" /> + </LinearLayout> + +</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/game_over.xml b/app/src/main/res/layout/game_over.xml new file mode 100755 index 0000000..5c4fdb1 --- /dev/null +++ b/app/src/main/res/layout/game_over.xml @@ -0,0 +1,60 @@ +<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:id="@+id/game_over" + android:layout_width="match_parent" + android:layout_height="match_parent" > + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:background="@color/design_default_color_secondary" > + + <TextView + android:id="@+id/score" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="24dp" + android:textColor="@color/design_default_color_on_secondary" + android:textSize="40dp" + android:text="Score: " + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/highscore" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:textColor="@color/design_default_color_on_secondary" + android:text="New highscore!" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/score" /> + + <TextView + android:id="@+id/correct" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="24dp" + android:textColor="@color/design_default_color_on_secondary" + android:textSize="30dp" + android:text="..." + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/highscore" /> + + <Button + android:id="@+id/got_it" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:onClick="onReset" + android:text="Got it!" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/correct" /> + </androidx.constraintlayout.widget.ConstraintLayout> +</RelativeLayout>
\ No newline at end of file |