diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/account/AccountFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/account/AccountFragment.kt index 271f33e5..7a8f8585 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/account/AccountFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/account/AccountFragment.kt @@ -34,8 +34,6 @@ class AccountFragment : BaseFragment(R.layout.fragment_a override val titleStringId = R.string.account_title - override var subtitleString = "" - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setHasOptionsMenu(true) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/account/accountdetails/AccountDetailsFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/account/accountdetails/AccountDetailsFragment.kt index 28b6bd2e..f1c7f7bd 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/account/accountdetails/AccountDetailsFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/account/accountdetails/AccountDetailsFragment.kt @@ -33,8 +33,6 @@ class AccountDetailsFragment : override val titleStringId = R.string.account_details_title - override var subtitleString = "" - companion object { private const val ARGUMENT_KEY = "Data" diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradeFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradeFragment.kt index 91e39e06..ade37775 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradeFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/GradeFragment.kt @@ -39,7 +39,7 @@ class GradeFragment : BaseFragment(R.layout.fragment_grade override val titleStringId get() = R.string.grade_title - override var subtitleString = "" + override var subtitleString = " " override val currentPageIndex get() = binding.gradeViewPager.currentItem @@ -63,11 +63,13 @@ class GradeFragment : BaseFragment(R.layout.fragment_grade override fun initView() { with(pagerAdapter) { containerId = binding.gradeViewPager.id - addFragmentsWithTitle(mapOf( - GradeDetailsFragment.newInstance() to getString(R.string.all_details), - GradeSummaryFragment.newInstance() to getString(R.string.grade_menu_summary), - GradeStatisticsFragment.newInstance() to getString(R.string.grade_menu_statistics) - )) + addFragmentsWithTitle( + mapOf( + GradeDetailsFragment.newInstance() to getString(R.string.all_details), + GradeSummaryFragment.newInstance() to getString(R.string.grade_menu_summary), + GradeStatisticsFragment.newInstance() to getString(R.string.grade_menu_statistics) + ) + ) } with(binding.gradeViewPager) { @@ -137,7 +139,10 @@ class GradeFragment : BaseFragment(R.layout.fragment_grade override fun setCurrentSemesterName(semester: Int, schoolYear: Int) { subtitleString = getString(R.string.grade_subtitle, semester, schoolYear, schoolYear + 1) - (activity as MainView).setViewSubTitle(subtitleString) + + if (isVisible) { + (activity as MainView?)?.setViewSubTitle(subtitleString) + } } fun onChildRefresh() { @@ -149,7 +154,8 @@ class GradeFragment : BaseFragment(R.layout.fragment_grade } override fun notifyChildLoadData(index: Int, semesterId: Int, forceRefresh: Boolean) { - (pagerAdapter.getFragmentInstance(index) as? GradeView.GradeChildView)?.onParentLoadData(semesterId, forceRefresh) + (pagerAdapter.getFragmentInstance(index) as? GradeView.GradeChildView) + ?.onParentLoadData(semesterId, forceRefresh) } override fun notifyChildParentReselected(index: Int) {