From 7588711df7746836f495d514164cb805f02f2e17 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 15 Feb 2024 18:21:57 +0100 Subject: [PATCH 1/7] Remove old build.gradle --- app/build.gradle.orig | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 app/build.gradle.orig diff --git a/app/build.gradle.orig b/app/build.gradle.orig deleted file mode 100644 index 57a1857..0000000 --- a/app/build.gradle.orig +++ /dev/null @@ -1,38 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 26 - defaultConfig { - applicationId "ru.karamoff.kawan_kawan.arithmaster" - minSdkVersion 21 - //noinspection OldTargetApi - targetSdkVersion 26 -<<<<<<< HEAD - versionCode 21 -======= - versionCode 25 ->>>>>>> feature/classic-mode - versionName "0.1" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled true - shrinkResources true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - compileOptions { - targetCompatibility 1.8 - sourceCompatibility 1.8 - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.android.support:appcompat-v7:26.1.0' - implementation 'com.android.support.constraint:constraint-layout:1.0.2' - implementation 'com.android.support:support-v4:26.1.0' - implementation 'com.android.support:design:26.1.0' - testImplementation 'junit:junit:4.12' -} From 21fcfff9e9e3400c1e9609a996fe7c8155c52665 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 15 Feb 2024 18:22:22 +0100 Subject: [PATCH 2/7] Remove tests --- app/build.gradle | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 025eac3..68e4d2a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,6 @@ android { targetSdk 34 versionCode 46 versionName "1.1.0" - - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } buildTypes { @@ -43,5 +41,4 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'com.google.android.material:material:1.11.0' - testImplementation 'junit:junit:4.13.2' } From e9ddab9061f144aede1b66118f555ddb70f947a6 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 15 Feb 2024 18:22:43 +0100 Subject: [PATCH 3/7] Remove unneeded AndroidX libraries --- app/build.gradle | 4 +--- gradle.properties | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 68e4d2a..e08fa86 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,7 +10,7 @@ android { applicationId "ru.karamoff.kawan_kawan.arithmaster" minSdk 21 targetSdk 34 - versionCode 46 + versionCode 47 versionName "1.1.0" } @@ -37,8 +37,6 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'com.google.android.material:material:1.11.0' } diff --git a/gradle.properties b/gradle.properties index 8619da9..92538cb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,4 +25,3 @@ android.useAndroidX=true # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -android.enableJetifier=true From bbd2374a1cb2f43617081b7a1a447b28af81f83e Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 15 Feb 2024 18:31:18 +0100 Subject: [PATCH 4/7] Remove Material library --- app/build.gradle | 3 +-- .../karamoff/kawan_kawan/arithmaster/GameActivity.java | 9 ++++----- .../karamoff/kawan_kawan/arithmaster/InfoActivity.java | 5 ++--- .../karamoff/kawan_kawan/arithmaster/MainActivity.java | 5 ++--- .../karamoff/kawan_kawan/arithmaster/ResultActivity.java | 5 ++--- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e08fa86..3346a8f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,7 +10,7 @@ android { applicationId "ru.karamoff.kawan_kawan.arithmaster" minSdk 21 targetSdk 34 - versionCode 47 + versionCode 48 versionName "1.1.0" } @@ -38,5 +38,4 @@ android { dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'com.google.android.material:material:1.11.0' } diff --git a/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/GameActivity.java b/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/GameActivity.java index 170a824..3eac5b7 100644 --- a/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/GameActivity.java +++ b/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/GameActivity.java @@ -1,21 +1,20 @@ package ru.karamoff.kawan_kawan.arithmaster; import android.annotation.SuppressLint; +import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.WindowManager; import android.widget.Button; import android.widget.TextView; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.content.res.AppCompatResources; import androidx.constraintlayout.widget.ConstraintLayout; import java.util.Date; import java.util.Timer; import java.util.TimerTask; -public class GameActivity extends AppCompatActivity { +public class GameActivity extends Activity { private TextView operationField; @@ -63,12 +62,12 @@ protected void onCreate(Bundle savedInstanceState) { // меняет окно в зависимости от режима игры switch (gamemode) { case 0: // классика - parent.setBackground(AppCompatResources.getDrawable(this, R.drawable.gradient_classic)); // установка фона + parent.setBackground(getResources().getDrawable(R.drawable.gradient_classic)); // установка фона modeTitle.setText(getText(R.string.classic_mode_name)); // установка заголовка // установка номера заполняемого поля - в данном случае последнее toBeFilled = 2; - textviews[toBeFilled].setBackground(AppCompatResources.getDrawable(this, R.drawable.empty_field_classic)); + textviews[toBeFilled].setBackground(getResources().getDrawable(R.drawable.empty_field_classic)); break; default: // если не передан один из стандартных режимов - скорее всего ошибка toBeFilled = 2; diff --git a/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/InfoActivity.java b/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/InfoActivity.java index 1b8d0a0..204f237 100644 --- a/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/InfoActivity.java +++ b/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/InfoActivity.java @@ -1,12 +1,11 @@ package ru.karamoff.kawan_kawan.arithmaster; +import android.app.Activity; import android.os.Bundle; import android.view.WindowManager; import android.widget.TextView; -import androidx.appcompat.app.AppCompatActivity; - -public class InfoActivity extends AppCompatActivity { +public class InfoActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/MainActivity.java b/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/MainActivity.java index 74b256a..1672ac5 100644 --- a/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/MainActivity.java +++ b/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/MainActivity.java @@ -1,12 +1,11 @@ package ru.karamoff.kawan_kawan.arithmaster; +import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.WindowManager; -import androidx.appcompat.app.AppCompatActivity; - -public class MainActivity extends AppCompatActivity { +public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/ResultActivity.java b/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/ResultActivity.java index 722b373..ec93a39 100644 --- a/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/ResultActivity.java +++ b/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/ResultActivity.java @@ -1,16 +1,15 @@ package ru.karamoff.kawan_kawan.arithmaster; import android.annotation.SuppressLint; +import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.WindowManager; import android.widget.TextView; -import androidx.appcompat.app.AppCompatActivity; - import java.util.Date; -public class ResultActivity extends AppCompatActivity { +public class ResultActivity extends Activity { @SuppressLint("DefaultLocale") @Override From a05b908c65c43b684ffc008910a54e17c7a5c957 Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Thu, 15 Feb 2024 19:21:45 +0100 Subject: [PATCH 5/7] Migrate from ConstraintLayout to other layouts --- app/build.gradle | 3 +- .../kawan_kawan/arithmaster/GameActivity.java | 5 +- app/src/main/res/layout/activity_game.xml | 395 +++++++++--------- app/src/main/res/layout/activity_info.xml | 66 ++- app/src/main/res/layout/activity_main.xml | 100 +++-- app/src/main/res/layout/activity_result.xml | 62 +-- app/src/main/res/values/styles.xml | 4 +- 7 files changed, 299 insertions(+), 336 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3346a8f..9d15c12 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,7 +10,7 @@ android { applicationId "ru.karamoff.kawan_kawan.arithmaster" minSdk 21 targetSdk 34 - versionCode 48 + versionCode 49 versionName "1.1.0" } @@ -37,5 +37,4 @@ android { } dependencies { - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' } diff --git a/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/GameActivity.java b/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/GameActivity.java index 3eac5b7..b19426f 100644 --- a/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/GameActivity.java +++ b/app/src/main/java/ru/karamoff/kawan_kawan/arithmaster/GameActivity.java @@ -6,10 +6,9 @@ import android.os.Bundle; import android.view.WindowManager; import android.widget.Button; +import android.widget.LinearLayout; import android.widget.TextView; -import androidx.constraintlayout.widget.ConstraintLayout; - import java.util.Date; import java.util.Timer; import java.util.TimerTask; @@ -42,7 +41,7 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_game); // получение объектов для изменения в дальнейшем - ConstraintLayout parent = findViewById(R.id.parentLayout); // "родитель" разметки + LinearLayout parent = findViewById(R.id.parentLayout); // "родитель" разметки TextView modeTitle = findViewById(R.id.modeTitle); // заголовок окна operationField = findViewById(R.id.operation); // операция diff --git a/app/src/main/res/layout/activity_game.xml b/app/src/main/res/layout/activity_game.xml index 3c902f3..55dbfdb 100644 --- a/app/src/main/res/layout/activity_game.xml +++ b/app/src/main/res/layout/activity_game.xml @@ -1,23 +1,21 @@ - + android:orientation="horizontal"> + android:src="@drawable/ic_arrow_back" /> + android:src="@drawable/ic_pause" + android:visibility="invisible" /> - - - - - - - - - - - - - - - - - - + -