├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── themes.xml
│ │ │ ├── raw
│ │ │ │ ├── o.mp3
│ │ │ │ ├── x.mp3
│ │ │ │ ├── click.mp3
│ │ │ │ └── draw_animi.json
│ │ │ ├── drawable-v24
│ │ │ │ ├── grid.png
│ │ │ │ ├── circle.png
│ │ │ │ ├── cross.png
│ │ │ │ ├── button_1.png
│ │ │ │ ├── button_2.png
│ │ │ │ ├── feedback.png
│ │ │ │ ├── ic_rating.png
│ │ │ │ ├── ic_sound.png
│ │ │ │ ├── purple_btn.png
│ │ │ │ ├── red_button.png
│ │ │ │ ├── splash_src.png
│ │ │ │ ├── background_img.png
│ │ │ │ ├── celebrate_gif.gif
│ │ │ │ ├── celebrategif.gif
│ │ │ │ ├── ic_vibration.png
│ │ │ │ ├── settings_gif.gif
│ │ │ │ ├── count_background.png
│ │ │ │ ├── cross_background.png
│ │ │ │ ├── circle_background.png
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── font
│ │ │ │ ├── poppins_medium.ttf
│ │ │ │ └── poppins_regular.ttf
│ │ │ ├── drawable
│ │ │ │ ├── profile_img.png
│ │ │ │ ├── rounded_corners.xml
│ │ │ │ ├── back_icon.xml
│ │ │ │ ├── radio_button_unchecked.xml
│ │ │ │ ├── radio_button_checked.xml
│ │ │ │ ├── app_main_theme_background.xml
│ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── values-night
│ │ │ │ └── themes.xml
│ │ │ └── layout
│ │ │ │ ├── activity_offline_game_menu.xml
│ │ │ │ ├── quit_dialog.xml
│ │ │ │ ├── activity_aiget_player_name.xml
│ │ │ │ ├── draw_dialog.xml
│ │ │ │ ├── robot_win_dialog.xml
│ │ │ │ ├── celebrate_dialog.xml
│ │ │ │ ├── activity_choose_symbol.xml
│ │ │ │ ├── activity_ai_choose_symbol.xml
│ │ │ │ ├── activity_offline_get_players_names.xml
│ │ │ │ ├── activity_settings.xml
│ │ │ │ ├── activity_ai_game.xml
│ │ │ │ └── activity_offline_game.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── techsoldev
│ │ │ │ └── tictactoegame
│ │ │ │ ├── MyServices.java
│ │ │ │ ├── AIGetPlayerNameActivity.java
│ │ │ │ ├── AiChooseSymbolActivity.java
│ │ │ │ ├── ChooseSymbolActivity.java
│ │ │ │ ├── OfflineGetPlayersNamesActivity.java
│ │ │ │ ├── SettingsActivity.java
│ │ │ │ ├── OfflineGameMenuActivity.java
│ │ │ │ └── Minmax.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── techsoldev
│ │ │ └── tictactoegame
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── techsoldev
│ │ └── tictactoegame
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── .idea
├── .gitignore
├── compiler.xml
├── vcs.xml
├── deploymentTargetDropDown.xml
├── gradle.xml
├── jarRepositories.xml
└── misc.xml
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── LICENSE.md
├── gradle.properties
├── gradlew.bat
├── README.md
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "Tictactoe"
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Tictactoe
3 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/o.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/raw/o.mp3
--------------------------------------------------------------------------------
/app/src/main/res/raw/x.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/raw/x.mp3
--------------------------------------------------------------------------------
/app/src/main/res/raw/click.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/raw/click.mp3
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/grid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/grid.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/circle.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/cross.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/cross.png
--------------------------------------------------------------------------------
/app/src/main/res/font/poppins_medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/font/poppins_medium.ttf
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/button_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/button_1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/button_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/button_2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/feedback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/feedback.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_rating.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/ic_rating.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_sound.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/ic_sound.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/profile_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable/profile_img.png
--------------------------------------------------------------------------------
/app/src/main/res/font/poppins_regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/font/poppins_regular.ttf
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/purple_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/purple_btn.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/red_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/red_button.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/splash_src.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/splash_src.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/background_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/background_img.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/celebrate_gif.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/celebrate_gif.gif
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/celebrategif.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/celebrategif.gif
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_vibration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/ic_vibration.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/settings_gif.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/settings_gif.gif
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/count_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/count_background.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/cross_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/cross_background.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/circle_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/drawable-v24/circle_background.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Abdullah-Sheikh/Tictactoe_in_Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/com/techsoldev/tictactoegame/MyServices.java:
--------------------------------------------------------------------------------
1 | package com.techsoldev.tictactoegame;
2 |
3 | public class MyServices {
4 |
5 | public static boolean VIBRATION_CHECK=false;
6 | public static boolean SOUND_CHECK=true;
7 |
8 |
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Jul 25 23:42:12 PKT 2021
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rounded_corners.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/back_icon.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF6200EE
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/radio_button_unchecked.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/test/java/com/techsoldev/tictactoegame/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.techsoldev.tictactoegame;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/radio_button_checked.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/deploymentTargetDropDown.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/techsoldev/tictactoegame/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.techsoldev.tictactoegame;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.techsoldev.tictactoegame", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Abdullah Sheikh
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
--------------------------------------------------------------------------------
/app/src/main/res/drawable/app_main_theme_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 |
10 |
11 | -
12 |
13 |
14 |
15 |
16 |
17 |
18 | -
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
18 |
19 |
26 |
29 |
30 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | }
4 |
5 | android {
6 | compileSdkVersion 30
7 | buildToolsVersion "30.0.3"
8 |
9 | defaultConfig {
10 | applicationId "com.techsoldev.tictactoegame"
11 | minSdkVersion 21
12 | targetSdkVersion 30
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | compileOptions {
26 | sourceCompatibility JavaVersion.VERSION_1_8
27 | targetCompatibility JavaVersion.VERSION_1_8
28 | }
29 | }
30 |
31 | dependencies {
32 |
33 | implementation 'androidx.appcompat:appcompat:1.3.1'
34 | implementation 'com.google.android.material:material:1.4.0'
35 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
36 | testImplementation 'junit:junit:4.+'
37 | androidTestImplementation 'androidx.test.ext:junit:1.1.3'
38 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
39 |
40 | implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.22'
41 |
42 |
43 | implementation 'com.google.android.play:core:1.8.0'
44 |
45 | implementation 'com.mikhaellopez:circularimageview:4.3.0'
46 |
47 | implementation "com.airbnb.android:lottie:4.0.0"
48 |
49 |
50 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
26 |
29 |
32 |
35 |
38 |
41 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/app/src/main/java/com/techsoldev/tictactoegame/AIGetPlayerNameActivity.java:
--------------------------------------------------------------------------------
1 | package com.techsoldev.tictactoegame;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.text.TextUtils;
8 | import android.view.MotionEvent;
9 | import android.view.View;
10 | import android.view.Window;
11 | import android.view.WindowManager;
12 | import android.view.animation.TranslateAnimation;
13 | import android.widget.Button;
14 | import android.widget.EditText;
15 | import android.widget.ImageView;
16 | import android.widget.LinearLayout;
17 | import android.widget.Toast;
18 |
19 | public class AIGetPlayerNameActivity extends AppCompatActivity implements View.OnTouchListener {
20 |
21 | private String playerName;
22 | private EditText playerNameTxt;
23 | private Button playerButton;
24 | private ImageView BackBtn;
25 |
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 |
30 | requestWindowFeature(Window.FEATURE_NO_TITLE); //will hide the title
31 | getSupportActionBar().hide(); // hide the title bar
32 | this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
33 | WindowManager.LayoutParams.FLAG_FULLSCREEN); //enable full screen
34 |
35 | setContentView(R.layout.activity_aiget_player_name);
36 |
37 | BackBtn = (ImageView) findViewById(R.id.ai_player_names_back_btn);
38 | playerNameTxt = (EditText) findViewById(R.id.ai_player_name_edttxt);
39 | playerButton = (Button) findViewById(R.id.ai_player_name_btn);
40 |
41 | playerButton.setOnTouchListener(this);
42 | playerButton.setOnClickListener(new View.OnClickListener() {
43 | @Override
44 | public void onClick(View v) {
45 |
46 | if (TextUtils.isEmpty(playerNameTxt.getText().toString())) {
47 | Toast.makeText(getBaseContext(), "Enter Name", Toast.LENGTH_LONG).show();
48 | } else {
49 |
50 | playerName = playerNameTxt.getText().toString();
51 | Intent intent = new Intent(AIGetPlayerNameActivity.this,AiChooseSymbolActivity.class);
52 | intent.putExtra("p1",playerName);
53 | startActivity(intent);
54 | }
55 | }
56 | });
57 |
58 | BackBtn.setOnClickListener(new View.OnClickListener() {
59 | @Override
60 | public void onClick(View v) {
61 |
62 | onBackPressed();
63 | }
64 | });
65 |
66 | }
67 |
68 |
69 | @Override
70 | public boolean onTouch(View v, MotionEvent event) {
71 |
72 | if (v == playerButton) {
73 | if (event.getAction() == MotionEvent.ACTION_DOWN) {
74 | v.setAlpha(0.5f);
75 | } else {
76 | v.setAlpha(1f);
77 | }
78 | }
79 | return false;
80 | }
81 |
82 | @Override
83 | public void onBackPressed() {
84 | super.onBackPressed();
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Tictactoe Android App
[](#) [](https://www.github.com/Abdullah/Tictactoe_in_Android//fork)[](https://www.github.com/Abdullah-Sheikh/management-System/issues)[](#)
2 |
3 |
4 |
5 |
6 |
7 | https://user-images.githubusercontent.com/62107887/130690253-f670eb6f-33ff-4abf-9353-dfc867808554.mp4
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | # Tic Tac Toe is a free classic puzzle game also known as Noughts and Crosses.
19 |
20 | ### Our free Tic Tac Toe game offers:
21 |
22 | ✓ Play with AI (computer)
23 | ✓ 2 players game (multiplayer)
24 | ✓ game statistics
25 | ✓ On or Off sound and vibration.
26 | ✓ Attractive Design (Minimal Design)
27 |
28 | The Tic Tac Toe game is a game for two players, who take turns marking the spaces in a 3×3 grid. The player who succeeded in placing three respective marks in a horizontal, vertical, or diagonal row wins the game.
29 |
30 | In this Tic Tac Toe game you have two options:
31 | -> Play with AI
32 | -> Play with Friend
33 |
34 | The Tic Tac Toe is a great way to pass your free time whether you're standing in a line or spending time with your kids. Its offline App means you do not need of internet to play. Because of the simplicity of Tic Tac Toe, it is often used as a pedagogical tool for teaching the concepts of good sportsmanship and the branch of artificial intelligence.
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | # App Screens
44 |
45 |
46 | 
47 |
48 | 
49 |
50 | 
51 |
52 | 
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | feel free to Star or Fork it and make your changes , then make pull request.
63 |
64 | We will appreciate your Changes and Review it 😄
65 |
66 |
67 |
68 |
69 |
70 |
71 |

72 |
Loading
73 |
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_offline_game_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
20 |
21 |
35 |
36 |
37 |
51 |
52 |
66 |
67 |
68 |
78 |
79 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
103 |
--------------------------------------------------------------------------------
/app/src/main/java/com/techsoldev/tictactoegame/AiChooseSymbolActivity.java:
--------------------------------------------------------------------------------
1 | package com.techsoldev.tictactoegame;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.graphics.drawable.Drawable;
7 | import android.os.Bundle;
8 | import android.view.MotionEvent;
9 | import android.view.View;
10 | import android.view.Window;
11 | import android.view.WindowManager;
12 | import android.widget.Button;
13 | import android.widget.ImageView;
14 | import android.widget.RadioButton;
15 |
16 | public class AiChooseSymbolActivity extends AppCompatActivity implements View.OnTouchListener {
17 |
18 |
19 | private ImageView BackBtn , CrossImg , CrossRadioImg , CircleImg , CircleRadioImg;
20 | private Button ContinueBtn;
21 |
22 | int PICK_SIDE ;
23 | private String playerName;
24 |
25 |
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 |
30 | requestWindowFeature(Window.FEATURE_NO_TITLE); //will hide the title
31 | getSupportActionBar().hide(); // hide the title bar
32 | this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
33 | WindowManager.LayoutParams.FLAG_FULLSCREEN); //enable full screen
34 | setContentView(R.layout.activity_ai_choose_symbol);
35 |
36 | playerName = getIntent().getStringExtra("p1");
37 |
38 |
39 | BackBtn= (ImageView) findViewById(R.id.ai_pick_side_back_btn);
40 | CrossImg= (ImageView) findViewById(R.id.ai_pick_side_cross_img);
41 | CircleImg= (ImageView) findViewById(R.id.ai_pick_side_circle_img);
42 | CrossRadioImg= (ImageView) findViewById(R.id.ai_pick_side_cross_radio);
43 | CircleRadioImg= (ImageView) findViewById(R.id.ai_pick_side_circle_radio);
44 |
45 | ContinueBtn = (Button) findViewById(R.id.ai_pick_side_continue_btn);
46 |
47 | // CrossRadioImg.setOnTouchListener(this);
48 | CrossRadioImg.setOnClickListener(new View.OnClickListener() {
49 | @Override
50 | public void onClick(View v) {
51 |
52 | PICK_SIDE = 0;
53 | CrossRadioImg.setImageResource(R.drawable.radio_button_checked);
54 | CircleRadioImg.setImageResource(R.drawable.radio_button_unchecked);
55 | CircleImg.setAlpha(0.3f);
56 | CrossImg.setAlpha(1.0f);
57 | //Intent intent = new Intent(.this,Ch.class);
58 | // startActivity(intent);
59 | }
60 | });
61 |
62 | // CircleRadioImg.setOnTouchListener(this);
63 | CircleRadioImg.setOnClickListener(new View.OnClickListener() {
64 | @Override
65 | public void onClick(View v) {
66 |
67 |
68 | PICK_SIDE= 1;
69 | CircleRadioImg.setImageResource(R.drawable.radio_button_checked);
70 | CrossRadioImg.setImageResource(R.drawable.radio_button_unchecked);
71 | CrossImg.setAlpha(0.3f);
72 | CircleImg.setAlpha(1.0f);
73 |
74 | //Intent intent = new Intent(.this,Ch.class);
75 | // startActivity(intent);
76 | }
77 | });
78 |
79 | BackBtn.setOnClickListener(new View.OnClickListener() {
80 | @Override
81 | public void onClick(View v) {
82 |
83 |
84 |
85 | onBackPressed();
86 | //Intent intent = new Intent(.this,Ch.class);
87 | // startActivity(intent);
88 | }
89 | });
90 |
91 | ContinueBtn.setOnTouchListener(this);
92 | ContinueBtn.setOnClickListener(new View.OnClickListener() {
93 | @Override
94 | public void onClick(View v) {
95 |
96 | Intent intent = new Intent( AiChooseSymbolActivity.this,AiGameActivity.class);
97 | intent.putExtra("p1",playerName);
98 | intent.putExtra("ps",PICK_SIDE);
99 | startActivity(intent);
100 | }
101 | });
102 | }
103 |
104 |
105 | @Override
106 | public boolean onTouch(View v, MotionEvent event) {
107 | if (v == ContinueBtn) {
108 | if (event.getAction() == MotionEvent.ACTION_DOWN) {
109 | v.setAlpha(0.5f);
110 | } else {
111 | v.setAlpha(1f);
112 | }
113 | }
114 | return false;
115 | }
116 |
117 | @Override
118 | public void onBackPressed() {
119 | super.onBackPressed();
120 | }
121 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/quit_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
22 |
23 |
27 |
28 |
29 |
41 |
42 |
43 |
50 |
51 |
56 |
57 |
71 |
72 |
73 |
74 |
79 |
80 |
94 |
95 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/app/src/main/java/com/techsoldev/tictactoegame/ChooseSymbolActivity.java:
--------------------------------------------------------------------------------
1 | package com.techsoldev.tictactoegame;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.graphics.drawable.Drawable;
7 | import android.os.Bundle;
8 | import android.view.MotionEvent;
9 | import android.view.View;
10 | import android.view.Window;
11 | import android.view.WindowManager;
12 | import android.widget.Button;
13 | import android.widget.ImageView;
14 | import android.widget.RadioButton;
15 |
16 | public class ChooseSymbolActivity extends AppCompatActivity implements View.OnTouchListener {
17 |
18 |
19 | private ImageView BackBtn , CrossImg , CrossRadioImg , CircleImg , CircleRadioImg;
20 | private Button ContinueBtn;
21 |
22 | int PICK_SIDE ;
23 | private String playerOne;
24 | private String playerTwo;
25 |
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 |
31 | requestWindowFeature(Window.FEATURE_NO_TITLE); //will hide the title
32 | getSupportActionBar().hide(); // hide the title bar
33 | this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
34 | WindowManager.LayoutParams.FLAG_FULLSCREEN); //enable full screen
35 | setContentView(R.layout.activity_choose_symbol);
36 |
37 | playerOne = getIntent().getStringExtra("p1");
38 | playerTwo = getIntent().getStringExtra("p2");
39 |
40 | BackBtn= (ImageView) findViewById(R.id.pick_side_back_btn);
41 | CrossImg= (ImageView) findViewById(R.id.pick_side_cross_img);
42 | CircleImg= (ImageView) findViewById(R.id.pick_side_circle_img);
43 | CrossRadioImg= (ImageView) findViewById(R.id.pick_side_cross_radio);
44 | CircleRadioImg= (ImageView) findViewById(R.id.pick_side_circle_radio);
45 |
46 | ContinueBtn = (Button) findViewById(R.id.pick_side_continue_btn);
47 |
48 | // CrossRadioImg.setOnTouchListener(this);
49 | CrossRadioImg.setOnClickListener(new View.OnClickListener() {
50 | @Override
51 | public void onClick(View v) {
52 |
53 | PICK_SIDE = 0;
54 | CrossRadioImg.setImageResource(R.drawable.radio_button_checked);
55 | CircleRadioImg.setImageResource(R.drawable.radio_button_unchecked);
56 | CircleImg.setAlpha(0.3f);
57 | CrossImg.setAlpha(1.0f);
58 | //Intent intent = new Intent(.this,Ch.class);
59 | // startActivity(intent);
60 | }
61 | });
62 |
63 | // CircleRadioImg.setOnTouchListener(this);
64 | CircleRadioImg.setOnClickListener(new View.OnClickListener() {
65 | @Override
66 | public void onClick(View v) {
67 |
68 |
69 | PICK_SIDE= 1;
70 | CircleRadioImg.setImageResource(R.drawable.radio_button_checked);
71 | CrossRadioImg.setImageResource(R.drawable.radio_button_unchecked);
72 | CrossImg.setAlpha(0.3f);
73 | CircleImg.setAlpha(1.0f);
74 |
75 | //Intent intent = new Intent(.this,Ch.class);
76 | // startActivity(intent);
77 | }
78 | });
79 |
80 | BackBtn.setOnClickListener(new View.OnClickListener() {
81 | @Override
82 | public void onClick(View v) {
83 |
84 |
85 |
86 | onBackPressed();
87 | //Intent intent = new Intent(.this,Ch.class);
88 | // startActivity(intent);
89 | }
90 | });
91 |
92 | ContinueBtn.setOnTouchListener(this);
93 | ContinueBtn.setOnClickListener(new View.OnClickListener() {
94 | @Override
95 | public void onClick(View v) {
96 |
97 | Intent intent = new Intent( ChooseSymbolActivity.this,OfflineGameActivity.class);
98 | intent.putExtra("p1",playerOne);
99 | intent.putExtra("p2",playerTwo);
100 | intent.putExtra("ps",PICK_SIDE);
101 | startActivity(intent);
102 | }
103 | });
104 | }
105 |
106 |
107 | @Override
108 | public boolean onTouch(View v, MotionEvent event) {
109 | if (v == ContinueBtn) {
110 | if (event.getAction() == MotionEvent.ACTION_DOWN) {
111 | v.setAlpha(0.5f);
112 | } else {
113 | v.setAlpha(1f);
114 | }
115 | }
116 | return false;
117 | }
118 |
119 | @Override
120 | public void onBackPressed() {
121 | super.onBackPressed();
122 | }
123 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_aiget_player_name.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
18 |
19 |
23 |
24 |
31 |
32 |
36 |
37 |
38 |
42 |
43 |
44 |
55 |
56 |
60 |
61 |
75 |
76 |
80 |
81 |
96 |
97 |
98 |
102 |
103 |
119 |
120 |
121 |
125 |
126 |
127 |
128 |
129 |
133 |
134 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/draw_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
19 |
20 |
21 |
22 |
27 |
28 |
38 |
39 |
50 |
51 |
52 |
58 |
59 |
64 |
65 |
79 |
80 |
81 |
82 |
87 |
88 |
102 |
103 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/robot_win_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
19 |
20 |
21 |
22 |
27 |
28 |
38 |
39 |
50 |
51 |
52 |
58 |
59 |
64 |
65 |
79 |
80 |
81 |
82 |
87 |
88 |
102 |
103 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/celebrate_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
19 |
20 |
28 |
29 |
35 |
36 |
45 |
46 |
57 |
58 |
59 |
65 |
66 |
71 |
72 |
86 |
87 |
88 |
89 |
94 |
95 |
109 |
110 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_choose_symbol.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
19 |
20 |
24 |
25 |
32 |
33 |
37 |
38 |
39 |
43 |
44 |
55 |
56 |
57 |
61 |
66 |
67 |
71 |
72 |
79 |
80 |
84 |
85 |
92 |
93 |
97 |
98 |
99 |
103 |
104 |
105 |
106 |
107 |
112 |
113 |
117 |
118 |
125 |
126 |
130 |
131 |
138 |
142 |
143 |
144 |
148 |
149 |
150 |
166 |
167 |
171 |
172 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_ai_choose_symbol.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
19 |
20 |
24 |
25 |
32 |
33 |
37 |
38 |
39 |
43 |
44 |
55 |
56 |
57 |
61 |
66 |
67 |
71 |
72 |
79 |
80 |
84 |
85 |
92 |
93 |
97 |
98 |
99 |
103 |
104 |
105 |
106 |
107 |
112 |
113 |
117 |
118 |
125 |
126 |
130 |
131 |
138 |
142 |
143 |
144 |
148 |
149 |
150 |
166 |
167 |
171 |
172 |
--------------------------------------------------------------------------------
/app/src/main/java/com/techsoldev/tictactoegame/OfflineGetPlayersNamesActivity.java:
--------------------------------------------------------------------------------
1 | package com.techsoldev.tictactoegame;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import androidx.core.view.ViewCompat;
5 | import androidx.core.view.ViewPropertyAnimatorCompat;
6 |
7 | import android.content.Intent;
8 | import android.media.Image;
9 | import android.os.Bundle;
10 | import android.text.TextUtils;
11 | import android.view.MotionEvent;
12 | import android.view.View;
13 | import android.view.ViewGroup;
14 | import android.view.Window;
15 | import android.view.WindowManager;
16 | import android.view.animation.DecelerateInterpolator;
17 | import android.view.animation.TranslateAnimation;
18 | import android.widget.Button;
19 | import android.widget.EditText;
20 | import android.widget.ImageView;
21 | import android.widget.LinearLayout;
22 | import android.widget.TextView;
23 | import android.widget.Toast;
24 |
25 | public class OfflineGetPlayersNamesActivity extends AppCompatActivity implements View.OnTouchListener {
26 |
27 |
28 | private String playerOne, playerTwo;
29 |
30 | private EditText playerOneName, playerTwoName;
31 | private Button playerOneButton, playerTwoButton;
32 | private ImageView BackBtn;
33 | private LinearLayout playerOneLayout, playerTwoLayout;
34 |
35 | boolean islayout = true;
36 |
37 |
38 | @Override
39 | protected void onCreate(Bundle savedInstanceState) {
40 | super.onCreate(savedInstanceState);
41 |
42 |
43 | requestWindowFeature(Window.FEATURE_NO_TITLE); //will hide the title
44 | getSupportActionBar().hide(); // hide the title bar
45 | this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
46 | WindowManager.LayoutParams.FLAG_FULLSCREEN); //enable full screen
47 |
48 | setContentView(R.layout.activity_offline_get_players_names);
49 |
50 |
51 | BackBtn = (ImageView) findViewById(R.id.player_names_back_btn);
52 | playerOneName = (EditText) findViewById(R.id.player_one_name_edttxt);
53 | playerTwoName = (EditText) findViewById(R.id.player_two_name_edttxt);
54 | playerOneButton = (Button) findViewById(R.id.player_one_btn);
55 | playerTwoButton = (Button) findViewById(R.id.player_two_btn);
56 | playerOneLayout = (LinearLayout) findViewById(R.id.player_one_layout);
57 | playerTwoLayout = (LinearLayout) findViewById(R.id.player_two_layout);
58 |
59 |
60 | playerOneButton.setOnTouchListener(this);
61 | playerOneButton.setOnClickListener(new View.OnClickListener() {
62 | @Override
63 | public void onClick(View v) {
64 |
65 | if (TextUtils.isEmpty(playerOneName.getText().toString())) {
66 | Toast.makeText(getBaseContext(), "Enter Name", Toast.LENGTH_LONG).show();
67 | } else {
68 | islayout = false;
69 | playerOneLayout.setVisibility(View.GONE);
70 | playerTwoLayout.setVisibility(View.VISIBLE);
71 | slideUp(playerTwoLayout);
72 | playerOne = playerOneName.getText().toString();
73 | }
74 | }
75 | });
76 |
77 | BackBtn.setOnClickListener(new View.OnClickListener() {
78 | @Override
79 | public void onClick(View v) {
80 |
81 | onBackPressed();
82 | }
83 | });
84 |
85 |
86 | playerTwoButton.setOnTouchListener(this);
87 | playerTwoButton.setOnClickListener(new View.OnClickListener() {
88 | @Override
89 | public void onClick(View v) {
90 |
91 | if (TextUtils.isEmpty(playerTwoName.getText().toString())) {
92 | Toast.makeText(getBaseContext(), "Enter Name", Toast.LENGTH_LONG).show();
93 | } else {
94 |
95 | playerTwo = playerTwoName.getText().toString();
96 | Intent intent = new Intent(OfflineGetPlayersNamesActivity.this,ChooseSymbolActivity.class);
97 | intent.putExtra("p1",playerOne);
98 | intent.putExtra("p2",playerTwo);
99 |
100 |
101 | startActivity(intent);
102 | }
103 | }
104 | });
105 |
106 | }
107 |
108 |
109 | @Override
110 | public boolean onTouch(View v, MotionEvent event) {
111 |
112 | if(islayout)
113 | {
114 | if (v == playerOneButton) {
115 | if (event.getAction() == MotionEvent.ACTION_DOWN) {
116 | v.setAlpha(0.5f);
117 | } else {
118 | v.setAlpha(1f);
119 | }
120 | }
121 | }
122 | else if(!islayout)
123 | {
124 | if (v == playerTwoButton) {
125 | if (event.getAction() == MotionEvent.ACTION_DOWN) {
126 | v.setAlpha(0.5f);
127 | } else {
128 | v.setAlpha(1f);
129 | }
130 | }
131 | }
132 |
133 | return false;
134 | }
135 |
136 |
137 | // slide the view from below itself to the current position
138 | public void slideUp(View view) {
139 | view.setVisibility(View.VISIBLE);
140 | TranslateAnimation animate = new TranslateAnimation(
141 | 0, // fromXDelta
142 | 0, // toXDelta
143 | view.getHeight(), // fromYDelta
144 | 0); // toYDelta
145 | animate.setDuration(500);
146 | animate.setFillAfter(true);
147 | view.startAnimation(animate);
148 | }
149 |
150 | // slide the view from its current position to below itself
151 | public void slideDown(View view) {
152 | TranslateAnimation animate = new TranslateAnimation(
153 | 0, // fromXDelta
154 | 0, // toXDelta
155 | 0, // fromYDelta
156 | view.getHeight()); // toYDelta
157 | animate.setDuration(500);
158 | animate.setFillAfter(true);
159 | view.startAnimation(animate);
160 | }
161 |
162 | @Override
163 | public void onBackPressed() {
164 | super.onBackPressed();
165 | }
166 | }
167 |
168 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/java/com/techsoldev/tictactoegame/SettingsActivity.java:
--------------------------------------------------------------------------------
1 | package com.techsoldev.tictactoegame;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.ActivityNotFoundException;
6 | import android.content.Intent;
7 | import android.net.Uri;
8 | import android.os.Bundle;
9 | import android.view.View;
10 | import android.view.Window;
11 | import android.view.WindowManager;
12 | import android.widget.CompoundButton;
13 | import android.widget.ImageView;
14 | import android.widget.LinearLayout;
15 | import android.widget.Switch;
16 | import android.widget.Toast;
17 |
18 | import com.google.android.play.core.review.ReviewInfo;
19 | import com.google.android.play.core.review.ReviewManager;
20 | import com.google.android.play.core.review.ReviewManagerFactory;
21 | import com.google.android.play.core.tasks.Task;
22 |
23 | import javax.security.auth.Subject;
24 |
25 |
26 | public class SettingsActivity extends AppCompatActivity {
27 |
28 | Switch vibrationSwitch;
29 | Switch soundSwitch;
30 |
31 | private LinearLayout rateUs,feedback ;
32 |
33 | private ImageView backBtn;
34 |
35 | @Override
36 | protected void onCreate(Bundle savedInstanceState) {
37 | super.onCreate(savedInstanceState);
38 |
39 | requestWindowFeature(Window.FEATURE_NO_TITLE); //will hide the title
40 | getSupportActionBar().hide(); // hide the title bar
41 | this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
42 | WindowManager.LayoutParams.FLAG_FULLSCREEN); //enable full screen
43 | setContentView(R.layout.activity_settings);
44 |
45 |
46 | vibrationSwitch = (Switch) findViewById(R.id.vibration_switch);
47 | soundSwitch = (Switch) findViewById(R.id.sound_switch);
48 |
49 | backBtn = (ImageView) findViewById(R.id.settings_back_btn);
50 | rateUs = (LinearLayout) findViewById(R.id.rate_us_layout);
51 | feedback = (LinearLayout) findViewById(R.id.feedback_layout);
52 |
53 | if(MyServices.VIBRATION_CHECK)
54 | {
55 | vibrationSwitch.setChecked(true);
56 | }
57 | else if(!MyServices.VIBRATION_CHECK)
58 | {
59 | vibrationSwitch.setChecked(false);
60 | }
61 |
62 |
63 |
64 | vibrationSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
65 |
66 | @Override
67 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
68 | if(isChecked)
69 | {
70 | MyServices.VIBRATION_CHECK =true;
71 | }
72 | else {
73 | MyServices.VIBRATION_CHECK= false;
74 | }
75 | }
76 |
77 | });
78 |
79 |
80 |
81 | if(MyServices.SOUND_CHECK)
82 | {
83 | soundSwitch.setChecked(true);
84 | }
85 | else if(!MyServices.SOUND_CHECK)
86 | {
87 | soundSwitch.setChecked(false);
88 | }
89 |
90 |
91 | soundSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
92 |
93 | @Override
94 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
95 | if(isChecked)
96 | {
97 | MyServices.SOUND_CHECK =true;
98 | }
99 | else {
100 | MyServices.SOUND_CHECK= false;
101 | }
102 | }
103 |
104 | });
105 |
106 | backBtn.setOnClickListener(new View.OnClickListener() {
107 | @Override
108 | public void onClick(View v) {
109 | onBackPressed();
110 | }
111 | });
112 |
113 |
114 | rateUs.setOnClickListener(new View.OnClickListener() {
115 | @Override
116 | public void onClick(View v) {
117 | askRatings();
118 | }
119 | });
120 |
121 | feedback.setOnClickListener(new View.OnClickListener() {
122 | @Override
123 | public void onClick(View v) {
124 |
125 | composeEmail("Tic Tac Toe Feedback");
126 |
127 | /*
128 | try {
129 | Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("mailto:" + "abdullahsh@hotmail.com"));
130 |
131 | intent.putExtra(Intent.EXTRA_TEXT, "your_text");
132 | startActivity(intent);
133 | } catch (ActivityNotFoundException e) {
134 | //TODO smth
135 | }
136 |
137 | */
138 | }
139 | });
140 |
141 | }
142 |
143 | void askRatings() {
144 | ReviewManager manager = ReviewManagerFactory.create(this);
145 | Task request = manager.requestReviewFlow();
146 | request.addOnCompleteListener(task -> {
147 | if (task.isSuccessful()) {
148 | // We can get the ReviewInfo object
149 | ReviewInfo reviewInfo = task.getResult();
150 | Task flow = manager.launchReviewFlow(this, reviewInfo);
151 | flow.addOnCompleteListener(task2 -> {
152 | // The flow has finished. The API does not indicate whether the user
153 | // reviewed or not, or even whether the review dialog was shown. Thus, no
154 | // matter the result, we continue our app flow.
155 | });
156 | } else {
157 |
158 | //Toast.makeText(getBaseContext(), "App does'nt uploaded on Play Store", Toast.LENGTH_SHORT).show();
159 | // There was some problem, continue regardless of the result.
160 | }
161 | });
162 | }
163 |
164 | public void composeEmail( String subject) {
165 | try {
166 | Intent intent = new Intent(Intent.ACTION_SENDTO);
167 | intent.setData(Uri.parse("mailto:abdullahsh123@hotmail.com")); // only email apps should handle this
168 | intent.putExtra(Intent.EXTRA_SUBJECT, subject);
169 | if (intent.resolveActivity(getPackageManager()) != null) {
170 | startActivity(Intent.createChooser(intent, "Send feedback"));
171 | }
172 | } catch (ActivityNotFoundException e) {
173 | //TODO smth
174 | }
175 | }
176 |
177 | @Override
178 | public void onBackPressed() {
179 | super.onBackPressed();
180 | }
181 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/techsoldev/tictactoegame/OfflineGameMenuActivity.java:
--------------------------------------------------------------------------------
1 | package com.techsoldev.tictactoegame;
2 |
3 | import androidx.annotation.Nullable;
4 | import androidx.appcompat.app.AppCompatActivity;
5 | import androidx.core.view.ViewCompat;
6 | import androidx.core.view.ViewPropertyAnimatorCompat;
7 |
8 | import android.content.Context;
9 | import android.content.Intent;
10 | import android.graphics.drawable.Animatable;
11 | import android.graphics.drawable.Drawable;
12 | import android.os.Bundle;
13 | import android.os.Handler;
14 | import android.util.DisplayMetrics;
15 | import android.view.Display;
16 | import android.view.MotionEvent;
17 | import android.view.View;
18 | import android.view.ViewGroup;
19 | import android.view.WindowManager;
20 | import android.view.animation.DecelerateInterpolator;
21 | import android.widget.Button;
22 | import android.widget.ImageView;
23 | import android.widget.Toast;
24 |
25 | import pl.droidsonroids.gif.GifImageView;
26 |
27 | public class OfflineGameMenuActivity extends AppCompatActivity implements View.OnTouchListener {
28 |
29 |
30 | public static final int STARTUP_DELAY = 300;
31 | public static final int ANIM_ITEM_DURATION = 1000;
32 | public static final int ITEM_DELAY = 300;
33 |
34 | public int SCREEN_SIZE;
35 | public int SET_TRANSLATE;
36 | private boolean animationStarted = false;
37 |
38 | private GifImageView settingsGifView;
39 | private Button WithAFriendBtn , WithAi;
40 | @Override
41 | protected void onCreate(@Nullable Bundle savedInstanceState) {
42 | setTheme(R.style.AppTheme);
43 | getWindow().getDecorView().setSystemUiVisibility(
44 | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
45 | super.onCreate(savedInstanceState);
46 | setContentView(R.layout.activity_offline_game_menu);
47 |
48 |
49 | settingsGifView = (GifImageView) findViewById(R.id.seting_gifview_offline_menu);
50 | WithAFriendBtn = (Button) findViewById(R.id.btn_choice2_offline_menu);
51 | WithAi = (Button) findViewById(R.id.btn_choice1_offline_menu);
52 |
53 | // settingsGifView.getBackground().Stop();
54 |
55 | // settingsGifView.getAnimation().hasEnded();
56 |
57 |
58 | Drawable drawable = settingsGifView.getDrawable();
59 | if (drawable instanceof Animatable) {
60 | ((Animatable) drawable).stop();
61 | }
62 |
63 | SCREEN_SIZE =getScreenResolution(this);
64 |
65 | if(SCREEN_SIZE >1500)
66 | {
67 | SET_TRANSLATE = -560;
68 | }
69 | else if(SCREEN_SIZE <=1500)
70 | {
71 | SET_TRANSLATE = -300;
72 | }
73 |
74 | WithAFriendBtn.setOnTouchListener(this);
75 | WithAFriendBtn.setOnClickListener(new View.OnClickListener() {
76 | @Override
77 | public void onClick(View v) {
78 | Intent intent = new Intent(OfflineGameMenuActivity.this,OfflineGetPlayersNamesActivity.class);
79 | startActivity(intent);
80 | }
81 | });
82 |
83 | WithAi.setOnTouchListener(this);
84 | WithAi.setOnClickListener(new View.OnClickListener() {
85 | @Override
86 | public void onClick(View v) {
87 | Intent intent = new Intent(OfflineGameMenuActivity.this,AIGetPlayerNameActivity.class);
88 | startActivity(intent);
89 | }
90 | });
91 |
92 | settingsGifView.setOnClickListener(new View.OnClickListener() {
93 | @Override
94 | public void onClick(View v) {
95 | Drawable drawable = settingsGifView.getDrawable();
96 | if (drawable instanceof Animatable) {
97 | ((Animatable) drawable).start();
98 |
99 | }
100 | Handler handler = new Handler();
101 | handler.postDelayed(new Runnable() {
102 | @Override
103 | public void run() {
104 | Drawable drawable = settingsGifView.getDrawable();
105 | if (drawable instanceof Animatable) {
106 | ((Animatable) drawable).stop();
107 | }
108 | Intent intent = new Intent(OfflineGameMenuActivity.this,SettingsActivity.class);
109 | startActivity(intent);
110 |
111 | }
112 | }, 750);
113 | }
114 | });
115 |
116 |
117 | }
118 |
119 |
120 |
121 | private int getScreenResolution(Context context)
122 | {
123 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
124 | Display display = wm.getDefaultDisplay();
125 | DisplayMetrics metrics = new DisplayMetrics();
126 | display.getMetrics(metrics);
127 | int width = metrics.widthPixels;
128 | int height = metrics.heightPixels;
129 |
130 | // Toast.makeText(SplashActivity.this , "Screen height is : "+ height , Toast.LENGTH_SHORT).show();
131 |
132 | return height ;
133 | }
134 |
135 | @Override
136 | public void onWindowFocusChanged(boolean hasFocus) {
137 |
138 | if (!hasFocus || animationStarted) {
139 | return;
140 | }
141 |
142 | animate();
143 |
144 | super.onWindowFocusChanged(hasFocus);
145 | }
146 |
147 | @Override
148 | public void onPointerCaptureChanged(boolean hasCapture) {
149 |
150 | }
151 |
152 | private void animate() {
153 |
154 | ImageView logoImageView = (ImageView) findViewById(R.id.img_logo_offline_menu);
155 | ViewGroup container = (ViewGroup) findViewById(R.id.container_offline_menu);
156 |
157 | ViewCompat.animate(logoImageView)
158 | .translationY(SET_TRANSLATE)
159 | .setStartDelay(STARTUP_DELAY)
160 | .setDuration(ANIM_ITEM_DURATION).setInterpolator(
161 | new DecelerateInterpolator(1.2f)).start();
162 |
163 | for (int i = 0; i < container.getChildCount(); i++) {
164 | View v = container.getChildAt(i);
165 | ViewPropertyAnimatorCompat viewAnimator;
166 |
167 | if (!(v instanceof Button)) {
168 | viewAnimator = ViewCompat.animate(v)
169 | .translationY(50).alpha(1)
170 | .setStartDelay((ITEM_DELAY * i) + 500)
171 | .setDuration(1000);
172 | } else {
173 | viewAnimator = ViewCompat.animate(v)
174 | .scaleY(1).scaleX(1)
175 | .setStartDelay((ITEM_DELAY * i) + 500)
176 | .setDuration(500);
177 | }
178 |
179 | viewAnimator.setInterpolator(new DecelerateInterpolator()).start();
180 | }
181 | }
182 |
183 |
184 | @Override
185 | public boolean onTouch(View v, MotionEvent event) {
186 | if (v == WithAFriendBtn) {
187 | if (event.getAction() == MotionEvent.ACTION_DOWN) {
188 | v.setAlpha(0.5f);
189 | } else {
190 | v.setAlpha(1f);
191 | }
192 | }
193 | else if (v == WithAi) {
194 | if (event.getAction() == MotionEvent.ACTION_DOWN) {
195 | v.setAlpha(0.5f);
196 | } else {
197 | v.setAlpha(1f);
198 | }
199 | }
200 | return false;
201 | }
202 | }
203 |
--------------------------------------------------------------------------------
/app/src/main/java/com/techsoldev/tictactoegame/Minmax.java:
--------------------------------------------------------------------------------
1 | package com.techsoldev.tictactoegame;
2 |
3 | public class Minmax {
4 |
5 |
6 | // Java program to find the
7 | // next optimal move for a player
8 |
9 | public static class Move
10 | {
11 | int row, col;
12 | };
13 |
14 | static char player = 'x', opponent = 'o';
15 |
16 | // This function returns true if there are moves
17 | // remaining on the board. It returns false if
18 | // there are no moves left to play.
19 | public static Boolean isMovesLeft(char board[][])
20 | {
21 | for (int i = 0; i < 3; i++)
22 | for (int j = 0; j < 3; j++)
23 | if (board[i][j] == '_')
24 | return true;
25 | return false;
26 | }
27 |
28 | // This is the evaluation function as discussed
29 | // in the previous article ( http://goo.gl/sJgv68 )
30 | public static int evaluate(char b[][])
31 | {
32 | // Checking for Rows for X or O victory.
33 | for (int row = 0; row < 3; row++)
34 | {
35 | if (b[row][0] == b[row][1] &&
36 | b[row][1] == b[row][2])
37 | {
38 | if (b[row][0] == player)
39 | return +10;
40 | else if (b[row][0] == opponent)
41 | return -10;
42 | }
43 | }
44 |
45 | // Checking for Columns for X or O victory.
46 | for (int col = 0; col < 3; col++)
47 | {
48 | if (b[0][col] == b[1][col] &&
49 | b[1][col] == b[2][col])
50 | {
51 | if (b[0][col] == player)
52 | return +10;
53 |
54 | else if (b[0][col] == opponent)
55 | return -10;
56 | }
57 | }
58 |
59 | // Checking for Diagonals for X or O victory.
60 | if (b[0][0] == b[1][1] && b[1][1] == b[2][2])
61 | {
62 | if (b[0][0] == player)
63 | return +10;
64 | else if (b[0][0] == opponent)
65 | return -10;
66 | }
67 |
68 | if (b[0][2] == b[1][1] && b[1][1] == b[2][0])
69 | {
70 | if (b[0][2] == player)
71 | return +10;
72 | else if (b[0][2] == opponent)
73 | return -10;
74 | }
75 |
76 | // Else if none of them have won then return 0
77 | return 0;
78 | }
79 |
80 | // This is the minimax function. It considers all
81 | // the possible ways the game can go and returns
82 | // the value of the board
83 | public static int minimax(char board[][],
84 | int depth, Boolean isMax)
85 | {
86 | int score = evaluate(board);
87 |
88 | // If Maximizer has won the game
89 | // return his/her evaluated score
90 | if (score == 10)
91 | return score;
92 |
93 | // If Minimizer has won the game
94 | // return his/her evaluated score
95 | if (score == -10)
96 | return score;
97 |
98 | // If there are no more moves and
99 | // no winner then it is a tie
100 | if (isMovesLeft(board) == false)
101 | return 0;
102 |
103 | // If this maximizer's move
104 | if (isMax)
105 | {
106 | int best = -1000;
107 |
108 | // Traverse all cells
109 | for (int i = 0; i < 3; i++)
110 | {
111 | for (int j = 0; j < 3; j++)
112 | {
113 | // Check if cell is empty
114 | if (board[i][j]=='_')
115 | {
116 | // Make the move
117 | board[i][j] = player;
118 |
119 | // Call minimax recursively and choose
120 | // the maximum value
121 | best = Math.max(best, minimax(board,
122 | depth + 1, !isMax));
123 |
124 | // Undo the move
125 | board[i][j] = '_';
126 | }
127 | }
128 | }
129 | return best;
130 | }
131 |
132 | // If this minimizer's move
133 | else
134 | {
135 | int best = 1000;
136 |
137 | // Traverse all cells
138 | for (int i = 0; i < 3; i++)
139 | {
140 | for (int j = 0; j < 3; j++)
141 | {
142 | // Check if cell is empty
143 | if (board[i][j] == '_')
144 | {
145 | // Make the move
146 | board[i][j] = opponent;
147 |
148 | // Call minimax recursively and choose
149 | // the minimum value
150 | best = Math.min(best, minimax(board,
151 | depth + 1, !isMax));
152 |
153 | // Undo the move
154 | board[i][j] = '_';
155 | }
156 | }
157 | }
158 | return best;
159 | }
160 | }
161 |
162 | // This will return the best possible
163 | // move for the player
164 | public static Move findBestMove(char board[][])
165 | {
166 | int bestVal = -1000;
167 | Move bestMove = new Move();
168 | bestMove.row = -1;
169 | bestMove.col = -1;
170 |
171 | // Traverse all cells, evaluate minimax function
172 | // for all empty cells. And return the cell
173 | // with optimal value.
174 | for (int i = 0; i < 3; i++)
175 | {
176 | for (int j = 0; j < 3; j++)
177 | {
178 | // Check if cell is empty
179 | if (board[i][j] == '_')
180 | {
181 | // Make the move
182 | board[i][j] = player;
183 |
184 | // compute evaluation function for this
185 | // move.
186 | int moveVal = minimax(board, 0, false);
187 |
188 | // Undo the move
189 | board[i][j] = '_';
190 |
191 | // If the value of the current move is
192 | // more than the best value, then update
193 | // best/
194 | if (moveVal > bestVal)
195 | {
196 | bestMove.row = i;
197 | bestMove.col = j;
198 | bestVal = moveVal;
199 | }
200 | }
201 | }
202 | }
203 |
204 | // System.out.printf("The value of the best Move " +
205 | // "is : %d\n\n", bestVal);
206 |
207 | return bestMove;
208 | }
209 |
210 | /*
211 | // Driver code
212 | public static void main(String[] args)
213 | {
214 | char board[][] = {{ 'x', 'o', 'x' },
215 | { 'o', 'o', 'x' },
216 | { '_', '_', '_' }};
217 |
218 | Move bestMove = findBestMove(board);
219 |
220 | System.out.printf("The Optimal Move is :\n");
221 | System.out.printf("ROW: %d COL: %d\n\n",
222 | bestMove.row, bestMove.col );
223 | }
224 |
225 | */
226 |
227 | }
228 |
229 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_offline_get_players_names.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
18 |
19 |
23 |
24 |
31 |
32 |
36 |
37 |
38 |
42 |
43 |
44 |
55 |
56 |
60 |
61 |
75 |
76 |
80 |
81 |
97 |
98 |
99 |
103 |
104 |
120 |
121 |
122 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
145 |
146 |
150 |
151 |
164 |
165 |
169 |
170 |
185 |
186 |
187 |
191 |
192 |
208 |
209 |
210 |
214 |
215 |
216 |
217 |
218 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
19 |
20 |
24 |
25 |
32 |
33 |
37 |
38 |
39 |
43 |
44 |
45 |
51 |
52 |
53 |
54 |
66 |
67 |
71 |
72 |
78 |
79 |
83 |
84 |
90 |
91 |
95 |
96 |
106 |
107 |
111 |
112 |
122 |
126 |
127 |
128 |
129 |
130 |
137 |
138 |
139 |
140 |
146 |
147 |
151 |
152 |
158 |
159 |
163 |
164 |
174 |
175 |
179 |
180 |
190 |
194 |
195 |
196 |
197 |
198 |
205 |
206 |
207 |
208 |
215 |
216 |
220 |
221 |
227 |
228 |
232 |
233 |
243 |
244 |
248 | android:textOn="ON"/>
249 |
250 |
251 |
252 |
253 |
254 |
261 |
262 |
263 |
270 |
271 |
275 |
276 |
282 |
283 |
287 |
288 |
298 |
299 |
303 | android:textOn="ON"/>
304 |
305 |
306 |
307 |
308 |
309 |
316 |
317 |
318 |
323 |
324 |
325 |
326 |
327 |
328 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/draw_animi.json:
--------------------------------------------------------------------------------
1 | {"v":"5.5.8","fr":29.9700012207031,"ip":0,"op":210.000008553475,"w":180,"h":220,"nm":"0","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Group 5601","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[89.545,127.701,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rc","d":1,"s":{"a":0,"k":[154.09,147.401],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false}],"ip":0,"op":210.289508565267,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Path 4559","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[-0.971,-2.034,0],"ix":2},"a":{"a":0,"k":[8.878,3.501,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[-8.571,-15.754]],"o":[[0,0],[0,0]],"v":[[0,7.002],[17.756,7.002]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.258823529412,0.094117647059,0.250980392157,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Path 4559","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":210.289508565267,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Path 4558","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":22,"s":[48.537,-51.538,0],"to":[0,8,0],"ti":[0,0,0]},{"t":80.0000032584668,"s":[48.537,-3.538,0]}],"ix":2},"a":{"a":0,"k":[13.776,17.195,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-5.211,5.544],[0.888,4.254],[2.138,2.01],[0,0],[0,0],[0.391,-2.699],[-3.407,-3.201]],"o":[[3.201,-3.406],[-0.557,-2.67],[0,0],[0,0],[-2.01,2.138],[-0.623,4.3],[5.544,5.212]],"v":[[23.814,30.049],[27.26,17.785],[23.212,10.574],[12.642,0],[3.738,11.177],[0.143,18.623],[4.34,30.651]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.360784313725,0.223529411765,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Path 4558","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":210.289508565267,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Line 210","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":165,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":1,"s":[-31.154,-26.768,0],"to":[0,-0.417,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":9,"s":[-31.154,-29.268,0],"to":[0,0,0],"ti":[0,-0.417,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":19,"s":[-31.154,-26.768,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":105,"s":[-31.154,-26.768,0],"to":[0,-0.417,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":113,"s":[-31.154,-29.268,0],"to":[0,0,0],"ti":[0,-0.417,0]},{"t":123.000005009893,"s":[-31.154,-26.768,0]}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-4.922,0],[4.922,0]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.258823529412,0.101960784314,0.250980392157,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Line 210","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":210.289508565267,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"Line 190","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":15,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":1,"s":[30.786,-26.768,0],"to":[0,-0.417,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":9,"s":[30.786,-29.268,0],"to":[0,0,0],"ti":[0,-0.417,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":19,"s":[30.786,-26.768,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":105,"s":[30.786,-26.768,0],"to":[0,-0.417,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":113,"s":[30.786,-29.268,0],"to":[0,0,0],"ti":[0,-0.417,0]},{"t":123.000005009893,"s":[30.786,-26.768,0]}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-4.922,0],[4.922,0]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.258823529412,0.101960784314,0.250980392157,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Line 190","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":210.289508565267,"st":0,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"eyewear","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":0,"s":[-1.773,-23.432,0],"to":[0,-0.75,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":9,"s":[-1.773,-27.932,0],"to":[0,0,0],"ti":[0,-0.75,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":19,"s":[-1.773,-23.432,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":105,"s":[-1.773,-23.432,0],"to":[0,-0.75,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":114,"s":[-1.773,-27.932,0],"to":[0,0,0],"ti":[0,-0.75,0]},{"t":124.000005050624,"s":[-1.773,-23.432,0]}],"ix":2},"a":{"a":0,"k":[69.609,27.87,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.014,-11.22],[0,0],[-9.754,0.009],[0,0]],"o":[[0,0],[0.009,-9.754],[0,0],[-11.22,0.013]],"v":[[14.437,27.926],[17.096,27.926],[34.762,10.259],[34.762,7.6]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0.014,-11.22],[0,0],[-9.754,0.009],[0,0]],"o":[[0,0],[0.009,-9.754],[0,0],[-11.22,0.013]],"v":[[14.437,27.926],[17.096,27.926],[34.762,10.259],[34.762,7.6]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[0.014,-11.22],[0,0],[-9.754,0.009],[0,0]],"o":[[0,0],[0.009,-9.754],[0,0],[-11.22,0.013]],"v":[[14.437,27.926],[17.096,27.926],[34.762,10.259],[34.762,7.6]],"c":true},"ix":2},"nm":"Path 3","mn":"ADBE Vector Shape - Group","hd":false},{"ind":3,"ty":"sh","ix":4,"ks":{"a":0,"k":{"i":[[0,0],[0.653,-0.001],[0,0],[15.35,-1.453],[2.77,-11.624],[4.238,-3.817],[0.262,-0.296],[15.008,-3.529],[1.129,-11.927],[0,0],[0,-1.358],[-1.359,0],[0,0],[-15.358,1.317],[-0.706,13.932],[-6.309,0],[0,0],[-15.395,0.78],[-1.191,13.899],[0,0],[-0.001,1.359],[0.461,0.462]],"o":[[-0.463,-0.461],[0,0],[-1.453,-15.351],[-11.897,1.126],[-3.817,-4.238],[-0.293,0.265],[-3.528,-15.008],[-11.662,2.741],[0,0],[-1.359,0],[0,1.358],[0,0],[1.317,15.358],[13.899,-1.191],[0,0],[6.551,0],[0.78,15.395],[13.932,-0.706],[0,0],[1.36,0],[0.001,-0.654],[0,0]],"v":[[138.551,26.011],[136.808,25.294],[132.303,25.294],[101.878,0.129],[77.349,21.452],[62.764,20.69],[61.93,21.533],[28.368,0.747],[6.965,25.294],[2.46,25.294],[0,27.753],[2.46,30.213],[6.926,30.213],[37.118,55.637],[62.608,29.243],[69.654,22.024],[76.606,29.243],[105.895,55.703],[132.289,30.213],[136.755,30.213],[139.218,27.753],[138.497,26.011]],"c":true},"ix":2},"nm":"Path 4","mn":"ADBE Vector Shape - Group","hd":false},{"ind":4,"ty":"sh","ix":5,"ks":{"a":0,"k":{"i":[[13.303,-0.004],[0.006,13.388],[0,0],[-13.385,-0.114],[0.114,-13.385]],"o":[[-13.388,-0.005],[0,0],[0.114,-13.385],[13.386,0.115],[-0.113,13.302]],"v":[[34.75,52.185],[10.506,27.94],[10.506,27.74],[34.949,3.71],[58.979,28.154]],"c":true},"ix":2},"nm":"Path 5","mn":"ADBE Vector Shape - Group","hd":false},{"ind":5,"ty":"sh","ix":6,"ks":{"a":0,"k":{"i":[[0,0],[13.39,0.002],[0.701,12.857],[0,0.437],[0,0],[-13.386,0.018],[-0.018,-13.386],[0,0]],"o":[[-0.002,13.39],[-12.876,-0.002],[0,-0.437],[0,0],[-0.018,-13.386],[13.386,-0.018],[0,0],[0,0]],"v":[[128.741,27.94],[104.493,52.181],[80.288,29.256],[80.261,27.94],[80.261,27.807],[104.467,3.535],[128.738,27.74],[128.738,27.74]],"c":true},"ix":2},"nm":"Path 6","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.827450980392,0.105882352941,0.360784313725,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"eyewear","np":7,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":210.289508565267,"st":0,"bm":0},{"ddd":0,"ind":7,"ty":4,"nm":"polly","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"rc","d":1,"s":{"a":0,"k":[154.09,147.401],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false}],"ip":0,"op":210.289508565267,"st":0,"bm":0},{"ddd":0,"ind":8,"ty":4,"nm":"Path 4473","parent":7,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[32.097,0,0],"ix":2},"a":{"a":0,"k":[44.947,73.7,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[4.759,0.692],[0,0],[1.268,2.571],[0,0],[1.714,0.848],[2.134,-4.311],[0,0],[-2.481,-1.228],[-0.729,-1.475],[0,0],[-2.442,-0.354],[0,0],[0.596,-4.097],[1.181,-1.151],[0,0],[-0.417,-2.432],[0,0],[4.082,-0.698],[0.524,0.022],[0,0],[-1.886,0.322],[0.811,4.74],[0,0],[-2.052,2.001],[0,0],[-0.276,1.895]],"o":[[0,0],[-2.836,-0.411],[0,0],[-0.847,-1.714],[-4.311,-2.134],[0,0],[2.153,-1.425],[1.475,0.729],[0,0],[1.091,2.213],[0,0],[4.096,0.595],[-0.237,1.631],[0,0],[-1.767,1.722],[0,0],[0.699,4.081],[-0.522,0.089],[0,0],[1.694,0.891],[4.741,-0.811],[0,0],[-0.485,-2.825],[0,0],[1.371,-1.336],[0.693,-4.758]],"v":[[82.44,49.742],[44.28,44.197],[37.722,39.433],[20.657,4.854],[16.711,0.905],[5.042,4.849],[0,15.066],[7.466,14.596],[10.865,17.994],[25.556,47.764],[31.2,51.865],[64.054,56.639],[70.393,65.136],[68.206,69.425],[44.436,92.597],[42.279,99.233],[47.893,131.953],[41.768,140.607],[40.194,140.701],[51.033,146.4],[56.553,147.276],[63.669,137.224],[57.148,99.218],[59.653,91.509],[87.264,64.593],[89.803,59.611]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.996078431373,0.647058823529,0.278431372549,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Path 4473","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":210.289508565267,"st":0,"bm":0},{"ddd":0,"ind":9,"ty":4,"nm":"polly","parent":7,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[77.045,73.701,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-0.847,-1.714],[0,0],[-2.836,-0.411],[0,0],[0.692,-4.759],[1.371,-1.336],[0,0],[-0.484,-2.826],[0,0],[4.741,-0.811],[1.694,0.891],[0,0],[2.536,-1.335],[0,0],[2.237,4.256],[-0.324,1.886],[0,0],[2.05,2.002],[0,0],[-3.356,3.444],[-1.896,0.275],[0,0],[-1.268,2.57],[0,0],[-4.311,-2.133]],"o":[[0,0],[1.268,2.571],[0,0],[4.759,0.692],[-0.276,1.894],[0,0],[-2.052,2.002],[0,0],[0.811,4.74],[-1.887,0.323],[0,0],[-2.537,-1.335],[0,0],[-4.257,2.237],[-0.891,-1.695],[0,0],[0.484,-2.825],[0,0],[-3.443,-3.356],[1.337,-1.371],[0,0],[2.836,-0.412],[0,0],[2.133,-4.312],[1.713,0.848]],"v":[[84.853,4.854],[101.918,39.433],[108.475,44.197],[146.636,49.742],[153.999,59.612],[151.459,64.593],[123.848,91.509],[121.343,99.218],[127.865,137.224],[120.749,147.275],[115.229,146.4],[81.098,128.456],[72.994,128.456],[38.86,146.4],[27.104,142.744],[26.23,137.22],[32.746,99.215],[30.243,91.505],[2.629,64.59],[2.472,52.277],[7.456,49.738],[45.618,44.193],[52.173,39.429],[69.238,4.849],[80.906,0.905]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0.756862745098,0.23137254902,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"polly","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":210.289508565267,"st":0,"bm":0},{"ddd":0,"ind":10,"ty":4,"nm":"Ellipse 1105","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[89.5,203.25,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[146,24],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"op","nm":"Offset Paths 1","a":{"a":0,"k":-0.5,"ix":1},"lj":1,"ml":{"a":0,"k":4,"ix":3},"ix":3,"mn":"ADBE Vector Filter - Offset","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1105 Stroke","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[146,24],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.862745098039,0.862745098039,0.862745098039,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1105 Fill","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":1798.20007324219,"st":0,"bm":0}],"markers":[]}
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_ai_game.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
18 |
19 |
23 |
24 |
31 |
32 |
36 |
37 |
38 |
42 |
43 |
49 |
50 |
54 |
55 |
66 |
67 |
78 |
79 |
80 |
81 |
82 |
86 |
87 |
88 |
94 |
95 |
96 |
97 |
105 |
106 |
107 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
130 |
131 |
132 |
133 |
137 |
138 |
147 |
148 |
152 |
153 |
159 |
160 |
161 |
165 |
173 |
174 |
178 |
179 |
187 |
188 |
189 |
193 |
194 |
202 |
203 |
207 |
208 |
209 |
213 |
214 |
220 |
221 |
222 |
226 |
234 |
235 |
239 |
240 |
248 |
249 |
250 |
254 |
255 |
263 |
264 |
268 |
269 |
273 |
279 |
280 |
281 |
282 |
286 |
294 |
295 |
299 |
300 |
308 |
309 |
310 |
314 |
315 |
323 |
324 |
328 |
329 |
330 |
331 |
335 |
336 |
337 |
338 |
339 |
343 |
344 |
345 |
351 |
352 |
356 |
357 |
358 |
359 |
360 |
366 |
367 |
371 |
372 |
383 |
384 |
388 |
389 |
401 |
402 |
406 |
407 |
408 |
409 |
410 |
414 |
415 |
425 |
426 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
456 |
457 |
458 |
467 |
468 |
475 |
476 |
477 |
478 |
479 |
480 |
484 |
485 |
486 |
487 |
488 |
489 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_offline_game.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
18 |
19 |
23 |
24 |
31 |
32 |
36 |
37 |
38 |
42 |
43 |
49 |
50 |
54 |
55 |
66 |
67 |
78 |
79 |
80 |
81 |
82 |
86 |
87 |
88 |
94 |
95 |
99 |
100 |
110 |
111 |
115 |
116 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
138 |
139 |
140 |
141 |
145 |
146 |
155 |
156 |
160 |
161 |
167 |
168 |
169 |
173 |
181 |
182 |
186 |
187 |
195 |
196 |
197 |
201 |
202 |
210 |
211 |
215 |
216 |
217 |
221 |
222 |
228 |
229 |
230 |
234 |
242 |
243 |
247 |
248 |
256 |
257 |
258 |
262 |
263 |
271 |
272 |
276 |
277 |
281 |
287 |
288 |
289 |
290 |
294 |
302 |
303 |
307 |
308 |
316 |
317 |
318 |
322 |
323 |
331 |
332 |
336 |
337 |
338 |
339 |
343 |
344 |
345 |
346 |
347 |
351 |
352 |
353 |
359 |
360 |
364 |
365 |
366 |
367 |
368 |
374 |
375 |
379 |
380 |
391 |
392 |
396 |
397 |
409 |
410 |
411 |
412 |
413 |
414 |
418 |
419 |
429 |
430 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
460 |
461 |
462 |
471 |
472 |
479 |
480 |
481 |
482 |
483 |
484 |
488 |
489 |
490 |
491 |
492 |
493 |
--------------------------------------------------------------------------------