Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christopher League
FloodGame
Commits
93ced759
Commit
93ced759
authored
Jul 08, 2019
by
Christopher League
Browse files
Factor out some main-screen layouts for landscape
parent
04d4637f
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/src/main/res/layout-land/activity_main.xml
0 → 100644
View file @
93ced759
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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:orientation=
"vertical"
android:padding=
"@dimen/default_gap"
tools:context=
".MainActivity"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"top"
android:orientation=
"horizontal"
android:padding=
"8dp"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<include
layout=
"@layout/title_author"
/>
</LinearLayout>
<ImageButton
android:id=
"@+id/imageButton"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:layout_gravity=
"center"
android:layout_marginStart=
"8dp"
android:layout_marginLeft=
"8dp"
android:layout_marginEnd=
"8dp"
android:layout_marginRight=
"8dp"
android:layout_marginBottom=
"8dp"
android:onClick=
"clickStartGame"
android:scaleType=
"centerInside"
app:srcCompat=
"@android:drawable/ic_media_play"
/>
</LinearLayout>
<Space
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
/>
<include
layout=
"@layout/options_table"
/>
<Space
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
93ced759
...
@@ -8,195 +8,14 @@
...
@@ -8,195 +8,14 @@
android:padding=
"@dimen/default_gap"
android:padding=
"@dimen/default_gap"
tools:context=
".MainActivity"
>
tools:context=
".MainActivity"
>
<TextView
<include
layout=
"@layout/title_author"
/>
android:id=
"@+id/title"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"24dp"
android:gravity=
"center"
android:text=
"@string/title"
android:textSize=
"54sp"
android:textStyle=
"bold"
app:fontFamily=
"casual"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/textView9"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:text=
"\u00A92019 Christopher League"
/>
<Space
<Space
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
/>
android:layout_weight=
"1"
/>
<TableLayout
<include
layout=
"@layout/options_table"
/>
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3"
android:padding=
"@dimen/default_gap"
>
<TableRow
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"fill_horizontal|center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/boardSizeLabel"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingRight=
"@dimen/default_gap"
android:text=
"Board Size"
android:textSize=
"18sp"
app:fontFamily=
"sans-serif-medium"
/>
<TextView
android:id=
"@+id/boardSizeValue"
android:layout_width=
"40dp"
android:layout_height=
"wrap_content"
android:gravity=
"end"
android:text=
"99"
android:textSize=
"18sp"
app:fontFamily=
"sans-serif-medium"
/>
<SeekBar
android:id=
"@+id/boardSizeSlider"
style=
"@style/Widget.AppCompat.SeekBar.Discrete"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:max=
"3"
android:progress=
"0"
/>
</TableRow>
<TableRow
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
>
<TextView
android:id=
"@+id/numColorsLabel"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"end"
android:paddingRight=
"@dimen/default_gap"
android:text=
"Colors"
android:textSize=
"18sp"
app:fontFamily=
"sans-serif-medium"
/>
<TextView
android:id=
"@+id/numColorsValue"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"end"
android:text=
"9"
android:textSize=
"18sp"
app:fontFamily=
"sans-serif-medium"
/>
<SeekBar
android:id=
"@+id/numColorsSlider"
style=
"@style/Widget.AppCompat.SeekBar.Discrete"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:max=
"5"
android:progress=
"3"
/>
</TableRow>
<TableRow
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
>
<TextView
android:id=
"@+id/paletteLabel"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"end"
android:paddingRight=
"@dimen/default_gap"
android:text=
"Palette"
android:textSize=
"18sp"
app:fontFamily=
"sans-serif-medium"
/>
<RadioButton
android:id=
"@+id/radioPalette1"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:checked=
"true"
android:gravity=
"right"
android:textSize=
"8sp"
/>
<edu.liu.floodgame.PaletteSwatchesView
android:id=
"@+id/swatchesPalette1"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/color_button"
android:layout_weight=
"1"
/>
</TableRow>
<TableRow
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
>
<View
android:layout_width=
"0dp"
android:layout_height=
"0dp"
/>
<RadioButton
android:id=
"@+id/radioPalette2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:checked=
"false"
android:gravity=
"right"
android:textSize=
"8sp"
/>
<edu.liu.floodgame.PaletteSwatchesView
android:id=
"@+id/swatchesPalette2"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/color_button"
android:layout_weight=
"1"
/>
</TableRow>
<TableRow
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
>
<View
android:layout_width=
"0dp"
android:layout_height=
"0dp"
/>
<RadioButton
android:id=
"@+id/radioPalette3"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:checked=
"false"
android:gravity=
"right"
android:textSize=
"8sp"
/>
<edu.liu.floodgame.PaletteSwatchesView
android:id=
"@+id/swatchesPalette3"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/color_button"
android:layout_weight=
"1"
/>
</TableRow>
</TableLayout>
<Space
<Space
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
app/src/main/res/layout/options_table.xml
0 → 100644
View file @
93ced759
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3"
android:layout_marginLeft=
"8dp"
android:layout_marginRight=
"8dp"
android:padding=
"@dimen/default_gap"
>
<TableRow
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"fill_horizontal|center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/boardSizeLabel"
app:fontFamily=
"sans-serif-medium"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingRight=
"@dimen/default_gap"
android:text=
"Board Size"
android:textSize=
"18sp"
/>
<TextView
android:id=
"@+id/boardSizeValue"
app:fontFamily=
"sans-serif-medium"
android:layout_width=
"40dp"
android:layout_height=
"wrap_content"
android:gravity=
"end"
android:text=
"99"
android:textSize=
"18sp"
/>
<SeekBar
android:id=
"@+id/boardSizeSlider"
style=
"@style/Widget.AppCompat.SeekBar.Discrete"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:max=
"3"
android:progress=
"0"
/>
</TableRow>
<TableRow
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
>
<TextView
android:id=
"@+id/numColorsLabel"
app:fontFamily=
"sans-serif-medium"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"end"
android:paddingRight=
"@dimen/default_gap"
android:text=
"Colors"
android:textSize=
"18sp"
/>
<TextView
android:id=
"@+id/numColorsValue"
app:fontFamily=
"sans-serif-medium"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"end"
android:text=
"9"
android:textSize=
"18sp"
/>
<SeekBar
android:id=
"@+id/numColorsSlider"
style=
"@style/Widget.AppCompat.SeekBar.Discrete"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:max=
"5"
android:progress=
"3"
/>
</TableRow>
<TableRow
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
>
<TextView
android:id=
"@+id/paletteLabel"
app:fontFamily=
"sans-serif-medium"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"end"
android:paddingRight=
"@dimen/default_gap"
android:text=
"Palette"
android:textSize=
"18sp"
/>
<RadioButton
android:id=
"@+id/radioPalette1"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:checked=
"true"
android:gravity=
"right"
android:textSize=
"8sp"
/>
<edu.liu.floodgame.PaletteSwatchesView
android:id=
"@+id/swatchesPalette1"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/color_button"
android:layout_weight=
"1"
/>
</TableRow>
<TableRow
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
>
<View
android:layout_width=
"0dp"
android:layout_height=
"0dp"
/>
<RadioButton
android:id=
"@+id/radioPalette2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:checked=
"false"
android:gravity=
"right"
android:textSize=
"8sp"
/>
<edu.liu.floodgame.PaletteSwatchesView
android:id=
"@+id/swatchesPalette2"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/color_button"
android:layout_weight=
"1"
/>
</TableRow>
<TableRow
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
>
<View
android:layout_width=
"0dp"
android:layout_height=
"0dp"
/>
<RadioButton
android:id=
"@+id/radioPalette3"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:checked=
"false"
android:gravity=
"right"
android:textSize=
"8sp"
/>
<edu.liu.floodgame.PaletteSwatchesView
android:id=
"@+id/swatchesPalette3"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/color_button"
android:layout_weight=
"1"
/>
</TableRow>
</TableLayout>
\ No newline at end of file
app/src/main/res/layout/title_author.xml
0 → 100644
View file @
93ced759
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<TextView
android:id=
"@+id/title"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"24dp"
android:gravity=
"center"
android:text=
"@string/title"
android:textSize=
"54sp"
android:textStyle=
"bold"
app:fontFamily=
"casual"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/textView9"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:text=
"\u00a92019 Christopher League"
/>
</merge>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment