Commit 769141d9 authored by Shaun Burch's avatar Shaun Burch 💻

#1 Add Icon & Credit dialog, update Readme

parent b51b1457
Pipeline #22999695 passed with stages
in 6 minutes and 2 seconds
# Tic Tac Toe # Tic Tac Toe
A sample Tic Tac Toe application in Android. A sample Tic Tac Toe application in Android.
## Goals ### Goals
* Allow 2 players to play tic tac toe (Follow the rules of tic tac toe) * Allow 2 players to play tic tac toe (Follow the rules of tic tac toe)
* Have 3x3 grid on which the players can play * Have 3x3 grid on which the players can play
* Allow the players to take turns marking spaces on the 3x3 grid * Allow the players to take turns marking spaces on the 3x3 grid
* Recognize when a player has won and declare that player as victorious * Recognize when a player has won and declare that player as victorious
* Allow the user to start a new game * Allow the user to start a new game
### Credits
* Icon made by [Freepik](https://www.flaticon.com/authors/freepik) from www.flaticon.com
### Libraries
* RxJava - https://github.com/ReactiveX/RxJava
* ButterKnife - http://jakewharton.github.io/butterknife/
\ No newline at end of file
...@@ -4,6 +4,7 @@ import android.graphics.Point; ...@@ -4,6 +4,7 @@ import android.graphics.Point;
import android.os.Bundle; import android.os.Bundle;
import android.support.design.widget.FloatingActionButton; import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar; import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.util.Log; import android.util.Log;
...@@ -68,7 +69,12 @@ public class MainActivity extends AppCompatActivity implements AddPlayerDialog.A ...@@ -68,7 +69,12 @@ public class MainActivity extends AppCompatActivity implements AddPlayerDialog.A
int id = item.getItemId(); int id = item.getItemId();
//noinspection SimplifiableIfStatement //noinspection SimplifiableIfStatement
if (id == R.id.action_settings) { if (id == R.id.action_credits) {
new AlertDialog.Builder(this)
.setTitle(R.string.title_credits)
.setMessage(R.string.message_credits)
.setPositiveButton(R.string.ok, null)
.show();
return true; return true;
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<vector <vector android:height="108dp"
xmlns:android="http://schemas.android.com/apk/res/android" android:width="108dp"
android:height="108dp" android:viewportHeight="108"
android:width="108dp" android:viewportWidth="108"
android:viewportHeight="108" xmlns:android="http://schemas.android.com/apk/res/android">
android:viewportWidth="108">
<path android:fillColor="#26A69A" <path android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z"/> android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108" <path android:fillColor="#00000000" android:pathData="M9,0L9,108"
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.tictactoe.MainActivity"> tools:context="com.example.tictactoe.MainActivity">
<item android:id="@+id/action_settings" <item
android:title="@string/action_settings" android:id="@+id/action_credits"
android:title="@string/action_credits"
android:orderInCategory="100" android:orderInCategory="100"
app:showAsAction="never"/> app:showAsAction="never"/>
</menu> </menu>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/> <background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/> <foreground android:drawable="@mipmap/ic_launcher_foreground" />
</adaptive-icon> </adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/> <background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/> <foreground android:drawable="@mipmap/ic_launcher_foreground" />
</adaptive-icon> </adaptive-icon>
\ No newline at end of file
<resources> <resources>
<string name="app_name">Tic Tac Toe</string> <string name="app_name">Tic Tac Toe</string>
<string name="action_settings">Settings</string>
<string name="player_1">Player 1:</string> <string name="player_1">Player 1:</string>
<string name="player_2">Player 2:</string> <string name="player_2">Player 2:</string>
<string name="unknown">Unknown</string> <string name="unknown">Unknown</string>
<string name="title_player_x">Player %1d</string> <string name="title_player_x">Player %1d</string>
<string name="button_ready">Ready!</string> <string name="button_ready">Ready!</string>
<string name="action_credits">Credits</string>
<string name="ok">OK</string>
<string name="title_credits">Credits</string>
<string name="message_credits">Icon made by Freepik from www.flaticon.com</string>
<string-array name="mark_options"> <string-array name="mark_options">
<item>X</item> <item>X</item>
<item>O</item> <item>O</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment