Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ci workflow and code cleanup #24

Merged
merged 4 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Continuous Integration
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Set up JDK environment
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run local unit tests
run: bash ./gradlew test --stacktrace

build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Set up JDK environment
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Build the app
run: bash ./gradlew build --stacktrace

This file was deleted.

27 changes: 14 additions & 13 deletions app/src/main/res/layout-land/content_main.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/main_content"
<LinearLayout android:id="@+id/main_content"
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"
Expand Down Expand Up @@ -35,30 +34,31 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:rotation="90"/>
android:rotation="90" />

<ImageView
android:id="@+id/mode_arrow_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:src="@drawable/ic_keyboard_arrow_left_black_24dp"
app:srcCompat="@drawable/ic_keyboard_arrow_left_black_24dp"
android:layout_alignParentTop="true"
android:padding="@dimen/activity_vertical_margin"
android:layout_centerHorizontal="true"
android:onClick="onClick"
android:rotation="90"/>
android:rotation="90" />

<ImageView
android:id="@+id/mode_arrow_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_keyboard_arrow_right_black_24dp"
app:srcCompat="@drawable/ic_keyboard_arrow_right_black_24dp"
android:layout_alignParentBottom="true"
android:padding="@dimen/activity_vertical_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:layout_centerHorizontal="true"
android:onClick="onClick"
android:rotation="90"/>
android:rotation="90" />
</RelativeLayout>

<RelativeLayout
Expand All @@ -81,30 +81,31 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:rotation="90"/>
android:rotation="90" />

<ImageView
android:id="@+id/size_arrow_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:src="@drawable/ic_keyboard_arrow_left_black_24dp"
app:srcCompat="@drawable/ic_keyboard_arrow_left_black_24dp"
android:layout_alignParentTop="true"
android:padding="@dimen/activity_vertical_margin"
android:layout_centerHorizontal="true"
android:onClick="onClick"
android:rotation="90" />

<ImageView
android:id="@+id/size_arrow_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_keyboard_arrow_right_black_24dp"
app:srcCompat="@drawable/ic_keyboard_arrow_right_black_24dp"
android:layout_alignParentBottom="true"
android:padding="@dimen/activity_vertical_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:layout_centerHorizontal="true"
android:onClick="onClick"
android:rotation="90"/>
android:rotation="90" />
</RelativeLayout>

<LinearLayout
Expand All @@ -122,7 +123,7 @@
android:background="@drawable/button_normal"
android:text="@string/main_button_quick_start"
android:id="@+id/quick_start_button"
android:onClick="onClick"/>
android:onClick="onClick" />

<Button
android:layout_marginBottom="@dimen/activity_vertical_margin"
Expand All @@ -132,7 +133,7 @@
android:background="@drawable/button_fullwidth"
android:text="@string/custom_game"
android:id="@+id/action_settings"
android:onClick="onClick"/>
android:onClick="onClick" />

</LinearLayout>

Expand Down
31 changes: 16 additions & 15 deletions app/src/main/res/layout-land/content_place_ship.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">

<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/placement_gridview"
Expand All @@ -10,7 +11,7 @@
android:verticalSpacing="1px"
android:horizontalSpacing="1px"
android:stretchMode="columnWidth"
android:layout_weight="1"/>
android:layout_weight="1" />

<LinearLayout
android:id="@+id/game_linear_layout"
Expand All @@ -31,10 +32,10 @@
android:id="@+id/arrow_left"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:src="@drawable/arrow_left_black"
app:srcCompat="@drawable/arrow_left_black"
android:adjustViewBounds="true"
android:onClick="onClickButton"
android:layout_gravity="center_vertical"/>
android:layout_gravity="center_vertical" />

<LinearLayout
android:layout_width="wrap_content"
Expand All @@ -46,30 +47,30 @@
android:id="@+id/arrow_up"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:src="@drawable/arrow_up_black"
app:srcCompat="@drawable/arrow_up_black"
android:adjustViewBounds="true"
android:onClick="onClickButton"
android:layout_weight="1"/>
android:layout_weight="1" />

<ImageView
android:id="@+id/arrow_down"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:src="@drawable/arrow_down_black"
app:srcCompat="@drawable/arrow_down_black"
android:adjustViewBounds="true"
android:onClick="onClickButton"
android:layout_weight="1"/>
android:layout_weight="1" />

</LinearLayout>

<ImageView
android:id="@+id/arrow_right"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:src="@drawable/arrow_right_black"
app:srcCompat="@drawable/arrow_right_black"
android:adjustViewBounds="true"
android:onClick="onClickButton"
android:layout_gravity="center_vertical"/>
android:layout_gravity="center_vertical" />

</LinearLayout>

Expand All @@ -83,11 +84,11 @@
android:id="@+id/rotate_right"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:src="@drawable/arrow_rotate_right_black"
app:srcCompat="@drawable/arrow_rotate_right_black"
android:adjustViewBounds="true"
android:onClick="onClickButton"
android:layout_weight="1"
android:layout_gravity="center_vertical"/>
android:layout_gravity="center_vertical" />

<androidx.legacy.widget.Space
android:layout_width="50dp"
Expand All @@ -97,11 +98,11 @@
android:id="@+id/rotate_left"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:src="@drawable/arrow_rotate_left_black"
app:srcCompat="@drawable/arrow_rotate_left_black"
android:adjustViewBounds="true"
android:onClick="onClickButton"
android:layout_weight="1"
android:layout_gravity="center_vertical"/>
android:layout_gravity="center_vertical" />

</LinearLayout>

Expand All @@ -115,7 +116,7 @@
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:background="@drawable/button_fullwidth"
android:textColor="@color/white"
android:onClick="onClickReady"/>
android:onClick="onClickReady" />

</LinearLayout>

Expand Down
9 changes: 5 additions & 4 deletions app/src/main/res/layout-land/fragment_mode_main.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
Expand All @@ -13,7 +13,8 @@
android:rotation="-90"
tools:context="org.secuso.privacyfriendlybattleship.ui.MainActivity$GameModeFragment">

<TextView android:id="@+id/section_label"
<TextView
android:id="@+id/section_label"
android:text="Label"
android:textStyle="bold"
android:textSize="18sp"
Expand All @@ -27,7 +28,7 @@
android:layout_width="match_parent"
android:adjustViewBounds="true"
android:layout_centerInParent="true"
android:src="@drawable/ic_person_black_24px"
android:layout_height="0dp"/>
app:srcCompat="@drawable/ic_person_black_24px"
android:layout_height="0dp" />

</LinearLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout-land/fragment_size_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
android:layout_height="wrap_content"
android:id="@+id/select_size"
android:layout_weight="1"
android:gravity="center"/>
android:gravity="center" />
</LinearLayout>
Loading
Loading