forked from github/wulkanowy-mirror
Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
c69bb2ef71 | |||
9cb4754132 | |||
5ba8289c87 | |||
258782c648 | |||
c568bc1515 | |||
da668f93cf | |||
037dbd792f | |||
7ec7afed87 | |||
bea50e6db5 | |||
6a00e75816 | |||
957adaf6ee | |||
827fb33eeb | |||
19c96ee83f | |||
5a7f52c773 | |||
dddeff802f | |||
91f6310892 | |||
0389642543 | |||
8528e0beff | |||
e665a8f18b | |||
6d5acbad2c | |||
7217d0f753 | |||
16a5d88dfb | |||
646a46727f | |||
f5e9197f98 | |||
b47f26684b | |||
3a03b5f1c6 |
2
.github/workflows/deploy-store.yml
vendored
2
.github/workflows/deploy-store.yml
vendored
@ -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
|
||||
|
@ -21,8 +21,8 @@ android {
|
||||
testApplicationId "io.github.tests.wulkanowy"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 30
|
||||
versionCode 94
|
||||
versionName "1.2.1"
|
||||
versionCode 96
|
||||
versionName "1.2.3"
|
||||
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.3"
|
||||
|
||||
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'
|
||||
|
||||
@ -211,7 +211,7 @@ dependencies {
|
||||
implementation 'me.xdrop:fuzzywuzzy:1.3.1'
|
||||
implementation 'com.fredporciuncula:flow-preferences:1.5.0'
|
||||
|
||||
playImplementation platform('com.google.firebase:firebase-bom:28.4.0')
|
||||
playImplementation platform('com.google.firebase:firebase-bom:28.4.1')
|
||||
playImplementation 'com.google.firebase:firebase-analytics-ktx'
|
||||
playImplementation 'com.google.firebase:firebase-messaging:'
|
||||
playImplementation 'com.google.firebase:firebase-crashlytics:'
|
||||
|
@ -119,11 +119,9 @@
|
||||
<receiver android:name=".services.alarm.TimetableNotificationReceiver" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.work.impl.WorkManagerInitializer"
|
||||
android:authorities="${applicationId}.workmanager-init"
|
||||
android:exported="false"
|
||||
android:name="androidx.startup.InitializationProvider"
|
||||
android:authorities="${applicationId}.androidx-startup"
|
||||
tools:node="remove" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
|
@ -14,33 +14,39 @@ import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
@Dao
|
||||
interface StudentDao {
|
||||
abstract class StudentDao {
|
||||
|
||||
@Insert(onConflict = ABORT)
|
||||
suspend fun insertAll(student: List<Student>): List<Long>
|
||||
abstract suspend fun insertAll(student: List<Student>): List<Long>
|
||||
|
||||
@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<Student>
|
||||
abstract suspend fun loadAll(): List<Student>
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT * FROM Students")
|
||||
suspend fun loadStudentsWithSemesters(): List<StudentWithSemesters>
|
||||
abstract suspend fun loadStudentsWithSemesters(): List<StudentWithSemesters>
|
||||
|
||||
@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)
|
||||
}
|
||||
}
|
||||
|
@ -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<StudentWithSemesters>): List<Long> {
|
||||
suspend fun saveStudents(studentsWithSemesters: List<StudentWithSemesters>) {
|
||||
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)
|
||||
|
@ -121,10 +121,14 @@ class AccountDetailsFragment :
|
||||
}
|
||||
}
|
||||
|
||||
override fun popView() {
|
||||
override fun popViewToMain() {
|
||||
(requireActivity() as MainActivity).popView(2)
|
||||
}
|
||||
|
||||
override fun popViewToAccounts() {
|
||||
(requireActivity() as MainActivity).popView(1)
|
||||
}
|
||||
|
||||
override fun recreateMainView() {
|
||||
requireActivity().recreate()
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ class AccountDetailsPresenter @Inject constructor(
|
||||
}
|
||||
}
|
||||
}.afterLoading {
|
||||
view?.popView()
|
||||
view?.popViewToMain()
|
||||
}.launch("switch")
|
||||
}
|
||||
|
||||
@ -152,11 +152,14 @@ class AccountDetailsPresenter @Inject constructor(
|
||||
syncManager.stopSyncWorker()
|
||||
openClearLoginView()
|
||||
}
|
||||
studentWithSemesters!!.student.isCurrent -> {
|
||||
studentWithSemesters?.student?.isCurrent == true -> {
|
||||
Timber.i("Logout result: Logout student and switch to another")
|
||||
recreateMainView()
|
||||
}
|
||||
else -> Timber.i("Logout result: Logout student")
|
||||
else -> {
|
||||
Timber.i("Logout result: Logout student")
|
||||
recreateMainView()
|
||||
}
|
||||
}
|
||||
}
|
||||
Status.ERROR -> {
|
||||
@ -165,7 +168,11 @@ class AccountDetailsPresenter @Inject constructor(
|
||||
}
|
||||
}
|
||||
}.afterLoading {
|
||||
view?.popView()
|
||||
if (studentWithSemesters?.student?.isCurrent == true) {
|
||||
view?.popViewToMain()
|
||||
} else {
|
||||
view?.popViewToAccounts()
|
||||
}
|
||||
}.launch("logout")
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,9 @@ interface AccountDetailsView : BaseView {
|
||||
|
||||
fun showLogoutConfirmDialog()
|
||||
|
||||
fun popView()
|
||||
fun popViewToMain()
|
||||
|
||||
fun popViewToAccounts()
|
||||
|
||||
fun recreateMainView()
|
||||
|
||||
|
@ -245,7 +245,9 @@ class AttendanceFragment : BaseFragment<FragmentAttendanceBinding>(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() {
|
||||
|
@ -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 })
|
||||
|
@ -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))
|
||||
|
@ -14,6 +14,8 @@ class ConferenceAdapter @Inject constructor() :
|
||||
|
||||
var items = emptyList<Conference>()
|
||||
|
||||
var onItemClickListener: (Conference) -> Unit = {}
|
||||
|
||||
override fun getItemCount() = items.size
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = ItemViewHolder(
|
||||
@ -28,7 +30,10 @@ class ConferenceAdapter @Inject constructor() :
|
||||
conferenceItemTitle.text = item.title
|
||||
conferenceItemSubject.text = item.subject
|
||||
conferenceItemContent.text = item.agenda
|
||||
conferenceItemContent.visibility = if (item.agenda.isBlank()) View.GONE else View.VISIBLE
|
||||
conferenceItemContent.visibility =
|
||||
if (item.agenda.isBlank()) View.GONE else View.VISIBLE
|
||||
|
||||
root.setOnClickListener { onItemClickListener(item) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,60 @@
|
||||
package io.github.wulkanowy.ui.modules.conference
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import io.github.wulkanowy.data.db.entities.Conference
|
||||
import io.github.wulkanowy.databinding.DialogConferenceBinding
|
||||
import io.github.wulkanowy.utils.lifecycleAwareVariable
|
||||
import io.github.wulkanowy.utils.toFormattedString
|
||||
|
||||
class ConferenceDialog : DialogFragment() {
|
||||
|
||||
private var binding: DialogConferenceBinding by lifecycleAwareVariable()
|
||||
|
||||
private lateinit var conference: Conference
|
||||
|
||||
companion object {
|
||||
|
||||
private const val ARGUMENT_KEY = "item"
|
||||
|
||||
fun newInstance(conference: Conference) = ConferenceDialog().apply {
|
||||
arguments = Bundle().apply { putSerializable(ARGUMENT_KEY, conference) }
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setStyle(STYLE_NO_TITLE, 0)
|
||||
arguments?.let {
|
||||
conference = it.getSerializable(ARGUMENT_KEY) as Conference
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
) = DialogConferenceBinding.inflate(inflater).also { binding = it }.root
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
with(binding) {
|
||||
conferenceDialogClose.setOnClickListener { dismiss() }
|
||||
|
||||
conferenceDialogSubjectValue.text = conference.subject
|
||||
conferenceDialogDateValue.text = conference.date.toFormattedString("dd.MM.yyyy HH:mm")
|
||||
conferenceDialogHeaderValue.text = conference.title
|
||||
conferenceDialogAgendaValue.text = conference.agenda
|
||||
conferenceDialogPresentValue.text = conference.presentOnConference
|
||||
conferenceDialogPresentValue.isVisible = conference.presentOnConference.isNotBlank()
|
||||
conferenceDialogPresentTitle.isVisible = conference.presentOnConference.isNotBlank()
|
||||
conferenceDialogAgendaValue.isVisible = conference.agenda.isNotBlank()
|
||||
conferenceDialogAgendaTitle.isVisible = conference.agenda.isNotBlank()
|
||||
}
|
||||
}
|
||||
}
|
@ -8,6 +8,7 @@ import io.github.wulkanowy.R
|
||||
import io.github.wulkanowy.data.db.entities.Conference
|
||||
import io.github.wulkanowy.databinding.FragmentConferenceBinding
|
||||
import io.github.wulkanowy.ui.base.BaseFragment
|
||||
import io.github.wulkanowy.ui.modules.main.MainActivity
|
||||
import io.github.wulkanowy.ui.modules.main.MainView
|
||||
import io.github.wulkanowy.ui.widgets.DividerItemDecoration
|
||||
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||
@ -41,6 +42,8 @@ class ConferenceFragment : BaseFragment<FragmentConferenceBinding>(R.layout.frag
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
conferencesAdapter.onItemClickListener = presenter::onItemSelected
|
||||
|
||||
with(binding.conferenceRecycler) {
|
||||
layoutManager = LinearLayoutManager(context)
|
||||
adapter = conferencesAdapter
|
||||
@ -50,7 +53,11 @@ class ConferenceFragment : BaseFragment<FragmentConferenceBinding>(R.layout.frag
|
||||
with(binding) {
|
||||
conferenceSwipe.setOnRefreshListener(presenter::onSwipeRefresh)
|
||||
conferenceSwipe.setColorSchemeColors(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
||||
conferenceSwipe.setProgressBackgroundColorSchemeColor(requireContext().getThemeAttrColor(R.attr.colorSwipeRefresh))
|
||||
conferenceSwipe.setProgressBackgroundColorSchemeColor(
|
||||
requireContext().getThemeAttrColor(
|
||||
R.attr.colorSwipeRefresh
|
||||
)
|
||||
)
|
||||
conferenceErrorRetry.setOnClickListener { presenter.onRetry() }
|
||||
conferenceErrorDetails.setOnClickListener { presenter.onDetailsClick() }
|
||||
}
|
||||
@ -98,6 +105,10 @@ class ConferenceFragment : BaseFragment<FragmentConferenceBinding>(R.layout.frag
|
||||
binding.conferenceRecycler.visibility = if (show) View.VISIBLE else View.GONE
|
||||
}
|
||||
|
||||
override fun openConferenceDialog(conference: Conference) {
|
||||
(activity as? MainActivity)?.showDialogFragment(ConferenceDialog.newInstance(conference))
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
presenter.onDetachView()
|
||||
super.onDestroyView()
|
||||
|
@ -1,6 +1,7 @@
|
||||
package io.github.wulkanowy.ui.modules.conference
|
||||
|
||||
import io.github.wulkanowy.data.Status
|
||||
import io.github.wulkanowy.data.db.entities.Conference
|
||||
import io.github.wulkanowy.data.repositories.ConferenceRepository
|
||||
import io.github.wulkanowy.data.repositories.SemesterRepository
|
||||
import io.github.wulkanowy.data.repositories.StudentRepository
|
||||
@ -43,6 +44,10 @@ class ConferencePresenter @Inject constructor(
|
||||
loadData(true)
|
||||
}
|
||||
|
||||
fun onItemSelected(conference: Conference) {
|
||||
view?.openConferenceDialog(conference)
|
||||
}
|
||||
|
||||
fun onDetailsClick() {
|
||||
view?.showErrorDetailsDialog(lastError)
|
||||
}
|
||||
|
@ -26,4 +26,6 @@ interface ConferenceView : BaseView {
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showContent(show: Boolean)
|
||||
|
||||
fun openConferenceDialog(conference: Conference)
|
||||
}
|
||||
|
@ -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
|
||||
@ -52,7 +53,7 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
||||
|
||||
var onAttendanceTileClickListener: () -> Unit = {}
|
||||
|
||||
var onLessonsTileClickListener: () -> Unit = {}
|
||||
var onLessonsTileClickListener: (LocalDate) -> Unit = {}
|
||||
|
||||
var onHomeworkTileClickListener: () -> Unit = {}
|
||||
|
||||
@ -170,6 +171,8 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
||||
val isLoading = item.isLoading
|
||||
val binding = horizontalGroupViewHolder.binding
|
||||
val context = binding.root.context
|
||||
val isLoadingVisible =
|
||||
(isLoading && !item.isDataLoaded) || (isLoading && !item.isFullDataLoaded)
|
||||
val attendanceColor = when {
|
||||
attendancePercentage == null || attendancePercentage == .0 -> {
|
||||
context.getThemeAttrColor(R.attr.colorOnSurface)
|
||||
@ -199,13 +202,12 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
||||
context.getString(R.string.dashboard_horizontal_group_no_data)
|
||||
} else luckyNumber?.toString()
|
||||
|
||||
dashboardHorizontalGroupItemInfoContainer.isVisible = error != null || isLoading
|
||||
dashboardHorizontalGroupItemInfoProgress.isVisible =
|
||||
(isLoading && !item.isDataLoaded) || (isLoading && !item.isFullDataLoaded)
|
||||
dashboardHorizontalGroupItemInfoContainer.isVisible = error != null || isLoadingVisible
|
||||
dashboardHorizontalGroupItemInfoProgress.isVisible = isLoadingVisible
|
||||
dashboardHorizontalGroupItemInfoErrorText.isVisible = error != null
|
||||
|
||||
with(dashboardHorizontalGroupItemLuckyContainer) {
|
||||
isVisible = luckyNumber != null && luckyNumber != -1
|
||||
isVisible = luckyNumber != null && luckyNumber != -1 && !isLoadingVisible
|
||||
setOnClickListener { onLuckyNumberTileClickListener() }
|
||||
|
||||
updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
@ -220,7 +222,8 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
||||
}
|
||||
|
||||
with(dashboardHorizontalGroupItemAttendanceContainer) {
|
||||
isVisible = attendancePercentage != null && attendancePercentage != -1.0
|
||||
isVisible =
|
||||
attendancePercentage != null && attendancePercentage != -1.0 && !isLoadingVisible
|
||||
updateLayoutParams<ConstraintLayout.LayoutParams> {
|
||||
matchConstraintPercentWidth = when {
|
||||
luckyNumber == null && unreadMessagesCount == null -> 1.0f
|
||||
@ -232,7 +235,8 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
||||
}
|
||||
|
||||
with(dashboardHorizontalGroupItemMessageContainer) {
|
||||
isVisible = unreadMessagesCount != null && unreadMessagesCount != -1
|
||||
isVisible =
|
||||
unreadMessagesCount != null && unreadMessagesCount != -1 && !isLoadingVisible
|
||||
setOnClickListener { onMessageTileClickListener() }
|
||||
}
|
||||
}
|
||||
@ -271,10 +275,12 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
||||
val item = items[position] as DashboardItem.Lessons
|
||||
val timetableFull = item.lessons
|
||||
val binding = lessonsViewHolder.binding
|
||||
var dateToNavigate = LocalDate.now()
|
||||
|
||||
fun updateLessonState() {
|
||||
val currentDateTime = LocalDateTime.now()
|
||||
val currentDate = LocalDate.now()
|
||||
val tomorrowDate = currentDate.plusDays(1)
|
||||
|
||||
val currentTimetable = timetableFull?.lessons
|
||||
.orEmpty()
|
||||
@ -292,22 +298,27 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
||||
|
||||
when {
|
||||
currentTimetable.isNotEmpty() -> {
|
||||
dateToNavigate = currentDate
|
||||
updateLessonView(item, currentTimetable, binding)
|
||||
binding.dashboardLessonsItemTitleTomorrow.isVisible = false
|
||||
}
|
||||
tomorrowTimetable.isNotEmpty() -> {
|
||||
dateToNavigate = tomorrowDate
|
||||
updateLessonView(item, tomorrowTimetable, binding)
|
||||
binding.dashboardLessonsItemTitleTomorrow.isVisible = true
|
||||
}
|
||||
currentDayHeader != null && currentDayHeader.content.isNotBlank() -> {
|
||||
dateToNavigate = currentDate
|
||||
updateLessonView(item, emptyList(), binding, currentDayHeader)
|
||||
binding.dashboardLessonsItemTitleTomorrow.isVisible = false
|
||||
}
|
||||
tomorrowDayHeader != null && tomorrowDayHeader.content.isNotBlank() -> {
|
||||
dateToNavigate = tomorrowDate
|
||||
updateLessonView(item, emptyList(), binding, tomorrowDayHeader)
|
||||
binding.dashboardLessonsItemTitleTomorrow.isVisible = true
|
||||
}
|
||||
else -> {
|
||||
dateToNavigate = tomorrowDate
|
||||
updateLessonView(item, emptyList(), binding)
|
||||
binding.dashboardLessonsItemTitleTomorrow.isVisible =
|
||||
!(item.isLoading && item.error == null)
|
||||
@ -322,7 +333,7 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
||||
Handler(Looper.getMainLooper()).post { updateLessonState() }
|
||||
}
|
||||
|
||||
binding.root.setOnClickListener { onLessonsTileClickListener() }
|
||||
binding.root.setOnClickListener { onLessonsTileClickListener(dateToNavigate) }
|
||||
}
|
||||
|
||||
private fun updateLessonView(
|
||||
@ -426,7 +437,10 @@ class DashboardAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
||||
}
|
||||
}
|
||||
} else {
|
||||
val minutesToEndLesson = firstLesson.left!!.toMinutes() + 1
|
||||
val minutesToEndLesson = firstLesson.left?.toMinutes()?.plus(1) ?: run {
|
||||
Timber.e(IllegalArgumentException("Lesson left is null. START ${firstLesson.start} ; END ${firstLesson.end} ; CURRENT ${LocalDateTime.now()}"))
|
||||
0
|
||||
}
|
||||
|
||||
firstTimeText = context.resources.getQuantityString(
|
||||
R.plurals.dashboard_timetable_first_lesson_time_more_minutes,
|
||||
|
@ -70,10 +70,7 @@ class DashboardFragment : BaseFragment<FragmentDashboardBinding>(R.layout.fragme
|
||||
override fun initView() {
|
||||
val mainActivity = requireActivity() as MainActivity
|
||||
val itemTouchHelper = ItemTouchHelper(
|
||||
DashboardItemMoveCallback(
|
||||
dashboardAdapter,
|
||||
presenter::onDragAndDropEnd
|
||||
)
|
||||
DashboardItemMoveCallback(dashboardAdapter, presenter::onDragAndDropEnd)
|
||||
)
|
||||
|
||||
dashboardAdapter.apply {
|
||||
@ -87,7 +84,9 @@ class DashboardFragment : BaseFragment<FragmentDashboardBinding>(R.layout.fragme
|
||||
onAttendanceTileClickListener = {
|
||||
mainActivity.pushView(AttendanceSummaryFragment.newInstance())
|
||||
}
|
||||
onLessonsTileClickListener = { mainActivity.pushView(TimetableFragment.newInstance()) }
|
||||
onLessonsTileClickListener = {
|
||||
mainActivity.pushView(TimetableFragment.newInstance(it))
|
||||
}
|
||||
onGradeTileClickListener = { mainActivity.pushView(GradeFragment.newInstance()) }
|
||||
onHomeworkTileClickListener = { mainActivity.pushView(HomeworkFragment.newInstance()) }
|
||||
onAnnouncementsTileClickListener = {
|
||||
|
@ -492,31 +492,37 @@ class DashboardPresenter @Inject constructor(
|
||||
end = LocalDate.now().plusDays(7),
|
||||
forceRefresh = forceRefresh
|
||||
)
|
||||
}.onEach {
|
||||
when (it.status) {
|
||||
Status.LOADING -> {
|
||||
Timber.i("Loading dashboard exams data started")
|
||||
if (forceRefresh) return@onEach
|
||||
updateData(
|
||||
DashboardItem.Exams(it.data.orEmpty(), isLoading = true),
|
||||
forceRefresh
|
||||
)
|
||||
}
|
||||
.map { examResource ->
|
||||
val sortedExams = examResource.data?.sortedBy { it.date }
|
||||
|
||||
if (!it.data.isNullOrEmpty()) {
|
||||
firstLoadedItemList += DashboardItem.Type.EXAMS
|
||||
examResource.copy(data = sortedExams)
|
||||
}
|
||||
.onEach {
|
||||
when (it.status) {
|
||||
Status.LOADING -> {
|
||||
Timber.i("Loading dashboard exams data started")
|
||||
if (forceRefresh) return@onEach
|
||||
updateData(
|
||||
DashboardItem.Exams(it.data.orEmpty(), isLoading = true),
|
||||
forceRefresh
|
||||
)
|
||||
|
||||
if (!it.data.isNullOrEmpty()) {
|
||||
firstLoadedItemList += DashboardItem.Type.EXAMS
|
||||
}
|
||||
}
|
||||
Status.SUCCESS -> {
|
||||
Timber.i("Loading dashboard exams result: Success")
|
||||
updateData(DashboardItem.Exams(it.data ?: emptyList()), forceRefresh)
|
||||
}
|
||||
Status.ERROR -> {
|
||||
Timber.i("Loading dashboard exams result: An exception occurred")
|
||||
errorHandler.dispatch(it.error!!)
|
||||
updateData(DashboardItem.Exams(error = it.error), forceRefresh)
|
||||
}
|
||||
}
|
||||
Status.SUCCESS -> {
|
||||
Timber.i("Loading dashboard exams result: Success")
|
||||
updateData(DashboardItem.Exams(it.data ?: emptyList()), forceRefresh)
|
||||
}
|
||||
Status.ERROR -> {
|
||||
Timber.i("Loading dashboard exams result: An exception occurred")
|
||||
errorHandler.dispatch(it.error!!)
|
||||
updateData(DashboardItem.Exams(error = it.error), forceRefresh)
|
||||
}
|
||||
}
|
||||
}.launch("dashboard_exams")
|
||||
}.launch("dashboard_exams")
|
||||
}
|
||||
|
||||
private fun loadConferences(student: Student, forceRefresh: Boolean) {
|
||||
|
@ -90,10 +90,10 @@ class LoginFormPresenter @Inject constructor(
|
||||
|
||||
flowWithResource {
|
||||
studentRepository.getStudentsScrapper(
|
||||
email,
|
||||
password,
|
||||
host,
|
||||
symbol
|
||||
email = email,
|
||||
password = password,
|
||||
scrapperBaseUrl = host,
|
||||
symbol = symbol
|
||||
)
|
||||
}.onEach {
|
||||
when (it.status) {
|
||||
|
@ -78,7 +78,9 @@ class LoginStudentSelectPresenter @Inject constructor(
|
||||
when (it.status) {
|
||||
Status.LOADING -> 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<StudentWithSemesters>) {
|
||||
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<StudentWithSemesters>, error: Throwable? = null) {
|
||||
private fun logRegisterEvent(
|
||||
studentsWithSemesters: List<StudentWithSemesters>,
|
||||
error: Throwable? = null
|
||||
) {
|
||||
studentsWithSemesters.forEach { student ->
|
||||
analytics.logEvent(
|
||||
"registration_student_select",
|
||||
|
@ -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) {
|
||||
|
@ -117,6 +117,7 @@ class MessageTabPresenter @Inject constructor(
|
||||
if (!it.data.isNullOrEmpty()) {
|
||||
view?.run {
|
||||
enableSwipe(true)
|
||||
showErrorView(false)
|
||||
showRefresh(true)
|
||||
showProgress(false)
|
||||
showContent(true)
|
||||
|
@ -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<FragmentMoreBinding>(R.layout.fragment_more),
|
||||
override val examRes: Pair<String, Drawable?>?
|
||||
get() = context?.run { getString(R.string.exam_title) to getCompatDrawable(R.drawable.ic_main_exam) }
|
||||
|
||||
override val luckyNumberRes: Pair<String, Drawable?>?
|
||||
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<FragmentMoreBinding>(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)
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -23,6 +23,8 @@ interface MoreView : BaseView {
|
||||
|
||||
val examRes: Pair<String, Drawable?>?
|
||||
|
||||
val luckyNumberRes: Pair<String, Drawable?>?
|
||||
|
||||
fun initView()
|
||||
|
||||
fun updateData(data: List<Pair<String, Drawable?>>)
|
||||
@ -46,4 +48,6 @@ interface MoreView : BaseView {
|
||||
fun openMobileDevicesView()
|
||||
|
||||
fun openExamView()
|
||||
|
||||
fun openLuckyNumberView()
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class SchoolAnnouncementDialog : DialogFragment() {
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
) = DialogSchoolAnnouncementBinding.inflate(inflater).apply { binding = this }.root
|
||||
) = DialogSchoolAnnouncementBinding.inflate(inflater).also { binding = it }.root
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
@ -64,6 +64,7 @@ class SchoolAnnouncementPresenter @Inject constructor(
|
||||
view?.run {
|
||||
enableSwipe(true)
|
||||
showRefresh(true)
|
||||
showErrorView(false)
|
||||
showProgress(false)
|
||||
showContent(true)
|
||||
updateData(it.data)
|
||||
|
@ -13,7 +13,6 @@ import io.github.wulkanowy.R
|
||||
import io.github.wulkanowy.data.db.entities.Timetable
|
||||
import io.github.wulkanowy.databinding.DialogTimetableBinding
|
||||
import io.github.wulkanowy.utils.capitalise
|
||||
import io.github.wulkanowy.utils.decapitalise
|
||||
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||
import io.github.wulkanowy.utils.lifecycleAwareVariable
|
||||
import io.github.wulkanowy.utils.toFormattedString
|
||||
@ -52,7 +51,7 @@ class TimetableDialog : DialogFragment() {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
with(lesson) {
|
||||
setInfo(info, teacher, canceled, changes)
|
||||
setInfo(info, canceled, changes)
|
||||
setSubject(subject, subjectOld)
|
||||
setTeacher(teacher, teacherOld)
|
||||
setGroup(group)
|
||||
@ -80,7 +79,7 @@ class TimetableDialog : DialogFragment() {
|
||||
}
|
||||
|
||||
@SuppressLint("DefaultLocale")
|
||||
private fun setInfo(info: String, teacher: String, canceled: Boolean, changes: Boolean) {
|
||||
private fun setInfo(info: String, canceled: Boolean, changes: Boolean) {
|
||||
with(binding) {
|
||||
when {
|
||||
info.isNotBlank() -> {
|
||||
@ -102,8 +101,6 @@ class TimetableDialog : DialogFragment() {
|
||||
|
||||
timetableDialogChangesValue.text = when {
|
||||
canceled && !changes -> "Lekcja odwołana: $info"
|
||||
changes && teacher.isNotBlank() -> "Zastępstwo: $teacher"
|
||||
changes && teacher.isBlank() -> "Zastępstwo, ${info.decapitalise()}"
|
||||
else -> info.capitalise()
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,13 @@ class TimetableFragment : BaseFragment<FragmentTimetableBinding>(R.layout.fragme
|
||||
companion object {
|
||||
private const val SAVED_DATE_KEY = "CURRENT_DATE"
|
||||
|
||||
fun newInstance() = TimetableFragment()
|
||||
private const val ARGUMENT_DATE_KEY = "ARGUMENT_DATE"
|
||||
|
||||
fun newInstance(date: LocalDate? = null) = TimetableFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
date?.let { putLong(ARGUMENT_DATE_KEY, it.toEpochDay()) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override val titleStringId get() = R.string.timetable_title
|
||||
@ -62,7 +68,11 @@ class TimetableFragment : BaseFragment<FragmentTimetableBinding>(R.layout.fragme
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
binding = FragmentTimetableBinding.bind(view)
|
||||
messageContainer = binding.timetableRecycler
|
||||
presenter.onAttachView(this, savedInstanceState?.getLong(SAVED_DATE_KEY))
|
||||
|
||||
val initDate = savedInstanceState?.getLong(SAVED_DATE_KEY)
|
||||
?: arguments?.getLong(ARGUMENT_DATE_KEY)?.takeUnless { it == 0L }
|
||||
|
||||
presenter.onAttachView(this, initDate)
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
@ -202,7 +212,9 @@ class TimetableFragment : BaseFragment<FragmentTimetableBinding>(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() {
|
||||
|
@ -149,6 +149,7 @@ class TimetablePresenter @Inject constructor(
|
||||
view?.run {
|
||||
enableSwipe(true)
|
||||
showRefresh(true)
|
||||
showErrorView(false)
|
||||
showProgress(false)
|
||||
showContent(true)
|
||||
updateData(it.data!!.lessons)
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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?) {
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
Wersja 1.2.1
|
||||
Wersja 1.2.3
|
||||
|
||||
- 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 pomieszane imiona nauczycieli z salami w planie lekcji
|
||||
- dodaliśmy brakujące okienka ze szczegółami na ekranie zebrań
|
||||
- klikając w kafelek z lekcjami na jutro aplikacja teraz przekierowuje na ekran z planem na jutro
|
||||
- naprawiliśmy błąd przy wylogowywaniu innego niż bieżący uczeń
|
||||
|
||||
Pełna lista zmian: https://github.com/wulkanowy/wulkanowy/releases
|
||||
|
211
app/src/main/res/layout/dialog_conference.xml
Normal file
211
app/src/main/res/layout/dialog_conference.xml
Normal file
@ -0,0 +1,211 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="8dp">
|
||||
|
||||
<View
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="1dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/allDetailsHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/all_details"
|
||||
android:textSize="21sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conferenceDialogHeaderTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/all_title"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/allDetailsHeader" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conferenceDialogHeaderValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="@string/all_no_data"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/conferenceDialogHeaderTitle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conferenceDialogSubjectTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/all_subject"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/conferenceDialogHeaderValue" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conferenceDialogSubjectValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="@string/all_no_data"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/conferenceDialogSubjectTitle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conferenceDialogDateTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/all_date"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/conferenceDialogSubjectValue" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conferenceDialogDateValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="@string/all_no_data"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/conferenceDialogDateTitle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conferenceDialogPresentTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/conferences_present"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/conferenceDialogDateValue" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conferenceDialogPresentValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="@string/all_no_data"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/conferenceDialogPresentTitle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conferenceDialogAgendaTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/conference_agenda"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/conferenceDialogPresentValue" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/conferenceDialogAgendaValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="@string/all_no_data"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/conferenceDialogAgendaTitle"
|
||||
tools:maxLines="5"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/conferenceDialogClose"
|
||||
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginTop="36dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:insetLeft="0dp"
|
||||
android:insetTop="0dp"
|
||||
android:insetRight="0dp"
|
||||
android:insetBottom="0dp"
|
||||
android:minWidth="88dp"
|
||||
android:text="@string/all_close"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/conferenceDialogAgendaValue" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
@ -118,6 +118,7 @@
|
||||
android:layout_marginEnd="24dp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="16dp"
|
||||
tools:maxLines="5"
|
||||
android:text="@string/all_no_data"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="16sp"
|
||||
|
@ -11,12 +11,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:includeFontPadding="false"
|
||||
android:maxEms="15"
|
||||
android:maxLines="1"
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/dashboard_grades_subitem_grade_container"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/dashboard_grades_subitem_grade_container"
|
||||
tools:text="Urządzenia techniki kompu..." />
|
||||
tools:text="Urządzenia techniki komputerowych" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dashboard_grades_subitem_grade_container"
|
||||
@ -26,6 +27,7 @@
|
||||
android:layout_marginBottom="6dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/dashboard_grades_subitem_title"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
@ -402,6 +402,8 @@
|
||||
<item quantity="many">Máte %1$d nových setkání</item>
|
||||
<item quantity="other">Máte %1$d nových setkání</item>
|
||||
</plurals>
|
||||
<string name="conferences_present">Present at conference</string>
|
||||
<string name="conference_agenda">Agenda</string>
|
||||
<!--Director information-->
|
||||
<string name="school_announcement_title">Školní oznámení</string>
|
||||
<string name="school_announcement_no_items">Žádná školní oznámení</string>
|
||||
@ -516,10 +518,10 @@
|
||||
<string name="dashboard_timetable_second_lessons_title">Další:</string>
|
||||
<string name="dashboard_timetable_third_title">Později:</string>
|
||||
<plurals name="dashboard_timetable_third_value">
|
||||
<item quantity="one">ještě %1$d další lekce</item>
|
||||
<item quantity="few">ještě %1$d další lekce</item>
|
||||
<item quantity="many">ještě %1$d dalších lekcí</item>
|
||||
<item quantity="other">ještě %1$d dalších lekcí</item>
|
||||
<item quantity="one">ještě %1$d lekce</item>
|
||||
<item quantity="few">ještě %1$d lekce</item>
|
||||
<item quantity="many">ještě %1$d lekcí</item>
|
||||
<item quantity="other">ještě %1$d lekcí</item>
|
||||
</plurals>
|
||||
<string name="dashboard_timetable_third_time">do %1$s</string>
|
||||
<string name="dashboard_timetable_no_lessons">Žádné nadcházející lekce</string>
|
||||
@ -528,10 +530,10 @@
|
||||
<string name="dashboard_homework_no_homework">Žádné domácí úkoly do vykonána</string>
|
||||
<string name="dashboard_homework_error">Při načítání domácích úkolů došlo k chybě</string>
|
||||
<plurals name="dashboard_homework_more">
|
||||
<item quantity="one">Ještě %1$d další domácí úkol</item>
|
||||
<item quantity="few">Ještě %1$d další domácí úkoly</item>
|
||||
<item quantity="many">Ještě %1$d dalších domácích úkolů</item>
|
||||
<item quantity="other">Ještě %1$d dalších domácích úkolů</item>
|
||||
<item quantity="one">Ještě %1$d domácí úkol</item>
|
||||
<item quantity="few">Ještě %1$d domácí úkoly</item>
|
||||
<item quantity="many">Ještě %1$d domácích úkolů</item>
|
||||
<item quantity="other">Ještě %1$d domácích úkolů</item>
|
||||
</plurals>
|
||||
<string name="dashboard_homework_time">do %1$s</string>
|
||||
<string name="dashboard_grade_title">Poslední známky</string>
|
||||
@ -541,28 +543,28 @@
|
||||
<string name="dashboard_announcements_no_announcements">Žádná aktuální oznámení</string>
|
||||
<string name="dashboard_announcements_error">Při načítání oznámení došlo k chybě</string>
|
||||
<plurals name="dashboard_announcements_more">
|
||||
<item quantity="one">Ještě %1$d další oznámení</item>
|
||||
<item quantity="few">Ještě %1$d další oznámení</item>
|
||||
<item quantity="many">Ještě %1$d dalších oznámení</item>
|
||||
<item quantity="other">Ještě %1$d dalších oznámení</item>
|
||||
<item quantity="one">Ještě %1$d oznámení</item>
|
||||
<item quantity="few">Ještě %1$d oznámení</item>
|
||||
<item quantity="many">Ještě %1$d oznámení</item>
|
||||
<item quantity="other">Ještě %1$d oznámení</item>
|
||||
</plurals>
|
||||
<string name="dashboard_exams_title">Zkoušky</string>
|
||||
<string name="dashboard_exams_no_exams">Žádné nadcházející zkoušky</string>
|
||||
<string name="dashboard_exams_error">Při načítání zkoušek došlo k chybě</string>
|
||||
<plurals name="dashboard_exams_more">
|
||||
<item quantity="one">Ještě %1$d další zkouška</item>
|
||||
<item quantity="few">Ještě %1$d další zkoušky</item>
|
||||
<item quantity="many">Ještě %1$d dalších zkoušek</item>
|
||||
<item quantity="other">Ještě %1$d dalších zkoušek</item>
|
||||
<item quantity="one">Ještě %1$d zkouška</item>
|
||||
<item quantity="few">Ještě %1$d zkoušky</item>
|
||||
<item quantity="many">Ještě %1$d zkoušek</item>
|
||||
<item quantity="other">Ještě %1$d zkoušek</item>
|
||||
</plurals>
|
||||
<string name="dashboard_conferences_title">Setkání</string>
|
||||
<string name="dashboard_conferences_no_conferences">Žádná nadcházející setkání</string>
|
||||
<string name="dashboard_conferences_error">Při načítání setkání došlo k chybě</string>
|
||||
<plurals name="dashboard_conference_more">
|
||||
<item quantity="one">Ještě %1$d další setkání</item>
|
||||
<item quantity="few">Ještě %1$d další setkání</item>
|
||||
<item quantity="many">Ještě %1$d dalších setkání</item>
|
||||
<item quantity="other">Ještě %1$d dalších setkání</item>
|
||||
<item quantity="one">Ještě %1$d setkání</item>
|
||||
<item quantity="few">Ještě %1$d setkání</item>
|
||||
<item quantity="many">Ještě %1$d setkání</item>
|
||||
<item quantity="other">Ještě %1$d setkání</item>
|
||||
</plurals>
|
||||
<string name="dashboard_horizontal_group_error">Při načítání dat došlo k chybě</string>
|
||||
<string name="dashboard_horizontal_group_no_data">Žádné</string>
|
||||
@ -590,6 +592,7 @@
|
||||
<string name="all_yes">Ano</string>
|
||||
<string name="all_no">Ne</string>
|
||||
<string name="all_save">Uložit</string>
|
||||
<string name="all_title">Title</string>
|
||||
<!--Timetable Widget-->
|
||||
<string name="widget_timetable_no_items">Žádné lekce</string>
|
||||
<string name="widget_timetable_theme_title">Vybrat motiv</string>
|
||||
|
@ -344,6 +344,8 @@
|
||||
<item quantity="one">Sie haben %1$d neue konferenz</item>
|
||||
<item quantity="other">Sie haben %1$d neue konferenzen</item>
|
||||
</plurals>
|
||||
<string name="conferences_present">Present at conference</string>
|
||||
<string name="conference_agenda">Agenda</string>
|
||||
<!--Director information-->
|
||||
<string name="school_announcement_title">Schulankündigungen</string>
|
||||
<string name="school_announcement_no_items">Keine schulankündigungen</string>
|
||||
@ -512,6 +514,7 @@
|
||||
<string name="all_yes">Ja</string>
|
||||
<string name="all_no">Nein</string>
|
||||
<string name="all_save">Speichern</string>
|
||||
<string name="all_title">Title</string>
|
||||
<!--Timetable Widget-->
|
||||
<string name="widget_timetable_no_items">Keine Lektionen</string>
|
||||
<string name="widget_timetable_theme_title">Thema wählen</string>
|
||||
|
@ -402,6 +402,8 @@
|
||||
<item quantity="many">Masz %1$d nowych zebrań</item>
|
||||
<item quantity="other">Masz %1$d nowych zebrań</item>
|
||||
</plurals>
|
||||
<string name="conferences_present">Obecność na zebraniu</string>
|
||||
<string name="conference_agenda">Agenda</string>
|
||||
<!--Director information-->
|
||||
<string name="school_announcement_title">Ogłoszenia szkolne</string>
|
||||
<string name="school_announcement_no_items">Brak ogłoszeń szkolnych</string>
|
||||
@ -516,10 +518,10 @@
|
||||
<string name="dashboard_timetable_second_lessons_title">Następnie:</string>
|
||||
<string name="dashboard_timetable_third_title">Później:</string>
|
||||
<plurals name="dashboard_timetable_third_value">
|
||||
<item quantity="one">jeszcze %1$d dodatkowa lekcja</item>
|
||||
<item quantity="few">jeszcze %1$d dodatkowe lekcje</item>
|
||||
<item quantity="many">jeszcze %1$d dodatkowych lekcji</item>
|
||||
<item quantity="other">jeszcze %1$d dodatkowych lekcji</item>
|
||||
<item quantity="one">jeszcze %1$d lekcja</item>
|
||||
<item quantity="few">jeszcze %1$d lekcje</item>
|
||||
<item quantity="many">jeszcze %1$d lekcji</item>
|
||||
<item quantity="other">jeszcze %1$d lekcji</item>
|
||||
</plurals>
|
||||
<string name="dashboard_timetable_third_time">do %1$s</string>
|
||||
<string name="dashboard_timetable_no_lessons">Brak nadchodzących lekcji</string>
|
||||
@ -528,10 +530,10 @@
|
||||
<string name="dashboard_homework_no_homework">Brak prac domowych do wykonania</string>
|
||||
<string name="dashboard_homework_error">Wystąpił błąd podczas ładowania zadań domowych</string>
|
||||
<plurals name="dashboard_homework_more">
|
||||
<item quantity="one">Jeszcze %1$d dodatkowe zadanie domowe</item>
|
||||
<item quantity="few">Jeszcze %1$d dodatkowe zadania domowe</item>
|
||||
<item quantity="many">Jeszcze %1$d dodatkowych zadań domowych</item>
|
||||
<item quantity="other">Jeszcze %1$d dodatkowych zadań domowych</item>
|
||||
<item quantity="one">Jeszcze %1$d zadanie domowe</item>
|
||||
<item quantity="few">Jeszcze %1$d zadania domowe</item>
|
||||
<item quantity="many">Jeszcze %1$d zadań domowych</item>
|
||||
<item quantity="other">Jeszcze %1$d zadań domowych</item>
|
||||
</plurals>
|
||||
<string name="dashboard_homework_time">do %1$s</string>
|
||||
<string name="dashboard_grade_title">Ostatnie oceny</string>
|
||||
@ -541,19 +543,19 @@
|
||||
<string name="dashboard_announcements_no_announcements">Brak aktualnych ogłoszeń</string>
|
||||
<string name="dashboard_announcements_error">Wystąpił błąd podczas ładowania ogłoszeń</string>
|
||||
<plurals name="dashboard_announcements_more">
|
||||
<item quantity="one">Jeszcze %1$d dodatkowe ogłoszenie</item>
|
||||
<item quantity="few">Jeszcze %1$d dodatkowe ogłoszenia</item>
|
||||
<item quantity="many">Jeszcze %1$d dodatkowych ogłoszeń</item>
|
||||
<item quantity="other">Jeszcze %1$d dodatkowych ogłoszeń</item>
|
||||
<item quantity="one">Jeszcze %1$d ogłoszenie</item>
|
||||
<item quantity="few">Jeszcze %1$d ogłoszenia</item>
|
||||
<item quantity="many">Jeszcze %1$d ogłoszeń</item>
|
||||
<item quantity="other">Jeszcze %1$d ogłoszeń</item>
|
||||
</plurals>
|
||||
<string name="dashboard_exams_title">Sprawdziany</string>
|
||||
<string name="dashboard_exams_no_exams">Brak nadchodzących sprawdzianów</string>
|
||||
<string name="dashboard_exams_error">Wystąpił błąd podczas ładowania sprawdzianów</string>
|
||||
<plurals name="dashboard_exams_more">
|
||||
<item quantity="one">Jeszcze %1$d dodatkowy sprawdzian</item>
|
||||
<item quantity="few">Jeszcze %1$d dodatkowe sprawdziany</item>
|
||||
<item quantity="many">Jeszcze %1$d dodatkowych sprawdzianów</item>
|
||||
<item quantity="other">Jeszcze %1$d dodatkowych sprawdzianów</item>
|
||||
<item quantity="one">Jeszcze %1$d sprawdzian</item>
|
||||
<item quantity="few">Jeszcze %1$d sprawdziany</item>
|
||||
<item quantity="many">Jeszcze %1$d sprawdzianów</item>
|
||||
<item quantity="other">Jeszcze %1$d sprawdzianów</item>
|
||||
</plurals>
|
||||
<string name="dashboard_conferences_title">Zebrania</string>
|
||||
<string name="dashboard_conferences_no_conferences">Brak nadchodzących zebrań</string>
|
||||
@ -562,7 +564,7 @@
|
||||
<item quantity="one">Jeszcze %1$d dodatkowe zebranie</item>
|
||||
<item quantity="few">Jeszcze %1$d dodatkowe zebrania</item>
|
||||
<item quantity="many">Jeszcze %1$d dodatkowych zebrań</item>
|
||||
<item quantity="other">Jeszcze %1$d dodatkowych zebrań</item>
|
||||
<item quantity="other">Jeszcze %1$d zebrań</item>
|
||||
</plurals>
|
||||
<string name="dashboard_horizontal_group_error">Wystąpił błąd podczas ładowania danych</string>
|
||||
<string name="dashboard_horizontal_group_no_data">Brak</string>
|
||||
@ -590,6 +592,7 @@
|
||||
<string name="all_yes">Tak</string>
|
||||
<string name="all_no">Nie</string>
|
||||
<string name="all_save">Zapisz</string>
|
||||
<string name="all_title">Tytuł</string>
|
||||
<!--Timetable Widget-->
|
||||
<string name="widget_timetable_no_items">Brak lekcji</string>
|
||||
<string name="widget_timetable_theme_title">Wybierz motyw</string>
|
||||
|
@ -402,6 +402,8 @@
|
||||
<item quantity="many">У вас %1$d новая конференция</item>
|
||||
<item quantity="other">У вас %1$d новых конференций</item>
|
||||
</plurals>
|
||||
<string name="conferences_present">Present at conference</string>
|
||||
<string name="conference_agenda">Agenda</string>
|
||||
<!--Director information-->
|
||||
<string name="school_announcement_title">Объявления школ</string>
|
||||
<string name="school_announcement_no_items">Нет объявлений о школе</string>
|
||||
@ -590,6 +592,7 @@
|
||||
<string name="all_yes">Да</string>
|
||||
<string name="all_no">Нет</string>
|
||||
<string name="all_save">Сохранить</string>
|
||||
<string name="all_title">Title</string>
|
||||
<!--Timetable Widget-->
|
||||
<string name="widget_timetable_no_items">Нет уроков</string>
|
||||
<string name="widget_timetable_theme_title">Выбрать тему</string>
|
||||
|
@ -402,6 +402,8 @@
|
||||
<item quantity="many">Máte %1$d nových stretnutí</item>
|
||||
<item quantity="other">Máte %1$d nových stretnutí</item>
|
||||
</plurals>
|
||||
<string name="conferences_present">Present at conference</string>
|
||||
<string name="conference_agenda">Agenda</string>
|
||||
<!--Director information-->
|
||||
<string name="school_announcement_title">Školské oznámenia</string>
|
||||
<string name="school_announcement_no_items">Žiadne školské oznámenia</string>
|
||||
@ -516,10 +518,10 @@
|
||||
<string name="dashboard_timetable_second_lessons_title">Ďalej:</string>
|
||||
<string name="dashboard_timetable_third_title">Neskôr:</string>
|
||||
<plurals name="dashboard_timetable_third_value">
|
||||
<item quantity="one">ešte %1$d ďalší lekcia</item>
|
||||
<item quantity="few">ešte %1$d ďalšie lekcie</item>
|
||||
<item quantity="many">ešte %1$d ďalších lekcií</item>
|
||||
<item quantity="other">ešte %1$d ďalších lekcií</item>
|
||||
<item quantity="one">ešte %1$d lekcia</item>
|
||||
<item quantity="few">ešte %1$d lekcie</item>
|
||||
<item quantity="many">ešte %1$d lekcií</item>
|
||||
<item quantity="other">ešte %1$d lekcií</item>
|
||||
</plurals>
|
||||
<string name="dashboard_timetable_third_time">do %1$s</string>
|
||||
<string name="dashboard_timetable_no_lessons">Žiadne nadchádzajúce lekcie</string>
|
||||
@ -528,10 +530,10 @@
|
||||
<string name="dashboard_homework_no_homework">Žiadne domáce úlohy do vykonaná</string>
|
||||
<string name="dashboard_homework_error">Pri načítaní domácich úloh došlo k chybe</string>
|
||||
<plurals name="dashboard_homework_more">
|
||||
<item quantity="one">Ešte %1$d ďalšia domáca úloha</item>
|
||||
<item quantity="few">Ešte %1$d ďalšie domáce úlohy</item>
|
||||
<item quantity="many">Ešte %1$d ďalších domácich úloh</item>
|
||||
<item quantity="other">Ešte %1$d ďalších domácich úloh</item>
|
||||
<item quantity="one">Ešte %1$d domáca úloha</item>
|
||||
<item quantity="few">Ešte %1$d domáce úlohy</item>
|
||||
<item quantity="many">Ešte %1$d domácich úloh</item>
|
||||
<item quantity="other">Ešte %1$d domácich úloh</item>
|
||||
</plurals>
|
||||
<string name="dashboard_homework_time">do %1$s</string>
|
||||
<string name="dashboard_grade_title">Posledné známky</string>
|
||||
@ -541,28 +543,28 @@
|
||||
<string name="dashboard_announcements_no_announcements">Žiadne aktuálne oznámenia</string>
|
||||
<string name="dashboard_announcements_error">Pri načítaní oznámení došlo k chybe</string>
|
||||
<plurals name="dashboard_announcements_more">
|
||||
<item quantity="one">Ešte %1$d ďalšie oznámenie</item>
|
||||
<item quantity="few">Ešte %1$d ďalšie oznámenia</item>
|
||||
<item quantity="many">Ešte %1$d ďalších oznámení</item>
|
||||
<item quantity="other">Ešte %1$d ďalších oznámení</item>
|
||||
<item quantity="one">Ešte %1$d oznámenie</item>
|
||||
<item quantity="few">Ešte %1$d oznámenia</item>
|
||||
<item quantity="many">Ešte %1$d oznámení</item>
|
||||
<item quantity="other">Ešte %1$d oznámení</item>
|
||||
</plurals>
|
||||
<string name="dashboard_exams_title">Skúšky</string>
|
||||
<string name="dashboard_exams_no_exams">Žiadne nadchádzajúce skúšky</string>
|
||||
<string name="dashboard_exams_error">Pri načítaní skúšok došlo k chybe</string>
|
||||
<plurals name="dashboard_exams_more">
|
||||
<item quantity="one">Ešte %1$d ďalšia skúška</item>
|
||||
<item quantity="few">Ešte %1$d ďalšie skúšky</item>
|
||||
<item quantity="many">Ešte %1$d ďalších skúšok</item>
|
||||
<item quantity="other">Ešte %1$d ďalších skúšok</item>
|
||||
<item quantity="one">Ešte %1$d skúška</item>
|
||||
<item quantity="few">Ešte %1$d skúšky</item>
|
||||
<item quantity="many">Ešte %1$d skúšok</item>
|
||||
<item quantity="other">Ešte %1$d skúšok</item>
|
||||
</plurals>
|
||||
<string name="dashboard_conferences_title">Stretnutie</string>
|
||||
<string name="dashboard_conferences_no_conferences">Žiadna nadchádzajúce stretnutie</string>
|
||||
<string name="dashboard_conferences_error">Pri načítaní stretnutí došlo k chybe</string>
|
||||
<plurals name="dashboard_conference_more">
|
||||
<item quantity="one">Ešte %1$d ďalšie stretnutie</item>
|
||||
<item quantity="few">Ešte %1$d ďalšie stretnutia</item>
|
||||
<item quantity="many">Ešte %1$d ďalších stretnutí</item>
|
||||
<item quantity="other">Ešte %1$d ďalších stretnutí</item>
|
||||
<item quantity="one">Ešte %1$d stretnutie</item>
|
||||
<item quantity="few">Ešte %1$d stretnutia</item>
|
||||
<item quantity="many">Ešte %1$d stretnutí</item>
|
||||
<item quantity="other">Ešte %1$d stretnutí</item>
|
||||
</plurals>
|
||||
<string name="dashboard_horizontal_group_error">Pri načítaní dát došlo k chybe</string>
|
||||
<string name="dashboard_horizontal_group_no_data">Žiadne</string>
|
||||
@ -590,6 +592,7 @@
|
||||
<string name="all_yes">Áno</string>
|
||||
<string name="all_no">Nie</string>
|
||||
<string name="all_save">Uložiť</string>
|
||||
<string name="all_title">Title</string>
|
||||
<!--Timetable Widget-->
|
||||
<string name="widget_timetable_no_items">Žiadne lekcie</string>
|
||||
<string name="widget_timetable_theme_title">Vybrať motív</string>
|
||||
|
@ -402,6 +402,8 @@
|
||||
<item quantity="many">У вас є %1$d нова конференція</item>
|
||||
<item quantity="other">У вас є %1$d нових конференцій</item>
|
||||
</plurals>
|
||||
<string name="conferences_present">Present at conference</string>
|
||||
<string name="conference_agenda">Agenda</string>
|
||||
<!--Director information-->
|
||||
<string name="school_announcement_title">Оголошення школи</string>
|
||||
<string name="school_announcement_no_items">Жодних навчальних оголошень</string>
|
||||
@ -590,6 +592,7 @@
|
||||
<string name="all_yes">Так</string>
|
||||
<string name="all_no">Ні</string>
|
||||
<string name="all_save">Зберегти</string>
|
||||
<string name="all_title">Title</string>
|
||||
<!--Timetable Widget-->
|
||||
<string name="widget_timetable_no_items">Брак уроків</string>
|
||||
<string name="widget_timetable_theme_title">Увібрати тему</string>
|
||||
|
@ -69,7 +69,7 @@
|
||||
<string name="login_contact_discord">Discord</string>
|
||||
<string name="login_email_intent_title">Send email</string>
|
||||
<string name="login_email_subject" translatable="false">Zgłoszenie: Problemy z logowaniem</string>
|
||||
<string name="login_email_text" translatable="false">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: </string>
|
||||
<string name="login_email_text" translatable="false">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): </string>
|
||||
<string name="login_recover_warning">Make sure you select the correct UONET+ register variation!</string>
|
||||
<string name="login_recover_button">I forgot my password</string>
|
||||
<string name="login_recover_title">Recover your account</string>
|
||||
@ -336,10 +336,12 @@
|
||||
<string name="lucky_number_notify_new_item">Today\'s lucky number is: %s</string>
|
||||
<string name="lucky_number_history_button">Show history</string>
|
||||
|
||||
|
||||
<!--Lucky number history-->
|
||||
<string name="lucky_number_history_title">Lucky number history</string>
|
||||
<string name="lucky_number_history_empty">No info about lucky numbers</string>
|
||||
|
||||
|
||||
<!--Mobile devices-->
|
||||
<string name="mobile_devices_title">Mobile devices</string>
|
||||
<string name="mobile_devices_no_items">No devices</string>
|
||||
@ -388,7 +390,8 @@
|
||||
<item quantity="one">You have %1$d new conference</item>
|
||||
<item quantity="other">You have %1$d new conferences</item>
|
||||
</plurals>
|
||||
|
||||
<string name="conferences_present">Present at conference</string>
|
||||
<string name="conference_agenda">Agenda</string>
|
||||
|
||||
<!--Director information-->
|
||||
<string name="school_announcement_title">School announcements</string>
|
||||
@ -585,6 +588,7 @@
|
||||
<string name="all_yes">Yes</string>
|
||||
<string name="all_no">No</string>
|
||||
<string name="all_save">Save</string>
|
||||
<string name="all_title">Title</string>
|
||||
|
||||
|
||||
<!--Timetable Widget-->
|
||||
|
@ -37,7 +37,8 @@ class StudentTest {
|
||||
studentDb,
|
||||
semesterDb,
|
||||
mockSdk,
|
||||
AppInfo()
|
||||
AppInfo(),
|
||||
mockk()
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -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 }) }
|
||||
|
Reference in New Issue
Block a user