Skip to content

Commit

Permalink
Merge pull request #4 from AlinaStepanova/dev
Browse files Browse the repository at this point in the history
Stable version
  • Loading branch information
AlinaStepanova authored Jan 17, 2024
2 parents eca4e69 + 4f931bc commit 42649cb
Show file tree
Hide file tree
Showing 28 changed files with 287 additions and 154 deletions.
46 changes: 46 additions & 0 deletions .idea/appInsightsSettings.xml

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

2 changes: 1 addition & 1 deletion .idea/compiler.xml

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

30 changes: 18 additions & 12 deletions .idea/deploymentTargetDropDown.xml

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

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

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

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

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

10 changes: 10 additions & 0 deletions .idea/migrations.xml

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

3 changes: 1 addition & 2 deletions .idea/misc.xml

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

21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,26 @@ Sea Battle - a classic puzzle 2D-game created using Canvas, Custom Views, Corout

![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
[Play Market](https://play.google.com/store/apps/details?id=com.avs.sea.battle) <b>10K+ downloads</b>

How to play: https://youtu.be/ZrbtILJjqpU
[How to play](https://youtu.be/ZrbtILJjqpU)

<h3> Active branches: </h3>

<ul><b> dev </b> - contains stable implementation of main functionality and tests.</ul>

<h3> Architecture approach </h3>

<img src="https://user-images.githubusercontent.com/23102335/174146090-fc6f1356-3cf1-482f-acb3-e167a5798bac.png" width="50%">

<h3> Main libraries used: </h3>

<b> Coroutines </b> - for performing delayes with respect of lifecycle<br>
<b> Lifecycle </b> - for performing actions in response to a change in the lifecycle status of activities and fragments<br>
<b> Databinding </b> - for binding UI components in layouts to data sources<br>
<b> JUnit 4, Mockito </b> - tests<br>

---

<p align="center">
<img src="https://user-images.githubusercontent.com/23102335/104816069-5d744c80-5821-11eb-9570-a43c10350dda.png" width="60%">
Expand Down
46 changes: 28 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,23 @@ apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'

def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
compileSdkVersion 31
buildToolsVersion '30.0.3'
compileSdk 34
buildToolsVersion = '30.0.3'
defaultConfig {
applicationId "com.avs.sea.battle"
minSdkVersion 19
targetSdkVersion 31
versionCode 8
versionName "8"
targetSdkVersion 34
versionCode 9
versionName "9"
vectorDrawables.useSupportLibrary = true
resConfigs "en", "uk", "ru"
resourceConfigurations += ['en', 'uk', 'ru']
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
Expand All @@ -41,27 +39,39 @@ android {
dataBinding {
enabled = true
}
buildFeatures {
viewBinding = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
namespace 'com.avs.sea.battle'
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.11.0'

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

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"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"

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

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

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:appCategory="game"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/com/avs/sea/battle/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.content.pm.ResolveInfo
import android.content.res.Configuration
import android.graphics.Color
import android.net.Uri
import java.util.*

Expand Down Expand Up @@ -44,4 +46,9 @@ fun openMarket(showAppsList: Boolean): Intent {
Uri.parse("market://details?id=$NAMESPACE")
}
return Intent(Intent.ACTION_VIEW, uri)
}

fun isDarkThemeOn(context: Context): Boolean {
return context.resources.configuration.uiMode and
Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES
}
Loading

0 comments on commit 42649cb

Please sign in to comment.