forked from github/wulkanowy-mirror
Fix grade fragment subtitle (#1185)
This commit is contained in:
parent
6f590eb194
commit
3b970209a5
@ -34,8 +34,6 @@ class AccountFragment : BaseFragment<FragmentAccountBinding>(R.layout.fragment_a
|
||||
|
||||
override val titleStringId = R.string.account_title
|
||||
|
||||
override var subtitleString = ""
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setHasOptionsMenu(true)
|
||||
|
@ -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"
|
||||
|
@ -63,11 +63,13 @@ class GradeFragment : BaseFragment<FragmentGradeBinding>(R.layout.fragment_grade
|
||||
override fun initView() {
|
||||
with(pagerAdapter) {
|
||||
containerId = binding.gradeViewPager.id
|
||||
addFragmentsWithTitle(mapOf(
|
||||
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<FragmentGradeBinding>(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<FragmentGradeBinding>(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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user