activity_flood_grid.xml 7.56 KB
Newer Older
1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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.support.v7.widget.GridLayout
        android:id="@+id/grid"
10
11
12
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:padding="10dp"
13
14
        app:columnCount="2"
        app:layout_constraintBottom_toBottomOf="parent"
15
        app:layout_constraintDimensionRatio="1"
16
        app:layout_constraintEnd_toEndOf="parent"
17
        app:layout_constraintHorizontal_bias="0.498"
18
        app:layout_constraintStart_toStartOf="parent"
19
20
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.0">
21
22
23

        <View
            android:id="@+id/sample1"
24
25
26
27
28
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@color/colorPrimary"
            app:layout_columnWeight="1"
            app:layout_rowWeight="1" />
29
30
31

        <View
            android:id="@+id/sample2"
32
33
34
35
36
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@color/colorAccent"
            app:layout_columnWeight="1"
            app:layout_rowWeight="1" />
37
38
39

        <View
            android:id="@+id/sample3"
40
41
42
43
44
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@color/colorPrimaryDark"
            app:layout_columnWeight="1"
            app:layout_rowWeight="1" />
45
46
47

        <View
            android:id="@+id/sample4"
48
49
50
51
52
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@color/colorPrimary"
            app:layout_columnWeight="1"
            app:layout_rowWeight="1" />
53
54
55
56
    </android.support.v7.widget.GridLayout>

    <LinearLayout
        android:id="@+id/buttonBar"
57
        android:layout_width="match_parent"
58
        android:layout_height="wrap_content"
59
        android:layout_marginBottom="24dp"
60
        android:orientation="horizontal"
61
        android:padding="@dimen/default_gap"
62
63
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
        app:layout_constraintStart_toStartOf="parent">

        <Space
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

        <edu.liu.floodgame.ColorButton
            android:layout_width="@dimen/color_button"
            android:layout_height="@dimen/color_button"
            android:layout_marginStart="@dimen/default_gap"
            android:layout_marginLeft="@dimen/default_gap"
            android:layout_marginEnd="@dimen/default_gap"
            android:layout_marginRight="@dimen/default_gap" />

        <Space
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

        <edu.liu.floodgame.ColorButton
            android:layout_width="@dimen/color_button"
            android:layout_height="@dimen/color_button"
            android:layout_marginStart="@dimen/default_gap"
            android:layout_marginLeft="@dimen/default_gap"
            android:layout_marginEnd="@dimen/default_gap"
            android:layout_marginRight="@dimen/default_gap" />
91

92
        <Space
93
94
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
95
96
97
98
99
100
101
102
103
104
105
            android:layout_weight="1" />

        <edu.liu.floodgame.ColorButton
            android:layout_width="@dimen/color_button"
            android:layout_height="@dimen/color_button"
            android:layout_marginStart="@dimen/default_gap"
            android:layout_marginLeft="@dimen/default_gap"
            android:layout_marginEnd="@dimen/default_gap"
            android:layout_marginRight="@dimen/default_gap" />

        <Space
106
107
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
            android:layout_weight="1" />

        <edu.liu.floodgame.ColorButton
            android:layout_width="@dimen/color_button"
            android:layout_height="@dimen/color_button"
            android:layout_marginStart="@dimen/default_gap"
            android:layout_marginLeft="@dimen/default_gap"
            android:layout_marginEnd="@dimen/default_gap"
            android:layout_marginRight="@dimen/default_gap" />

        <Space
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

        <edu.liu.floodgame.ColorButton
            android:layout_width="@dimen/color_button"
            android:layout_height="@dimen/color_button"
            android:layout_marginStart="@dimen/default_gap"
            android:layout_marginLeft="@dimen/default_gap"
            android:layout_marginEnd="@dimen/default_gap"
            android:layout_marginRight="@dimen/default_gap" />

        <Space
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

        <edu.liu.floodgame.ColorButton
            android:layout_width="@dimen/color_button"
            android:layout_height="@dimen/color_button"
            android:layout_marginStart="@dimen/default_gap"
            android:layout_marginLeft="@dimen/default_gap"
            android:layout_marginEnd="@dimen/default_gap"
            android:layout_marginRight="@dimen/default_gap" />

        <Space
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

        <edu.liu.floodgame.ColorButton
            android:layout_width="@dimen/color_button"
            android:layout_height="@dimen/color_button"
            android:layout_marginStart="@dimen/default_gap"
            android:layout_marginLeft="@dimen/default_gap"
            android:layout_marginEnd="@dimen/default_gap"
            android:layout_marginRight="@dimen/default_gap" />

        <Space
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

        <edu.liu.floodgame.ColorButton
            android:layout_width="@dimen/color_button"
            android:layout_height="@dimen/color_button"
            android:layout_marginStart="@dimen/default_gap"
            android:layout_marginLeft="@dimen/default_gap"
            android:layout_marginEnd="@dimen/default_gap"
            android:layout_marginRight="@dimen/default_gap" />

        <Space
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1" />


176
177
    </LinearLayout>

178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
    <TextView
        android:id="@+id/num_moves"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginBottom="8dp"
        android:text="numMoves"
        android:textSize="30sp"
        app:fontFamily="sans-serif-black"
        app:layout_constraintBottom_toTopOf="@+id/buttonBar"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/grid"
        app:layout_constraintVertical_bias="0.341" />

196
</android.support.constraint.ConstraintLayout>