Merge branch 'release/1.6.2'

This commit is contained in:
Mikołaj Pich 2022-04-10 20:37:17 +02:00
commit d5e0ae7b37
6 changed files with 39 additions and 39 deletions

View File

@ -22,8 +22,8 @@ android {
testApplicationId "io.github.tests.wulkanowy" testApplicationId "io.github.tests.wulkanowy"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 31 targetSdkVersion 31
versionCode 105 versionCode 106
versionName "1.6.1" versionName "1.6.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resValue "string", "app_name", "Wulkanowy" resValue "string", "app_name", "Wulkanowy"
@ -153,7 +153,7 @@ play {
defaultToAppBundles = false defaultToAppBundles = false
track = 'production' track = 'production'
releaseStatus = com.github.triplet.gradle.androidpublisher.ReleaseStatus.IN_PROGRESS releaseStatus = com.github.triplet.gradle.androidpublisher.ReleaseStatus.IN_PROGRESS
userFraction = 0.25d userFraction = 0.50d
updatePriority = 1 updatePriority = 1
enabled.set(false) enabled.set(false)
} }

View File

@ -21,15 +21,15 @@ import kotlinx.serialization.Serializable
import java.time.LocalDate import java.time.LocalDate
@Serializable @Serializable
sealed class Destination private constructor() : Parcelable { sealed class Destination : Parcelable {
/* /*
Type in children classes have to be as getter to avoid null in enums Type in children classes have to be as getter to avoid null in enums
https://stackoverflow.com/questions/68866453/kotlin-enum-val-is-returning-null-despite-being-set-at-compile-time https://stackoverflow.com/questions/68866453/kotlin-enum-val-is-returning-null-despite-being-set-at-compile-time
*/ */
abstract val type: Type abstract val destinationType: Type
abstract val fragment: Fragment abstract val destinationFragment: Fragment
enum class Type(val defaultDestination: Destination) { enum class Type(val defaultDestination: Destination) {
DASHBOARD(Dashboard), DASHBOARD(Dashboard),
@ -50,29 +50,29 @@ sealed class Destination private constructor() : Parcelable {
@Parcelize @Parcelize
@Serializable @Serializable
object Dashboard : Destination() { object Dashboard : Destination() {
override val type get() = Type.DASHBOARD override val destinationType get() = Type.DASHBOARD
override val fragment get() = DashboardFragment.newInstance() override val destinationFragment get() = DashboardFragment.newInstance()
} }
@Parcelize @Parcelize
@Serializable @Serializable
object Grade : Destination() { object Grade : Destination() {
override val type get() = Type.GRADE override val destinationType get() = Type.GRADE
override val fragment get() = GradeFragment.newInstance() override val destinationFragment get() = GradeFragment.newInstance()
} }
@Parcelize @Parcelize
@Serializable @Serializable
object Attendance : Destination() { object Attendance : Destination() {
override val type get() = Type.ATTENDANCE override val destinationType get() = Type.ATTENDANCE
override val fragment get() = AttendanceFragment.newInstance() override val destinationFragment get() = AttendanceFragment.newInstance()
} }
@Parcelize @Parcelize
@Serializable @Serializable
object Exam : Destination() { object Exam : Destination() {
override val type get() = Type.EXAM override val destinationType get() = Type.EXAM
override val fragment get() = ExamFragment.newInstance() override val destinationFragment get() = ExamFragment.newInstance()
} }
@Parcelize @Parcelize
@ -81,63 +81,63 @@ sealed class Destination private constructor() : Parcelable {
@Serializable(with = LocalDateSerializer::class) @Serializable(with = LocalDateSerializer::class)
private val date: LocalDate? = null private val date: LocalDate? = null
) : Destination() { ) : Destination() {
override val type get() = Type.TIMETABLE override val destinationType get() = Type.TIMETABLE
override val fragment get() = TimetableFragment.newInstance(date) override val destinationFragment get() = TimetableFragment.newInstance(date)
} }
@Parcelize @Parcelize
@Serializable @Serializable
object Homework : Destination() { object Homework : Destination() {
override val type get() = Type.HOMEWORK override val destinationType get() = Type.HOMEWORK
override val fragment get() = HomeworkFragment.newInstance() override val destinationFragment get() = HomeworkFragment.newInstance()
} }
@Parcelize @Parcelize
@Serializable @Serializable
object Note : Destination() { object Note : Destination() {
override val type get() = Type.NOTE override val destinationType get() = Type.NOTE
override val fragment get() = NoteFragment.newInstance() override val destinationFragment get() = NoteFragment.newInstance()
} }
@Parcelize @Parcelize
@Serializable @Serializable
object Conference : Destination() { object Conference : Destination() {
override val type get() = Type.CONFERENCE override val destinationType get() = Type.CONFERENCE
override val fragment get() = ConferenceFragment.newInstance() override val destinationFragment get() = ConferenceFragment.newInstance()
} }
@Parcelize @Parcelize
@Serializable @Serializable
object SchoolAnnouncement : Destination() { object SchoolAnnouncement : Destination() {
override val type get() = Type.SCHOOL_ANNOUNCEMENT override val destinationType get() = Type.SCHOOL_ANNOUNCEMENT
override val fragment get() = SchoolAnnouncementFragment.newInstance() override val destinationFragment get() = SchoolAnnouncementFragment.newInstance()
} }
@Parcelize @Parcelize
@Serializable @Serializable
object School : Destination() { object School : Destination() {
override val type get() = Type.SCHOOL override val destinationType get() = Type.SCHOOL
override val fragment get() = SchoolFragment.newInstance() override val destinationFragment get() = SchoolFragment.newInstance()
} }
@Parcelize @Parcelize
@Serializable @Serializable
object LuckyNumber : Destination() { object LuckyNumber : Destination() {
override val type get() = Type.LUCKY_NUMBER override val destinationType get() = Type.LUCKY_NUMBER
override val fragment get() = LuckyNumberFragment.newInstance() override val destinationFragment get() = LuckyNumberFragment.newInstance()
} }
@Parcelize @Parcelize
@Serializable @Serializable
object More : Destination() { object More : Destination() {
override val type get() = Type.MORE override val destinationType get() = Type.MORE
override val fragment get() = MoreFragment.newInstance() override val destinationFragment get() = MoreFragment.newInstance()
} }
@Parcelize @Parcelize
@Serializable @Serializable
object Message : Destination() { object Message : Destination() {
override val type get() = Type.MESSAGE override val destinationType get() = Type.MESSAGE
override val fragment get() = MessageFragment.newInstance() override val destinationFragment get() = MessageFragment.newInstance()
} }
} }

View File

@ -129,7 +129,7 @@ class MainActivity : BaseActivity<MainPresenter, ActivityMainBinding>(), MainVie
) )
} }
fragmentHideStrategy = HIDE fragmentHideStrategy = HIDE
rootFragments = rootDestinations.map { it.fragment } rootFragments = rootDestinations.map { it.destinationFragment }
initialize(startMenuIndex, savedInstanceState) initialize(startMenuIndex, savedInstanceState)
} }
@ -230,7 +230,7 @@ class MainActivity : BaseActivity<MainPresenter, ActivityMainBinding>(), MainVie
} }
override fun openMoreDestination(destination: Destination) { override fun openMoreDestination(destination: Destination) {
pushView(destination.fragment) pushView(destination.destinationFragment)
} }
override fun notifyMenuViewReselected() { override fun notifyMenuViewReselected() {

View File

@ -45,8 +45,8 @@ class MainPresenter @Inject constructor(
private val Destination?.startMenuIndex private val Destination?.startMenuIndex
get() = when { get() = when {
this == null -> prefRepository.startMenuIndex this == null -> prefRepository.startMenuIndex
type in rootDestinationTypeList -> { destinationType in rootDestinationTypeList -> {
rootDestinationTypeList.indexOf(type) rootDestinationTypeList.indexOf(destinationType)
} }
else -> 4 else -> 4
} }
@ -56,7 +56,7 @@ class MainPresenter @Inject constructor(
val startMenuIndex = initDestination.startMenuIndex val startMenuIndex = initDestination.startMenuIndex
val destinations = rootDestinationTypeList.map { val destinations = rootDestinationTypeList.map {
if (it == initDestination?.type) initDestination else it.defaultDestination if (it == initDestination?.destinationType) initDestination else it.defaultDestination
} }
view.initView(startMenuIndex, destinations) view.initView(startMenuIndex, destinations)

View File

@ -43,7 +43,7 @@ class NotificationsCenterFragment :
override fun initView() { override fun initView() {
notificationsCenterAdapter.onItemClickListener = { notification -> notificationsCenterAdapter.onItemClickListener = { notification ->
(requireActivity() as MainActivity).pushView(notification.destination.fragment) (requireActivity() as MainActivity).pushView(notification.destination.destinationFragment)
} }
with(binding.notificationsCenterRecycler) { with(binding.notificationsCenterRecycler) {

View File

@ -1,4 +1,4 @@
Wersja 1.6.0 Wersja 1.6.2
- dodaliśmy możliwość usuwania wielu wiadomości jednocześnie - dodaliśmy możliwość usuwania wielu wiadomości jednocześnie
- dodaliśmy opcję szybkiego dodawania sprawdzianów do kalendarza - dodaliśmy opcję szybkiego dodawania sprawdzianów do kalendarza