Skip to content

Commit b4a07c3

Browse files
committed
style #12: add question ui
1 parent f4ee8c7 commit b4a07c3

File tree

4 files changed

+144
-5
lines changed

4 files changed

+144
-5
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="rectangle">
4+
<stroke
5+
android:width="1dp"
6+
android:color="#E8E8E8" />
7+
8+
<solid android:color="@android:color/white" />
9+
10+
<corners android:radius="5dp" />
11+
12+
</shape>
Lines changed: 127 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,134 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7+
android:fillViewport="true"
78
tools:context=".QuizQuestionActivity">
89

9-
</androidx.constraintlayout.widget.ConstraintLayout>
10+
<LinearLayout
11+
android:layout_width="match_parent"
12+
android:layout_height="wrap_content"
13+
android:gravity="center"
14+
android:orientation="vertical"
15+
android:padding="16dp">
16+
17+
<TextView
18+
android:id="@+id/tv_question"
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content"
21+
android:layout_margin="10dp"
22+
android:gravity="center"
23+
android:textColor="#363A43"
24+
android:textSize="22sp"
25+
tools:text="What country does this flag belong to?" />
26+
27+
<ImageView
28+
android:id="@+id/iv_image"
29+
android:layout_width="wrap_content"
30+
android:layout_height="wrap_content"
31+
android:layout_marginTop="16dp"
32+
android:contentDescription="@string/flag_image"
33+
tools:src="@drawable/ic_flag_of_germany" />
34+
35+
<LinearLayout
36+
android:id="@+id/ll_progress_details"
37+
android:layout_width="match_parent"
38+
android:layout_height="wrap_content"
39+
android:layout_marginTop="16dp"
40+
android:gravity="center_vertical"
41+
android:orientation="horizontal">
42+
43+
<ProgressBar
44+
android:id="@+id/progressBar"
45+
style="?android:attr/progressBarStyleHorizontal"
46+
android:layout_width="0dp"
47+
android:layout_height="wrap_content"
48+
android:layout_weight="1"
49+
android:indeterminate="false"
50+
android:max="10"
51+
android:minHeight="50dp"
52+
android:progress="0" />
53+
54+
<TextView
55+
android:id="@+id/tv_progress"
56+
android:layout_width="wrap_content"
57+
android:layout_height="wrap_content"
58+
android:gravity="center"
59+
android:padding="15dp"
60+
android:textColorHint="#7A8089"
61+
android:textSize="14sp"
62+
tools:text="0/10" />
63+
</LinearLayout>
64+
65+
<TextView
66+
android:id="@+id/tv_option_one"
67+
android:layout_width="match_parent"
68+
android:layout_height="wrap_content"
69+
android:layout_margin="10dp"
70+
android:background="@drawable/default_option_border_bg"
71+
android:gravity="center"
72+
android:padding="15dp"
73+
android:textColor="#7A8089"
74+
android:textSize="18sp"
75+
tools:text="Apple" />
76+
77+
<TextView
78+
android:id="@+id/tv_option_two"
79+
android:layout_width="match_parent"
80+
android:layout_height="wrap_content"
81+
android:layout_marginStart="10dp"
82+
android:layout_marginTop="10dp"
83+
android:layout_marginEnd="10dp"
84+
android:layout_marginBottom="10dp"
85+
android:background="@drawable/default_option_border_bg"
86+
android:gravity="center"
87+
android:padding="15dp"
88+
android:textColor="#7A8089"
89+
android:textSize="18sp"
90+
tools:text="Google" />
91+
92+
<TextView
93+
android:id="@+id/tv_option_three"
94+
android:layout_width="match_parent"
95+
android:layout_height="wrap_content"
96+
android:layout_marginStart="10dp"
97+
android:layout_marginTop="10dp"
98+
android:layout_marginEnd="10dp"
99+
android:layout_marginBottom="10dp"
100+
android:background="@drawable/default_option_border_bg"
101+
android:gravity="center"
102+
android:padding="15dp"
103+
android:textColor="#7A8089"
104+
android:textSize="18sp"
105+
tools:text="Android Inc." />
106+
107+
<TextView
108+
android:id="@+id/tv_option_four"
109+
android:layout_width="match_parent"
110+
android:layout_height="wrap_content"
111+
android:layout_marginStart="10dp"
112+
android:layout_marginTop="10dp"
113+
android:layout_marginEnd="10dp"
114+
android:layout_marginBottom="10dp"
115+
android:background="@drawable/default_option_border_bg"
116+
android:gravity="center"
117+
android:padding="15dp"
118+
android:textColor="#7A8089"
119+
android:textSize="18sp"
120+
tools:text="Nokia" />
121+
122+
<Button
123+
android:id="@+id/btn_submit"
124+
android:layout_width="match_parent"
125+
android:layout_height="wrap_content"
126+
android:layout_margin="10dp"
127+
android:background="@color/purple_700"
128+
android:text="@string/btn_submit"
129+
android:textColor="@android:color/white"
130+
android:textSize="18sp"
131+
android:textStyle="bold" />
132+
</LinearLayout>
133+
134+
</ScrollView>

QuizApp/app/src/main/res/values/colors.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<color name="purple_200">#FFBB86FC</color>
4-
<color name="purple_500">#FF6200EE</color>
5-
<color name="purple_700">#FF3700B3</color>
3+
<color name="purple_200">#9013FE</color>
4+
<color name="purple_500">#6A1B9A</color>
5+
<color name="purple_700">#9013FE</color>
66
<color name="teal_200">#FF03DAC5</color>
77
<color name="teal_700">#FF018786</color>
88
<color name="black">#FF000000</color>

QuizApp/app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
<string name="please_enter_your_name">Please enter your name</string>
66
<string name="hint_name">Name</string>
77
<string name="button_start">Start</string>
8+
<string name="flag_image">image</string>
9+
<string name="btn_submit">SUBMIT</string>
810
</resources>

0 commit comments

Comments
 (0)