forked from github/wulkanowy-mirror
Add dark mode to swipe refresh layout (#1118)
This commit is contained in:
parent
e39b053d2d
commit
39534aeda4
@ -26,6 +26,7 @@ import io.github.wulkanowy.ui.modules.main.MainView
|
|||||||
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
||||||
import io.github.wulkanowy.utils.SchooldaysRangeLimiter
|
import io.github.wulkanowy.utils.SchooldaysRangeLimiter
|
||||||
import io.github.wulkanowy.utils.dpToPx
|
import io.github.wulkanowy.utils.dpToPx
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -112,6 +113,8 @@ class AttendanceFragment : BaseFragment<FragmentAttendanceBinding>(R.layout.frag
|
|||||||
|
|
||||||
with(binding) {
|
with(binding) {
|
||||||
attendanceSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
attendanceSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
attendanceSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
attendanceSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
attendanceErrorRetry.setOnClickListener { presenter.onRetry() }
|
attendanceErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
attendanceErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
attendanceErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ import io.github.wulkanowy.databinding.FragmentAttendanceSummaryBinding
|
|||||||
import io.github.wulkanowy.ui.base.BaseFragment
|
import io.github.wulkanowy.ui.base.BaseFragment
|
||||||
import io.github.wulkanowy.ui.modules.main.MainView
|
import io.github.wulkanowy.ui.modules.main.MainView
|
||||||
import io.github.wulkanowy.utils.dpToPx
|
import io.github.wulkanowy.utils.dpToPx
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import io.github.wulkanowy.utils.setOnItemSelectedListener
|
import io.github.wulkanowy.utils.setOnItemSelectedListener
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -56,6 +57,8 @@ class AttendanceSummaryFragment :
|
|||||||
|
|
||||||
with(binding) {
|
with(binding) {
|
||||||
attendanceSummarySwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
attendanceSummarySwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
attendanceSummarySwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
attendanceSummarySwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
attendanceSummaryErrorRetry.setOnClickListener { presenter.onRetry() }
|
attendanceSummaryErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
attendanceSummaryErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
attendanceSummaryErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ import io.github.wulkanowy.databinding.FragmentConferenceBinding
|
|||||||
import io.github.wulkanowy.ui.base.BaseFragment
|
import io.github.wulkanowy.ui.base.BaseFragment
|
||||||
import io.github.wulkanowy.ui.modules.main.MainView
|
import io.github.wulkanowy.ui.modules.main.MainView
|
||||||
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
@ -47,7 +48,9 @@ class ConferenceFragment : BaseFragment<FragmentConferenceBinding>(R.layout.frag
|
|||||||
}
|
}
|
||||||
|
|
||||||
with(binding) {
|
with(binding) {
|
||||||
conferenceSwipe.setOnRefreshListener { presenter.onSwipeRefresh() }
|
conferenceSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
conferenceSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
conferenceSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
conferenceErrorRetry.setOnClickListener { presenter.onRetry() }
|
conferenceErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
conferenceErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
conferenceErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import io.github.wulkanowy.ui.modules.main.MainActivity
|
|||||||
import io.github.wulkanowy.ui.modules.main.MainView
|
import io.github.wulkanowy.ui.modules.main.MainView
|
||||||
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
||||||
import io.github.wulkanowy.utils.dpToPx
|
import io.github.wulkanowy.utils.dpToPx
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
@ -55,6 +56,8 @@ class ExamFragment : BaseFragment<FragmentExamBinding>(R.layout.fragment_exam),
|
|||||||
|
|
||||||
with(binding) {
|
with(binding) {
|
||||||
examSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
examSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
examSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
examSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
examErrorRetry.setOnClickListener { presenter.onRetry() }
|
examErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
examErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
examErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ import io.github.wulkanowy.ui.base.BaseFragment
|
|||||||
import io.github.wulkanowy.ui.modules.grade.GradeFragment
|
import io.github.wulkanowy.ui.modules.grade.GradeFragment
|
||||||
import io.github.wulkanowy.ui.modules.grade.GradeView
|
import io.github.wulkanowy.ui.modules.grade.GradeView
|
||||||
import io.github.wulkanowy.ui.modules.main.MainActivity
|
import io.github.wulkanowy.ui.modules.main.MainActivity
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
@ -65,7 +66,9 @@ class GradeDetailsFragment :
|
|||||||
layoutManager = LinearLayoutManager(context)
|
layoutManager = LinearLayoutManager(context)
|
||||||
adapter = gradeDetailsAdapter
|
adapter = gradeDetailsAdapter
|
||||||
}
|
}
|
||||||
gradeDetailsSwipe.setOnRefreshListener { presenter.onSwipeRefresh() }
|
gradeDetailsSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
gradeDetailsSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
gradeDetailsSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
gradeDetailsErrorRetry.setOnClickListener { presenter.onRetry() }
|
gradeDetailsErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
gradeDetailsErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
gradeDetailsErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import io.github.wulkanowy.ui.base.BaseFragment
|
|||||||
import io.github.wulkanowy.ui.modules.grade.GradeFragment
|
import io.github.wulkanowy.ui.modules.grade.GradeFragment
|
||||||
import io.github.wulkanowy.ui.modules.grade.GradeView
|
import io.github.wulkanowy.ui.modules.grade.GradeView
|
||||||
import io.github.wulkanowy.utils.dpToPx
|
import io.github.wulkanowy.utils.dpToPx
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import io.github.wulkanowy.utils.setOnItemSelectedListener
|
import io.github.wulkanowy.utils.setOnItemSelectedListener
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -69,6 +70,8 @@ class GradeStatisticsFragment :
|
|||||||
gradeStatisticsSubjectsContainer.setElevationCompat(requireContext().dpToPx(1f))
|
gradeStatisticsSubjectsContainer.setElevationCompat(requireContext().dpToPx(1f))
|
||||||
|
|
||||||
gradeStatisticsSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
gradeStatisticsSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
gradeStatisticsSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
gradeStatisticsSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
gradeStatisticsErrorRetry.setOnClickListener { presenter.onRetry() }
|
gradeStatisticsErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
gradeStatisticsErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
gradeStatisticsErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import io.github.wulkanowy.databinding.FragmentGradeSummaryBinding
|
|||||||
import io.github.wulkanowy.ui.base.BaseFragment
|
import io.github.wulkanowy.ui.base.BaseFragment
|
||||||
import io.github.wulkanowy.ui.modules.grade.GradeFragment
|
import io.github.wulkanowy.ui.modules.grade.GradeFragment
|
||||||
import io.github.wulkanowy.ui.modules.grade.GradeView
|
import io.github.wulkanowy.ui.modules.grade.GradeView
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
@ -52,7 +53,9 @@ class GradeSummaryFragment :
|
|||||||
adapter = gradeSummaryAdapter
|
adapter = gradeSummaryAdapter
|
||||||
}
|
}
|
||||||
with(binding) {
|
with(binding) {
|
||||||
gradeSummarySwipe.setOnRefreshListener { presenter.onSwipeRefresh() }
|
gradeSummarySwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
gradeSummarySwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
gradeSummarySwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
gradeSummaryErrorRetry.setOnClickListener { presenter.onRetry() }
|
gradeSummaryErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
gradeSummaryErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
gradeSummaryErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import io.github.wulkanowy.ui.modules.main.MainActivity
|
|||||||
import io.github.wulkanowy.ui.modules.main.MainView
|
import io.github.wulkanowy.ui.modules.main.MainView
|
||||||
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
||||||
import io.github.wulkanowy.utils.dpToPx
|
import io.github.wulkanowy.utils.dpToPx
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
@ -55,6 +56,8 @@ class HomeworkFragment : BaseFragment<FragmentHomeworkBinding>(R.layout.fragment
|
|||||||
|
|
||||||
with(binding) {
|
with(binding) {
|
||||||
homeworkSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
homeworkSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
homeworkSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
homeworkSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
homeworkErrorRetry.setOnClickListener { presenter.onRetry() }
|
homeworkErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
homeworkErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
homeworkErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import io.github.wulkanowy.data.db.entities.LuckyNumber
|
|||||||
import io.github.wulkanowy.databinding.FragmentLuckyNumberBinding
|
import io.github.wulkanowy.databinding.FragmentLuckyNumberBinding
|
||||||
import io.github.wulkanowy.ui.base.BaseFragment
|
import io.github.wulkanowy.ui.base.BaseFragment
|
||||||
import io.github.wulkanowy.ui.modules.main.MainView
|
import io.github.wulkanowy.ui.modules.main.MainView
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
@ -38,7 +39,9 @@ class LuckyNumberFragment :
|
|||||||
|
|
||||||
override fun initView() {
|
override fun initView() {
|
||||||
with(binding) {
|
with(binding) {
|
||||||
luckyNumberSwipe.setOnRefreshListener { presenter.onSwipeRefresh() }
|
luckyNumberSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
luckyNumberSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
luckyNumberSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
luckyNumberErrorRetry.setOnClickListener { presenter.onRetry() }
|
luckyNumberErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
luckyNumberErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
luckyNumberErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ import io.github.wulkanowy.ui.modules.main.MainActivity
|
|||||||
import io.github.wulkanowy.ui.modules.message.MessageFragment
|
import io.github.wulkanowy.ui.modules.message.MessageFragment
|
||||||
import io.github.wulkanowy.ui.modules.message.preview.MessagePreviewFragment
|
import io.github.wulkanowy.ui.modules.message.preview.MessagePreviewFragment
|
||||||
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import kotlinx.coroutines.FlowPreview
|
import kotlinx.coroutines.FlowPreview
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -74,7 +75,9 @@ class MessageTabFragment : BaseFragment<FragmentMessageTabBinding>(R.layout.frag
|
|||||||
addItemDecoration(DividerItemDecoration(context))
|
addItemDecoration(DividerItemDecoration(context))
|
||||||
}
|
}
|
||||||
with(binding) {
|
with(binding) {
|
||||||
messageTabSwipe.setOnRefreshListener { presenter.onSwipeRefresh() }
|
messageTabSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
messageTabSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
messageTabSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
messageTabErrorRetry.setOnClickListener { presenter.onRetry() }
|
messageTabErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
messageTabErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
messageTabErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ import io.github.wulkanowy.ui.modules.main.MainActivity
|
|||||||
import io.github.wulkanowy.ui.modules.main.MainView
|
import io.github.wulkanowy.ui.modules.main.MainView
|
||||||
import io.github.wulkanowy.ui.modules.mobiledevice.token.MobileDeviceTokenDialog
|
import io.github.wulkanowy.ui.modules.mobiledevice.token.MobileDeviceTokenDialog
|
||||||
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
@ -56,7 +57,9 @@ class MobileDeviceFragment :
|
|||||||
}
|
}
|
||||||
|
|
||||||
with(binding) {
|
with(binding) {
|
||||||
mobileDevicesSwipe.setOnRefreshListener { presenter.onSwipeRefresh() }
|
mobileDevicesSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
mobileDevicesSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
mobileDevicesSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
mobileDevicesErrorRetry.setOnClickListener { presenter.onRetry() }
|
mobileDevicesErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
mobileDevicesErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
mobileDevicesErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
mobileDeviceAddButton.setOnClickListener { presenter.onRegisterDevice() }
|
mobileDeviceAddButton.setOnClickListener { presenter.onRegisterDevice() }
|
||||||
|
@ -13,6 +13,7 @@ import io.github.wulkanowy.ui.base.BaseFragment
|
|||||||
import io.github.wulkanowy.ui.modules.main.MainActivity
|
import io.github.wulkanowy.ui.modules.main.MainActivity
|
||||||
import io.github.wulkanowy.ui.modules.main.MainView
|
import io.github.wulkanowy.ui.modules.main.MainView
|
||||||
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
@ -50,7 +51,9 @@ class NoteFragment : BaseFragment<FragmentNoteBinding>(R.layout.fragment_note),
|
|||||||
addItemDecoration(DividerItemDecoration(context))
|
addItemDecoration(DividerItemDecoration(context))
|
||||||
}
|
}
|
||||||
with(binding) {
|
with(binding) {
|
||||||
noteSwipe.setOnRefreshListener { presenter.onSwipeRefresh() }
|
noteSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
noteSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
noteSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
noteErrorRetry.setOnClickListener { presenter.onRetry() }
|
noteErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
noteErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
noteErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ import io.github.wulkanowy.ui.base.BaseFragment
|
|||||||
import io.github.wulkanowy.ui.modules.main.MainView
|
import io.github.wulkanowy.ui.modules.main.MainView
|
||||||
import io.github.wulkanowy.ui.modules.schoolandteachers.SchoolAndTeachersChildView
|
import io.github.wulkanowy.ui.modules.schoolandteachers.SchoolAndTeachersChildView
|
||||||
import io.github.wulkanowy.ui.modules.schoolandteachers.SchoolAndTeachersFragment
|
import io.github.wulkanowy.ui.modules.schoolandteachers.SchoolAndTeachersFragment
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import io.github.wulkanowy.utils.openDialer
|
import io.github.wulkanowy.utils.openDialer
|
||||||
import io.github.wulkanowy.utils.openNavigation
|
import io.github.wulkanowy.utils.openNavigation
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@ -39,7 +40,9 @@ class SchoolFragment : BaseFragment<FragmentSchoolBinding>(R.layout.fragment_sch
|
|||||||
|
|
||||||
override fun initView() {
|
override fun initView() {
|
||||||
with(binding) {
|
with(binding) {
|
||||||
schoolSwipe.setOnRefreshListener { presenter.onSwipeRefresh() }
|
schoolSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
schoolSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
schoolSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
schoolErrorRetry.setOnClickListener { presenter.onRetry() }
|
schoolErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
schoolErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
schoolErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import io.github.wulkanowy.ui.modules.main.MainView
|
|||||||
import io.github.wulkanowy.ui.modules.schoolandteachers.SchoolAndTeachersChildView
|
import io.github.wulkanowy.ui.modules.schoolandteachers.SchoolAndTeachersChildView
|
||||||
import io.github.wulkanowy.ui.modules.schoolandteachers.SchoolAndTeachersFragment
|
import io.github.wulkanowy.ui.modules.schoolandteachers.SchoolAndTeachersFragment
|
||||||
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
@ -51,7 +52,9 @@ class TeacherFragment : BaseFragment<FragmentTeacherBinding>(R.layout.fragment_t
|
|||||||
addItemDecoration(DividerItemDecoration(context))
|
addItemDecoration(DividerItemDecoration(context))
|
||||||
}
|
}
|
||||||
with(binding) {
|
with(binding) {
|
||||||
teacherSwipe.setOnRefreshListener { presenter.onSwipeRefresh() }
|
teacherSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
teacherSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
teacherSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
teacherErrorRetry.setOnClickListener { presenter.onRetry() }
|
teacherErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
teacherErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
teacherErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ import io.github.wulkanowy.databinding.FragmentStudentInfoBinding
|
|||||||
import io.github.wulkanowy.ui.base.BaseFragment
|
import io.github.wulkanowy.ui.base.BaseFragment
|
||||||
import io.github.wulkanowy.ui.modules.main.MainActivity
|
import io.github.wulkanowy.ui.modules.main.MainActivity
|
||||||
import io.github.wulkanowy.ui.modules.main.MainView
|
import io.github.wulkanowy.ui.modules.main.MainView
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
@ -72,7 +73,9 @@ class StudentInfoFragment :
|
|||||||
|
|
||||||
override fun initView() {
|
override fun initView() {
|
||||||
with(binding) {
|
with(binding) {
|
||||||
studentInfoSwipe.setOnRefreshListener { presenter.onSwipeRefresh() }
|
studentInfoSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
studentInfoSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
studentInfoSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
studentInfoErrorRetry.setOnClickListener { presenter.onRetry() }
|
studentInfoErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
studentInfoErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
studentInfoErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import io.github.wulkanowy.ui.modules.timetable.completed.CompletedLessonsFragme
|
|||||||
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
||||||
import io.github.wulkanowy.utils.SchooldaysRangeLimiter
|
import io.github.wulkanowy.utils.SchooldaysRangeLimiter
|
||||||
import io.github.wulkanowy.utils.dpToPx
|
import io.github.wulkanowy.utils.dpToPx
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -69,6 +70,8 @@ class TimetableFragment : BaseFragment<FragmentTimetableBinding>(R.layout.fragme
|
|||||||
|
|
||||||
with(binding) {
|
with(binding) {
|
||||||
timetableSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
timetableSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
timetableSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
timetableSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
timetableErrorRetry.setOnClickListener { presenter.onRetry() }
|
timetableErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
timetableErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
timetableErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ import io.github.wulkanowy.ui.modules.main.MainView
|
|||||||
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
||||||
import io.github.wulkanowy.utils.SchooldaysRangeLimiter
|
import io.github.wulkanowy.utils.SchooldaysRangeLimiter
|
||||||
import io.github.wulkanowy.utils.dpToPx
|
import io.github.wulkanowy.utils.dpToPx
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -53,6 +54,8 @@ class AdditionalLessonsFragment :
|
|||||||
|
|
||||||
with(binding) {
|
with(binding) {
|
||||||
additionalLessonsSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
additionalLessonsSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
additionalLessonsSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
additionalLessonsSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
additionalLessonsErrorRetry.setOnClickListener { presenter.onRetry() }
|
additionalLessonsErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
|
|
||||||
additionalLessonsPreviousButton.setOnClickListener { presenter.onPreviousDay() }
|
additionalLessonsPreviousButton.setOnClickListener { presenter.onPreviousDay() }
|
||||||
|
@ -18,6 +18,7 @@ import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
|||||||
import io.github.wulkanowy.utils.SchooldaysRangeLimiter
|
import io.github.wulkanowy.utils.SchooldaysRangeLimiter
|
||||||
import io.github.wulkanowy.utils.dpToPx
|
import io.github.wulkanowy.utils.dpToPx
|
||||||
import io.github.wulkanowy.utils.getCompatDrawable
|
import io.github.wulkanowy.utils.getCompatDrawable
|
||||||
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -60,6 +61,8 @@ class CompletedLessonsFragment :
|
|||||||
|
|
||||||
with(binding) {
|
with(binding) {
|
||||||
completedLessonsSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
completedLessonsSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||||
|
completedLessonsSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||||
|
completedLessonsSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||||
completedLessonErrorRetry.setOnClickListener { presenter.onRetry() }
|
completedLessonErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||||
completedLessonErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
completedLessonErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
<item name="colorTimetableChange">@color/timetable_change_light</item>
|
<item name="colorTimetableChange">@color/timetable_change_light</item>
|
||||||
<item name="colorError">@color/colorErrorLight</item>
|
<item name="colorError">@color/colorErrorLight</item>
|
||||||
<item name="colorDivider">@color/colorDividerInverse</item>
|
<item name="colorDivider">@color/colorDividerInverse</item>
|
||||||
|
<item name="colorSwipeRefresh">@color/colorSwipeRefreshDark</item>
|
||||||
<item name="android:windowBackground">?colorSurface</item>
|
<item name="android:windowBackground">?colorSurface</item>
|
||||||
<item name="android:textColor">?android:textColorPrimary</item>
|
<item name="android:textColor">?android:textColorPrimary</item>
|
||||||
<item name="android:navigationBarColor" tools:targetApi="lollipop">@android:color/black
|
<item name="android:navigationBarColor" tools:targetApi="lollipop">@android:color/black
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<attr name="colorDivider" format="color" />
|
<attr name="colorDivider" format="color" />
|
||||||
|
<attr name="colorSwipeRefresh" format="color" />
|
||||||
<attr name="colorTimetableChange" format="color" />
|
<attr name="colorTimetableChange" format="color" />
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -12,6 +12,9 @@
|
|||||||
<color name="colorDivider">#1f000000</color>
|
<color name="colorDivider">#1f000000</color>
|
||||||
<color name="colorDividerInverse">#1fffffff</color>
|
<color name="colorDividerInverse">#1fffffff</color>
|
||||||
|
|
||||||
|
<color name="colorSwipeRefreshDark">#ff383838</color>
|
||||||
|
<color name="colorSwipeRefresh">#ffffffff</color>
|
||||||
|
|
||||||
<color name="note_positive">#a0c431</color>
|
<color name="note_positive">#a0c431</color>
|
||||||
<color name="note_negative">#d43f3f</color>
|
<color name="note_negative">#d43f3f</color>
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
<item name="colorTimetableChange">@color/timetable_change_dark</item>
|
<item name="colorTimetableChange">@color/timetable_change_dark</item>
|
||||||
<item name="colorError">@color/colorError</item>
|
<item name="colorError">@color/colorError</item>
|
||||||
<item name="colorDivider">@color/colorDivider</item>
|
<item name="colorDivider">@color/colorDivider</item>
|
||||||
|
<item name="colorSwipeRefresh">@color/colorSwipeRefresh</item>
|
||||||
<item name="android:textColor">?android:textColorPrimary</item>
|
<item name="android:textColor">?android:textColorPrimary</item>
|
||||||
<item name="android:preferenceStyle">@style/PreferenceThemeOverlay</item>
|
<item name="android:preferenceStyle">@style/PreferenceThemeOverlay</item>
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user