From 31e619deab4d56614ba5a3c7ecf13f5e8948b559 Mon Sep 17 00:00:00 2001 From: Alexandr Alexeenko Date: Sun, 14 Nov 2021 22:01:19 +0300 Subject: [PATCH 01/32] Create empty ContributionsGridFragment.kt Related #102 --- .../contributions/ContributionsFragment.kt | 5 +++ .../ContributionsGridFragment.kt | 36 +++++++++++++++++++ .../res/layout/fragment_contributions.xml | 8 +++++ .../layout/fragment_contributions_grid.xml | 19 ++++++++++ app/src/main/res/navigation/nav_graph.xml | 25 ++++++++++++- 5 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/by/alexandr7035/gitstat/view/contributions_grid/ContributionsGridFragment.kt create mode 100644 app/src/main/res/layout/fragment_contributions_grid.xml diff --git a/app/src/main/java/by/alexandr7035/gitstat/view/contributions/ContributionsFragment.kt b/app/src/main/java/by/alexandr7035/gitstat/view/contributions/ContributionsFragment.kt index a799762d..eceb66d7 100644 --- a/app/src/main/java/by/alexandr7035/gitstat/view/contributions/ContributionsFragment.kt +++ b/app/src/main/java/by/alexandr7035/gitstat/view/contributions/ContributionsFragment.kt @@ -179,6 +179,11 @@ class ContributionsFragment : Fragment() { getString(R.string.contribution_rate_dynamics_help_text) )) } + + // FIXME TEST + binding?.testButton?.setOnClickListener { + findNavController().navigateSafe(ContributionsFragmentDirections.actionContributionsFragmentToContributionsGridFragment(2021)) + } } } \ No newline at end of file diff --git a/app/src/main/java/by/alexandr7035/gitstat/view/contributions_grid/ContributionsGridFragment.kt b/app/src/main/java/by/alexandr7035/gitstat/view/contributions_grid/ContributionsGridFragment.kt new file mode 100644 index 00000000..ce759b37 --- /dev/null +++ b/app/src/main/java/by/alexandr7035/gitstat/view/contributions_grid/ContributionsGridFragment.kt @@ -0,0 +1,36 @@ +package by.alexandr7035.gitstat.view.contributions_grid + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import androidx.navigation.fragment.findNavController +import by.alexandr7035.gitstat.databinding.FragmentContributionsGridBinding +import by.alexandr7035.gitstat.extensions.debug +import timber.log.Timber + +class ContributionsGridFragment : Fragment() { + + private var binding: FragmentContributionsGridBinding? = null + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + // Inflate the layout for this fragment + binding = FragmentContributionsGridBinding.inflate(inflater, container, false) + return binding?.root + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + binding?.toolbar?.setNavigationOnClickListener { + findNavController().navigateUp() + } + + } + + override fun onDestroyView() { + super.onDestroyView() + binding = null + } +} \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_contributions.xml b/app/src/main/res/layout/fragment_contributions.xml index 4ef529da..7bdf7f40 100644 --- a/app/src/main/res/layout/fragment_contributions.xml +++ b/app/src/main/res/layout/fragment_contributions.xml @@ -31,6 +31,14 @@ app:layout_constraintStart_toEndOf="@id/drawerBtn" app:layout_constraintTop_toTopOf="parent"/> +