Commit 17758341 authored by Shaun Burch's avatar Shaun Burch 💻

Merge branch '1-add-icon' into 'master'

Resolve "Add Icon"

Closes #1

See merge request !4
parents b51b1457 769141d9
Pipeline #23064766 passed with stages
in 8 minutes and 18 seconds
# Tic Tac Toe
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)
* Have 3x3 grid on which the players can play
* Allow the players to take turns marking spaces on the 3x3 grid
* Recognize when a player has won and declare that player as victorious
* 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;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
......@@ -68,7 +69,12 @@ public class MainActivity extends AppCompatActivity implements AddPlayerDialog.A
int id = item.getItemId();
//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;
}
......
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<vector android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
......
......@@ -2,8 +2,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.tictactoe.MainActivity">
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
<item
android:id="@+id/action_credits"
android:title="@string/action_credits"
android:orderInCategory="100"
app:showAsAction="never"/>
</menu>
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<resources>
<string name="app_name">Tic Tac Toe</string>
<string name="action_settings">Settings</string>
<string name="player_1">Player 1:</string>
<string name="player_2">Player 2:</string>
<string name="unknown">Unknown</string>
<string name="title_player_x">Player %1d</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">
<item>X</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