From 5ed3c8bda3dee9971000398ba3caac34326f52a2 Mon Sep 17 00:00:00 2001 From: ericmaxwell2003 Date: Thu, 19 Jan 2017 14:38:00 -0800 Subject: [PATCH 1/5] View complete --- app/src/main/AndroidManifest.xml | 3 +- .../controller/TicTacToeActivity.java | 17 ++++ app/src/main/res/layout/tictactoe.xml | 93 ++++++++++++++++++- app/src/main/res/values/dimens.xml | 2 +- app/src/main/res/values/strings.xml | 1 + app/src/main/res/values/styles.xml | 6 ++ 6 files changed, 115 insertions(+), 7 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6ae66cc..0c44595 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -8,10 +8,9 @@ android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> - + - diff --git a/app/src/main/java/com/acme/tictactoe/controller/TicTacToeActivity.java b/app/src/main/java/com/acme/tictactoe/controller/TicTacToeActivity.java index 84ba558..53f7988 100644 --- a/app/src/main/java/com/acme/tictactoe/controller/TicTacToeActivity.java +++ b/app/src/main/java/com/acme/tictactoe/controller/TicTacToeActivity.java @@ -2,14 +2,31 @@ import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.util.Log; +import android.view.View; import com.acme.tictactoe.R; +import com.acme.tictactoe.model.Board; public class TicTacToeActivity extends AppCompatActivity { + private static String TAG = TicTacToeActivity.class.getName(); + + private Board gameBoard; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tictactoe); + gameBoard = new Board(); + } + + public void onCellClicked(View button) { + + String tag = button.getTag().toString(); + int row = Integer.valueOf(tag.substring(0,1)); + int col = Integer.valueOf(tag.substring(1,2)); + Log.i(TAG, "Click Row: [" + row + "," + col + "]"); + } } diff --git a/app/src/main/res/layout/tictactoe.xml b/app/src/main/res/layout/tictactoe.xml index d97f0f8..03aaee1 100644 --- a/app/src/main/res/layout/tictactoe.xml +++ b/app/src/main/res/layout/tictactoe.xml @@ -1,17 +1,102 @@ - - - + android:columnCount="3" android:rowCount="3"> + +