diff --git a/android/app/build.gradle b/android/app/build.gradle index 8964205..f2741d6 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,15 +1,19 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' +apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 29 buildToolsVersion "29.0.3" - + dataBinding { + enabled = true + } defaultConfig { applicationId "de.hft.geotracker" minSdkVersion 23 targetSdkVersion 29 + vectorDrawables.useSupportLibrary = true versionCode 1 versionName "1.0" @@ -31,7 +35,13 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.core:core-ktx:1.2.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'com.google.android.material:material:1.1.0' testImplementation 'junit:junit:4.13' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2' + implementation 'androidx.navigation:navigation-ui-ktx:2.2.2' + implementation"android.arch.navigation:navigation-fragment-ktx:2.2.2" + implementation "android.arch.navigation:navigation-ui-ktx:2.2.2" } diff --git a/android/app/src/main/java/de/hft/geotracker/MainActivity.kt b/android/app/src/main/java/de/hft/geotracker/MainActivity.kt index 68bfee2..96a2805 100644 --- a/android/app/src/main/java/de/hft/geotracker/MainActivity.kt +++ b/android/app/src/main/java/de/hft/geotracker/MainActivity.kt @@ -2,11 +2,23 @@ package de.hft.geotracker import androidx.appcompat.app.AppCompatActivity import android.os.Bundle +import androidx.navigation.findNavController +import androidx.databinding.DataBindingUtil +import androidx.navigation.ui.NavigationUI + class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) +// val binding = DataBindingUtil.setContentView(this, R.layout.activity_main) +// val navController = this.findNavController(R.id.HostFragment) +// NavigationUI.setupActionBarWithNavController(this, navController) + } + + override fun onSupportNavigateUp(): Boolean { + val navController = this.findNavController(R.id.HostFragment) + return navController.navigateUp() } } diff --git a/android/app/src/main/java/de/hft/geotracker/home.kt b/android/app/src/main/java/de/hft/geotracker/home.kt new file mode 100644 index 0000000..1a7a6a1 --- /dev/null +++ b/android/app/src/main/java/de/hft/geotracker/home.kt @@ -0,0 +1,22 @@ +package de.hft.geotracker + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup + +/** + * A simple [Fragment] subclass. + */ +class home : Fragment() { + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_home, container, false) + } + +} diff --git a/android/app/src/main/java/de/hft/geotracker/login.kt b/android/app/src/main/java/de/hft/geotracker/login.kt new file mode 100644 index 0000000..c8e26af --- /dev/null +++ b/android/app/src/main/java/de/hft/geotracker/login.kt @@ -0,0 +1,25 @@ +package de.hft.geotracker + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.databinding.DataBindingUtil +import kotlinx.android.synthetic.main.fragment_login.view.* + +/** + * A simple [Fragment] subclass. + */ +class login : Fragment() { + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle?): View? { + // Inflate the layout for this fragment +// val binding = DataBindingUtil.inflate(inflater, R.layout.fragment_login, container, false) + // val binding = DataBindingUtil.inflate(inflater, R.layout.fragment_title, container, false) + return inflater.inflate(R.layout.fragment_login, container, false) + } + +} diff --git a/android/app/src/main/res/drawable/outlined_button.xml b/android/app/src/main/res/drawable/outlined_button.xml new file mode 100644 index 0000000..88ffb77 --- /dev/null +++ b/android/app/src/main/res/drawable/outlined_button.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/font/montserrat.ttf b/android/app/src/main/res/font/montserrat.ttf new file mode 100644 index 0000000..626355a Binary files /dev/null and b/android/app/src/main/res/font/montserrat.ttf differ diff --git a/android/app/src/main/res/layout/activity_main.xml b/android/app/src/main/res/layout/activity_main.xml index 4fc2444..653c903 100644 --- a/android/app/src/main/res/layout/activity_main.xml +++ b/android/app/src/main/res/layout/activity_main.xml @@ -1,18 +1,18 @@ - + android:orientation="vertical" + android:background="@color/background_grey" + tools:context=".MainActivity" > - - - \ No newline at end of file + + \ No newline at end of file diff --git a/android/app/src/main/res/layout/fragment_home.xml b/android/app/src/main/res/layout/fragment_home.xml new file mode 100644 index 0000000..fd585bc --- /dev/null +++ b/android/app/src/main/res/layout/fragment_home.xml @@ -0,0 +1,88 @@ + + + + + + + + +