From af458bf7b13fa11fac26d97523734c39f5e15799 Mon Sep 17 00:00:00 2001 From: hussienalrubaye Date: Wed, 3 May 2017 07:03:21 -0400 Subject: [PATCH 01/11] tict tac toy online --- TicTacToyGame/TicTacToyLocal2/.gitignore | 9 + .../TicTacToyLocal2/.idea/encodings.xml | 6 + .../TicTacToyLocal2/.idea/gradle.xml | 18 + TicTacToyGame/TicTacToyLocal2/.idea/misc.xml | 36 ++ .../TicTacToyLocal2/.idea/modules.xml | 9 + .../.idea/runConfigurations.xml | 12 + .../{ => TicTacToyLocal2}/app/.gitignore | 0 .../{ => TicTacToyLocal2}/app/build.gradle | 6 +- .../app/proguard-rules.pro | 0 .../ExampleInstrumentedTest.java | 4 +- .../app/src/main/AndroidManifest.xml | 2 +- .../hussein/tictactoylocal}/MainActivity.java | 14 +- .../app/src/main/res/layout/activity_main.xml | 2 +- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../res/mipmap-hdpi/ic_launcher_round.png | Bin .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../res/mipmap-mdpi/ic_launcher_round.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../res/mipmap-xhdpi/ic_launcher_round.png | Bin .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin .../app/src/main/res/values/colors.xml | 0 .../app/src/main/res/values/strings.xml | 3 + .../app/src/main/res/values/styles.xml | 11 + .../tictactoylocal}/ExampleUnitTest.java | 2 +- .../{ => TicTacToyLocal2}/build.gradle | 2 +- .../{ => TicTacToyLocal2}/gradle.properties | 0 .../gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 2 +- TicTacToyGame/{ => TicTacToyLocal2}/gradlew | 0 .../{ => TicTacToyLocal2}/gradlew.bat | 0 .../{ => TicTacToyLocal2}/settings.gradle | 0 TicTacToyGame/TicTacToyOnline/.gitignore | 9 + .../TicTacToyOnline/.idea/encodings.xml | 6 + .../TicTacToyOnline/.idea/gradle.xml | 18 + TicTacToyGame/TicTacToyOnline/.idea/misc.xml | 36 ++ .../TicTacToyOnline/.idea/modules.xml | 9 + .../.idea/runConfigurations.xml | 12 + TicTacToyGame/TicTacToyOnline/app/.gitignore | 1 + .../TicTacToyOnline/app/build.gradle | 39 ++ .../TicTacToyOnline/app/google-services.json | 99 ++++ .../TicTacToyOnline/app/proguard-rules.pro | 25 ++ .../ExampleInstrumentedTest.java | 26 ++ .../app/src/main/AndroidManifest.xml | 23 + .../hussein/tictactoyonline/MainActivity.java | 424 ++++++++++++++++++ .../app/src/main/res/layout/activity_main.xml | 158 +++++++ .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3418 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 4208 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2206 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2555 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4842 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 6114 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7718 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10056 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10486 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 14696 bytes .../app/src/main/res/values/colors.xml | 6 + .../app/src/main/res/values/strings.xml | 4 + .../app/src/main/res/values/styles.xml | 0 .../tictactoyonline/ExampleUnitTest.java | 17 + TicTacToyGame/TicTacToyOnline/build.gradle | 24 + .../TicTacToyOnline/gradle.properties | 17 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 53636 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + TicTacToyGame/TicTacToyOnline/gradlew | 160 +++++++ TicTacToyGame/TicTacToyOnline/gradlew.bat | 90 ++++ TicTacToyGame/TicTacToyOnline/settings.gradle | 1 + .../app/src/main/res/values/strings.xml | 3 - TwitterApp/.idea/TwitterApp.iml | 9 + TwitterApp/.idea/encodings.xml | 6 + TwitterApp/.idea/misc.xml | 7 + TwitterApp/.idea/modules.xml | 8 + TwitterApp/.idea/workspace.xml | 181 ++++++++ 75 files changed, 1542 insertions(+), 20 deletions(-) create mode 100644 TicTacToyGame/TicTacToyLocal2/.gitignore create mode 100644 TicTacToyGame/TicTacToyLocal2/.idea/encodings.xml create mode 100644 TicTacToyGame/TicTacToyLocal2/.idea/gradle.xml create mode 100644 TicTacToyGame/TicTacToyLocal2/.idea/misc.xml create mode 100644 TicTacToyGame/TicTacToyLocal2/.idea/modules.xml create mode 100644 TicTacToyGame/TicTacToyLocal2/.idea/runConfigurations.xml rename TicTacToyGame/{ => TicTacToyLocal2}/app/.gitignore (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/build.gradle (88%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/proguard-rules.pro (100%) rename TicTacToyGame/{app/src/androidTest/java/com/hussein/tictactoygame => TicTacToyLocal2/app/src/androidTest/java/com/hussein/tictactoylocal}/ExampleInstrumentedTest.java (84%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/AndroidManifest.xml (93%) rename TicTacToyGame/{app/src/main/java/com/hussein/tictactoygame => TicTacToyLocal2/app/src/main/java/com/hussein/tictactoylocal}/MainActivity.java (96%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/res/layout/activity_main.xml (99%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/res/mipmap-hdpi/ic_launcher_round.png (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/res/mipmap-mdpi/ic_launcher_round.png (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/app/src/main/res/values/colors.xml (100%) create mode 100644 TicTacToyGame/TicTacToyLocal2/app/src/main/res/values/strings.xml create mode 100644 TicTacToyGame/TicTacToyLocal2/app/src/main/res/values/styles.xml rename TicTacToyGame/{app/src/test/java/com/hussein/tictactoygame => TicTacToyLocal2/app/src/test/java/com/hussein/tictactoylocal}/ExampleUnitTest.java (91%) rename TicTacToyGame/{ => TicTacToyLocal2}/build.gradle (87%) rename TicTacToyGame/{ => TicTacToyLocal2}/gradle.properties (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/gradle/wrapper/gradle-wrapper.jar (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/gradle/wrapper/gradle-wrapper.properties (87%) rename TicTacToyGame/{ => TicTacToyLocal2}/gradlew (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/gradlew.bat (100%) rename TicTacToyGame/{ => TicTacToyLocal2}/settings.gradle (100%) create mode 100644 TicTacToyGame/TicTacToyOnline/.gitignore create mode 100644 TicTacToyGame/TicTacToyOnline/.idea/encodings.xml create mode 100644 TicTacToyGame/TicTacToyOnline/.idea/gradle.xml create mode 100644 TicTacToyGame/TicTacToyOnline/.idea/misc.xml create mode 100644 TicTacToyGame/TicTacToyOnline/.idea/modules.xml create mode 100644 TicTacToyGame/TicTacToyOnline/.idea/runConfigurations.xml create mode 100644 TicTacToyGame/TicTacToyOnline/app/.gitignore create mode 100644 TicTacToyGame/TicTacToyOnline/app/build.gradle create mode 100644 TicTacToyGame/TicTacToyOnline/app/google-services.json create mode 100644 TicTacToyGame/TicTacToyOnline/app/proguard-rules.pro create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/androidTest/java/com/hussein/tictactoyonline/ExampleInstrumentedTest.java create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/AndroidManifest.xml create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/java/com/hussein/tictactoyonline/MainActivity.java create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/layout/activity_main.xml create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/values/colors.xml create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/main/res/values/strings.xml rename TicTacToyGame/{ => TicTacToyOnline}/app/src/main/res/values/styles.xml (100%) create mode 100644 TicTacToyGame/TicTacToyOnline/app/src/test/java/com/hussein/tictactoyonline/ExampleUnitTest.java create mode 100644 TicTacToyGame/TicTacToyOnline/build.gradle create mode 100644 TicTacToyGame/TicTacToyOnline/gradle.properties create mode 100644 TicTacToyGame/TicTacToyOnline/gradle/wrapper/gradle-wrapper.jar create mode 100644 TicTacToyGame/TicTacToyOnline/gradle/wrapper/gradle-wrapper.properties create mode 100755 TicTacToyGame/TicTacToyOnline/gradlew create mode 100644 TicTacToyGame/TicTacToyOnline/gradlew.bat create mode 100644 TicTacToyGame/TicTacToyOnline/settings.gradle delete mode 100644 TicTacToyGame/app/src/main/res/values/strings.xml create mode 100644 TwitterApp/.idea/TwitterApp.iml create mode 100644 TwitterApp/.idea/encodings.xml create mode 100644 TwitterApp/.idea/misc.xml create mode 100644 TwitterApp/.idea/modules.xml create mode 100644 TwitterApp/.idea/workspace.xml diff --git a/TicTacToyGame/TicTacToyLocal2/.gitignore b/TicTacToyGame/TicTacToyLocal2/.gitignore new file mode 100644 index 000000000000..39fb081a42a8 --- /dev/null +++ b/TicTacToyGame/TicTacToyLocal2/.gitignore @@ -0,0 +1,9 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures +.externalNativeBuild diff --git a/TicTacToyGame/TicTacToyLocal2/.idea/encodings.xml b/TicTacToyGame/TicTacToyLocal2/.idea/encodings.xml new file mode 100644 index 000000000000..97626ba45445 --- /dev/null +++ b/TicTacToyGame/TicTacToyLocal2/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyLocal2/.idea/gradle.xml b/TicTacToyGame/TicTacToyLocal2/.idea/gradle.xml new file mode 100644 index 000000000000..7ac24c777f8a --- /dev/null +++ b/TicTacToyGame/TicTacToyLocal2/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyLocal2/.idea/misc.xml b/TicTacToyGame/TicTacToyLocal2/.idea/misc.xml new file mode 100644 index 000000000000..4da8b0b52a27 --- /dev/null +++ b/TicTacToyGame/TicTacToyLocal2/.idea/misc.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyLocal2/.idea/modules.xml b/TicTacToyGame/TicTacToyLocal2/.idea/modules.xml new file mode 100644 index 000000000000..6d2b64ab92ba --- /dev/null +++ b/TicTacToyGame/TicTacToyLocal2/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyLocal2/.idea/runConfigurations.xml b/TicTacToyGame/TicTacToyLocal2/.idea/runConfigurations.xml new file mode 100644 index 000000000000..7f68460d8b38 --- /dev/null +++ b/TicTacToyGame/TicTacToyLocal2/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/TicTacToyGame/app/.gitignore b/TicTacToyGame/TicTacToyLocal2/app/.gitignore similarity index 100% rename from TicTacToyGame/app/.gitignore rename to TicTacToyGame/TicTacToyLocal2/app/.gitignore diff --git a/TicTacToyGame/app/build.gradle b/TicTacToyGame/TicTacToyLocal2/app/build.gradle similarity index 88% rename from TicTacToyGame/app/build.gradle rename to TicTacToyGame/TicTacToyLocal2/app/build.gradle index 8fb44739c686..990d6ed6e2c0 100644 --- a/TicTacToyGame/app/build.gradle +++ b/TicTacToyGame/TicTacToyLocal2/app/build.gradle @@ -2,10 +2,10 @@ apply plugin: 'com.android.application' android { compileSdkVersion 25 - buildToolsVersion "25.0.2" + buildToolsVersion "25.0.3" defaultConfig { - applicationId "com.hussein.tictactoygame" - minSdkVersion 12 + applicationId "com.hussein.tictactoylocal" + minSdkVersion 14 targetSdkVersion 25 versionCode 1 versionName "1.0" diff --git a/TicTacToyGame/app/proguard-rules.pro b/TicTacToyGame/TicTacToyLocal2/app/proguard-rules.pro similarity index 100% rename from TicTacToyGame/app/proguard-rules.pro rename to TicTacToyGame/TicTacToyLocal2/app/proguard-rules.pro diff --git a/TicTacToyGame/app/src/androidTest/java/com/hussein/tictactoygame/ExampleInstrumentedTest.java b/TicTacToyGame/TicTacToyLocal2/app/src/androidTest/java/com/hussein/tictactoylocal/ExampleInstrumentedTest.java similarity index 84% rename from TicTacToyGame/app/src/androidTest/java/com/hussein/tictactoygame/ExampleInstrumentedTest.java rename to TicTacToyGame/TicTacToyLocal2/app/src/androidTest/java/com/hussein/tictactoylocal/ExampleInstrumentedTest.java index c13fbb0fb819..df5c35b60899 100644 --- a/TicTacToyGame/app/src/androidTest/java/com/hussein/tictactoygame/ExampleInstrumentedTest.java +++ b/TicTacToyGame/TicTacToyLocal2/app/src/androidTest/java/com/hussein/tictactoylocal/ExampleInstrumentedTest.java @@ -1,4 +1,4 @@ -package com.hussein.tictactoygame; +package com.hussein.tictactoylocal; import android.content.Context; import android.support.test.InstrumentationRegistry; @@ -21,6 +21,6 @@ public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); - assertEquals("com.hussein.tictactoygame", appContext.getPackageName()); + assertEquals("com.hussein.tictactoylocal", appContext.getPackageName()); } } diff --git a/TicTacToyGame/app/src/main/AndroidManifest.xml b/TicTacToyGame/TicTacToyLocal2/app/src/main/AndroidManifest.xml similarity index 93% rename from TicTacToyGame/app/src/main/AndroidManifest.xml rename to TicTacToyGame/TicTacToyLocal2/app/src/main/AndroidManifest.xml index 63dc7105dc0c..3a2036a39121 100644 --- a/TicTacToyGame/app/src/main/AndroidManifest.xml +++ b/TicTacToyGame/TicTacToyLocal2/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.hussein.tictactoylocal"> - + \ No newline at end of file diff --git a/TicTacToyGame/app/src/main/res/mipmap-hdpi/ic_launcher.png b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from TicTacToyGame/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/TicTacToyGame/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from TicTacToyGame/app/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/TicTacToyGame/app/src/main/res/mipmap-mdpi/ic_launcher.png b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from TicTacToyGame/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/TicTacToyGame/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from TicTacToyGame/app/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/TicTacToyGame/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from TicTacToyGame/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/TicTacToyGame/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from TicTacToyGame/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/TicTacToyGame/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from TicTacToyGame/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/TicTacToyGame/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from TicTacToyGame/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/TicTacToyGame/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from TicTacToyGame/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/TicTacToyGame/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from TicTacToyGame/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to TicTacToyGame/TicTacToyLocal2/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/TicTacToyGame/app/src/main/res/values/colors.xml b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/values/colors.xml similarity index 100% rename from TicTacToyGame/app/src/main/res/values/colors.xml rename to TicTacToyGame/TicTacToyLocal2/app/src/main/res/values/colors.xml diff --git a/TicTacToyGame/TicTacToyLocal2/app/src/main/res/values/strings.xml b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/values/strings.xml new file mode 100644 index 000000000000..9dec6f32a875 --- /dev/null +++ b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + TicTacToyLocal + diff --git a/TicTacToyGame/TicTacToyLocal2/app/src/main/res/values/styles.xml b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/values/styles.xml new file mode 100644 index 000000000000..5885930df6d1 --- /dev/null +++ b/TicTacToyGame/TicTacToyLocal2/app/src/main/res/values/styles.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/TicTacToyGame/app/src/test/java/com/hussein/tictactoygame/ExampleUnitTest.java b/TicTacToyGame/TicTacToyLocal2/app/src/test/java/com/hussein/tictactoylocal/ExampleUnitTest.java similarity index 91% rename from TicTacToyGame/app/src/test/java/com/hussein/tictactoygame/ExampleUnitTest.java rename to TicTacToyGame/TicTacToyLocal2/app/src/test/java/com/hussein/tictactoylocal/ExampleUnitTest.java index 22832ff8d8db..c665dfefff15 100644 --- a/TicTacToyGame/app/src/test/java/com/hussein/tictactoygame/ExampleUnitTest.java +++ b/TicTacToyGame/TicTacToyLocal2/app/src/test/java/com/hussein/tictactoylocal/ExampleUnitTest.java @@ -1,4 +1,4 @@ -package com.hussein.tictactoygame; +package com.hussein.tictactoylocal; import org.junit.Test; diff --git a/TicTacToyGame/build.gradle b/TicTacToyGame/TicTacToyLocal2/build.gradle similarity index 87% rename from TicTacToyGame/build.gradle rename to TicTacToyGame/TicTacToyLocal2/build.gradle index 39c5f30b0c46..d143f697b7d1 100644 --- a/TicTacToyGame/build.gradle +++ b/TicTacToyGame/TicTacToyLocal2/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.4.0-alpha6' + classpath 'com.android.tools.build:gradle:2.4.0-alpha7' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/TicTacToyGame/gradle.properties b/TicTacToyGame/TicTacToyLocal2/gradle.properties similarity index 100% rename from TicTacToyGame/gradle.properties rename to TicTacToyGame/TicTacToyLocal2/gradle.properties diff --git a/TicTacToyGame/gradle/wrapper/gradle-wrapper.jar b/TicTacToyGame/TicTacToyLocal2/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from TicTacToyGame/gradle/wrapper/gradle-wrapper.jar rename to TicTacToyGame/TicTacToyLocal2/gradle/wrapper/gradle-wrapper.jar diff --git a/TicTacToyGame/gradle/wrapper/gradle-wrapper.properties b/TicTacToyGame/TicTacToyLocal2/gradle/wrapper/gradle-wrapper.properties similarity index 87% rename from TicTacToyGame/gradle/wrapper/gradle-wrapper.properties rename to TicTacToyGame/TicTacToyLocal2/gradle/wrapper/gradle-wrapper.properties index 284bd070bc92..699b67f9dfae 100644 --- a/TicTacToyGame/gradle/wrapper/gradle-wrapper.properties +++ b/TicTacToyGame/TicTacToyLocal2/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -#Sun Apr 30 09:53:37 EDT 2017 +#Wed May 03 07:01:01 EDT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/TicTacToyGame/gradlew b/TicTacToyGame/TicTacToyLocal2/gradlew similarity index 100% rename from TicTacToyGame/gradlew rename to TicTacToyGame/TicTacToyLocal2/gradlew diff --git a/TicTacToyGame/gradlew.bat b/TicTacToyGame/TicTacToyLocal2/gradlew.bat similarity index 100% rename from TicTacToyGame/gradlew.bat rename to TicTacToyGame/TicTacToyLocal2/gradlew.bat diff --git a/TicTacToyGame/settings.gradle b/TicTacToyGame/TicTacToyLocal2/settings.gradle similarity index 100% rename from TicTacToyGame/settings.gradle rename to TicTacToyGame/TicTacToyLocal2/settings.gradle diff --git a/TicTacToyGame/TicTacToyOnline/.gitignore b/TicTacToyGame/TicTacToyOnline/.gitignore new file mode 100644 index 000000000000..39fb081a42a8 --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/.gitignore @@ -0,0 +1,9 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures +.externalNativeBuild diff --git a/TicTacToyGame/TicTacToyOnline/.idea/encodings.xml b/TicTacToyGame/TicTacToyOnline/.idea/encodings.xml new file mode 100644 index 000000000000..97626ba45445 --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyOnline/.idea/gradle.xml b/TicTacToyGame/TicTacToyOnline/.idea/gradle.xml new file mode 100644 index 000000000000..7ac24c777f8a --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyOnline/.idea/misc.xml b/TicTacToyGame/TicTacToyOnline/.idea/misc.xml new file mode 100644 index 000000000000..4da8b0b52a27 --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/.idea/misc.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyOnline/.idea/modules.xml b/TicTacToyGame/TicTacToyOnline/.idea/modules.xml new file mode 100644 index 000000000000..f64f11c226e7 --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyOnline/.idea/runConfigurations.xml b/TicTacToyGame/TicTacToyOnline/.idea/runConfigurations.xml new file mode 100644 index 000000000000..7f68460d8b38 --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyOnline/app/.gitignore b/TicTacToyGame/TicTacToyOnline/app/.gitignore new file mode 100644 index 000000000000..796b96d1c402 --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/TicTacToyGame/TicTacToyOnline/app/build.gradle b/TicTacToyGame/TicTacToyOnline/app/build.gradle new file mode 100644 index 000000000000..a6c97056904c --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/app/build.gradle @@ -0,0 +1,39 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 25 + buildToolsVersion "25.0.3" + defaultConfig { + applicationId "com.hussein.tictactoyonline" + minSdkVersion 14 + targetSdkVersion 25 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + exclude group: 'com.android.support', module: 'support-annotations' + }) + compile 'com.android.support:appcompat-v7:25.3.1' + testCompile 'junit:junit:4.12' + compile 'com.android.support.constraint:constraint-layout:1.0.2' + compile 'com.google.firebase:firebase-core:10.2.1' + compile 'com.google.firebase:firebase-auth:10.2.1' + compile 'com.google.firebase:firebase-database:10.2.1' +} + + + + + +apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyOnline/app/google-services.json b/TicTacToyGame/TicTacToyOnline/app/google-services.json new file mode 100644 index 000000000000..c45b0471814f --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/app/google-services.json @@ -0,0 +1,99 @@ +{ + "project_info": { + "project_number": "369846450842", + "firebase_url": "https://androiddemotest-e347b.firebaseio.com", + "project_id": "androiddemotest-e347b", + "storage_bucket": "androiddemotest-e347b.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:369846450842:android:875abf9254040a6a", + "android_client_info": { + "package_name": "com.example.hussienalrubaye.androiddemotest" + } + }, + "oauth_client": [ + { + "client_id": "369846450842-g6ufjar7n3u4ujv1u4ptrgbbg0ocvgnt.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.example.hussienalrubaye.androiddemotest", + "certificate_hash": "76a07b52241638f10fb6d3cf8f6b855f929169dc" + } + }, + { + "client_id": "369846450842-f0t69e4c4ocso788qh4sujnqofuv0pr2.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAwxZOuKGCy_IPtIchuIgAzukaOAxAZ7_U" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 2, + "other_platform_oauth_client": [ + { + "client_id": "369846450842-f0t69e4c4ocso788qh4sujnqofuv0pr2.apps.googleusercontent.com", + "client_type": 3 + } + ] + }, + "ads_service": { + "status": 2 + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:369846450842:android:663c8b9a16cb6183", + "android_client_info": { + "package_name": "com.hussein.tictactoyonline" + } + }, + "oauth_client": [ + { + "client_id": "369846450842-tbd32qs3nfn7bju4r9bhp2lor0vfihkv.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.hussein.tictactoyonline", + "certificate_hash": "76a07b52241638f10fb6d3cf8f6b855f929169dc" + } + }, + { + "client_id": "369846450842-f0t69e4c4ocso788qh4sujnqofuv0pr2.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAwxZOuKGCy_IPtIchuIgAzukaOAxAZ7_U" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 2, + "other_platform_oauth_client": [ + { + "client_id": "369846450842-f0t69e4c4ocso788qh4sujnqofuv0pr2.apps.googleusercontent.com", + "client_type": 3 + } + ] + }, + "ads_service": { + "status": 2 + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyOnline/app/proguard-rules.pro b/TicTacToyGame/TicTacToyOnline/app/proguard-rules.pro new file mode 100644 index 000000000000..823ed0c41709 --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/app/proguard-rules.pro @@ -0,0 +1,25 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/hussienalrubaye/Library/Android/sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/TicTacToyGame/TicTacToyOnline/app/src/androidTest/java/com/hussein/tictactoyonline/ExampleInstrumentedTest.java b/TicTacToyGame/TicTacToyOnline/app/src/androidTest/java/com/hussein/tictactoyonline/ExampleInstrumentedTest.java new file mode 100644 index 000000000000..53b8f42028b2 --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/app/src/androidTest/java/com/hussein/tictactoyonline/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.hussein.tictactoyonline; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumentation test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() throws Exception { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("com.hussein.tictactoyonline", appContext.getPackageName()); + } +} diff --git a/TicTacToyGame/TicTacToyOnline/app/src/main/AndroidManifest.xml b/TicTacToyGame/TicTacToyOnline/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000000..a75da1fb60eb --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/app/src/main/AndroidManifest.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyOnline/app/src/main/java/com/hussein/tictactoyonline/MainActivity.java b/TicTacToyGame/TicTacToyOnline/app/src/main/java/com/hussein/tictactoyonline/MainActivity.java new file mode 100644 index 000000000000..b509539817ff --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/app/src/main/java/com/hussein/tictactoyonline/MainActivity.java @@ -0,0 +1,424 @@ +package com.hussein.tictactoyonline; +import android.graphics.Color; +import android.support.annotation.NonNull; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.Toast; + +import com.google.android.gms.tasks.OnCompleteListener; +import com.google.android.gms.tasks.Task; +import com.google.firebase.analytics.FirebaseAnalytics; +import com.google.firebase.auth.AuthResult; +import com.google.firebase.auth.FirebaseAuth; +import com.google.firebase.auth.FirebaseUser; +import com.google.firebase.database.DataSnapshot; +import com.google.firebase.database.DatabaseError; +import com.google.firebase.database.DatabaseReference; +import com.google.firebase.database.FirebaseDatabase; +import com.google.firebase.database.ValueEventListener; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; + +public class MainActivity extends AppCompatActivity { + private FirebaseAnalytics mFirebaseAnalytics; + private FirebaseAuth mAuth; + private FirebaseAuth.AuthStateListener mAuthListener; + public static final String TAG ="Login" ; + EditText etEmail; + EditText etMyEmail; + String uid; + String email; +String PlayersSession; + FirebaseDatabase database = FirebaseDatabase.getInstance(); + DatabaseReference myRef = database.getReference(); + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + mFirebaseAnalytics = FirebaseAnalytics.getInstance(this); + mAuth = FirebaseAuth.getInstance(); + mAuthListener = new FirebaseAuth.AuthStateListener() { + + + @Override + public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { + FirebaseUser user = firebaseAuth.getCurrentUser(); + if (user != null) { + // User is signed in + Log.d(TAG, "onAuthStateChanged:signed_in:" + user.getUid()); + + // Name, email address, and profile photo Url + String name = user.getDisplayName(); + email = user.getEmail(); + //Uri photoUrl = user.getPhotoUrl(); + Log.d(TAG, "name:" + name); + Log.d(TAG, "email:" + email); + // Check if user's email is verified + boolean emailVerified = user.isEmailVerified(); + + // The user's ID, unique to the Firebase project. Do NOT use this value to + // authenticate with your backend server, if you have one. Use + // FirebaseUser.getToken() instead. + uid = user.getUid(); + + // Write a message to the database + myRef.child("Users").child(email.substring(0,4)).child("requests").setValue(uid); + IncommmingInvatations(); + + } else { + // User is signed out + Log.d(TAG, "onAuthStateChanged:signed_out"); + } + // ... + } + }; + + + + etEmail=(EditText)findViewById(R.id.etEmail); + etMyEmail=(EditText)findViewById(R.id.etmyemail); + + } + + @Override + public void onStart() { + super.onStart(); + mAuth.addAuthStateListener(mAuthListener); + } + @Override + public void onStop() { + super.onStop(); + if (mAuthListener != null) { + mAuth.removeAuthStateListener(mAuthListener); + } + } + + void login(String email,String password){ + mAuth.createUserWithEmailAndPassword(email, password) + .addOnCompleteListener(this, new OnCompleteListener() { + @Override + public void onComplete(@NonNull Task task) { + Log.d(TAG, "createUserWithEmail:onComplete:" + task.isSuccessful()); + + // If sign in fails, display a message to the user. If sign in succeeds + // the auth state listener will be notified and logic to handle the + // signed in user can be handled in the listener. + if (!task.isSuccessful()) { + + } + + // ... + } + }); + + } + public void BuClick(View view) { + Button buSelected= (Button) view; + int CellID=0; + switch ((buSelected.getId())){ + + case R.id.bu1: + CellID=1; + break; + + case R.id.bu2: + CellID=2; + break; + + case R.id.bu3: + CellID=3; + break; + + case R.id.bu4: + CellID=4; + break; + + case R.id.bu5: + CellID=5; + break; + + case R.id.bu6: + CellID=6; + break; + + case R.id.bu7: + CellID=7; + break; + + case R.id.bu8: + CellID=8; + break; + + case R.id.bu9: + CellID=9; + break; + } + myRef.child("Playing").child(PlayersSession).child(CountSteps+"CellID:"+String.valueOf(CellID)).setValue(email.substring(0,4)); + + } + + int ActivePlayer=1; // 1- for first , 2 for second + int CountSteps=0; //number of used cells + ArrayList Player1= new ArrayList();// hold player 1 data + ArrayList Player2= new ArrayList();// hold player 2 data + void PlayGame(int CellID,Button buSelected ){ + + Log.d("Player:",String.valueOf(CellID)); + + if (ActivePlayer==1){ + buSelected.setText("X"); + buSelected.setBackgroundColor(Color.GREEN); + Player1.add(CellID); + + + + } + else { + buSelected.setText("O"); + buSelected.setBackgroundColor(Color.BLUE); + Player2.add(CellID); + + + } + + buSelected.setEnabled(false); + CheckWiner(); + } + + void CheckWiner(){ + int Winer=-1; + //row 1 + if (Player1.contains(1) && Player1.contains(2) && Player1.contains(3)) { + Winer=1 ; + } + if (Player2.contains(1) && Player2.contains(2) && Player2.contains(3)) { + Winer=2 ; + } + + //row 2 + if (Player1.contains(4) && Player1.contains(5) && Player1.contains(6)) { + Winer=1 ; + } + if (Player2.contains(4) && Player2.contains(5) && Player2.contains(6)) { + Winer=2 ; + } + + //row 3 + if (Player1.contains(7) && Player1.contains(8) && Player1.contains(9)) { + Winer=1 ; + } + if (Player2.contains(7) && Player2.contains(8) && Player2.contains(9)) { + Winer=2 ; + } + + + //col 1 + if (Player1.contains(1) && Player1.contains(4) && Player1.contains(7)) { + Winer=1 ; + } + if (Player2.contains(1) && Player2.contains(4) && Player2.contains(7)) { + Winer=2 ; + } + + //col 2 + if (Player1.contains(2) && Player1.contains(5) && Player1.contains(8)) { + Winer=1 ; + } + if (Player2.contains(2) && Player2.contains(5) && Player2.contains(8)) { + Winer=2 ; + } + + + //col 3 + if (Player1.contains(3) && Player1.contains(6) && Player1.contains(9)) { + Winer=1 ; + } + if (Player2.contains(3) && Player2.contains(6) && Player2.contains(9)) { + Winer=2 ; + } + + + if ( Winer !=-1){ + // We have winer + + if (Winer==1){ + Toast.makeText(this,"Player 1 is winner",Toast.LENGTH_LONG).show(); + } + + if (Winer==2){ + Toast.makeText(this,"Player 2 is winner",Toast.LENGTH_LONG).show(); + } + + } + + } + + void AutoPlay(int CellID ){ + + Button buSelected; + switch (CellID){ + + case 1 : + buSelected=(Button) findViewById(R.id.bu1); + break; + + case 2: + buSelected=(Button) findViewById(R.id.bu2); + break; + + case 3: + buSelected=(Button) findViewById(R.id.bu3); + break; + + case 4: + buSelected=(Button) findViewById(R.id.bu4); + break; + + case 5: + buSelected=(Button) findViewById(R.id.bu5); + break; + + case 6: + buSelected=(Button) findViewById(R.id.bu6); + break; + + case 7: + buSelected=(Button) findViewById(R.id.bu7); + break; + + case 8: + buSelected=(Button) findViewById(R.id.bu8); + break; + + case 9: + buSelected=(Button) findViewById(R.id.bu9); + break; + default: + buSelected=(Button) findViewById(R.id.bu1); + break; + + } + PlayGame(CellID, buSelected ); + } + + + public void buPlay(View view) { + // myRef.child("Games").push().child("Request").removeValue(); + String value=email.substring(0,4) + ":"+ etEmail.getText().toString().substring(0,4); + myRef.child("Users").child(etEmail.getText().toString().substring(0,4)).child("requests") + .push().setValue(email); + StartGame(value); + } + void IncommmingInvatations(){ + myRef.child("Users").child(email.substring(0,4)).child("requests") + .addValueEventListener(new ValueEventListener() { + @Override + public void onDataChange(DataSnapshot dataSnapshot) { + // This method is called once with the initial value and again + // whenever data at this location is updated. + + try { + Map td = (HashMap) dataSnapshot.getValue(); + if (td != null) //no one allow you to find him + { + String value; + + for ( String key : td.keySet()) { + value=(String)td.get(key); + + Log.w("Get new inviation",value ); + + ColorButton(); + etEmail.setText(value.substring(0,4)); + myRef.child("Users").child(email.substring(0,4)).child("requests").setValue(uid); + break; + + + } + } + }catch (Exception ex){} + + + } + + @Override + public void onCancelled(DatabaseError error) { + // Failed to read value + Log.w(TAG, "Failed to read value.", error.toException()); + } + }); + + } + void StartGame(final String Players){ + PlayersSession=Players; + myRef.child("Playing").child(Players).removeValue(); + myRef.child("Playing").child(Players) + .addValueEventListener(new ValueEventListener() { + @Override + public void onDataChange(DataSnapshot dataSnapshot) { + // This method is called once with the initial value and again + // whenever data at this location is updated. + + try { + ActivePlayer=2; + Player1.clear(); + Player2.clear(); + Map td = (HashMap) dataSnapshot.getValue(); + if (td != null) //no one allow you to find him + { + + String FirstPlayer="X"; //default + for ( String key : td.keySet()) { + String value=(String)td.get(key); + if(!FirstPlayer.equals(value)) + ActivePlayer=ActivePlayer==2?1:2; + FirstPlayer=value; + + AutoPlay(Integer.valueOf(key.substring(8)) ); + Log.w("Get new inviation",value ); + + + + + } + CountSteps=td.size(); + } + }catch (Exception ex){ + ex.printStackTrace(); + } + + } + + @Override + public void onCancelled(DatabaseError error) { + // Failed to read value + Log.w(TAG, "Failed to read value.", error.toException()); + } + }); + + } + + void ColorButton(){ + etEmail.setBackgroundColor(Color.RED); + } + + public void buRegister(View view) { + + login(etMyEmail.getText().toString(),"hussein"); + } + + public void buAccept(View view) { + String value= etEmail.getText().toString().substring(0,4) + ":"+ email.substring(0,4); + myRef.child("Users").child(etEmail.getText().toString().substring(0,4)).child("requests") + .push().setValue(email); + StartGame(value); + } +} \ No newline at end of file diff --git a/TicTacToyGame/TicTacToyOnline/app/src/main/res/layout/activity_main.xml b/TicTacToyGame/TicTacToyOnline/app/src/main/res/layout/activity_main.xml new file mode 100644 index 000000000000..bf459f8c200b --- /dev/null +++ b/TicTacToyGame/TicTacToyOnline/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,158 @@ + + + + + + + +