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 deleted file mode 100644 index 8d86b3a..0000000 --- a/DBTApp/app/src/main/java/de/cdaut/dbt/activities/FavouritesFragment.kt +++ /dev/null @@ -1,60 +0,0 @@ -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 12a8eba..461008c 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,65 +1,23 @@ package de.cdaut.dbt.activities import android.os.Bundle -import android.view.MenuItem +import com.google.android.material.snackbar.Snackbar import androidx.appcompat.app.AppCompatActivity -import com.google.android.material.bottomnavigation.BottomNavigationView -import com.google.android.material.navigation.NavigationBarView +import androidx.navigation.findNavController +import androidx.navigation.ui.AppBarConfiguration +import androidx.navigation.ui.navigateUp +import androidx.navigation.ui.setupActionBarWithNavController 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 deleted file mode 100644 index c06649b..0000000 --- a/DBTApp/app/src/main/java/de/cdaut/dbt/activities/SkillListFragment.kt +++ /dev/null @@ -1,60 +0,0 @@ -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 deleted file mode 100644 index 27f32af..0000000 --- a/DBTApp/app/src/main/java/de/cdaut/dbt/activities/SkillsChainsFragment.kt +++ /dev/null @@ -1,60 +0,0 @@ -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 deleted file mode 100644 index 2dd113b..0000000 --- a/DBTApp/app/src/main/java/de/cdaut/dbt/activities/TrackingFragment.kt +++ /dev/null @@ -1,60 +0,0 @@ -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 9619299..3c8a0a8 100644 --- a/DBTApp/app/src/main/res/layout/activity_home.xml +++ b/DBTApp/app/src/main/res/layout/activity_home.xml @@ -1,5 +1,6 @@ - - + - \ 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 7d6c917..24ef6f2 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" /> \ 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 deleted file mode 100644 index 812e2f1..0000000 --- a/DBTApp/app/src/main/res/layout/fragment_favourites.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - \ 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 329f50a..5988fc7 100644 --- a/DBTApp/app/src/main/res/layout/fragment_home.xml +++ b/DBTApp/app/src/main/res/layout/fragment_home.xml @@ -1,20 +1,23 @@ - + android:layout_height="match_parent"> + - - \ No newline at end of file + android:layout_alignParentBottom="true" + android:layout_gravity="bottom" + android:background="@android:color/background_dark" + app:itemIconTint="@android:color/white" + app:itemTextColor="@android:color/white" + app:menu="@menu/bottom_navbar" /> + \ 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 deleted file mode 100644 index f19e3e0..0000000 --- a/DBTApp/app/src/main/res/layout/fragment_skill_list.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - \ 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 deleted file mode 100644 index 828eed2..0000000 --- a/DBTApp/app/src/main/res/layout/fragment_skills_chains.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - \ 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 deleted file mode 100644 index f1898ef..0000000 --- a/DBTApp/app/src/main/res/layout/fragment_tracking.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - \ 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 f65506a..01f32eb 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 @@ -