commit c1e3b7c6789c58d0acfc1895476dfe5e04284ac7 Author: tonywesoly Date: Tue Jul 26 19:52:06 2022 +0200 finished first faze of the project diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties 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..51676d2 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +Kothlin-app \ 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/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a2d7c21 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..a97ad67 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/render.experimental.xml b/.idea/render.experimental.xml new file mode 100644 index 0000000..8ec256a --- /dev/null +++ b/.idea/render.experimental.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file 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..9e0a12f --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,51 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' +} + +android { + compileSdk 32 + + defaultConfig { + applicationId "com.lsm.kothlin_app" + minSdk 24 + targetSdk 32 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } + buildFeatures { + viewBinding true +// viewBinding false + } +} + +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' + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1' + implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1' + implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5' + implementation 'androidx.navigation:navigation-ui-ktx:2.3.5' + 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/com/lsm/kothlin_app/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/lsm/kothlin_app/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..a9e0dd3 --- /dev/null +++ b/app/src/androidTest/java/com/lsm/kothlin_app/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.lsm.kothlin_app + +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.lsm.kothlin_app", 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..4affa53 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/lsm/kothlin_app/MainActivity.kt b/app/src/main/java/com/lsm/kothlin_app/MainActivity.kt new file mode 100644 index 0000000..df7e3dd --- /dev/null +++ b/app/src/main/java/com/lsm/kothlin_app/MainActivity.kt @@ -0,0 +1,35 @@ +package com.lsm.kothlin_app + +import android.os.Bundle +import com.google.android.material.bottomnavigation.BottomNavigationView +import androidx.appcompat.app.AppCompatActivity +import androidx.navigation.findNavController +import androidx.navigation.ui.AppBarConfiguration +import androidx.navigation.ui.setupActionBarWithNavController +import androidx.navigation.ui.setupWithNavController +import com.lsm.kothlin_app.databinding.ActivityMainBinding + +class MainActivity : AppCompatActivity() { + + private lateinit var binding: ActivityMainBinding + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + binding = ActivityMainBinding.inflate(layoutInflater) + setContentView(binding.root) + + val navView: BottomNavigationView = binding.navView + + val navController = findNavController(R.id.nav_host_fragment_activity_main) + // Passing each menu ID as a set of Ids because each + // menu should be considered as top level destinations. + val appBarConfiguration = AppBarConfiguration( + setOf( + R.id.navigation_home, R.id.navigation_duties, R.id.navigation_rewards + ) + ) + setupActionBarWithNavController(navController, appBarConfiguration) + navView.setupWithNavController(navController) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/lsm/kothlin_app/ui/dashboard/DashboardFragment.kt b/app/src/main/java/com/lsm/kothlin_app/ui/dashboard/DashboardFragment.kt new file mode 100644 index 0000000..446d4d4 --- /dev/null +++ b/app/src/main/java/com/lsm/kothlin_app/ui/dashboard/DashboardFragment.kt @@ -0,0 +1,42 @@ +package com.lsm.kothlin_app.ui.dashboard + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import androidx.fragment.app.Fragment +import androidx.lifecycle.ViewModelProvider +import com.lsm.kothlin_app.databinding.FragmentDashboardBinding + +class DashboardFragment : Fragment() { + + private var _binding: FragmentDashboardBinding? = null + + // This property is only valid between onCreateView and + // onDestroyView. + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + val dashboardViewModel = + ViewModelProvider(this).get(DashboardViewModel::class.java) + + _binding = FragmentDashboardBinding.inflate(inflater, container, false) + val root: View = binding.root + + val textView: TextView = binding.textDashboard + dashboardViewModel.text.observe(viewLifecycleOwner) { + textView.text = it + } + return root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/app/src/main/java/com/lsm/kothlin_app/ui/dashboard/DashboardViewModel.kt b/app/src/main/java/com/lsm/kothlin_app/ui/dashboard/DashboardViewModel.kt new file mode 100644 index 0000000..bbe6dc2 --- /dev/null +++ b/app/src/main/java/com/lsm/kothlin_app/ui/dashboard/DashboardViewModel.kt @@ -0,0 +1,13 @@ +package com.lsm.kothlin_app.ui.dashboard + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel + +class DashboardViewModel : ViewModel() { + + private val _text = MutableLiveData().apply { + value = "This is dashboard Fragment" + } + val text: LiveData = _text +} \ No newline at end of file diff --git a/app/src/main/java/com/lsm/kothlin_app/ui/home/HomeFragment.kt b/app/src/main/java/com/lsm/kothlin_app/ui/home/HomeFragment.kt new file mode 100644 index 0000000..5e1a497 --- /dev/null +++ b/app/src/main/java/com/lsm/kothlin_app/ui/home/HomeFragment.kt @@ -0,0 +1,42 @@ +package com.lsm.kothlin_app.ui.home + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import androidx.fragment.app.Fragment +import androidx.lifecycle.ViewModelProvider +import com.lsm.kothlin_app.databinding.FragmentHomeBinding + +class HomeFragment : Fragment() { + + private var _binding: FragmentHomeBinding? = null + +// This property is only valid between onCreateView and +// onDestroyView. + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + val homeViewModel = + ViewModelProvider(this).get(HomeViewModel::class.java) + + _binding = FragmentHomeBinding.inflate(inflater, container, false) + val root: View = binding.root + + val textView: TextView = binding.homeHeadline + homeViewModel.text.observe(viewLifecycleOwner) { + textView.text = it + } + return root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/app/src/main/java/com/lsm/kothlin_app/ui/home/HomeViewModel.kt b/app/src/main/java/com/lsm/kothlin_app/ui/home/HomeViewModel.kt new file mode 100644 index 0000000..06faa67 --- /dev/null +++ b/app/src/main/java/com/lsm/kothlin_app/ui/home/HomeViewModel.kt @@ -0,0 +1,13 @@ +package com.lsm.kothlin_app.ui.home + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel + +class HomeViewModel : ViewModel() { + + private val _text = MutableLiveData().apply { + value = "Child\nRewards" + } + val text: LiveData = _text +} \ No newline at end of file diff --git a/app/src/main/java/com/lsm/kothlin_app/ui/notifications/NotificationsFragment.kt b/app/src/main/java/com/lsm/kothlin_app/ui/notifications/NotificationsFragment.kt new file mode 100644 index 0000000..c6886b9 --- /dev/null +++ b/app/src/main/java/com/lsm/kothlin_app/ui/notifications/NotificationsFragment.kt @@ -0,0 +1,42 @@ +package com.lsm.kothlin_app.ui.notifications + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import androidx.fragment.app.Fragment +import androidx.lifecycle.ViewModelProvider +import com.lsm.kothlin_app.databinding.FragmentNotificationsBinding + +class NotificationsFragment : Fragment() { + + private var _binding: FragmentNotificationsBinding? = null + + // This property is only valid between onCreateView and + // onDestroyView. + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + val notificationsViewModel = + ViewModelProvider(this).get(NotificationsViewModel::class.java) + + _binding = FragmentNotificationsBinding.inflate(inflater, container, false) + val root: View = binding.root + + val textView: TextView = binding.textNotifications + notificationsViewModel.text.observe(viewLifecycleOwner) { + textView.text = it + } + return root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/app/src/main/java/com/lsm/kothlin_app/ui/notifications/NotificationsViewModel.kt b/app/src/main/java/com/lsm/kothlin_app/ui/notifications/NotificationsViewModel.kt new file mode 100644 index 0000000..a17a89b --- /dev/null +++ b/app/src/main/java/com/lsm/kothlin_app/ui/notifications/NotificationsViewModel.kt @@ -0,0 +1,13 @@ +package com.lsm.kothlin_app.ui.notifications + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel + +class NotificationsViewModel : ViewModel() { + + private val _text = MutableLiveData().apply { + value = "This is notifications Fragment" + } + val text: LiveData = _text +} \ No newline at end of file diff --git a/app/src/main/java/com/lsm/kothlin_app/ui/person_card/PersonCardFragment.kt b/app/src/main/java/com/lsm/kothlin_app/ui/person_card/PersonCardFragment.kt new file mode 100644 index 0000000..6c3c6d6 --- /dev/null +++ b/app/src/main/java/com/lsm/kothlin_app/ui/person_card/PersonCardFragment.kt @@ -0,0 +1,6 @@ +package com.lsm.kothlin_app.ui.person_card + +import androidx.fragment.app.Fragment + +class PersonCardFragment: Fragment() { +} \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_baseline_check_circle_outline_24.xml b/app/src/main/res/drawable/ic_baseline_check_circle_outline_24.xml new file mode 100644 index 0000000..139900a --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_check_circle_outline_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_edit_24.xml b/app/src/main/res/drawable/ic_baseline_edit_24.xml new file mode 100644 index 0000000..bfebafb --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_edit_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_favorite_24.xml b/app/src/main/res/drawable/ic_baseline_favorite_24.xml new file mode 100644 index 0000000..7b6e2c9 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_favorite_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_dashboard_black_24dp.xml b/app/src/main/res/drawable/ic_dashboard_black_24dp.xml new file mode 100644 index 0000000..46fc8de --- /dev/null +++ b/app/src/main/res/drawable/ic_dashboard_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_duties.xml b/app/src/main/res/drawable/ic_duties.xml new file mode 100644 index 0000000..a0e994b --- /dev/null +++ b/app/src/main/res/drawable/ic_duties.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_home_black_24dp.xml b/app/src/main/res/drawable/ic_home_black_24dp.xml new file mode 100644 index 0000000..f8bb0b5 --- /dev/null +++ b/app/src/main/res/drawable/ic_home_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_notifications_black_24dp.xml b/app/src/main/res/drawable/ic_notifications_black_24dp.xml new file mode 100644 index 0000000..78b75c3 --- /dev/null +++ b/app/src/main/res/drawable/ic_notifications_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_rewards.xml b/app/src/main/res/drawable/ic_rewards.xml new file mode 100644 index 0000000..25cdbd0 --- /dev/null +++ b/app/src/main/res/drawable/ic_rewards.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_wave.xml b/app/src/main/res/drawable/ic_wave.xml new file mode 100644 index 0000000..4eec309 --- /dev/null +++ b/app/src/main/res/drawable/ic_wave.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ico_1.jpg b/app/src/main/res/drawable/ico_1.jpg new file mode 100644 index 0000000..b545ff4 Binary files /dev/null and b/app/src/main/res/drawable/ico_1.jpg differ diff --git a/app/src/main/res/drawable/ico_2.jpg b/app/src/main/res/drawable/ico_2.jpg new file mode 100644 index 0000000..e1ce1d6 Binary files /dev/null and b/app/src/main/res/drawable/ico_2.jpg differ diff --git a/app/src/main/res/drawable/ico_3.jpg b/app/src/main/res/drawable/ico_3.jpg new file mode 100644 index 0000000..7fbe15b Binary files /dev/null and b/app/src/main/res/drawable/ico_3.jpg differ diff --git a/app/src/main/res/drawable/ico_4.jpg b/app/src/main/res/drawable/ico_4.jpg new file mode 100644 index 0000000..2f4fbc4 Binary files /dev/null and b/app/src/main/res/drawable/ico_4.jpg differ diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..ad7ddc4 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_dashboard.xml b/app/src/main/res/layout/fragment_dashboard.xml new file mode 100644 index 0000000..166ab0e --- /dev/null +++ b/app/src/main/res/layout/fragment_dashboard.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml new file mode 100644 index 0000000..6ff7c7e --- /dev/null +++ b/app/src/main/res/layout/fragment_home.xml @@ -0,0 +1,69 @@ + + + + + + + + + +