From 1915e66a31991093e43ca169b1bd627b56d03d10 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Mon, 25 Jul 2022 16:35:18 +0400 Subject: [PATCH] Commit --- .gitignore | 85 ++++++++ .idea/.gitignore | 3 + .idea/.name | 1 + .idea/codeStyles/Project.xml | 123 ++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/compiler.xml | 6 + .idea/misc.xml | 16 ++ README.md | 2 + app/.gitignore | 1 + app/build.gradle | 48 +++++ app/proguard-rules.pro | 21 ++ .../dc09/helloapp/ExampleInstrumentedTest.kt | 24 +++ app/src/main/AndroidManifest.xml | 27 +++ .../java/ru/dc09/helloapp/MainActivity.kt | 115 +++++++++++ app/src/main/res/drawable-v24/def.webp | Bin 0 -> 11088 bytes app/src/main/res/drawable-v24/dev.webp | Bin 0 -> 4120 bytes .../drawable-v24/ic_launcher_foreground.xml | 30 +++ app/src/main/res/drawable-v24/pic1.webp | Bin 0 -> 4470 bytes app/src/main/res/drawable-v24/pic10.webp | Bin 0 -> 5468 bytes app/src/main/res/drawable-v24/pic11.webp | Bin 0 -> 6838 bytes app/src/main/res/drawable-v24/pic12.webp | Bin 0 -> 5672 bytes app/src/main/res/drawable-v24/pic13.webp | Bin 0 -> 5340 bytes app/src/main/res/drawable-v24/pic14.webp | Bin 0 -> 13452 bytes app/src/main/res/drawable-v24/pic15.webp | Bin 0 -> 2236 bytes app/src/main/res/drawable-v24/pic2.webp | Bin 0 -> 5864 bytes app/src/main/res/drawable-v24/pic3.webp | Bin 0 -> 7080 bytes app/src/main/res/drawable-v24/pic4.webp | Bin 0 -> 4906 bytes app/src/main/res/drawable-v24/pic5.webp | Bin 0 -> 1986 bytes app/src/main/res/drawable-v24/pic6.webp | Bin 0 -> 4130 bytes app/src/main/res/drawable-v24/pic7.webp | Bin 0 -> 6876 bytes app/src/main/res/drawable-v24/pic8.webp | Bin 0 -> 11286 bytes app/src/main/res/drawable-v24/pic9.webp | Bin 0 -> 12450 bytes .../res/drawable/ic_launcher_background.xml | 170 ++++++++++++++++ app/src/main/res/layout/activity_main.xml | 75 +++++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + app/src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 1404 bytes .../res/mipmap-hdpi/ic_launcher_round.webp | Bin 0 -> 2898 bytes app/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 | 16 ++ app/src/main/res/values-ru-rRU/strings.xml | 14 ++ app/src/main/res/values/colors.xml | 10 + app/src/main/res/values/strings.xml | 13 ++ app/src/main/res/values/themes.xml | 16 ++ app/src/main/res/xml/backup_rules.xml | 13 ++ .../main/res/xml/data_extraction_rules.xml | 19 ++ .../java/ru/dc09/helloapp/ExampleUnitTest.kt | 17 ++ build.gradle | 10 + gradle.properties | 23 +++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 185 ++++++++++++++++++ gradlew.bat | 89 +++++++++ settings.gradle | 16 ++ 61 files changed, 1209 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/.name create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/compiler.xml create mode 100644 .idea/misc.xml create mode 100644 README.md create mode 100644 app/.gitignore create mode 100644 app/build.gradle create mode 100644 app/proguard-rules.pro create mode 100644 app/src/androidTest/java/ru/dc09/helloapp/ExampleInstrumentedTest.kt create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/java/ru/dc09/helloapp/MainActivity.kt create mode 100644 app/src/main/res/drawable-v24/def.webp create mode 100644 app/src/main/res/drawable-v24/dev.webp create mode 100644 app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 app/src/main/res/drawable-v24/pic1.webp create mode 100644 app/src/main/res/drawable-v24/pic10.webp create mode 100644 app/src/main/res/drawable-v24/pic11.webp create mode 100644 app/src/main/res/drawable-v24/pic12.webp create mode 100644 app/src/main/res/drawable-v24/pic13.webp create mode 100644 app/src/main/res/drawable-v24/pic14.webp create mode 100644 app/src/main/res/drawable-v24/pic15.webp create mode 100644 app/src/main/res/drawable-v24/pic2.webp create mode 100644 app/src/main/res/drawable-v24/pic3.webp create mode 100644 app/src/main/res/drawable-v24/pic4.webp create mode 100644 app/src/main/res/drawable-v24/pic5.webp create mode 100644 app/src/main/res/drawable-v24/pic6.webp create mode 100644 app/src/main/res/drawable-v24/pic7.webp create mode 100644 app/src/main/res/drawable-v24/pic8.webp create mode 100644 app/src/main/res/drawable-v24/pic9.webp create mode 100644 app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp create mode 100644 app/src/main/res/values-night/themes.xml create mode 100644 app/src/main/res/values-ru-rRU/strings.xml create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/themes.xml create mode 100644 app/src/main/res/xml/backup_rules.xml create mode 100644 app/src/main/res/xml/data_extraction_rules.xml create mode 100644 app/src/test/java/ru/dc09/helloapp/ExampleUnitTest.kt create mode 100644 build.gradle create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..56cc642 --- /dev/null +++ b/.gitignore @@ -0,0 +1,85 @@ +# Built application files +*.apk +*.aar +*.ap_ +*.aab + +# Files for the ART/Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ +# Uncomment the following line in case you need and you don't have the release build type files in your app +# release/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +# IntelliJ +*.iml +.idea/workspace.xml +.idea/tasks.xml +.idea/gradle.xml +.idea/assetWizardSettings.xml +.idea/dictionaries +.idea/libraries +# Android Studio 3 in .gitignore file. +.idea/caches +.idea/modules.xml +# Comment next line if keeping position of elements in Navigation Editor is relevant for you +.idea/navEditor.xml + +# Keystore files +# Uncomment the following lines if you do not want to check your keystore files in. +#*.jks +#*.keystore + +# External native build folder generated in Android Studio 2.2 and later +.externalNativeBuild +.cxx/ + +# Google Services (e.g. APIs or Firebase) +# google-services.json + +# Freeline +freeline.py +freeline/ +freeline_project_description.json + +# fastlane +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output +fastlane/readme.md + +# Version control +vcs.xml + +# lint +lint/intermediates/ +lint/generated/ +lint/outputs/ +lint/tmp/ +# lint/reports/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..7cbe6c0 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +Hello App \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..7643783 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,123 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..c160b68 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..a51ce94 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# HelloApp +My first Android app on Kotlin diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..ad024b9 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,48 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' +} + +android { + compileSdk 32 + + defaultConfig { + applicationId "ru.dc09.helloapp" + minSdk 21 + targetSdk 32 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + + debug { + minifyEnabled false + } + + release { + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + + implementation 'androidx.core:core-ktx:1.7.0' + implementation 'androidx.appcompat:appcompat:1.3.0' + implementation 'com.google.android.material:material:1.4.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/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/app/src/androidTest/java/ru/dc09/helloapp/ExampleInstrumentedTest.kt b/app/src/androidTest/java/ru/dc09/helloapp/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..5efe3cf --- /dev/null +++ b/app/src/androidTest/java/ru/dc09/helloapp/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package ru.dc09.helloapp + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("ru.dc09.helloapp", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a94097f --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/ru/dc09/helloapp/MainActivity.kt b/app/src/main/java/ru/dc09/helloapp/MainActivity.kt new file mode 100644 index 0000000..9255584 --- /dev/null +++ b/app/src/main/java/ru/dc09/helloapp/MainActivity.kt @@ -0,0 +1,115 @@ +package ru.dc09.helloapp + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.view.View +import android.widget.* +import java.util.* + +class MainActivity : AppCompatActivity() { + + private lateinit var progressBar: ProgressBar + private var pThread: Progress? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + val nameEditText: EditText = findViewById(R.id.nameEditText) + val birthdayEditText: EditText = findViewById(R.id.birthdayEditText) + val imageView: ImageView = findViewById(R.id.imageView) + val devCheckBox: CheckBox = findViewById(R.id.devCheckBox) + + val helloTextView: TextView = findViewById(R.id.helloTextView) + val ageTextView: TextView = findViewById(R.id.ageTextView) + progressBar = findViewById(R.id.progressBar) + + val pictures = listOf( + getDrawable(R.drawable.pic1), + getDrawable(R.drawable.pic2), + getDrawable(R.drawable.pic3), + getDrawable(R.drawable.pic4), + getDrawable(R.drawable.pic5), + getDrawable(R.drawable.pic6), + getDrawable(R.drawable.pic7), + getDrawable(R.drawable.pic8), + getDrawable(R.drawable.pic9), + getDrawable(R.drawable.pic10), + getDrawable(R.drawable.pic11), + getDrawable(R.drawable.pic12), + getDrawable(R.drawable.pic13), + getDrawable(R.drawable.pic14), + getDrawable(R.drawable.pic15), + ) + + findViewById