├── app ├── .gitignore ├── libs │ ├── hex-ai.jar │ ├── hex-core.jar │ ├── hex-net.jar │ └── gson-2.2.4.jar ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── icon.png │ │ │ ├── play.png │ │ │ ├── store.png │ │ │ ├── history.png │ │ │ ├── settings.png │ │ │ ├── donate_gold.png │ │ │ ├── file_icon.png │ │ │ ├── howtoplay.png │ │ │ ├── achievements.png │ │ │ ├── directory_up.png │ │ │ ├── donate_bronze.png │ │ │ ├── donate_hollow.png │ │ │ ├── donate_silver.png │ │ │ ├── file_hex_icon.png │ │ │ ├── history_icon.png │ │ │ ├── directory_icon.png │ │ │ ├── history_background_black.9.png │ │ │ ├── history_background_blue.9.png │ │ │ └── history_background_red.9.png │ │ ├── drawable-mdpi │ │ │ ├── icon.png │ │ │ ├── donate_gold.png │ │ │ ├── donate_bronze.png │ │ │ ├── donate_hollow.png │ │ │ └── donate_silver.png │ │ ├── drawable-xhdpi │ │ │ ├── exit.png │ │ │ ├── home.png │ │ │ ├── icon.png │ │ │ ├── undo.png │ │ │ ├── restart.png │ │ │ ├── play_again.png │ │ │ ├── donate_gold.png │ │ │ ├── donate_bronze.png │ │ │ ├── donate_bronze_d.png │ │ │ ├── donate_gold_d.png │ │ │ ├── donate_hollow.png │ │ │ ├── donate_silver.png │ │ │ └── donate_silver_d.png │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── dialog_view_game_over_icon.xml │ │ │ ├── fragment_game_selection.xml │ │ │ ├── fragment_online_selection.xml │ │ │ ├── fragment_history.xml │ │ │ ├── preferences_timer.xml │ │ │ ├── preferences.xml │ │ │ ├── view_history_item.xml │ │ │ ├── dialog_view_donate.xml │ │ │ ├── fragment_instructions.xml │ │ │ ├── fragment_game.xml │ │ │ ├── dialog_view_game_over.xml │ │ │ └── fragment_main.xml │ │ ├── values │ │ │ ├── integer.xml │ │ │ ├── constants.xml │ │ │ ├── styles.xml │ │ │ ├── arrays.xml │ │ │ ├── colors.xml │ │ │ └── strings.xml │ │ ├── drawable │ │ │ └── background_drawable.xml │ │ ├── values-nl │ │ │ ├── arrays.xml │ │ │ └── strings.xml │ │ ├── layout-sw600dp │ │ │ ├── dialog_view_donate.xml │ │ │ ├── dialog_view_game_over.xml │ │ │ └── fragment_game.xml │ │ ├── xml │ │ │ └── preferences_general.xml │ │ ├── layout-sw400dp │ │ │ └── fragment_game.xml │ │ └── values-de │ │ │ └── strings.xml │ │ ├── java │ │ └── com │ │ │ ├── google │ │ │ └── android │ │ │ │ └── gms │ │ │ │ └── games │ │ │ │ ├── GameCompat.java │ │ │ │ ├── InvitationsClient.java │ │ │ │ ├── PlayerCompat.java │ │ │ │ ├── multiplayer │ │ │ │ ├── Participant.java │ │ │ │ ├── Invitation.java │ │ │ │ ├── ParticipantResult.java │ │ │ │ ├── turnbased │ │ │ │ │ ├── TurnBasedMatchUpdateCallback.java │ │ │ │ │ ├── TurnBasedMatch.java │ │ │ │ │ └── TurnBasedMatchConfig.java │ │ │ │ ├── Multiplayer.java │ │ │ │ └── realtime │ │ │ │ │ └── RoomConfig.java │ │ │ │ ├── GamesCompat.java │ │ │ │ └── TurnBasedMultiplayerClient.java │ │ │ └── xlythe │ │ │ └── hex │ │ │ ├── PermissionUtils.java │ │ │ ├── fragment │ │ │ ├── InstructionsFragment.java │ │ │ ├── OnlineSelectionFragment.java │ │ │ ├── GameSelectionFragment.java │ │ │ ├── HexFragment.java │ │ │ ├── HistoryFragment.java │ │ │ ├── PreferencesFragment.java │ │ │ └── MainFragment.java │ │ │ ├── compat │ │ │ ├── GameOptions.java │ │ │ ├── Game.java │ │ │ └── NetworkPlayer.java │ │ │ ├── FileUtil.java │ │ │ ├── Stats.java │ │ │ ├── view │ │ │ ├── HexDialog.java │ │ │ ├── DonateDialog.java │ │ │ ├── GameOverDialog.java │ │ │ └── SelectorLayout.java │ │ │ ├── Settings.java │ │ │ ├── BaseGameActivity.java │ │ │ ├── PreferencesActivity.java │ │ │ ├── MainActivity.java │ │ │ └── NetActivity.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle.properties ├── ic_launcher-web.png ├── .gitignore ├── LICENSE.txt └── README.txt /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.apk 3 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | android.useAndroidX=true 2 | android.enableJetifier=true 3 | -------------------------------------------------------------------------------- /app/libs/hex-ai.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/libs/hex-ai.jar -------------------------------------------------------------------------------- /app/libs/hex-core.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/libs/hex-core.jar -------------------------------------------------------------------------------- /app/libs/hex-net.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/libs/hex-net.jar -------------------------------------------------------------------------------- /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/ic_launcher-web.png -------------------------------------------------------------------------------- /app/libs/gson-2.2.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/libs/gson-2.2.4.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/play.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/store.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/exit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/home.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/undo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/history.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/restart.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/donate_gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/donate_gold.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/file_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/file_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/howtoplay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/howtoplay.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/donate_gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-mdpi/donate_gold.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/play_again.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/play_again.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/achievements.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/achievements.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/directory_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/directory_up.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/donate_bronze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/donate_bronze.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/donate_hollow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/donate_hollow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/donate_silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/donate_silver.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/file_hex_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/file_hex_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/history_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/history_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/donate_bronze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-mdpi/donate_bronze.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/donate_hollow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-mdpi/donate_hollow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/donate_silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-mdpi/donate_silver.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/donate_gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/donate_gold.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/directory_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/directory_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/donate_bronze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/donate_bronze.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/donate_bronze_d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/donate_bronze_d.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/donate_gold_d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/donate_gold_d.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/donate_hollow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/donate_hollow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/donate_silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/donate_silver.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/donate_silver_d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-xhdpi/donate_silver_d.png -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/gms/games/GameCompat.java: -------------------------------------------------------------------------------- 1 | package com.google.android.gms.games; 2 | 3 | public interface GameCompat { 4 | } 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/gms/games/InvitationsClient.java: -------------------------------------------------------------------------------- 1 | package com.google.android.gms.games; 2 | 3 | public class InvitationsClient { 4 | } 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/history_background_black.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/history_background_black.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/history_background_blue.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/history_background_blue.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/history_background_red.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xlythe/Hex/HEAD/app/src/main/res/drawable-hdpi/history_background_red.9.png -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/gms/games/PlayerCompat.java: -------------------------------------------------------------------------------- 1 | package com.google.android.gms.games; 2 | 3 | public interface PlayerCompat { 4 | String getPlayerId(); 5 | String getDisplayName(); 6 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/gms/games/multiplayer/Participant.java: -------------------------------------------------------------------------------- 1 | package com.google.android.gms.games.multiplayer; 2 | 3 | import com.google.android.gms.games.PlayerCompat; 4 | 5 | public interface Participant { 6 | PlayerCompat getPlayer(); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_view_game_over_icon.xml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_game_selection.xml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_online_selection.xml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/integer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0xffcc5c57 4 | 0xff4ba5e2 5 | 0 6 | 1 7 | 2 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/background_drawable.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/gms/games/multiplayer/Invitation.java: -------------------------------------------------------------------------------- 1 | package com.google.android.gms.games.multiplayer; 2 | 3 | import com.google.android.gms.games.GameCompat; 4 | 5 | public interface Invitation { 6 | int INVITATION_TYPE_TURN_BASED = 1; 7 | GameCompat getGame(); 8 | String getInvitationId(); 9 | int getInvitationType(); 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/gms/games/multiplayer/ParticipantResult.java: -------------------------------------------------------------------------------- 1 | package com.google.android.gms.games.multiplayer; 2 | 3 | public class ParticipantResult { 4 | public static final int MATCH_RESULT_WIN = 0; 5 | public static final int MATCH_RESULT_LOSS = 1; 6 | 7 | public ParticipantResult(String participantId, int result, int placing) { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/gms/games/multiplayer/turnbased/TurnBasedMatchUpdateCallback.java: -------------------------------------------------------------------------------- 1 | package com.google.android.gms.games.multiplayer.turnbased; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | public interface TurnBasedMatchUpdateCallback { 6 | void onTurnBasedMatchReceived(@NonNull TurnBasedMatch turnBasedMatch); 7 | void onTurnBasedMatchRemoved(@NonNull String matchId); 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/gms/games/multiplayer/Multiplayer.java: -------------------------------------------------------------------------------- 1 | package com.google.android.gms.games.multiplayer; 2 | 3 | public interface Multiplayer { 4 | String EXTRA_EXCLUSIVE_BIT_MASK = "exclusive_bit_mask"; 5 | String EXTRA_INVITATION = "invitation"; 6 | String EXTRA_TURN_BASED_MATCH = "turn_based_match"; 7 | String EXTRA_MIN_AUTOMATCH_PLAYERS = "min_automatch_players"; 8 | String EXTRA_MAX_AUTOMATCH_PLAYERS = "max_automatch_players"; 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/gms/games/GamesCompat.java: -------------------------------------------------------------------------------- 1 | package com.google.android.gms.games; 2 | 3 | import android.content.Context; 4 | 5 | import com.google.android.gms.auth.api.signin.GoogleSignInAccount; 6 | 7 | public class GamesCompat { 8 | public static TurnBasedMultiplayerClient getTurnBasedMultiplayerClient(Context context, GoogleSignInAccount account) { 9 | return new TurnBasedMultiplayerClient(); 10 | } 11 | 12 | public static InvitationsClient getInvitationsClient(Context context, GoogleSignInAccount account) { 13 | return new InvitationsClient(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/values-nl/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7x7 5 | 9x9 6 | 11x11 7 | Aangepast 8 | 9 | 10 | Makkelijk 11 | Gemiddeld 12 | Moeilijk 13 | 14 | 15 | Geen timer 16 | Per beurt 17 | Hele spel 18 | 19 | 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Can ignore specific files 2 | .DS_Store 3 | Thumbs.db 4 | 5 | # Use wildcards as well 6 | *~ 7 | *.swp 8 | *.~ 9 | 10 | # Can also ignore all directories and files in a directory. 11 | tmp/**/* 12 | 13 | #ignore the binary 14 | bin/* 15 | 16 | #eclips stuff 17 | .project 18 | .classpath 19 | proguard-project.txt 20 | project.properties 21 | default.properties 22 | 23 | .~lock.designDoc.odt# 24 | 25 | *.class 26 | 27 | scr 28 | 29 | gen/* 30 | 31 | .gradle/* 32 | 33 | gradle/* 34 | 35 | .idea/* 36 | 37 | build/* 38 | 39 | *.iml 40 | 41 | local.properties 42 | 43 | gradlew 44 | 45 | gradlew.bat 46 | .gradle/ 47 | .idea/ 48 | gradle/ 49 | app/release/output-metadata.json 50 | *.dm 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/xlythe/hex/PermissionUtils.java: -------------------------------------------------------------------------------- 1 | package com.xlythe.hex; 2 | 3 | import android.content.Context; 4 | import android.content.pm.PackageManager; 5 | 6 | import androidx.core.content.ContextCompat; 7 | 8 | public class PermissionUtils { 9 | /** 10 | * Returns true if all given permissions are available 11 | */ 12 | public static boolean hasPermissions(Context context, String... permissions) { 13 | for (String permission : permissions) { 14 | if (ContextCompat.checkSelfPermission(context, permission) != PackageManager.PERMISSION_GRANTED) { 15 | return false; 16 | } 17 | } 18 | return true; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/res/values/constants.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | @integer/COLOR_RED 4 | @integer/COLOR_BLUE 5 | Player1 6 | Guest 7 | 1 8 | 7 9 | true 10 | 0 11 | 0 12 | true 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/gms/games/multiplayer/turnbased/TurnBasedMatch.java: -------------------------------------------------------------------------------- 1 | package com.google.android.gms.games.multiplayer.turnbased; 2 | 3 | import com.google.android.gms.games.GameCompat; 4 | import com.google.android.gms.games.multiplayer.Participant; 5 | 6 | import java.util.ArrayList; 7 | 8 | public interface TurnBasedMatch { 9 | int MATCH_TURN_STATUS_MY_TURN = 1; 10 | int MATCH_TURN_STATUS_THEIR_TURN = 2; 11 | 12 | GameCompat getGame(); 13 | String getMatchId(); 14 | int getTurnStatus(); 15 | byte[] getData(); 16 | int getVersion(); 17 | String getRematchId(); 18 | ArrayList getParticipantIds(); 19 | String getParticipantId(String playerId); 20 | Participant getParticipant(String participantId); 21 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Xlyth\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/gms/games/multiplayer/turnbased/TurnBasedMatchConfig.java: -------------------------------------------------------------------------------- 1 | package com.google.android.gms.games.multiplayer.turnbased; 2 | 3 | import android.os.Bundle; 4 | 5 | import java.util.ArrayList; 6 | 7 | public abstract class TurnBasedMatchConfig { 8 | public static Builder builder() { 9 | return new Builder(); 10 | } 11 | 12 | public static final class Builder { 13 | private Builder() {} 14 | 15 | public Builder addInvitedPlayers(ArrayList playerIds) { 16 | return this; 17 | } 18 | 19 | public Builder setAutoMatchCriteria(Bundle autoMatchCriteria) { 20 | return this; 21 | } 22 | 23 | public TurnBasedMatchConfig build() { 24 | return null; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/gms/games/multiplayer/realtime/RoomConfig.java: -------------------------------------------------------------------------------- 1 | package com.google.android.gms.games.multiplayer.realtime; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.google.android.gms.games.multiplayer.Multiplayer; 6 | 7 | public abstract class RoomConfig { 8 | public static final class Builder { 9 | public RoomConfig build() { 10 | return null; 11 | } 12 | } 13 | 14 | public static Bundle createAutoMatchCriteria(int minAutoMatchPlayers, 15 | int maxAutoMatchPlayers, long exclusiveBitMask) { 16 | Bundle autoMatchData = new Bundle(); 17 | autoMatchData.putInt(Multiplayer.EXTRA_MIN_AUTOMATCH_PLAYERS, minAutoMatchPlayers); 18 | autoMatchData.putInt(Multiplayer.EXTRA_MAX_AUTOMATCH_PLAYERS, maxAutoMatchPlayers); 19 | autoMatchData.putLong(Multiplayer.EXTRA_EXCLUSIVE_BIT_MASK, exclusiveBitMask); 20 | return autoMatchData; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_history.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | 17 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/preferences_timer.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 12 | 13 | 20 | 21 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7x7 5 | 9x9 6 | 11x11 7 | Custom 8 | 9 | 10 | 7 11 | 9 12 | 11 13 | 0 14 | 15 | 16 | Easy 17 | Medium 18 | Hard 19 | 20 | 21 | 0 22 | 1 23 | 2 24 | 25 | 26 | No timer 27 | Per move 28 | Entire match 29 | 30 | 31 | 0 32 | 1 33 | 2 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #000000 4 | #FFFFFF 5 | #00000000 6 | #FFCCCCCC 7 | #00000000 8 | #FFFFFFFF 9 | #00000000 10 | #D2D2D2 11 | #333333 12 | 13 | #cc5c57 14 | #5f6ec2 15 | #f9db00 16 | #b7cf47 17 | #f48935 18 | #4ba5e2 19 | 20 | #b7cf47 21 | #4ba5e2 22 | #cc5c57 23 | 24 | #f9db00 25 | #5f6ec2 26 | #f48935 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/xlythe/hex/fragment/InstructionsFragment.java: -------------------------------------------------------------------------------- 1 | package com.xlythe.hex.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.text.method.LinkMovementMethod; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.TextView; 9 | 10 | import com.xlythe.hex.R; 11 | 12 | import androidx.annotation.NonNull; 13 | 14 | /** 15 | * @author Will Harmon 16 | **/ 17 | public class InstructionsFragment extends HexFragment { 18 | @Override 19 | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 20 | super.onCreateView(inflater, container, savedInstanceState); 21 | View v = inflater.inflate(R.layout.fragment_instructions, container, false); 22 | 23 | TextView title = v.findViewById(R.id.title); 24 | title.setText(R.string.activity_title_instructions); 25 | 26 | TextView rules = v.findViewById(R.id.rules); 27 | rules.setMovementMethod(LinkMovementMethod.getInstance()); 28 | 29 | TextView privacy = v.findViewById(R.id.privacy); 30 | privacy.setMovementMethod(LinkMovementMethod.getInstance()); 31 | 32 | return v; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/preferences.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 20 | 21 | 22 | 26 | 27 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_history_item.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 14 | 22 | 23 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_view_donate.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 13 | 14 | 18 | 19 | 25 | 26 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/layout-sw600dp/dialog_view_donate.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 13 | 14 | 18 | 19 | 25 | 26 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_instructions.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 18 | 19 | 27 | 28 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/xlythe/hex/compat/GameOptions.java: -------------------------------------------------------------------------------- 1 | package com.xlythe.hex.compat; 2 | 3 | import com.hex.core.Timer; 4 | 5 | public class GameOptions extends com.hex.core.Game.GameOptions { 6 | private GameOptions() {} 7 | 8 | public static class Builder { 9 | private final GameOptions gameOptions = new GameOptions(); 10 | 11 | public Builder() { 12 | setNoTimer(); 13 | } 14 | 15 | public Builder setGridSize(int gridSize) { 16 | gameOptions.gridSize = gridSize; 17 | return this; 18 | } 19 | 20 | public Builder setSwapEnabled(boolean enabled) { 21 | gameOptions.swap = enabled; 22 | return this; 23 | } 24 | 25 | public Builder setTimer(Timer timer) { 26 | gameOptions.timer = timer; 27 | return this; 28 | } 29 | 30 | public Builder setTimerPerMove(long totalTimeMinutes, long additionalTimePerMoveSeconds) { 31 | return setTimer(new Timer(totalTimeMinutes, additionalTimePerMoveSeconds, Timer.PER_MOVE)); 32 | } 33 | 34 | public Builder setTimerForEntireMatch(long totalTimeMinutes) { 35 | return setTimer(new Timer(totalTimeMinutes, 0, Timer.ENTIRE_MATCH)); 36 | } 37 | 38 | public Builder setNoTimer() { 39 | return setTimer(new Timer(0, 0, Timer.NO_TIMER)); 40 | } 41 | 42 | public GameOptions build() { 43 | return gameOptions; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preferences_general.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 7 | 14 | 15 | 20 | 21 | 25 | 26 | 32 | 33 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | Properties local = new Properties() 4 | local.load(project.rootProject.file('local.properties').newDataInputStream()) 5 | 6 | android { 7 | compileSdkVersion 36 8 | defaultConfig { 9 | applicationId "com.sam.hex" 10 | minSdkVersion 21 11 | targetSdkVersion 36 12 | versionCode 31 13 | versionName "5.1.2" 14 | multiDexEnabled true 15 | } 16 | signingConfigs { 17 | release { 18 | storeFile file(local.getProperty("keystoreDir")) 19 | storePassword local.getProperty("keystorePassword") 20 | keyAlias local.getProperty("keystoreAlias") 21 | keyPassword local.getProperty("keystoreAliasPassword") 22 | } 23 | } 24 | buildTypes { 25 | release { 26 | minifyEnabled false 27 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 28 | signingConfig signingConfigs.release 29 | } 30 | } 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | namespace 'com.xlythe.hex' 36 | lint { 37 | abortOnError false 38 | } 39 | } 40 | 41 | dependencies { 42 | implementation fileTree(include: ['*.jar'], dir: 'libs') 43 | implementation 'androidx.appcompat:appcompat:+' 44 | implementation 'com.google.android.material:material:+' 45 | implementation 'com.google.android.gms:play-services-auth:+' 46 | implementation 'com.google.android.gms:play-services-games:+' 47 | implementation 'androidx.multidex:multidex:+' 48 | implementation 'com.xlythe:play-billing:3.1.2' 49 | testImplementation 'junit:junit:4.13.2' 50 | } 51 | 52 | configurations.all { 53 | exclude group: 'com.android.support' 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_game.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 |