From 64c41201b87b06a7a8d53ba4e5a42b6a13e4b55c Mon Sep 17 00:00:00 2001 From: IsaykinEugene Date: Wed, 19 Mar 2025 10:44:22 +0300 Subject: [PATCH] init --- AndroidStudioProjects/taxi/.gitignore | 15 ++ AndroidStudioProjects/taxi/.idea/.gitignore | 3 + AndroidStudioProjects/taxi/.idea/compiler.xml | 6 + .../taxi/.idea/deploymentTargetSelector.xml | 10 + AndroidStudioProjects/taxi/.idea/gradle.xml | 19 ++ .../taxi/.idea/migrations.xml | 10 + AndroidStudioProjects/taxi/.idea/misc.xml | 10 + .../taxi/.idea/runConfigurations.xml | 17 ++ AndroidStudioProjects/taxi/.idea/vcs.xml | 4 + AndroidStudioProjects/taxi/app/.gitignore | 1 + .../taxi/app/build.gradle.kts | 43 ++++ .../taxi/app/proguard-rules.pro | 21 ++ .../example/taxi/ExampleInstrumentedTest.java | 26 +++ .../taxi/app/src/main/AndroidManifest.xml | 34 ++++ .../java/com/example/taxi/MainActivity.java | 56 ++++++ .../java/com/example/taxi/SecondActivity.java | 53 +++++ .../java/com/example/taxi/ThirdActivity.java | 35 ++++ .../res/drawable/ic_launcher_background.xml | 170 ++++++++++++++++ .../res/drawable/ic_launcher_foreground.xml | 30 +++ .../app/src/main/res/layout/activity_main.xml | 32 +++ .../src/main/res/layout/activity_second.xml | 39 ++++ .../src/main/res/layout/activity_third.xml | 26 +++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 6 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 6 + .../src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 1404 bytes .../res/mipmap-hdpi/ic_launcher_round.webp | Bin 0 -> 2898 bytes .../src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 0 -> 982 bytes .../res/mipmap-mdpi/ic_launcher_round.webp | Bin 0 -> 1772 bytes .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin 0 -> 1900 bytes .../res/mipmap-xhdpi/ic_launcher_round.webp | Bin 0 -> 3918 bytes .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 0 -> 2884 bytes .../res/mipmap-xxhdpi/ic_launcher_round.webp | Bin 0 -> 5914 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 0 -> 3844 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin 0 -> 7778 bytes .../app/src/main/res/values-night/themes.xml | 7 + .../taxi/app/src/main/res/values/colors.xml | 5 + .../taxi/app/src/main/res/values/strings.xml | 3 + .../taxi/app/src/main/res/values/themes.xml | 9 + .../app/src/main/res/xml/backup_rules.xml | 13 ++ .../main/res/xml/data_extraction_rules.xml | 19 ++ .../com/example/taxi/ExampleUnitTest.java | 17 ++ AndroidStudioProjects/taxi/build.gradle.kts | 4 + AndroidStudioProjects/taxi/gradle.properties | 21 ++ .../taxi/gradle/libs.versions.toml | 22 +++ .../taxi/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + AndroidStudioProjects/taxi/gradlew | 185 ++++++++++++++++++ AndroidStudioProjects/taxi/gradlew.bat | 89 +++++++++ .../taxi/settings.gradle.kts | 23 +++ 49 files changed, 1095 insertions(+) create mode 100644 AndroidStudioProjects/taxi/.gitignore create mode 100644 AndroidStudioProjects/taxi/.idea/.gitignore create mode 100644 AndroidStudioProjects/taxi/.idea/compiler.xml create mode 100644 AndroidStudioProjects/taxi/.idea/deploymentTargetSelector.xml create mode 100644 AndroidStudioProjects/taxi/.idea/gradle.xml create mode 100644 AndroidStudioProjects/taxi/.idea/migrations.xml create mode 100644 AndroidStudioProjects/taxi/.idea/misc.xml create mode 100644 AndroidStudioProjects/taxi/.idea/runConfigurations.xml create mode 100644 AndroidStudioProjects/taxi/.idea/vcs.xml create mode 100644 AndroidStudioProjects/taxi/app/.gitignore create mode 100644 AndroidStudioProjects/taxi/app/build.gradle.kts create mode 100644 AndroidStudioProjects/taxi/app/proguard-rules.pro create mode 100644 AndroidStudioProjects/taxi/app/src/androidTest/java/com/example/taxi/ExampleInstrumentedTest.java create mode 100644 AndroidStudioProjects/taxi/app/src/main/AndroidManifest.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/java/com/example/taxi/MainActivity.java create mode 100644 AndroidStudioProjects/taxi/app/src/main/java/com/example/taxi/SecondActivity.java create mode 100644 AndroidStudioProjects/taxi/app/src/main/java/com/example/taxi/ThirdActivity.java create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/drawable/ic_launcher_foreground.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/layout/activity_main.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/layout/activity_second.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/layout/activity_third.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/values-night/themes.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/values/colors.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/values/strings.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/values/themes.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/xml/backup_rules.xml create mode 100644 AndroidStudioProjects/taxi/app/src/main/res/xml/data_extraction_rules.xml create mode 100644 AndroidStudioProjects/taxi/app/src/test/java/com/example/taxi/ExampleUnitTest.java create mode 100644 AndroidStudioProjects/taxi/build.gradle.kts create mode 100644 AndroidStudioProjects/taxi/gradle.properties create mode 100644 AndroidStudioProjects/taxi/gradle/libs.versions.toml create mode 100644 AndroidStudioProjects/taxi/gradle/wrapper/gradle-wrapper.jar create mode 100644 AndroidStudioProjects/taxi/gradle/wrapper/gradle-wrapper.properties create mode 100644 AndroidStudioProjects/taxi/gradlew create mode 100644 AndroidStudioProjects/taxi/gradlew.bat create mode 100644 AndroidStudioProjects/taxi/settings.gradle.kts diff --git a/AndroidStudioProjects/taxi/.gitignore b/AndroidStudioProjects/taxi/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/taxi/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/AndroidStudioProjects/taxi/.idea/.gitignore b/AndroidStudioProjects/taxi/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/taxi/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/taxi/.idea/compiler.xml b/AndroidStudioProjects/taxi/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/AndroidStudioProjects/taxi/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/.idea/deploymentTargetSelector.xml b/AndroidStudioProjects/taxi/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/AndroidStudioProjects/taxi/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/.idea/gradle.xml b/AndroidStudioProjects/taxi/.idea/gradle.xml new file mode 100644 index 0000000..ae733f1 --- /dev/null +++ b/AndroidStudioProjects/taxi/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/.idea/migrations.xml b/AndroidStudioProjects/taxi/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/AndroidStudioProjects/taxi/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/.idea/misc.xml b/AndroidStudioProjects/taxi/.idea/misc.xml new file mode 100644 index 0000000..74dd639 --- /dev/null +++ b/AndroidStudioProjects/taxi/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/.idea/runConfigurations.xml b/AndroidStudioProjects/taxi/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/AndroidStudioProjects/taxi/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/.idea/vcs.xml b/AndroidStudioProjects/taxi/.idea/vcs.xml new file mode 100644 index 0000000..d843f34 --- /dev/null +++ b/AndroidStudioProjects/taxi/.idea/vcs.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/app/.gitignore b/AndroidStudioProjects/taxi/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidStudioProjects/taxi/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/app/build.gradle.kts b/AndroidStudioProjects/taxi/app/build.gradle.kts new file mode 100644 index 0000000..abc3ea2 --- /dev/null +++ b/AndroidStudioProjects/taxi/app/build.gradle.kts @@ -0,0 +1,43 @@ +plugins { + alias(libs.plugins.android.application) +} + +android { + namespace = "com.example.taxi" + compileSdk = 35 + + defaultConfig { + applicationId = "com.example.taxi" + minSdk = 24 + targetSdk = 35 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } +} + +dependencies { + + implementation(libs.appcompat) + implementation(libs.material) + implementation(libs.activity) + implementation(libs.constraintlayout) + testImplementation(libs.junit) + androidTestImplementation(libs.ext.junit) + androidTestImplementation(libs.espresso.core) +} \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/app/proguard-rules.pro b/AndroidStudioProjects/taxi/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/AndroidStudioProjects/taxi/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/app/src/androidTest/java/com/example/taxi/ExampleInstrumentedTest.java b/AndroidStudioProjects/taxi/app/src/androidTest/java/com/example/taxi/ExampleInstrumentedTest.java new file mode 100644 index 0000000..5ac8cc8 --- /dev/null +++ b/AndroidStudioProjects/taxi/app/src/androidTest/java/com/example/taxi/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.taxi; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.taxi", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/taxi/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..33b1d2c --- /dev/null +++ b/AndroidStudioProjects/taxi/app/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/app/src/main/java/com/example/taxi/MainActivity.java b/AndroidStudioProjects/taxi/app/src/main/java/com/example/taxi/MainActivity.java new file mode 100644 index 0000000..b4261ae --- /dev/null +++ b/AndroidStudioProjects/taxi/app/src/main/java/com/example/taxi/MainActivity.java @@ -0,0 +1,56 @@ +package com.example.taxi; + +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import androidx.appcompat.app.AppCompatActivity; + + +public class MainActivity extends AppCompatActivity { + + private EditText etPhone, etFirstName, etLastName; + private Button btnRegistration; + private SharedPreferences sharedPreferences; + private static final String PREFS_NAME = "TaxiAppPrefs"; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + etPhone = findViewById(R.id.etPhone); + etFirstName = findViewById(R.id.etFirstName); + etLastName = findViewById(R.id.etLastName); + btnRegistration = findViewById(R.id.btnRegistration); + + sharedPreferences = getSharedPreferences(PREFS_NAME, MODE_PRIVATE); + + if (sharedPreferences.contains("phone")) { + btnRegistration.setText("Log in"); + etPhone.setText(sharedPreferences.getString("phone", "")); + etFirstName.setText(sharedPreferences.getString("firstName", "")); + etLastName.setText(sharedPreferences.getString("lastName", "")); + } + + btnRegistration.setOnClickListener(v -> { + String phone = etPhone.getText().toString(); + String firstName = etFirstName.getText().toString(); + String lastName = etLastName.getText().toString(); + + SharedPreferences.Editor editor = sharedPreferences.edit(); + editor.putString("phone", phone); + editor.putString("firstName", firstName); + editor.putString("lastName", lastName); + editor.apply(); + + Intent intent = new Intent(MainActivity.this, SecondActivity.class); + intent.putExtra("phone", phone); + intent.putExtra("firstName", firstName); + intent.putExtra("lastName", lastName); + startActivity(intent); + }); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/app/src/main/java/com/example/taxi/SecondActivity.java b/AndroidStudioProjects/taxi/app/src/main/java/com/example/taxi/SecondActivity.java new file mode 100644 index 0000000..a6a10b6 --- /dev/null +++ b/AndroidStudioProjects/taxi/app/src/main/java/com/example/taxi/SecondActivity.java @@ -0,0 +1,53 @@ +package com.example.taxi; + +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; +import androidx.appcompat.app.AppCompatActivity; + +public class SecondActivity extends AppCompatActivity { + + private TextView tvUserInfo, tvPhone, tvRoute; + private Button btnSetPath, btnCallTaxi; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_second); + + tvUserInfo = findViewById(R.id.tvUserInfo); + tvPhone = findViewById(R.id.tvPhone); + tvRoute = findViewById(R.id.tvRoute); + btnSetPath = findViewById(R.id.btnSetPath); + btnCallTaxi = findViewById(R.id.btnCallTaxi); + + Intent intent = getIntent(); + String firstName = intent.getStringExtra("firstName"); + String lastName = intent.getStringExtra("lastName"); + String phone = intent.getStringExtra("phone"); + + tvUserInfo.setText(firstName + " " + lastName); + tvPhone.setText(phone); + + btnSetPath.setOnClickListener(v -> { + Intent thirdIntent = new Intent(SecondActivity.this, ThirdActivity.class); + startActivityForResult(thirdIntent, 1); + }); + + btnCallTaxi.setOnClickListener(v -> { + android.widget.Toast.makeText(SecondActivity.this, "Такси успешно вызвано!", android.widget.Toast.LENGTH_SHORT).show(); + }); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == 1 && resultCode == RESULT_OK) { + String route = data.getStringExtra("route"); + tvRoute.setText(route); + btnCallTaxi.setEnabled(true); + } + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/app/src/main/java/com/example/taxi/ThirdActivity.java b/AndroidStudioProjects/taxi/app/src/main/java/com/example/taxi/ThirdActivity.java new file mode 100644 index 0000000..4dbcbaf --- /dev/null +++ b/AndroidStudioProjects/taxi/app/src/main/java/com/example/taxi/ThirdActivity.java @@ -0,0 +1,35 @@ +package com.example.taxi; + +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import androidx.appcompat.app.AppCompatActivity; + +public class ThirdActivity extends AppCompatActivity { + + private EditText etStartPoint, etEndPoint; + private Button btnOk; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_third); + + etStartPoint = findViewById(R.id.etStartPoint); + etEndPoint = findViewById(R.id.etEndPoint); + btnOk = findViewById(R.id.btnOk); + + btnOk.setOnClickListener(v -> { + String startPoint = etStartPoint.getText().toString(); + String endPoint = etEndPoint.getText().toString(); + String route = "Маршрут: " + startPoint + " -> " + endPoint; + + Intent resultIntent = new Intent(); + resultIntent.putExtra("route", route); + setResult(RESULT_OK, resultIntent); + finish(); + }); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidStudioProjects/taxi/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/AndroidStudioProjects/taxi/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AndroidStudioProjects/taxi/app/src/main/res/drawable/ic_launcher_foreground.xml b/AndroidStudioProjects/taxi/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/AndroidStudioProjects/taxi/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/AndroidStudioProjects/taxi/app/src/main/res/layout/activity_main.xml b/AndroidStudioProjects/taxi/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..3024a37 --- /dev/null +++ b/AndroidStudioProjects/taxi/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,32 @@ + + + + + + + + + +