Skip to content

Commit

Permalink
Merge pull request #1 from AlinaStepanova/dev
Browse files Browse the repository at this point in the history
Stable release
  • Loading branch information
AlinaStepanova authored Jun 13, 2022
2 parents 5300f30 + 63667df commit eca4e69
Show file tree
Hide file tree
Showing 44 changed files with 1,105 additions and 313 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/android_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Android Build

on:
push:
branches:
- dev
pull_request:
branches:
- dev

jobs:
test_job:
name: Test
runs-on: ubuntu-latest
continue-on-error: true
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Restore Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Debug Tests
run: ./gradlew testDebugUnitTest --continue

- name: Upload Test Reports
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-reports
path: '**/build/reports/tests/'

lint_job:
name: Lint
runs-on: ubuntu-latest
continue-on-error: true
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Restore Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Debug Lint
run: ./gradlew lintDebug

- name: Upload Lint Reports
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: lint-report
path: '**/build/reports/lint-results-*'

assemble_job:
name: Assemble
runs-on: ubuntu-latest
continue-on-error: true
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Restore Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Assemble Debug
run: ./gradlew assembleDebug

- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: apk
path: app/build/outputs/apk/debug/**.apk
6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SeaBattle
Sea Battle - a classic puzzle 2D-game created using Canvas, Custom Views, Coroutines and Kotlin.

![push](https://github.com/AlinaStepanova/SeaBattle/workflows/Android%20Build/badge.svg?branch=dev&event=push)

Play Market: https://play.google.com/store/apps/details?id=com.avs.sea.battle

How to play: https://youtu.be/ZrbtILJjqpU

<p align="center">
<img src="https://user-images.githubusercontent.com/23102335/104816069-5d744c80-5821-11eb-9570-a43c10350dda.png" width="60%">
<img src="https://user-images.githubusercontent.com/23102335/104816078-6ebd5900-5821-11eb-84b1-bf9283e9a4f1.png" width="60%">
<img src="https://user-images.githubusercontent.com/23102335/104816081-72e97680-5821-11eb-9c49-1eac627b5015.png" width="60%">
</p>
42 changes: 22 additions & 20 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileSdkVersion 31
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "com.avs.sea.battle"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
minSdkVersion 19
targetSdkVersion 31
versionCode 8
versionName "8"
vectorDrawables.useSupportLibrary = true
resConfigs "en"
resConfigs "en", "uk", "ru"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
Expand All @@ -38,9 +38,6 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
aaptOptions {
cruncherEnabled = false
}
dataBinding {
enabled = true
}
Expand All @@ -49,17 +46,22 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
testImplementation "org.mockito:mockito-core:2.25.0"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0"
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
testImplementation "org.mockito:mockito-core:3.3.0"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0"

kapt "com.android.databinding:compiler:3.1.4"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
androidTestImplementation 'androidx.test:rules:1.3.0-alpha05'
androidTestImplementation 'androidx.test:rules:1.4.0'
implementation 'com.google.android.play:core:1.10.2'
implementation 'com.google.android.play:core-ktx:1.8.1'
}
16 changes: 7 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.avs.sea.battle">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
Expand All @@ -12,19 +11,18 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name="com.avs.sea.battle.main.MainActivity"
android:screenOrientation="landscape"
tools:ignore="LockedOrientationActivity">
<activity android:name="com.avs.sea.battle.main.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.avs.sea.battle.privacy_policy.PrivacyPolicyActivity"
android:screenOrientation="fullSensor"
android:parentActivityName="com.avs.sea.battle.main.MainActivity"/>
<activity
android:name="com.avs.sea.battle.privacy_policy.PrivacyPolicyActivity"
android:parentActivityName="com.avs.sea.battle.main.MainActivity"
android:screenOrientation="fullSensor" />
</application>

</manifest>
2 changes: 1 addition & 1 deletion app/src/main/java/com/avs/sea/battle/Constants.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.avs.sea.battle

const val NAMESPACE = "com.avs.sea_battle"
const val NAMESPACE = "com.avs.sea.battle"
const val SQUARES_COUNT = 10
const val FOUR_DECK_SHIP_SIZE = 4
const val THREE_DECK_SHIP_SIZE = 3
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/avs/sea/battle/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import android.content.pm.ResolveInfo
import android.net.Uri
import java.util.*

fun openGmail(activity: Activity, email: Array<String>, subject: String?): Intent? {
fun openGmail(activity: Activity, email: Array<String>, subject: String?): Intent {
val emailIntent = Intent(Intent.ACTION_SEND)
emailIntent.putExtra(Intent.EXTRA_EMAIL, email)
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject)
Expand All @@ -17,7 +17,7 @@ fun openGmail(activity: Activity, email: Array<String>, subject: String?): Inten
var best: ResolveInfo? = null
for (info in matches) {
if (info.activityInfo.packageName.endsWith(".gm")
|| info.activityInfo.name.toLowerCase(Locale.getDefault()).contains("gmail")
|| info.activityInfo.name.lowercase(Locale.getDefault()).contains("gmail")
) best = info
}
if (best != null) emailIntent.setClassName(
Expand All @@ -37,7 +37,7 @@ fun getShareIntent(context: Context): Intent {
return sharingIntent
}

fun openMarket(showAppsList: Boolean): Intent? {
fun openMarket(showAppsList: Boolean): Intent {
val uri = if (showAppsList) {
Uri.parse("market://search?q=pub:$DEV_NAME")
} else {
Expand Down
Loading

0 comments on commit eca4e69

Please sign in to comment.