Skip to content

Commit

Permalink
Merge pull request #37 from Neomer/refactoring/#31-state-pattern
Browse files Browse the repository at this point in the history
#31-state-pattern !Заработали состояния
  • Loading branch information
Neomer committed Apr 20, 2019
2 parents 5e0c887 + 049268f commit 598097a
Show file tree
Hide file tree
Showing 54 changed files with 2,042 additions and 537 deletions.
29 changes: 0 additions & 29 deletions .idea/codeStyles/Project.xml

This file was deleted.

7 changes: 7 additions & 0 deletions .idea/dictionaries/Kir.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation "com.android.support:customtabs:28.0.0"
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'

implementation 'com.google.android.gms:play-services-ads:17.2.0'
implementation 'com.yandex.android:mobmetricalib:3.5.3'
implementation 'com.android.installreferrer:installreferrer:1.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'android.arch.lifecycle:extensions:1.1.1'

// ButterKnife
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
15 changes: 9 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="my.neomer.sixtyseconds">

<uses-permission android:name="android.permission.INTERNET" />
Expand All @@ -12,19 +13,21 @@
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:ignore="UnusedAttribute">
<activity android:name=".PrivacyPolicyActivity"></activity>
<activity android:name=".GameModeSelectionActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-5078878060587689~8320307873" />

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package my.neomer.sixtyseconds;

import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import my.neomer.sixtyseconds.gamemodes.IGameMode;
import my.neomer.sixtyseconds.gamemodes.SinglePlayerGameMode;
import my.neomer.sixtyseconds.gamemodes.SinglePlayerWithRatesGameMode;
import my.neomer.sixtyseconds.helpers.ApplicationResources;

public class GameModeSelectionActivity extends AppCompatActivity {

public static final String GAMEMODE_TAG = "GameModeTag";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_game_mode_selection);

ApplicationResources.getInstance().setDebug(0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));

ApplicationResources.getInstance().loadSounds(this, null);
ButterKnife.bind(this);
}

@OnClick(R.id.btnSinglePlayerWithRatesGameMode)
void SinglePlayerWithRatesGameMode() {
ApplicationResources.getInstance().playClickSound();
runGame(new SinglePlayerWithRatesGameMode());
}

@OnClick(R.id.btnSinglePlayerGameMode)
void SinglePlayerGameMode() {
ApplicationResources.getInstance().playClickSound();
runGame(new SinglePlayerGameMode());
}

private void runGame(IGameMode gameMode) {
Intent intent = new Intent(this, MainActivity.class);
intent.putExtra(GAMEMODE_TAG, gameMode);
startActivity(intent);
}

}
Loading

0 comments on commit 598097a

Please sign in to comment.