activity_flood_grid.xml 5.71 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
        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"
73
            android:layout_height="@dimen/color_button" />
74
75
76
77
78
79
80
81

        <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"
82
            android:layout_height="@dimen/color_button" />
83

84
        <Space
85
86
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
87
88
89
90
            android:layout_weight="1" />

        <edu.liu.floodgame.ColorButton
            android:layout_width="@dimen/color_button"
91
            android:layout_height="@dimen/color_button" />
92
93

        <Space
94
95
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
96
97
98
99
            android:layout_weight="1" />

        <edu.liu.floodgame.ColorButton
            android:layout_width="@dimen/color_button"
100
            android:layout_height="@dimen/color_button" />
101
102
103
104
105
106
107
108

        <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"
109
            android:layout_height="@dimen/color_button" />
110
111
112
113
114
115
116
117

        <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"
118
            android:layout_height="@dimen/color_button" />
119
120
121
122
123
124
125
126

        <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"
127
            android:layout_height="@dimen/color_button" />
128
129
130
131
132
133
134
135

        <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"
136
            android:layout_height="@dimen/color_button"/>
137
138
139
140
141
142
143

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


144
145
    </LinearLayout>

146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
    <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" />

164
</android.support.constraint.ConstraintLayout>