diff --git a/.gitignore b/.gitignore index a9a7031..2d34da4 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,4 @@ run.sh *.aab output-metadata.json /build.properties -*.hprof \ No newline at end of file +*.hprof diff --git a/README.md b/README.md deleted file mode 100644 index 6b5a493..0000000 --- a/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Activities #1 - -Домашняя работа к лекции **Activities #1**. В ней мы научимся работать с лаунч-модами и флагами запуска активити. - -Задание лежит здесь: -https://kazakovanton.notion.site/Activity-1-Homework-2826d9a095ce437ea9d9cf49b8cd34c1 \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore index 42afabf..1571bfe 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1 +1,2 @@ -/build \ No newline at end of file +/build +/.gradle/ diff --git a/app/build.gradle b/app/build.gradle index 0579b10..4049c1b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' + id 'kotlin-parcelize' } android { @@ -35,4 +36,8 @@ dependencies { implementation 'androidx.core:core-ktx:1.8.0' implementation 'androidx.appcompat:appcompat:1.5.0' implementation 'com.google.android.material:material:1.6.1' -} \ No newline at end of file + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' +} diff --git a/app/src/androidTest/java/ru/otus/otusdemo/ExampleInstrumentedTest.kt b/app/src/androidTest/java/ru/otus/otusdemo/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..20c1fb7 --- /dev/null +++ b/app/src/androidTest/java/ru/otus/otusdemo/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package ru.otus.otusdemo + +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.otus.otusdemo", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f318e6c..a92d480 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,9 +1,10 @@ + package="ru.otus.otusdemo"> + android:theme="@style/Theme.OtusDemo" + tools:targetApi="31"> + + + + + + - \ No newline at end of file + + + + + + + + + diff --git a/app/src/main/java/ru/otus/otusdemo/ActivityA.kt b/app/src/main/java/ru/otus/otusdemo/ActivityA.kt new file mode 100644 index 0000000..3f9a527 --- /dev/null +++ b/app/src/main/java/ru/otus/otusdemo/ActivityA.kt @@ -0,0 +1,28 @@ +package ru.otus.otusdemo + +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.widget.Button +import android.widget.Toast + +class ActivityA : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_a) + + val button = findViewById