commit 0f56146615e70d457dec784f6af85333f8a82190 Author: Sebastian Seedorf Date: Sun Dec 6 20:35:25 2020 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7ea113c --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.gradle +/local.properties +/.idea/* +/.idea - PC/* +.DS_Store +/build +/captures +.externalNativeBuild +app/release/* diff --git a/Vokabulator.iml b/Vokabulator.iml new file mode 100644 index 0000000..a9345ec --- /dev/null +++ b/Vokabulator.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/app.iml b/app/app.iml new file mode 100644 index 0000000..49cf997 --- /dev/null +++ b/app/app.iml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..ac0462a --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,35 @@ +apply plugin: 'com.android.application' + +apply plugin: 'kotlin-android' + +apply plugin: 'kotlin-android-extensions' + +android { + compileSdkVersion 28 + defaultConfig { + applicationId "de.sebse.vokabulator" + minSdkVersion 15 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'com.android.support.constraint:constraint-layout:1.1.3' + implementation 'android.arch.lifecycle:extensions:1.1.1' + implementation 'com.android.support:support-v4:28.0.0' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /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 diff --git a/app/src/androidTest/java/de/sebse/vokabulator/ExampleInstrumentedTest.kt b/app/src/androidTest/java/de/sebse/vokabulator/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..f869be8 --- /dev/null +++ b/app/src/androidTest/java/de/sebse/vokabulator/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package de.sebse.vokabulator + +import android.support.test.InstrumentationRegistry +import android.support.test.runner.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.getTargetContext() + assertEquals("de.sebse.vokabulator", appContext.packageName) + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..b24fbf8 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/de/sebse/vokabulator/MainActivity.kt b/app/src/main/java/de/sebse/vokabulator/MainActivity.kt new file mode 100644 index 0000000..b996a45 --- /dev/null +++ b/app/src/main/java/de/sebse/vokabulator/MainActivity.kt @@ -0,0 +1,26 @@ +package de.sebse.vokabulator + +import android.support.v7.app.AppCompatActivity +import android.os.Bundle +import de.sebse.vokabulator.fragments.MainFragment +import de.sebse.vokabulator.fragments.MainFragmentListener +import de.sebse.vokabulator.fragments.TaskFragment + +class MainActivity : AppCompatActivity(), MainFragmentListener { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.main_activity) + supportFragmentManager.beginTransaction() + .replace(R.id.container, MainFragment.newInstance()) + .commit() + } + + override fun startTest() { + supportFragmentManager.beginTransaction() + .replace(R.id.container, TaskFragment.newInstance()) + .commit() + } + + +} diff --git a/app/src/main/java/de/sebse/vokabulator/fragments/MainFragment.kt b/app/src/main/java/de/sebse/vokabulator/fragments/MainFragment.kt new file mode 100644 index 0000000..8b0baeb --- /dev/null +++ b/app/src/main/java/de/sebse/vokabulator/fragments/MainFragment.kt @@ -0,0 +1,46 @@ +package de.sebse.vokabulator.fragments + +import android.content.Context +import android.os.Bundle +import android.support.v4.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Button +import de.sebse.vokabulator.R + +class MainFragment : Fragment() { + + private var listener: MainFragmentListener? = null + + companion object { + fun newInstance() = MainFragment() + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + val view = inflater.inflate(R.layout.fragment_main, container, false) + val button = view.findViewById