diff --git a/.gitignore b/.gitignore index a1c2a23..1e51fcd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,91 @@ -# Compiled class file +# Built application files +*.apk +*.aar +*.ap_ +*.aab + +# Files for the ART/Dalvik VM +*.dex + +# Java class files *.class -# Log file +# 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 -# BlueJ files -*.ctxt +# 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 -# Mobile Tools for Java (J2ME) -.mtj.tmp/ +# lint +lint/intermediates/ +lint/generated/ +lint/outputs/ +lint/tmp/ +# lint/reports/ -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar +# DS_Store -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* +*.DS_Store +.DS_Store +DS_Store diff --git a/Project2/.gitignore b/Project2/.gitignore new file mode 100644 index 0000000..603b140 --- /dev/null +++ b/Project2/.gitignore @@ -0,0 +1,14 @@ +*.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 diff --git a/Project2/.idea/codeStyles/Project.xml b/Project2/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..45b5654 --- /dev/null +++ b/Project2/.idea/codeStyles/Project.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+ + +
+
\ No newline at end of file diff --git a/Project2/.idea/codeStyles/codeStyleConfig.xml b/Project2/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/Project2/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/Project2/.idea/gradle.xml b/Project2/.idea/gradle.xml new file mode 100644 index 0000000..169fd0d --- /dev/null +++ b/Project2/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/Project2/.idea/misc.xml b/Project2/.idea/misc.xml new file mode 100644 index 0000000..37a7509 --- /dev/null +++ b/Project2/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/Project2/.idea/runConfigurations.xml b/Project2/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/Project2/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/Project2/app/.gitignore b/Project2/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/Project2/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/Project2/app/build.gradle b/Project2/app/build.gradle new file mode 100644 index 0000000..7057ebf --- /dev/null +++ b/Project2/app/build.gradle @@ -0,0 +1,35 @@ +apply plugin: 'com.android.application' + +apply plugin: 'kotlin-android' + +apply plugin: 'kotlin-android-extensions' + +android { + compileSdkVersion 29 + buildToolsVersion "29.0.2" + defaultConfig { + applicationId "com.emedinaa.samples" + minSdkVersion 15 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.core:core-ktx:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' +} diff --git a/Project2/app/proguard-rules.pro b/Project2/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/Project2/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 diff --git a/Project2/app/src/androidTest/java/com/emedinaa/samples/ExampleInstrumentedTest.kt b/Project2/app/src/androidTest/java/com/emedinaa/samples/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..99adbfe --- /dev/null +++ b/Project2/app/src/androidTest/java/com/emedinaa/samples/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.emedinaa.samples + +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("com.emedinaa.samples", appContext.packageName) + } +} diff --git a/Project2/app/src/main/AndroidManifest.xml b/Project2/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..53b9df1 --- /dev/null +++ b/Project2/app/src/main/AndroidManifest.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Project2/app/src/main/java/com/emedinaa/samples/MainActivity.kt b/Project2/app/src/main/java/com/emedinaa/samples/MainActivity.kt new file mode 100644 index 0000000..f901079 --- /dev/null +++ b/Project2/app/src/main/java/com/emedinaa/samples/MainActivity.kt @@ -0,0 +1,32 @@ +package com.emedinaa.samples + +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.android.synthetic.main.activity_main.* + +class MainActivity : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + button.setOnClickListener { + goToScreen02() + } + + button2.setOnClickListener { + goToScreen03() + } + } + + private fun goToScreen02(){ + val intent= Intent(this, Screen02Activity::class.java) + startActivity(intent) + } + + private fun goToScreen03(){ + val intent= Intent(this, Screen03Activity::class.java) + startActivity(intent) + } +} diff --git a/Project2/app/src/main/java/com/emedinaa/samples/Screen02Activity.kt b/Project2/app/src/main/java/com/emedinaa/samples/Screen02Activity.kt new file mode 100644 index 0000000..b2ef633 --- /dev/null +++ b/Project2/app/src/main/java/com/emedinaa/samples/Screen02Activity.kt @@ -0,0 +1,21 @@ +package com.emedinaa.samples + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import kotlinx.android.synthetic.main.activity_screen02.* + +class Screen02Activity : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_screen02) + + button.setOnClickListener { + back() + } + } + + private fun back(){ + finish() + } +} diff --git a/Project2/app/src/main/java/com/emedinaa/samples/Screen03Activity.kt b/Project2/app/src/main/java/com/emedinaa/samples/Screen03Activity.kt new file mode 100644 index 0000000..22506a5 --- /dev/null +++ b/Project2/app/src/main/java/com/emedinaa/samples/Screen03Activity.kt @@ -0,0 +1,12 @@ +package com.emedinaa.samples + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle + +class Screen03Activity : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_screen03) + } +} diff --git a/Project2/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Project2/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..1f6bb29 --- /dev/null +++ b/Project2/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/Project2/app/src/main/res/drawable/ic_launcher_background.xml b/Project2/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..0d025f9 --- /dev/null +++ b/Project2/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Project2/app/src/main/res/layout/activity_main.xml b/Project2/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..e61408a --- /dev/null +++ b/Project2/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,42 @@ + + + + + +