diff --git a/DBTApp/app/src/main/java/de/cdaut/dbt/activities/FavouritesFragment.kt b/DBTApp/app/src/main/java/de/cdaut/dbt/activities/FavouritesFragment.kt new file mode 100644 index 0000000..8d86b3a --- /dev/null +++ b/DBTApp/app/src/main/java/de/cdaut/dbt/activities/FavouritesFragment.kt @@ -0,0 +1,60 @@ +package de.cdaut.dbt.activities + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import de.cdaut.dbt.R + +// TODO: Rename parameter arguments, choose names that match +// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER +private const val ARG_PARAM1 = "param1" +private const val ARG_PARAM2 = "param2" + +/** + * A simple [Fragment] subclass. + * Use the [FavouritesFragment.newInstance] factory method to + * create an instance of this fragment. + */ +class FavouritesFragment : Fragment() { + // TODO: Rename and change types of parameters + private var param1: String? = null + private var param2: String? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + arguments?.let { + param1 = it.getString(ARG_PARAM1) + param2 = it.getString(ARG_PARAM2) + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_favourites, container, false) + } + + companion object { + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment FavouritesFragment. + */ + // TODO: Rename and change types and number of parameters + @JvmStatic + fun newInstance(param1: String, param2: String) = + FavouritesFragment().apply { + arguments = Bundle().apply { + putString(ARG_PARAM1, param1) + putString(ARG_PARAM2, param2) + } + } + } +} \ No newline at end of file diff --git a/DBTApp/app/src/main/java/de/cdaut/dbt/activities/HomeActivity.kt b/DBTApp/app/src/main/java/de/cdaut/dbt/activities/HomeActivity.kt index 461008c..12a8eba 100644 --- a/DBTApp/app/src/main/java/de/cdaut/dbt/activities/HomeActivity.kt +++ b/DBTApp/app/src/main/java/de/cdaut/dbt/activities/HomeActivity.kt @@ -1,23 +1,65 @@ package de.cdaut.dbt.activities import android.os.Bundle -import com.google.android.material.snackbar.Snackbar +import android.view.MenuItem import androidx.appcompat.app.AppCompatActivity -import androidx.navigation.findNavController -import androidx.navigation.ui.AppBarConfiguration -import androidx.navigation.ui.navigateUp -import androidx.navigation.ui.setupActionBarWithNavController +import com.google.android.material.bottomnavigation.BottomNavigationView +import com.google.android.material.navigation.NavigationBarView import de.cdaut.dbt.R import de.cdaut.dbt.databinding.ActivityHomeBinding + class HomeActivity : AppCompatActivity() { private lateinit var binding: ActivityHomeBinding + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityHomeBinding.inflate(layoutInflater) setContentView(binding.root) + + val bottomNav = findViewById(R.id.bottom_navigation) + bottomNav.setSelectedItemId(R.id.home) + + bottomNav.setOnItemSelectedListener { selectedItem -> + when (selectedItem.itemId){ + R.id.home -> { + supportFragmentManager.beginTransaction() + .replace(R.id.fragment_container, HomeFragment()).commit() + true + } + R.id.favs -> { + supportFragmentManager.beginTransaction() + .replace(R.id.fragment_container, FavouritesFragment()).commit() + true + } + R.id.skilllist -> { + supportFragmentManager.beginTransaction() + .replace(R.id.fragment_container, SkillListFragment()).commit() + true + } + R.id.skills_chains -> { + supportFragmentManager.beginTransaction() + .replace(R.id.fragment_container, SkillsChainsFragment()).commit() + true + } + R.id.tracking -> { + supportFragmentManager.beginTransaction() + .replace(R.id.fragment_container, TrackingFragment()).commit() + true + } + else -> false + } + } + + supportFragmentManager.beginTransaction() + .replace(R.id.fragment_container, HomeFragment()).commit() + } -} \ No newline at end of file + + +} + + diff --git a/DBTApp/app/src/main/java/de/cdaut/dbt/activities/SkillListFragment.kt b/DBTApp/app/src/main/java/de/cdaut/dbt/activities/SkillListFragment.kt new file mode 100644 index 0000000..c06649b --- /dev/null +++ b/DBTApp/app/src/main/java/de/cdaut/dbt/activities/SkillListFragment.kt @@ -0,0 +1,60 @@ +package de.cdaut.dbt.activities + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import de.cdaut.dbt.R + +// TODO: Rename parameter arguments, choose names that match +// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER +private const val ARG_PARAM1 = "param1" +private const val ARG_PARAM2 = "param2" + +/** + * A simple [Fragment] subclass. + * Use the [SkillListFragment.newInstance] factory method to + * create an instance of this fragment. + */ +class SkillListFragment : Fragment() { + // TODO: Rename and change types of parameters + private var param1: String? = null + private var param2: String? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + arguments?.let { + param1 = it.getString(ARG_PARAM1) + param2 = it.getString(ARG_PARAM2) + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_skill_list, container, false) + } + + companion object { + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment SkillListFragment. + */ + // TODO: Rename and change types and number of parameters + @JvmStatic + fun newInstance(param1: String, param2: String) = + SkillListFragment().apply { + arguments = Bundle().apply { + putString(ARG_PARAM1, param1) + putString(ARG_PARAM2, param2) + } + } + } +} \ No newline at end of file diff --git a/DBTApp/app/src/main/java/de/cdaut/dbt/activities/SkillsChainsFragment.kt b/DBTApp/app/src/main/java/de/cdaut/dbt/activities/SkillsChainsFragment.kt new file mode 100644 index 0000000..27f32af --- /dev/null +++ b/DBTApp/app/src/main/java/de/cdaut/dbt/activities/SkillsChainsFragment.kt @@ -0,0 +1,60 @@ +package de.cdaut.dbt.activities + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import de.cdaut.dbt.R + +// TODO: Rename parameter arguments, choose names that match +// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER +private const val ARG_PARAM1 = "param1" +private const val ARG_PARAM2 = "param2" + +/** + * A simple [Fragment] subclass. + * Use the [SkillsChainsFragment.newInstance] factory method to + * create an instance of this fragment. + */ +class SkillsChainsFragment : Fragment() { + // TODO: Rename and change types of parameters + private var param1: String? = null + private var param2: String? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + arguments?.let { + param1 = it.getString(ARG_PARAM1) + param2 = it.getString(ARG_PARAM2) + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_skills_chains, container, false) + } + + companion object { + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment SkillsChainsFragment. + */ + // TODO: Rename and change types and number of parameters + @JvmStatic + fun newInstance(param1: String, param2: String) = + SkillsChainsFragment().apply { + arguments = Bundle().apply { + putString(ARG_PARAM1, param1) + putString(ARG_PARAM2, param2) + } + } + } +} \ No newline at end of file diff --git a/DBTApp/app/src/main/java/de/cdaut/dbt/activities/TrackingFragment.kt b/DBTApp/app/src/main/java/de/cdaut/dbt/activities/TrackingFragment.kt new file mode 100644 index 0000000..2dd113b --- /dev/null +++ b/DBTApp/app/src/main/java/de/cdaut/dbt/activities/TrackingFragment.kt @@ -0,0 +1,60 @@ +package de.cdaut.dbt.activities + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import de.cdaut.dbt.R + +// TODO: Rename parameter arguments, choose names that match +// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER +private const val ARG_PARAM1 = "param1" +private const val ARG_PARAM2 = "param2" + +/** + * A simple [Fragment] subclass. + * Use the [TrackingFragment.newInstance] factory method to + * create an instance of this fragment. + */ +class TrackingFragment : Fragment() { + // TODO: Rename and change types of parameters + private var param1: String? = null + private var param2: String? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + arguments?.let { + param1 = it.getString(ARG_PARAM1) + param2 = it.getString(ARG_PARAM2) + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_tracking, container, false) + } + + companion object { + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment TrackingFragment. + */ + // TODO: Rename and change types and number of parameters + @JvmStatic + fun newInstance(param1: String, param2: String) = + TrackingFragment().apply { + arguments = Bundle().apply { + putString(ARG_PARAM1, param1) + putString(ARG_PARAM2, param2) + } + } + } +} \ No newline at end of file diff --git a/DBTApp/app/src/main/res/layout/activity_home.xml b/DBTApp/app/src/main/res/layout/activity_home.xml index 3c8a0a8..9619299 100644 --- a/DBTApp/app/src/main/res/layout/activity_home.xml +++ b/DBTApp/app/src/main/res/layout/activity_home.xml @@ -1,6 +1,5 @@ - - + - \ No newline at end of file + \ No newline at end of file diff --git a/DBTApp/app/src/main/res/layout/content_home.xml b/DBTApp/app/src/main/res/layout/content_home.xml index 24ef6f2..7d6c917 100644 --- a/DBTApp/app/src/main/res/layout/content_home.xml +++ b/DBTApp/app/src/main/res/layout/content_home.xml @@ -7,7 +7,7 @@ app:layout_behavior="@string/appbar_scrolling_view_behavior"> + app:navGraph="@navigation/nav_graph" + android:layout_above="@id/bottom_navigation"/> + + \ No newline at end of file diff --git a/DBTApp/app/src/main/res/layout/fragment_favourites.xml b/DBTApp/app/src/main/res/layout/fragment_favourites.xml new file mode 100644 index 0000000..812e2f1 --- /dev/null +++ b/DBTApp/app/src/main/res/layout/fragment_favourites.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/DBTApp/app/src/main/res/layout/fragment_home.xml b/DBTApp/app/src/main/res/layout/fragment_home.xml index 5988fc7..329f50a 100644 --- a/DBTApp/app/src/main/res/layout/fragment_home.xml +++ b/DBTApp/app/src/main/res/layout/fragment_home.xml @@ -1,23 +1,20 @@ - + android:layout_height="match_parent" + tools:context=".activities.FavouritesFragment"> - - - \ No newline at end of file + android:text="@string/home" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + \ No newline at end of file diff --git a/DBTApp/app/src/main/res/layout/fragment_skill_list.xml b/DBTApp/app/src/main/res/layout/fragment_skill_list.xml new file mode 100644 index 0000000..f19e3e0 --- /dev/null +++ b/DBTApp/app/src/main/res/layout/fragment_skill_list.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/DBTApp/app/src/main/res/layout/fragment_skills_chains.xml b/DBTApp/app/src/main/res/layout/fragment_skills_chains.xml new file mode 100644 index 0000000..828eed2 --- /dev/null +++ b/DBTApp/app/src/main/res/layout/fragment_skills_chains.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/DBTApp/app/src/main/res/layout/fragment_tracking.xml b/DBTApp/app/src/main/res/layout/fragment_tracking.xml new file mode 100644 index 0000000..f1898ef --- /dev/null +++ b/DBTApp/app/src/main/res/layout/fragment_tracking.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/DBTApp/app/src/main/res/values-night/themes.xml b/DBTApp/app/src/main/res/values-night/themes.xml index 01f32eb..f65506a 100644 --- a/DBTApp/app/src/main/res/values-night/themes.xml +++ b/DBTApp/app/src/main/res/values-night/themes.xml @@ -1,6 +1,6 @@ -