Skip to content

Commit

Permalink
Merge branch 'hotfix/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
kytta committed Dec 19, 2017
2 parents 110af4b + 0be3ad7 commit f8e3bb8
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
minSdkVersion 21
//noinspection OldTargetApi
targetSdkVersion 26
versionCode 40
versionName "1.0.1"
versionCode 44
versionName "1.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".MainActivity"
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -36,10 +37,10 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<activity android:name=".ResultActivity"
android:label="@string/result_name"
<activity
android:name=".ResultActivity"
android:parentActivityName=".GameActivity"
android:theme="@style/AppTheme">
android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".GameActivity" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
Expand All @@ -16,20 +17,21 @@ public class GameActivity extends AppCompatActivity {

private TextView operationField;

private int correctAnswer, gamemode;
private int correctAnswer;
private int gamemode;

private int round = 0;
private int correctRounds = 0;

private final int MAX_ROUNDS = 10;

private final int TIME = 60 * 1000;

private Date endTime, startTime;
private Date startTime;
private Date endTime;


private Timer timer;

@SuppressLint("SetTextI18n") // не обращать внимания
@Override
protected void onCreate(Bundle savedInstanceState) {
// стартовая инициализация
Expand Down Expand Up @@ -97,7 +99,7 @@ protected void onCreate(Bundle savedInstanceState) {
&& textviews[toBeFilled].getText().length() <= 4
|| textviews[toBeFilled].getText().length() <= 3) {
textviews[toBeFilled].setText(
textviews[toBeFilled].getText() + String.valueOf(digit));
String.format("%s%s", textviews[toBeFilled].getText(), String.valueOf(digit)));
}
});
}
Expand All @@ -115,7 +117,7 @@ protected void onCreate(Bundle savedInstanceState) {
// метод меняет положительное число на отрицательноеи наоборот
if (textviews[toBeFilled].getText().length() != 0) { // если поле не пусто
if (textviews[toBeFilled].getText().charAt(0) != 45) { // если первый НЕ минус
textviews[toBeFilled].setText("" + getText(R.string.operation_minus) + textviews[toBeFilled].getText());
textviews[toBeFilled].setText(String.format("%s%s", getText(R.string.operation_minus), textviews[toBeFilled].getText()));
} else {
textviews[toBeFilled].setText(
textviews[toBeFilled].getText()
Expand Down Expand Up @@ -208,7 +210,6 @@ private void initiate(TextView[] textviews, int toBeFilled) {
}
}

@SuppressLint("DefaultLocale")
private void endGame(Date check) {
timer.cancel();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_info);

TextView version = findViewById(R.id.textView0);
version.setText(String.format("%s %s", getString(R.string.version), getString(R.string.version_code)));
version.setText(String.format("%s %s", getString(R.string.version), BuildConfig.VERSION_NAME));

findViewById(R.id.backButton).setOnClickListener(v -> finish());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import android.annotation.SuppressLint;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.WindowManager;
import android.widget.TextView;

Expand Down Expand Up @@ -48,8 +48,8 @@ protected void onCreate(Bundle savedInstanceState) {
});

findViewById(R.id.buttonBackToMenu).setOnClickListener(v -> {
Intent menuIntent = new Intent(ResultActivity.this, MainActivity.class);
startActivity(menuIntent);
// Intent menuIntent = new Intent(ResultActivity.this, MainActivity.class);
// startActivity(menuIntent);
finish();
});

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<string name="check">Check</string>

<string name="version">version</string>
<string name="version_code" translatable="false">0.2</string>

<string name="brought_to_you">brought to you by</string>
<string name="team_name" translatable="false">kawan-kawan</string>
Expand Down

0 comments on commit f8e3bb8

Please sign in to comment.