@@ -7,6 +7,7 @@
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.media.Image;
import android.os.Bundle;
import android.os.Handler;
import android.os.SystemClock;
@@ -19,6 +20,9 @@
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import org.w3c.dom.Text;

import java.text.ParseException;
import java.util.ArrayList;
@@ -73,7 +77,7 @@ public class GameMain extends Activity implements View.OnClickListener, Runnable

//Storing the highscore values
private SharedPreferences sharedPreferences;
private String max = "";
private String max = "No High Score";


/*
@@ -85,12 +89,21 @@ protected void onCreate(Bundle savedInstanceState) {

//Making it full screen
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

super.onCreate(savedInstanceState);
setContentView(R.layout.game_layout);


//Font of game page
Button select = (Button)findViewById(R.id.btnNextTurn);

Typeface typface=Typeface.createFromAsset(getAssets(),"gameFont.ttf");

select.setTypeface(typface);



//Initializing the database and calling the parser.
getData = new GetData(this);
getData.parseData();
@@ -101,7 +114,6 @@ protected void onCreate(Bundle savedInstanceState) {
settingOnClickListeners();

//setting the font type..needs to be done after initialization
Typeface typface = Typeface.createFromAsset(getAssets(), "minecraftPE.ttf");
tvPlayerTurn.setTypeface(typface);
tvComputerTurn.setTypeface(typface);

@@ -110,13 +122,14 @@ protected void onCreate(Bundle savedInstanceState) {
chronometer.setBase(SystemClock.elapsedRealtime());
chronometer.start();

//working on shared pregerences to store the high score values
//working on shared preferences to store the high score values
sharedPreferences = getSharedPreferences("highscore", this.MODE_PRIVATE);
max = sharedPreferences.getString("hs", null);
if (max == null) {
max = "";
max = "No High Score";
}


//Let's start the thread. Cause this is important!
Thread myThread = new Thread(this);
myThread.start();
@@ -152,7 +165,7 @@ public void run() {

imageButton.setVisibility(View.INVISIBLE);
}
}, 2500);
}, 2000);
}
selectedButtons.clear();
}
@@ -191,6 +204,14 @@ public void makeVisible() {
Basically an algorithm for the computer to play its turn.
*/
public void computersTurn() {
runOnUiThread(new Runnable() {
@Override
public void run() {
nextTurn.setButtonColor(Color.GRAY);
nextTurn.setShadowColor(Color.BLACK);
nextTurn.setClickable(false);
}
});

if (numberOfVisibleButton() == 0) {
return;
@@ -247,14 +268,24 @@ public void run() {
});

//for maintaining the FPS of the game!
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
// try {
// Thread.sleep(3000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }

//changing the turn.
playerTurn = true;
runOnUiThread(new Runnable() {
@Override
public void run() {
nextTurn.setButtonColor(Color.GRAY);
nextTurn.setShadowColor(Color.BLACK);
nextTurn.setClickable(false);


}
});
}


