diff --git a/.github/workflows/deploy-store.yml b/.github/workflows/deploy-store.yml
index e7ed6b49a..8015ef640 100644
--- a/.github/workflows/deploy-store.yml
+++ b/.github/workflows/deploy-store.yml
@@ -71,4 +71,4 @@ jobs:
PLAY_KEY_ALIAS: ${{ secrets.PLAY_KEY_ALIAS }}
PLAY_KEY_PASSWORD: ${{ secrets.PLAY_KEY_PASSWORD }}
PLAY_STORE_PASSWORD: ${{ secrets.PLAY_STORE_PASSWORD }}
- run: ./gradlew assembleHmsRelease --stacktrace && ./gradlew publishHuaweiAppGalleryHmsRelease --stacktrace
+ run: ./gradlew bundleHmsRelease --stacktrace && ./gradlew publishHuaweiAppGalleryHmsRelease --stacktrace
diff --git a/app/build.gradle b/app/build.gradle
index 695dc6399..745859988 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -21,8 +21,8 @@ android {
testApplicationId "io.github.tests.wulkanowy"
minSdkVersion 21
targetSdkVersion 30
- versionCode 94
- versionName "1.2.1"
+ versionCode 95
+ versionName "1.2.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
@@ -141,14 +141,14 @@ huaweiPublish {
instances {
hmsRelease {
credentialsPath = "$rootDir/app/src/release/agconnect-credentials.json"
- buildFormat = "apk"
+ buildFormat = "aab"
deployType = "draft"
}
}
}
ext {
- work_manager = "2.5.0"
+ work_manager = "2.6.0"
android_hilt = "1.0.0"
room = "2.3.0"
chucker = "3.5.2"
@@ -157,7 +157,7 @@ ext {
}
dependencies {
- implementation "io.github.wulkanowy:sdk:1.2.1"
+ implementation "io.github.wulkanowy:sdk:1.2.2"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
@@ -177,7 +177,7 @@ dependencies {
implementation "androidx.constraintlayout:constraintlayout:2.1.0"
implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
implementation "com.google.android.material:material:1.4.0"
- implementation "com.github.wulkanowy:material-chips-input:2.2.0"
+ implementation "com.github.wulkanowy:material-chips-input:2.3.1"
implementation "com.github.PhilJay:MPAndroidChart:v3.1.0"
implementation 'com.github.lopspower:CircularImageView:4.2.0'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index a331c41f6..ad5adaf2e 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -119,11 +119,9 @@
-
): List
+ abstract suspend fun insertAll(student: List): List
@Delete
- suspend fun delete(student: Student)
+ abstract suspend fun delete(student: Student)
@Update(entity = Student::class)
- suspend fun update(studentNickAndAvatar: StudentNickAndAvatar)
+ abstract suspend fun update(studentNickAndAvatar: StudentNickAndAvatar)
@Query("SELECT * FROM Students WHERE is_current = 1")
- suspend fun loadCurrent(): Student?
+ abstract suspend fun loadCurrent(): Student?
@Query("SELECT * FROM Students WHERE id = :id")
- suspend fun loadById(id: Long): Student?
+ abstract suspend fun loadById(id: Long): Student?
@Query("SELECT * FROM Students")
- suspend fun loadAll(): List
+ abstract suspend fun loadAll(): List
@Transaction
@Query("SELECT * FROM Students")
- suspend fun loadStudentsWithSemesters(): List
+ abstract suspend fun loadStudentsWithSemesters(): List
@Query("UPDATE Students SET is_current = 1 WHERE id = :id")
- suspend fun updateCurrent(id: Long)
+ abstract suspend fun updateCurrent(id: Long)
@Query("UPDATE Students SET is_current = 0")
- suspend fun resetCurrent()
+ abstract suspend fun resetCurrent()
+
+ @Transaction
+ open suspend fun switchCurrent(id: Long) {
+ resetCurrent()
+ updateCurrent(id)
+ }
}
diff --git a/app/src/main/java/io/github/wulkanowy/data/repositories/StudentRepository.kt b/app/src/main/java/io/github/wulkanowy/data/repositories/StudentRepository.kt
index c2f364b3d..2ac892d01 100644
--- a/app/src/main/java/io/github/wulkanowy/data/repositories/StudentRepository.kt
+++ b/app/src/main/java/io/github/wulkanowy/data/repositories/StudentRepository.kt
@@ -1,7 +1,9 @@
package io.github.wulkanowy.data.repositories
import android.content.Context
+import androidx.room.withTransaction
import dagger.hilt.android.qualifiers.ApplicationContext
+import io.github.wulkanowy.data.db.AppDatabase
import io.github.wulkanowy.data.db.dao.SemesterDao
import io.github.wulkanowy.data.db.dao.StudentDao
import io.github.wulkanowy.data.db.entities.Student
@@ -25,7 +27,8 @@ class StudentRepository @Inject constructor(
private val studentDb: StudentDao,
private val semesterDb: SemesterDao,
private val sdk: Sdk,
- private val appInfo: AppInfo
+ private val appInfo: AppInfo,
+ private val appDatabase: AppDatabase
) {
suspend fun isStudentSaved() = getSavedStudents(false).isNotEmpty()
@@ -92,7 +95,7 @@ class StudentRepository @Inject constructor(
return student
}
- suspend fun saveStudents(studentsWithSemesters: List): List {
+ suspend fun saveStudents(studentsWithSemesters: List) {
val semesters = studentsWithSemesters.flatMap { it.semesters }
val students = studentsWithSemesters.map { it.student }
.map {
@@ -104,16 +107,21 @@ class StudentRepository @Inject constructor(
}
}
}
+ .mapIndexed { index, student ->
+ if (index == 0) {
+ student.copy(isCurrent = true).apply { avatarColor = student.avatarColor }
+ } else student
+ }
- semesterDb.insertSemesters(semesters)
- return studentDb.insertAll(students)
+ appDatabase.withTransaction {
+ studentDb.resetCurrent()
+ semesterDb.insertSemesters(semesters)
+ studentDb.insertAll(students)
+ }
}
suspend fun switchStudent(studentWithSemesters: StudentWithSemesters) {
- with(studentDb) {
- resetCurrent()
- updateCurrent(studentWithSemesters.student.id)
- }
+ studentDb.switchCurrent(studentWithSemesters.student.id)
}
suspend fun logoutStudent(student: Student) = studentDb.delete(student)
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendanceFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendanceFragment.kt
index 058946796..3fbdaec5a 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendanceFragment.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendanceFragment.kt
@@ -245,7 +245,9 @@ class AttendanceFragment : BaseFragment(R.layout.frag
presenter.onDateSet(date.year, date.monthValue, date.dayOfMonth)
}
- datePicker.show(this@AttendanceFragment.parentFragmentManager, null)
+ if (!parentFragmentManager.isStateSaved) {
+ datePicker.show(parentFragmentManager, null)
+ }
}
override fun showExcuseDialog() {
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendancePresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendancePresenter.kt
index 9a1598128..03545b25b 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendancePresenter.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendancePresenter.kt
@@ -152,6 +152,8 @@ class AttendancePresenter @Inject constructor(
fun onExcuseDialogSubmit(reason: String) {
view?.finishActionMode()
+ if (attendanceToExcuseList.isEmpty()) return
+
if (isVulcanExcusedFunctionEnabled) {
excuseAbsence(
reason = reason.takeIf { it.isNotBlank() },
@@ -234,6 +236,7 @@ class AttendancePresenter @Inject constructor(
enableSwipe(true)
showRefresh(true)
showProgress(false)
+ showErrorView(false)
showEmpty(filteredAttendance.isEmpty())
showContent(filteredAttendance.isNotEmpty())
updateData(filteredAttendance.sortedBy { item -> item.number })
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryPresenter.kt
index e53cda749..8b603837b 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryPresenter.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryPresenter.kt
@@ -82,7 +82,13 @@ class AttendanceSummaryPresenter @Inject constructor(
flowWithResourceIn {
val student = studentRepository.getCurrentStudent()
val semester = semesterRepository.getCurrentSemester(student)
- attendanceSummaryRepository.getAttendanceSummary(student, semester, subjectId, forceRefresh)
+
+ attendanceSummaryRepository.getAttendanceSummary(
+ student = student,
+ semester = semester,
+ subjectId = subjectId,
+ forceRefresh = forceRefresh
+ )
}.onEach {
when (it.status) {
Status.LOADING -> {
@@ -92,6 +98,7 @@ class AttendanceSummaryPresenter @Inject constructor(
showRefresh(true)
showProgress(false)
showContent(true)
+ showErrorView(false)
updateDataSet(sortItems(it.data))
}
}
@@ -99,6 +106,7 @@ class AttendanceSummaryPresenter @Inject constructor(
Status.SUCCESS -> {
Timber.i("Loading attendance summary result: Success")
view?.apply {
+ showErrorView(false)
showEmpty(it.data!!.isEmpty())
showContent(it.data.isNotEmpty())
updateDataSet(sortItems(it.data))
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/dashboard/DashboardAdapter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/dashboard/DashboardAdapter.kt
index 56503d027..0eda49326 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/dashboard/DashboardAdapter.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/dashboard/DashboardAdapter.kt
@@ -31,6 +31,7 @@ import io.github.wulkanowy.utils.getThemeAttrColor
import io.github.wulkanowy.utils.left
import io.github.wulkanowy.utils.nickOrName
import io.github.wulkanowy.utils.toFormattedString
+import timber.log.Timber
import java.time.Duration
import java.time.LocalDate
import java.time.LocalDateTime
@@ -170,6 +171,8 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter {
context.getThemeAttrColor(R.attr.colorOnSurface)
@@ -199,13 +202,12 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter {
@@ -220,7 +222,8 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter {
matchConstraintPercentWidth = when {
luckyNumber == null && unreadMessagesCount == null -> 1.0f
@@ -232,7 +235,8 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter Timber.d("Login student select students load started")
Status.SUCCESS -> view?.updateData(studentsWithSemesters.map { studentWithSemesters ->
- studentWithSemesters to it.data!!.any { item -> compareStudents(studentWithSemesters.student, item.student) }
+ studentWithSemesters to it.data!!.any { item ->
+ compareStudents(studentWithSemesters.student, item.student)
+ }
})
Status.ERROR -> {
errorHandler.dispatch(it.error!!)
@@ -95,35 +97,32 @@ class LoginStudentSelectPresenter @Inject constructor(
}
private fun registerStudents(studentsWithSemesters: List) {
- flowWithResource {
- val savedStudents = studentRepository.saveStudents(studentsWithSemesters)
- val firstRegistered = studentsWithSemesters.first().apply { student.id = savedStudents.first() }
- studentRepository.switchStudent(firstRegistered)
- }.onEach {
- when (it.status) {
- Status.LOADING -> view?.run {
- Timber.i("Registration started")
- showProgress(true)
- showContent(false)
- }
- Status.SUCCESS -> {
- Timber.i("Registration result: Success")
- view?.openMainView()
- logRegisterEvent(studentsWithSemesters)
- }
- Status.ERROR -> {
- Timber.i("Registration result: An exception occurred ")
- view?.apply {
- showProgress(false)
- showContent(true)
- showContact(true)
+ flowWithResource { studentRepository.saveStudents(studentsWithSemesters) }
+ .onEach {
+ when (it.status) {
+ Status.LOADING -> view?.run {
+ Timber.i("Registration started")
+ showProgress(true)
+ showContent(false)
+ }
+ Status.SUCCESS -> {
+ Timber.i("Registration result: Success")
+ view?.openMainView()
+ logRegisterEvent(studentsWithSemesters)
+ }
+ Status.ERROR -> {
+ Timber.i("Registration result: An exception occurred ")
+ view?.apply {
+ showProgress(false)
+ showContent(true)
+ showContact(true)
+ }
+ lastError = it.error
+ loginErrorHandler.dispatch(it.error!!)
+ logRegisterEvent(studentsWithSemesters, it.error)
}
- lastError = it.error
- loginErrorHandler.dispatch(it.error!!)
- logRegisterEvent(studentsWithSemesters, it.error)
}
- }
- }.launch("register")
+ }.launch("register")
}
fun onDiscordClick() {
@@ -134,7 +133,10 @@ class LoginStudentSelectPresenter @Inject constructor(
view?.openEmail(lastError?.message.ifNullOrBlank { "empty" })
}
- private fun logRegisterEvent(studentsWithSemesters: List, error: Throwable? = null) {
+ private fun logRegisterEvent(
+ studentsWithSemesters: List,
+ error: Throwable? = null
+ ) {
studentsWithSemesters.forEach { student ->
analytics.logEvent(
"registration_student_select",
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/history/LuckyNumberHistoryFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/history/LuckyNumberHistoryFragment.kt
index dc141f8d3..3a84b2dd5 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/history/LuckyNumberHistoryFragment.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/history/LuckyNumberHistoryFragment.kt
@@ -131,7 +131,9 @@ class LuckyNumberHistoryFragment :
presenter.onDateSet(date.year, date.monthValue, date.dayOfMonth)
}
- datePicker.show(this@LuckyNumberHistoryFragment.parentFragmentManager, null)
+ if (!parentFragmentManager.isStateSaved) {
+ datePicker.show(parentFragmentManager, null)
+ }
}
override fun showContent(show: Boolean) {
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabPresenter.kt
index 3e5e09b48..a24f9b79f 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabPresenter.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabPresenter.kt
@@ -117,6 +117,7 @@ class MessageTabPresenter @Inject constructor(
if (!it.data.isNullOrEmpty()) {
view?.run {
enableSwipe(true)
+ showErrorView(false)
showRefresh(true)
showProgress(false)
showContent(true)
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreFragment.kt
index 2f0957c46..145b12a35 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreFragment.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreFragment.kt
@@ -11,6 +11,7 @@ import io.github.wulkanowy.ui.base.BaseFragment
import io.github.wulkanowy.ui.modules.conference.ConferenceFragment
import io.github.wulkanowy.ui.modules.exam.ExamFragment
import io.github.wulkanowy.ui.modules.homework.HomeworkFragment
+import io.github.wulkanowy.ui.modules.luckynumber.LuckyNumberFragment
import io.github.wulkanowy.ui.modules.main.MainActivity
import io.github.wulkanowy.ui.modules.main.MainView
import io.github.wulkanowy.ui.modules.message.MessageFragment
@@ -66,6 +67,9 @@ class MoreFragment : BaseFragment(R.layout.fragment_more),
override val examRes: Pair?
get() = context?.run { getString(R.string.exam_title) to getCompatDrawable(R.drawable.ic_main_exam) }
+ override val luckyNumberRes: Pair?
+ get() = context?.run { getString(R.string.lucky_number_title) to getCompatDrawable(R.drawable.ic_more_lucky_number) }
+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding = FragmentMoreBinding.bind(view)
@@ -128,6 +132,10 @@ class MoreFragment : BaseFragment(R.layout.fragment_more),
(activity as? MainActivity)?.pushView(ExamFragment.newInstance())
}
+ override fun openLuckyNumberView() {
+ (activity as? MainActivity)?.pushView(LuckyNumberFragment.newInstance())
+ }
+
override fun popView(depth: Int) {
(activity as? MainActivity)?.popView(depth)
}
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/more/MorePresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/more/MorePresenter.kt
index a2b7f204e..92551d6e9 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/more/MorePresenter.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/more/MorePresenter.kt
@@ -31,6 +31,7 @@ class MorePresenter @Inject constructor(
schoolAndTeachersRes?.first -> openSchoolAndTeachersView()
mobileDevicesRes?.first -> openMobileDevicesView()
settingsRes?.first -> openSettingsView()
+ luckyNumberRes?.first -> openLuckyNumberView()
}
}
}
@@ -48,6 +49,7 @@ class MorePresenter @Inject constructor(
examRes,
homeworkRes,
noteRes,
+ luckyNumberRes,
conferencesRes,
schoolAnnouncementRes,
schoolAndTeachersRes,
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreView.kt
index c4a07bdcc..cb895de28 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreView.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreView.kt
@@ -23,6 +23,8 @@ interface MoreView : BaseView {
val examRes: Pair?
+ val luckyNumberRes: Pair?
+
fun initView()
fun updateData(data: List>)
@@ -46,4 +48,6 @@ interface MoreView : BaseView {
fun openMobileDevicesView()
fun openExamView()
+
+ fun openLuckyNumberView()
}
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/schoolannouncement/SchoolAnnouncementPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/schoolannouncement/SchoolAnnouncementPresenter.kt
index 88ad81465..d6a32e3cc 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/schoolannouncement/SchoolAnnouncementPresenter.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/schoolannouncement/SchoolAnnouncementPresenter.kt
@@ -64,6 +64,7 @@ class SchoolAnnouncementPresenter @Inject constructor(
view?.run {
enableSwipe(true)
showRefresh(true)
+ showErrorView(false)
showProgress(false)
showContent(true)
updateData(it.data)
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableFragment.kt
index 1e1084a8d..83218a0da 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableFragment.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableFragment.kt
@@ -202,7 +202,9 @@ class TimetableFragment : BaseFragment(R.layout.fragme
presenter.onDateSet(date.year, date.monthValue, date.dayOfMonth)
}
- datePicker.show(this@TimetableFragment.parentFragmentManager, null)
+ if (!parentFragmentManager.isStateSaved) {
+ datePicker.show(parentFragmentManager, null)
+ }
}
override fun openAdditionalLessonsView() {
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetablePresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetablePresenter.kt
index fa1bbfb28..86e993982 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetablePresenter.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetablePresenter.kt
@@ -149,6 +149,7 @@ class TimetablePresenter @Inject constructor(
view?.run {
enableSwipe(true)
showRefresh(true)
+ showErrorView(false)
showProgress(false)
showContent(true)
updateData(it.data!!.lessons)
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/additional/AdditionalLessonsFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/additional/AdditionalLessonsFragment.kt
index a4e1f0fc0..47bee1e39 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/additional/AdditionalLessonsFragment.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/additional/AdditionalLessonsFragment.kt
@@ -152,7 +152,9 @@ class AdditionalLessonsFragment :
presenter.onDateSet(date.year, date.monthValue, date.dayOfMonth)
}
- datePicker.show(this@AdditionalLessonsFragment.parentFragmentManager, null)
+ if (!parentFragmentManager.isStateSaved) {
+ datePicker.show(parentFragmentManager, null)
+ }
}
override fun onSaveInstanceState(outState: Bundle) {
diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsFragment.kt
index ad698c1cf..b8da1c0fd 100644
--- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsFragment.kt
+++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsFragment.kt
@@ -173,7 +173,9 @@ class CompletedLessonsFragment :
presenter.onDateSet(date.year, date.monthValue, date.dayOfMonth)
}
- datePicker.show(this@CompletedLessonsFragment.parentFragmentManager, null)
+ if (!parentFragmentManager.isStateSaved) {
+ datePicker.show(parentFragmentManager, null)
+ }
}
override fun onSaveInstanceState(outState: Bundle) {
diff --git a/app/src/main/java/io/github/wulkanowy/utils/ContextExtension.kt b/app/src/main/java/io/github/wulkanowy/utils/ContextExtension.kt
index 68d3afe83..2cd4459eb 100644
--- a/app/src/main/java/io/github/wulkanowy/utils/ContextExtension.kt
+++ b/app/src/main/java/io/github/wulkanowy/utils/ContextExtension.kt
@@ -102,7 +102,9 @@ fun Context.openNavigation(location: String) {
fun Context.openDialer(phone: String) {
val intentUri = Uri.parse("tel:$phone")
val intent = Intent(Intent.ACTION_DIAL, intentUri)
- startActivity(intent)
+ if (intent.resolveActivity(packageManager) != null) {
+ startActivity(intent)
+ }
}
fun Context.shareText(text: String, subject: String?) {
diff --git a/app/src/main/java/io/github/wulkanowy/utils/SchooldaysValidator.kt b/app/src/main/java/io/github/wulkanowy/utils/SchooldaysValidator.kt
index 00fccfc8d..b6dd528f5 100644
--- a/app/src/main/java/io/github/wulkanowy/utils/SchooldaysValidator.kt
+++ b/app/src/main/java/io/github/wulkanowy/utils/SchooldaysValidator.kt
@@ -2,7 +2,6 @@ package io.github.wulkanowy.utils
import com.google.android.material.datepicker.CalendarConstraints
import kotlinx.parcelize.Parcelize
-import java.time.DayOfWeek
import java.time.temporal.ChronoUnit
@Parcelize
@@ -12,7 +11,6 @@ class SchoolDaysValidator(val start: Long, val end: Long) : CalendarConstraints.
val date = dateLong.toLocalDateTime()
return date.until(end.toLocalDateTime(), ChronoUnit.DAYS) >= 0 &&
- date.until(start.toLocalDateTime(), ChronoUnit.DAYS) <= 0 &&
- date.dayOfWeek != DayOfWeek.SUNDAY
+ date.until(start.toLocalDateTime(), ChronoUnit.DAYS) <= 0
}
-}
\ No newline at end of file
+}
diff --git a/app/src/main/play/release-notes/pl-PL/default.txt b/app/src/main/play/release-notes/pl-PL/default.txt
index aeef2a77e..3456c3d03 100644
--- a/app/src/main/play/release-notes/pl-PL/default.txt
+++ b/app/src/main/play/release-notes/pl-PL/default.txt
@@ -1,7 +1,8 @@
-Wersja 1.2.1
+Wersja 1.2.2
-- dodaliśmy brakujące okienka z podglądem szczegółów ogłoszeń szkolnych
-- naprawiliśmy rzucające się w oczy błędy na ekranie startowym
-- naprawiliśmy też inne drobne błędy w wyglądzie i stabilności aplikacji
+- naprawiliśmy problem z widocznością zadań w aplikacji gdy widoczne są one na stronie www dziennika (nadal pozostaje błąd z zadaniami widocznymi tylko w oficjalnej aplikacji - czekamy na poprawkę po stronie VULCANa)
+- odblokowaliśmy niedzielę w wyborze daty w planie lekcji i innych zakładkach
+- przywróciliśmy odnośnik do szczęśliwego numerka w menu Więcej
+- naprawiliśmy drobne błędy ze stabilnością i wyglądem
Pełna lista zmian: https://github.com/wulkanowy/wulkanowy/releases
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index cf8a07604..295d83193 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -69,7 +69,7 @@
Discord
Send email
Zgłoszenie: Problemy z logowaniem
- Informacje o aplikacji:\n\nUrządzenie: %1$s\nWersja SDK: %2$s\nWersja aplikacji: %3$s\nDodatkowe informacje: %4$s\nOstatni błąd: %5$s\n\nOpis problemu:
+ Informacje o aplikacji:\n\nUrządzenie: %1$s\nWersja SDK: %2$s\nWersja aplikacji: %3$s\nDodatkowe informacje: %4$s\nOstatni błąd: %5$s\n\nOpis problemu (pełna nazwa szkoły, klasa ucznia):
Make sure you select the correct UONET+ register variation!
I forgot my password
Recover your account
diff --git a/app/src/test/java/io/github/wulkanowy/data/repositories/StudentTest.kt b/app/src/test/java/io/github/wulkanowy/data/repositories/StudentTest.kt
index 402b22723..b34bbf1b2 100644
--- a/app/src/test/java/io/github/wulkanowy/data/repositories/StudentTest.kt
+++ b/app/src/test/java/io/github/wulkanowy/data/repositories/StudentTest.kt
@@ -37,7 +37,8 @@ class StudentTest {
studentDb,
semesterDb,
mockSdk,
- AppInfo()
+ AppInfo(),
+ mockk()
)
}
diff --git a/app/src/test/java/io/github/wulkanowy/ui/modules/login/studentselect/LoginStudentSelectPresenterTest.kt b/app/src/test/java/io/github/wulkanowy/ui/modules/login/studentselect/LoginStudentSelectPresenterTest.kt
index 9e34235e7..c79d739e8 100644
--- a/app/src/test/java/io/github/wulkanowy/ui/modules/login/studentselect/LoginStudentSelectPresenterTest.kt
+++ b/app/src/test/java/io/github/wulkanowy/ui/modules/login/studentselect/LoginStudentSelectPresenterTest.kt
@@ -89,24 +89,11 @@ class LoginStudentSelectPresenterTest {
@Test
fun onSelectedStudentTest() {
coEvery {
- studentRepository.saveStudents(
- listOf(
- StudentWithSemesters(
- testStudent,
- emptyList()
- )
- )
- )
- } returns listOf(1L)
- coEvery {
- studentRepository.switchStudent(
- StudentWithSemesters(
- testStudent,
- emptyList()
- )
- )
+ studentRepository.saveStudents(listOf(StudentWithSemesters(testStudent, emptyList())))
} just Runs
+
every { loginStudentSelectView.openMainView() } just Runs
+
presenter.onItemSelected(StudentWithSemesters(testStudent, emptyList()), false)
presenter.onSignIn()
@@ -118,18 +105,14 @@ class LoginStudentSelectPresenterTest {
@Test
fun onSelectedStudentErrorTest() {
coEvery {
- studentRepository.saveStudents(
- listOf(
- StudentWithSemesters(
- testStudent,
- emptyList()
- )
- )
- )
+ studentRepository.saveStudents(listOf(StudentWithSemesters(testStudent, emptyList())))
} throws testException
+
coEvery { studentRepository.logoutStudent(testStudent) } just Runs
+
presenter.onItemSelected(StudentWithSemesters(testStudent, emptyList()), false)
presenter.onSignIn()
+
verify { loginStudentSelectView.showContent(false) }
verify { loginStudentSelectView.showProgress(true) }
verify { errorHandler.dispatch(match { testException.message == it.message }) }