@@ -322,21 +353,30 @@ public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
tvPlayerTurn.setTextColor(Color.GREEN);
tvComputerTurn.setTextColor(Color.RED);
tvPlayerTurn.setTextColor(Color.RED);
tvComputerTurn.setTextColor(Color.GRAY);
enableAllButton();
nextTurn.setButtonColor(getResources().getColor(R.color.fbutton_color_peter_river));
nextTurn.setShadowColor(getResources().getColor(R.color.fbutton_color_midnight_blue));
nextTurn.setButtonColor(getResources().getColor(R.color.fbutton_color_green));
nextTurn.setShadowColor(getResources().getColor(R.color.fbutton_color_greenShadow));
nextTurn.setClickable(true);
}
});
//maintaining the FPS.
// maintaining the FPS.
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}

} else {
runOnUiThread(new Runnable() {
@Override
public void run() {
nextTurn.setButtonColor(Color.GRAY);
nextTurn.setShadowColor(Color.BLACK);
nextTurn.setClickable(false);
}
});
disableAllButton();
try {
Thread.sleep(2500);
@@ -364,13 +404,23 @@ public void run() {
resultDialog.setCanceledOnTouchOutside(false);
TextView userScore = (TextView) resultDialog.findViewById(R.id.ustext);
TextView highScore = (TextView) resultDialog.findViewById(R.id.hstext);
ImageView resultImage = (ImageView) resultDialog.findViewById(R.id.resultImage);
TextView resultTitle = (TextView) resultDialog.findViewById(R.id.resultTitle);
ImageView resultGif = (ImageView) resultDialog.findViewById(R.id.resultGif);

Typeface typface=Typeface.createFromAsset(getAssets(),"gameFont.ttf");
userScore.setTypeface(typface);
highScore.setTypeface(typface);

if (playerTurn) {
userScore.setVisibility(View.INVISIBLE);
resultGif.setVisibility(View.VISIBLE);
resultTitle.setText("GAME OVER \n Computer won");
highScore.setText("HIGHSCORE: " + max);
resultImage.setImageResource(R.drawable.gameovercomputerwon);

resultTitle.setTypeface(typface);
} else {
resultTitle.setText("GAME OVER \n You won!");
resultGif.setVisibility(View.GONE);

try {
if (checkUserTime((String) chronometer.getText(), max)) {
@@ -380,18 +430,22 @@ public void run() {
edit.putString("hs", max);
edit.commit();
}

} catch (ParseException e) {
e.printStackTrace();
}
highScore.setText("HIGHSCORE: " + max);
userScore.setText("SCORE: " + chronometer.getText());

resultImage.setImageResource(R.drawable.gameoveryouwon);
}

Button exit = (Button) resultDialog.findViewById(R.id.btnExit);
Button playAgain = (Button) resultDialog.findViewById(R.id.btnPlayAgain);

playAgain.setTypeface(typface);
exit.setTypeface(typface);
resultTitle.setTypeface(typface);

exit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -421,25 +475,39 @@ public void onClick(View v) {
public boolean checkUserTime(String userTime, String hsTime) throws ParseException {

//if the user won for the first time. Kudos to him, that is his highscore!
if (hsTime == "") {
if (hsTime == "No High Score") {
return true;
}

String userSeconds = userTime.substring(3);
String userMinutes = userTime.substring(0, 2);

String hsSeconds = userTime.substring(3);
String hsMinutes = userTime.substring(0, 2);
String hsSeconds = hsTime.substring(3);
String hsMinutes = hsTime.substring(0, 2);

if (Integer.parseInt(hsMinutes) <= Integer.parseInt(userMinutes)) {
if (Integer.parseInt(hsMinutes) == Integer.parseInt(userMinutes)
&& Integer.parseInt(hsSeconds) < Integer.parseInt(userSeconds)) {
return true;
}
if (Integer.parseInt(hsMinutes) < Integer.parseInt(userMinutes)) {
return false;
} else if (Integer.parseInt(hsMinutes) > Integer.parseInt(userMinutes)) {
}
else if(Integer.parseInt(hsMinutes) > Integer.parseInt(userMinutes)){
return true;
}
else if(Integer.parseInt(hsMinutes) == Integer.parseInt(userMinutes)){
Log.e("codemaker12","amount of minutes is equal");

if (Integer.parseInt(hsSeconds) < Integer.parseInt(userSeconds)) {
Log.e("codemaker12","high score seconds are less");
return false;

}
else if(Integer.parseInt(hsSeconds) > Integer.parseInt(userSeconds)){
Log.e("codemaker12","user seconds are less");
return true;
}
else if(Integer.parseInt(hsSeconds) == Integer.parseInt(userSeconds)){
Log.e("codemaker12","amount of seconds is equal");
return true;
}
}
return true;
}

@@ -495,13 +563,13 @@ public void initialize() {
runOnUiThread(new Runnable() {
@Override
public void run() {
nextTurn.setButtonColor(getResources().getColor(R.color.fbutton_color_concrete));
nextTurn.setShadowColor(getResources().getColor(R.color.fbutton_color_asbestos));
nextTurn.setButtonColor(Color.GRAY);
nextTurn.setShadowColor(Color.BLACK);
nextTurn.setClickable(false);
}
});
tvPlayerTurn.setTextColor(Color.RED);
tvComputerTurn.setTextColor(Color.GREEN);
tvPlayerTurn.setTextColor(Color.GRAY);
tvComputerTurn.setTextColor(Color.BLUE);
break;
}

@@ -581,15 +649,29 @@ public void onClick(View v) {

//BEFORE WE START WITH ALL THE CRAZY-NESS
case R.id.btnNextTurn:
removeSelected();
disableAllButton();
playerTurn = false;
tvPlayerTurn.setTextColor(Color.RED);
tvComputerTurn.setTextColor(Color.GREEN);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();

if(selectedButtons.size() != 0) {
removeSelected();
disableAllButton();
playerTurn = false;
runOnUiThread(new Runnable() {
@Override
public void run() {
nextTurn.setButtonColor(Color.GRAY);
nextTurn.setShadowColor(Color.BLACK);
nextTurn.setClickable(false);
}
});
tvPlayerTurn.setTextColor(Color.GRAY);
tvComputerTurn.setTextColor(Color.RED);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
else{
Toast.makeText(this,"Please select a piece",Toast.LENGTH_SHORT).show();
}
break;

This file was deleted.

@@ -19,7 +19,7 @@ public int[] computerTurn(int a[]) {

int max = 0;

//finding the max value cause we will subtract from that!
//finding the max value cause we will subtract from that! FINDS THE INDEX OF THE HIGHEST NUMBER IN THE ARRAY
for (int i = 0; i < a.length; i++) {

if (a[i] > a[max]) {
@@ -30,15 +30,16 @@ public int[] computerTurn(int a[]) {
//Storing the binary in string form.
for (int i = 0; i < a.length; i++) {
bits[i] = String.format("%3s", Integer.toBinaryString(a[i])).replace(' ', '0');
//Log.e("Codemaker13",a[i] +" = "+ String.format("%3s", Integer.toBinaryString(a[i])).replace(' ', '0'));
}


//for addition of the bits.
int[] answerBit = new int[3];
for (int i = 2; i >= 0; i--) {
for (int i = 2; i >= 0; i--) {//iterates through 3 times
Log.d(LOG_TAG, "____________________");
for (int j = 0; j < bits.length; j++) {
Log.d(LOG_TAG, "[BIT VALUE]: " + Integer.parseInt(String.valueOf(bits[j].charAt(i))));
for (int j = 0; j < bits.length; j++) { //iterates 7 times
// Log.d(LOG_TAG, "[BIT VALUE]: " + Integer.parseInt(String.valueOf(bits[j].charAt(i))));
answerBit[i] += Integer.parseInt(String.valueOf(bits[j].charAt(i)));
}

@@ -60,7 +61,7 @@ public int[] computerTurn(int a[]) {
//This is trouble.. se we fix the max bit valued number!
if (answerBit[i] == 1) {

Log.d(LOG_TAG, "[FUCK THIS] " + Integer.parseInt(String.valueOf(bits[max].charAt(i))));
//Log.d(LOG_TAG, "[FUCK THIS] " + Integer.parseInt(String.valueOf(bits[max].charAt(i))));
if (Integer.parseInt(String.valueOf(bits[max].charAt(i))) == 1) {
changedBit[i] = 0;
} else {
@@ -74,10 +75,8 @@ public int[] computerTurn(int a[]) {
Log.d(LOG_TAG, "CHECKING: " + changedBit[0] + " " + changedBit[1] + " " + changedBit[2]);
//Manually calculating the sum difference like an idiot.
//Should have used a for loop. Oh well....
int sumDiff = (Integer.parseInt(String.valueOf(bits[max].charAt(0))) * 4
+ Integer.parseInt(String.valueOf(bits[max].charAt(1))) * 2
+ Integer.parseInt(String.valueOf(bits[max].charAt(2))))
- (changedBit[0] * 4 + changedBit[1] * 2 + changedBit[2]);
int sumDiff = (Integer.parseInt(String.valueOf(bits[max].charAt(0))) * 4 + Integer.parseInt(String.valueOf(bits[max].charAt(1))) * 2
+ Integer.parseInt(String.valueOf(bits[max].charAt(2)))) - (changedBit[0] * 4 + changedBit[1] * 2 + changedBit[2]);

//we need to make a move even if the user is winning.
if (sumDiff == 0) {
@@ -2,56 +2,52 @@

import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

import com.nightonke.boommenu.BoomMenuButton;
import com.nightonke.boommenu.Types.BoomType;
import com.nightonke.boommenu.Types.ButtonType;
import com.nightonke.boommenu.Types.PlaceType;
import com.nightonke.boommenu.Util;
import android.widget.RadioButton;
import android.widget.TextView;

import me.arnavgarg.nimgame.Database.GameDatabase;
import me.arnavgarg.nimgame.Game.GameMain;
import me.arnavgarg.nimgame.Game.GamePVP;
import me.arnavgarg.nimgame.R;
import me.arnavgarg.nimgame.settings.GameSettings;
import me.arnavgarg.nimgame.settings.HowToPlay;
import me.arnavgarg.nimgame.widgets.FButton;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{
public class MainActivity extends AppCompatActivity{

private static final String LOG_TAG = MainActivity.class.getSimpleName();

BoomMenuButton boomMenuButton;
Button buttonPlay, buttonPVP;
Context mContext;
GameDatabase gameDatabase;

@Override
protected void onCreate(Bundle savedInstanceState) {

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setContentView(R.layout.content_main);


//Font of front page

TextView nims=(TextView)findViewById(R.id.Nims);
Button play = (Button)findViewById(R.id.buttonPlay);
Button settings = (Button)findViewById(R.id.buttonSettings);

Typeface typface=Typeface.createFromAsset(getAssets(),"gameFont.ttf");
nims.setTypeface(typface);
play.setTypeface(typface);
settings.setTypeface(typface);


buttonPlay = (Button) findViewById(R.id.buttonPlay);
buttonPVP = (Button) findViewById(R.id.buttonPVP);
mContext = this;
boomMenuButton = (BoomMenuButton) findViewById(R.id.boom);
buttonPlay.setOnClickListener(this);
buttonPVP.setOnClickListener(this);
gameDatabase = new GameDatabase(this);

//Default settings for the game.
@@ -64,129 +60,13 @@ protected void onCreate(Bundle savedInstanceState) {
gameDatabase.close();
}


@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);

BoomMenuThead boomMenuThead = new BoomMenuThead();
boomMenuThead.run();
}

@Override
protected void onResume() {
super.onResume();
}

@Override
protected void onPause() {
super.onPause();
public void gotoGameActivity(View v){
Intent intent = new Intent(MainActivity.this, GameMain.class);
startActivity(intent);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}

@Override
public void onClick(View v) {

Intent intent = null;
switch(v.getId()) {

case R.id.buttonPlay:
intent = new Intent(MainActivity.this, GameMain.class);
startActivity(intent);
break;
case R.id.buttonPVP:
intent = new Intent(MainActivity.this, GamePVP.class);
startActivity(intent);
break;
}
}

private class BoomMenuThead implements Runnable {

@Override
public void run() {

try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}

Drawable[] drawables = new Drawable[2];
int[] drawablesResource = new int[]{
R.drawable.settings,
R.drawable.howtoplay,
};
for (int i = 0; i < 2; i++)
drawables[i] = ContextCompat.getDrawable(mContext, drawablesResource[i]);

int[][] colors = new int[2][2];
for (int i = 0; i < 2; i++) {
colors[i][1] = ContextCompat.getColor(mContext, R.color.colorPrimary);
colors[i][0] = Util.getInstance().getPressedColor(colors[i][1]);
}

String[] text = {
"Settings",
"How To Play",
""
};

boomMenuButton.init(
drawables, // The drawables of images of sub buttons. Can not be null.
text, // The texts of sub buttons, ok to be null.
colors, // The colors of sub buttons, including pressed-state and normal-state.
ButtonType.HAM, // The button type.
BoomType.PARABOLA, // The boom type.
PlaceType.HAM_3_1, // The place type.
null, // Ease type to move the sub buttons when showing.
null, // Ease type to scale the sub buttons when showing.
null, // Ease type to rotate the sub buttons when showing.
null, // Ease type to move the sub buttons when dismissing.
null, // Ease type to scale the sub buttons when dismissing.
null, // Ease type to rotate the sub buttons when dismissing.
null // Rotation degree.
);

boomMenuButton.setOnSubButtonClickListener(new BoomMenuButton.OnSubButtonClickListener() {
@Override
public void onClick(int buttonIndex) {

Intent intent = null;
switch (buttonIndex) {

case 0:
intent = new Intent(MainActivity.this, GameSettings.class);
startActivity(intent);
break;
case 1:
intent = new Intent(MainActivity.this, HowToPlay.class);
startActivity(intent);
break;
}
}
});
}

public void gotoSettingsActivity(View v){
Intent intent = new Intent(MainActivity.this, GameSettings.class);
startActivity(intent);
}
}

This file was deleted.

@@ -9,6 +9,7 @@
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;

@@ -37,16 +38,41 @@ public class GameSettings extends Activity implements RadioGroup.OnCheckedChange
protected void onCreate(Bundle savedInstanceState) {

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

super.onCreate(savedInstanceState);
setContentView(R.layout.game_settings);

//FOR THE FONT
TextView txtvw=(TextView)findViewById(R.id.gameSettings);
Typeface typface=Typeface.createFromAsset(getAssets(),"minecraftPE.ttf");
txtvw.setTypeface(typface);
TextView txtvwSettings=(TextView)findViewById(R.id.gameSettings);
TextView txtvwDifficulty=(TextView)findViewById(R.id.textView2);
TextView txtvwFirsTurn=(TextView)findViewById(R.id.textView3);
TextView txtvwnumberOfSticks=(TextView)findViewById(R.id.textView4);
RadioButton rdBtnEasy = (RadioButton) findViewById(R.id.rDiffEasy);
RadioButton rdBtnIntermediate = (RadioButton) findViewById(R.id.rDiffIntermediate);
RadioButton rdBtnDifficult = (RadioButton) findViewById(R.id.rDiffDifficult);
RadioButton rdBtnUser = (RadioButton) findViewById(R.id.rUser);
RadioButton rdBtnComputer = (RadioButton) findViewById(R.id.rComputer);
RadioButton rdBtn5 = (RadioButton) findViewById(R.id.rFive);
RadioButton rdBtn6 = (RadioButton) findViewById(R.id.rSix);
RadioButton rdBtn7 = (RadioButton) findViewById(R.id.rSeven);
Button done = (Button)findViewById(R.id.btnDone);

Typeface typface=Typeface.createFromAsset(getAssets(),"gameFont.ttf");
txtvwSettings.setTypeface(typface);
txtvwDifficulty.setTypeface(typface);
txtvwFirsTurn.setTypeface(typface);
txtvwnumberOfSticks.setTypeface(typface);
rdBtnEasy.setTypeface(typface);
rdBtnIntermediate.setTypeface(typface);
rdBtnDifficult.setTypeface(typface);
rdBtnUser.setTypeface(typface);
rdBtnComputer.setTypeface(typface);
rdBtn5.setTypeface(typface);
rdBtn6.setTypeface(typface);
rdBtn7.setTypeface(typface);
done.setTypeface(typface);



btnDone = (Button) findViewById(R.id.btnDone);

This file was deleted.

@@ -1,5 +1,6 @@
package me.arnavgarg.nimgame.widgets;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
@@ -20,7 +21,7 @@
/**
* Created by Arnav on 3/26/2016.
*/
public class FButton extends Button implements View.OnTouchListener {
public class FButton extends android.support.v7.widget.AppCompatButton implements View.OnTouchListener {

//Custom values
private boolean isShadowEnabled = true;
@@ -103,6 +104,7 @@ private void init() {
mCornerRadius = resources.getDimensionPixelSize(R.dimen.fbutton_default_conner_radius);
}

@SuppressLint("ResourceAsColor")
private void parseAttrs(Context context, AttributeSet attrs) {
//Load from custom attributes
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.FButton);

This file was deleted.

Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Deleted file not rendered
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN +60.8 KB (25000%) app/src/main/res/drawable/stick.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Deleted file not rendered
Deleted file not rendered

This file was deleted.

@@ -1,98 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:fbutton="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".Homescreen.MainActivity"
tools:showIn="@layout/activity_main"
android:background="#334B7A">
>

<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:gravity="center"-->
<!--android:paddingTop="30dp"-->
<!--android:textSize="50dp"-->
<!--android:text="NIMS"-->
<!--android:id="@+id/Nims"-->
<!--android:textColor="#ffffff"-->
<!--android:layout_alignParentTop="true"-->
<!--android:layout_centerHorizontal="true" />-->

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/nimslogo"
android:gravity="center"
android:paddingTop="30dp"
android:textSize="50dp"
android:text="NIMS"
android:id="@+id/Nims"
android:textColor="#ffffff"
<pl.droidsonroids.gif.GifImageButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
/>

android:background="@drawable/loop"
android:clickable="false">

</pl.droidsonroids.gif.GifImageButton>

<com.nightonke.boommenu.BoomMenuButton
android:id="@+id/boom"
android:layout_width="wrap_content"
<TextView
android:id="@+id/Nims"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_margin="20dp"
app:boom_inActionBar="false"
app:boom_button_color="@color/fbutton_color_orange"
app:boom_button_pressed_color="@color/colorPrimary"
/>
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_gravity="center"
android:layout_marginTop="38dp"
android:gravity="center_vertical|center_horizontal"
android:paddingTop="30dp"
android:text="NIM GAME"
android:textColor="#00A000"
android:textSize="50dp" />


<info.hoang8f.widget.FButton
android:id="@+id/buttonPlay"
android:layout_width="200dp"
android:layout_height="wrap_content"
fbutton:buttonColor="@color/fbutton_color_peter_river"
fbutton:shadowColor="@color/fbutton_color_midnight_blue"
fbutton:shadowEnabled="true"
fbutton:shadowHeight="8dp"
fbutton:cornerRadius="8dp"
android:text="Vs COMPUTER"
android:id="@+id/buttonPlay"
android:layout_alignWithParentIfMissing="false"
android:layout_marginTop="41dp"
android:layout_below="@+id/Nims"
android:layout_centerHorizontal="true" />
android:layout_below="@+id/gifImageButton"
android:layout_centerHorizontal="true"
android:layout_marginTop="33dp"
android:onClick="gotoGameActivity"
android:text="Play"
fbutton:buttonColor="#00A000"
fbutton:cornerRadius="8dp"
fbutton:shadowColor="#004000"
fbutton:shadowEnabled="true"
fbutton:shadowHeight="8dp" />

<info.hoang8f.widget.FButton
android:id="@+id/buttonSettings"
android:layout_width="200dp"
android:layout_height="wrap_content"
fbutton:buttonColor="@color/fbutton_color_peter_river"
fbutton:shadowColor="@color/fbutton_color_midnight_blue"
fbutton:shadowEnabled="true"
fbutton:shadowHeight="8dp"
fbutton:cornerRadius="8dp"
android:text="Vs Player"
android:id="@+id/buttonPVP"
android:layout_marginTop="32dp"
android:layout_below="@+id/buttonPlay"
android:layout_alignLeft="@+id/buttonPlay"
android:layout_alignStart="@+id/buttonPlay" />
android:layout_alignStart="@+id/buttonPlay"
android:layout_below="@+id/buttonPlay"
android:layout_marginTop="23dp"
android:onClick="gotoSettingsActivity"
android:text="Settings"
fbutton:buttonColor="#00A000"
fbutton:cornerRadius="8dp"
fbutton:shadowColor="#004000"
fbutton:shadowEnabled="true"
fbutton:shadowHeight="8dp" />

<pl.droidsonroids.gif.GifImageButton
android:id="@+id/gifImageButton"
android:layout_width="130dp"
android:layout_height="130dp"
android:layout_below="@+id/Nims"
android:layout_centerHorizontal="true"
android:layout_marginTop="54dp"
android:background="@drawable/splashhomepage"
android:layout_marginTop="36dp"
android:clickable="false"
android:layout_below="@+id/buttonPVP"
android:layout_centerHorizontal="true">
android:clickable="false">

</pl.droidsonroids.gif.GifImageButton>

Large diffs are not rendered by default.

@@ -1,14 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:fbutton="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:paddingTop="0dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".Homescreen.MainActivity">

<pl.droidsonroids.gif.GifImageButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/loop"
android:layout_marginTop="0dp"
android:clickable="false"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true">
</pl.droidsonroids.gif.GifImageButton>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fbutton="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:padding="20dp"
android:background="#900E33">
android:padding="20dp">

<TextView
<TextView
android:id="@+id/gameSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -19,145 +41,149 @@
android:textStyle="bold"
android:textColor="#ffffff"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp">

<TextView
android:id="@+id/textView2"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_vertical|center_horizontal"
android:text="Difficulty"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff"/>

<RadioGroup
android:id="@+id/rgDifficulty"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<RadioButton
android:id="@+id/rDiffEasy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Easy"
android:textColor="#ffffff"/>
android:orientation="vertical"
android:paddingTop="40dp"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"

<RadioButton
android:id="@+id/rDiffIntermediate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Intermediate"
android:textColor="#ffffff"/>
android:textColor="#ffffff">

<RadioButton
android:id="@+id/rDiffDifficult"
<TextView
android:id="@+id/textView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_vertical|center_horizontal"
android:text="Number of Girs"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />

<RadioGroup
android:id="@+id/rgSticks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Difficult"
android:textColor="#ffffff"/>

</RadioGroup>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp">

<TextView
android:id="@+id/textView3"
android:orientation="vertical">

<RadioButton
android:id="@+id/rFive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:textColor="#ffffff"/>


<RadioButton
android:id="@+id/rSix"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6"
android:textColor="#ffffff"/>

<RadioButton
android:id="@+id/rSeven"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="7"
android:textColor="#ffffff"/>

</RadioGroup>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_vertical|center_horizontal"
android:text="First Turn"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceMedium" />

<RadioGroup
android:id="@+id/rgFirstTurn"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<RadioButton
android:id="@+id/rUser"
android:layout_width="wrap_content"
android:orientation="vertical"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="30dp">

<TextView
android:id="@+id/textView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="User"
android:textColor="#ffffff"/>

<RadioButton
android:id="@+id/rComputer"
android:layout_gravity="center"
android:gravity="center_vertical|center_horizontal"
android:text="First Turn"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff" />

<RadioGroup
android:id="@+id/rgFirstTurn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Computer"
android:textColor="#ffffff"/>
android:layout_height="wrap_content">

<RadioButton
android:id="@+id/rUser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="User"
android:textColor="#ffffff" />

</RadioGroup>
</LinearLayout>
<RadioButton
android:id="@+id/rComputer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Computer"
android:textColor="#ffffff" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp"
android:textColor="#ffffff">

<TextView
android:id="@+id/textView4"
</RadioGroup>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_vertical|center_horizontal"
android:text="Number of Sticks"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceMedium" />

<RadioGroup
android:id="@+id/rgSticks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/rFive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:textColor="#ffffff"/>


<RadioButton
android:id="@+id/rSix"
android:layout_width="wrap_content"
android:orientation="vertical"
android:paddingTop="30dp"
android:paddingBottom="30dp"
android:paddingLeft="10dp"
android:paddingRight="10dp">

<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="6"
android:textColor="#ffffff"/>

<RadioButton
android:id="@+id/rSeven"
android:layout_gravity="center"
android:gravity="center_vertical|center_horizontal"
android:text="Difficulty"
android:textColor="#ffffff"
android:textSize="18sp" />

<RadioGroup
android:id="@+id/rgDifficulty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="7"
android:textColor="#ffffff"/>

</RadioGroup>
</LinearLayout>

<info.hoang8f.widget.FButton
android:layout_height="wrap_content">

<RadioButton
android:id="@+id/rDiffEasy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Easy"
android:textColor="#ffffff"/>

<RadioButton
android:id="@+id/rDiffIntermediate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Intermediate"
android:textColor="#ffffff"/>

<RadioButton
android:id="@+id/rDiffDifficult"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Difficult"
android:textColor="#ffffff"/>

</RadioGroup>
</LinearLayout>

<info.hoang8f.widget.FButton
android:id="@+id/btnDone"
android:layout_width="150dp"
android:layout_height="wrap_content"
@@ -166,8 +192,10 @@
android:text="Done"
fbutton:shadowHeight="10dp"
fbutton:cornerRadius="8dp"
app:buttonColor="@color/fbutton_color_pomegranate"
android:shadowColor="@color/fbutton_color_peter_river"
app:buttonColor="#FF0000"
android:shadowColor="#400000"
fbutton:shadowEnabled="true" />

</LinearLayout>
</LinearLayout>

</RelativeLayout>

This file was deleted.

@@ -1,47 +1,64 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:fbutton="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:padding="10dp"
>
android:padding="10dp">

<ImageView
android:layout_width="match_parent"
android:layout_height="64dp"
android:contentDescription="@string/app_name"
android:scaleType="center"
android:padding="30dp"
android:src="@drawable/gameover"
android:id="@+id/resultImage"/>
<TextView
android:id="@+id/resultTitle"
android:layout_width="349dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:gravity="center_vertical|center_horizontal"
android:padding="10dp"
android:text="GAME OVER"
android:textColor="#00A000"
android:textSize="40sp" />

<pl.droidsonroids.gif.GifImageButton
android:id="@+id/resultGif"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/Nims"
android:layout_centerHorizontal="true"
android:gravity="center_vertical|center_horizontal"
android:layout_gravity="center"
android:layout_marginTop="54dp"
android:background="@drawable/lose"
android:clickable="false">

</pl.droidsonroids.gif.GifImageButton>

<TextView
android:id="@+id/hstext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:textColor="#ffffff"
android:text="HIGHSCORE:"
/>
android:text="HIGHSCORE:" />

<TextView
android:id="@+id/ustext"
android:padding="10dp"
android:textColor="#ffffff"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SCORE: "
/>
android:text="SCORE: " />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
android:orientation="horizontal">

<me.arnavgarg.nimgame.widgets.FButton
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
fbutton:buttonColor="#00A000"
fbutton:shadowColor="#004000"
android:id="@+id/btnExit"
android:text="EXIT"
android:layout_margin="5dp"/>
@@ -50,6 +67,8 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
fbutton:buttonColor="#00A000"
fbutton:shadowColor="#004000"
android:id="@+id/btnPlayAgain"
android:text="PLAY AGAIN"
android:layout_margin="5dp"/>

This file was deleted.

This file was deleted.

@@ -27,5 +27,9 @@
<color name="fbutton_color_silver">#bdc3c7</color>
<color name="fbutton_color_concrete">#95a5a6</color>
<color name="fbutton_color_asbestos">#7f8c8d</color>
<color name="fbutton_color_green">#00A000</color>
<color name="fbutton_color_greenShadow">#004000</color>

<color name="fbutton_color_transparent">@android:color/transparent</color>

</resources>
@@ -13,10 +13,6 @@
<item name="windowNoTitle">true</item>
</style>

<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/background_splash</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:2.3.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -1,6 +1,6 @@
#Tue Apr 19 13:10:02 CDT 2016
#Fri Dec 01 03:50:25 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip