From ff6d5d4dacf09b7b8901ab10d0b20deb77c5f93c Mon Sep 17 00:00:00 2001 From: N08I40K Date: Fri, 13 Dec 2024 06:33:24 +0400 Subject: [PATCH] 2.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Теперь регулярное выражение для парсинга ссылки на расписание получается с сервера. 2.2.0 Отображение дополнительного типа пары. Отображение улицы, на которой будут проходить пары, если указана. --- .idea/misc.xml | 1 + app/build.gradle.kts | 4 +- .../polytechnic/next/data/AppContainer.kt | 15 +++- .../ru/n08i40k/polytechnic/next/model/Day.kt | 4 +- .../polytechnic/next/model/LessonType.kt | 6 +- .../next/network/request/CachedRequest.kt | 10 +-- .../network/request/schedule/ScheduleGet.kt | 2 +- .../request/schedule/ScheduleGetTeacher.kt | 2 +- .../request/schedule/ScheduleUpdate.kt | 2 +- .../polytechnic/next/ui/MainActivity.kt | 7 +- .../polytechnic/next/ui/main/MainScreen.kt | 3 +- .../next/ui/main/schedule/DayCard.kt | 44 +++++++--- .../next/ui/main/schedule/DayPager.kt | 2 +- .../next/ui/main/schedule/LessonView.kt | 80 ++++++++++--------- app/src/main/res/values-ru/strings.xml | 4 + app/src/main/res/values/strings.xml | 4 + .../main/res/xml/remote_config_defaults.xml | 26 +++--- gradle/libs.versions.toml | 18 ++--- 18 files changed, 143 insertions(+), 91 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 7b35623..5bb575c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,3 +1,4 @@ + diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f50c002..5072a76 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -33,8 +33,8 @@ android { applicationId = "ru.n08i40k.polytechnic.next" minSdk = 26 targetSdk = 35 - versionCode = 20 - versionName = "2.1.0" + versionCode = 22 + versionName = "2.2.1" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/app/src/main/java/ru/n08i40k/polytechnic/next/data/AppContainer.kt b/app/src/main/java/ru/n08i40k/polytechnic/next/data/AppContainer.kt index ece502c..613b8e1 100644 --- a/app/src/main/java/ru/n08i40k/polytechnic/next/data/AppContainer.kt +++ b/app/src/main/java/ru/n08i40k/polytechnic/next/data/AppContainer.kt @@ -2,6 +2,9 @@ package ru.n08i40k.polytechnic.next.data import android.app.Application import android.content.Context +import com.google.firebase.Firebase +import com.google.firebase.remoteconfig.FirebaseRemoteConfig +import com.google.firebase.remoteconfig.remoteConfig import dagger.Module import dagger.Provides import dagger.hilt.InstallIn @@ -10,11 +13,11 @@ import ru.n08i40k.polytechnic.next.data.cache.NetworkCacheRepository import ru.n08i40k.polytechnic.next.data.cache.impl.FakeNetworkCacheRepository import ru.n08i40k.polytechnic.next.data.cache.impl.LocalNetworkCacheRepository import ru.n08i40k.polytechnic.next.data.schedule.ScheduleRepository -import ru.n08i40k.polytechnic.next.data.scheduleReplacer.impl.FakeScheduleReplacerRepository import ru.n08i40k.polytechnic.next.data.schedule.impl.FakeScheduleRepository -import ru.n08i40k.polytechnic.next.data.scheduleReplacer.impl.RemoteScheduleReplacerRepository import ru.n08i40k.polytechnic.next.data.schedule.impl.RemoteScheduleRepository import ru.n08i40k.polytechnic.next.data.scheduleReplacer.ScheduleReplacerRepository +import ru.n08i40k.polytechnic.next.data.scheduleReplacer.impl.FakeScheduleReplacerRepository +import ru.n08i40k.polytechnic.next.data.scheduleReplacer.impl.RemoteScheduleReplacerRepository import ru.n08i40k.polytechnic.next.data.users.ProfileRepository import ru.n08i40k.polytechnic.next.data.users.impl.FakeProfileRepository import ru.n08i40k.polytechnic.next.data.users.impl.RemoteProfileRepository @@ -30,6 +33,8 @@ interface AppContainer { val scheduleReplacerRepository: ScheduleReplacerRepository val profileRepository: ProfileRepository + + val remoteConfig: FirebaseRemoteConfig } class MockAppContainer(override val applicationContext: Context) : AppContainer { @@ -44,6 +49,9 @@ class MockAppContainer(override val applicationContext: Context) : AppContainer override val profileRepository: ProfileRepository by lazy { FakeProfileRepository() } + + override val remoteConfig: FirebaseRemoteConfig + by lazy { Firebase.remoteConfig } } class RemoteAppContainer(override val applicationContext: Context) : AppContainer { @@ -58,6 +66,9 @@ class RemoteAppContainer(override val applicationContext: Context) : AppContaine override val profileRepository: ProfileRepository by lazy { RemoteProfileRepository(applicationContext) } + + override val remoteConfig: FirebaseRemoteConfig + by lazy { Firebase.remoteConfig } } @Module diff --git a/app/src/main/java/ru/n08i40k/polytechnic/next/model/Day.kt b/app/src/main/java/ru/n08i40k/polytechnic/next/model/Day.kt index 3bbe795..b3d5ba2 100644 --- a/app/src/main/java/ru/n08i40k/polytechnic/next/model/Day.kt +++ b/app/src/main/java/ru/n08i40k/polytechnic/next/model/Day.kt @@ -22,7 +22,9 @@ data class Day( @SerialName("date") private val dateMillis: Long, - val lessons: List + val lessons: List, + + val street: String? = null ) : Parcelable { constructor(name: String, date: Instant, lessons: List) : this( name, date.toEpochMilliseconds(), lessons diff --git a/app/src/main/java/ru/n08i40k/polytechnic/next/model/LessonType.kt b/app/src/main/java/ru/n08i40k/polytechnic/next/model/LessonType.kt index ffc06cf..f3e0509 100644 --- a/app/src/main/java/ru/n08i40k/polytechnic/next/model/LessonType.kt +++ b/app/src/main/java/ru/n08i40k/polytechnic/next/model/LessonType.kt @@ -13,5 +13,9 @@ private class LessonTypeIntSerializer : EnumAsIntSerializer( enum class LessonType(val value: Int) { DEFAULT(0), ADDITIONAL(1), - BREAK(2) + BREAK(2), + CONSULTATION(3), + INDEPENDENT_WORK(4), + EXAM(5), + EXAM_WITH_GRADE(6), } \ No newline at end of file diff --git a/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/CachedRequest.kt b/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/CachedRequest.kt index 1bce6a2..e17d45c 100644 --- a/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/CachedRequest.kt +++ b/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/CachedRequest.kt @@ -33,11 +33,6 @@ open class CachedRequest( }, errorListener) { private val appContainer: AppContainer = (context as PolytechnicApplication).container - companion object { - private const val REGEX: String = "" - val pattern: Pattern = Pattern.compile(REGEX, Pattern.MULTILINE) - } - private suspend fun getXlsUrl(): MyResult = withContext(Dispatchers.IO) { val mainPageFuture = RequestFuture.newFuture() val request = StringRequest( @@ -54,6 +49,11 @@ open class CachedRequest( val pageData = (response as MyResult.Success).data + val remoteConfig = (context.applicationContext as PolytechnicApplication).container.remoteConfig + + val pattern: Pattern = + Pattern.compile(remoteConfig.getString("linkParserRegex"), Pattern.MULTILINE) + val matcher = pattern.matcher(pageData) if (!matcher.find()) return@withContext MyResult.Failure(RuntimeException("Required url not found!")) diff --git a/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/schedule/ScheduleGet.kt b/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/schedule/ScheduleGet.kt index d14c6d1..9c1a5a8 100644 --- a/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/schedule/ScheduleGet.kt +++ b/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/schedule/ScheduleGet.kt @@ -14,7 +14,7 @@ class ScheduleGet( ) : CachedRequest( context, Method.GET, - "v2/schedule/group", + "v3/schedule/group", { listener.onResponse(Json.decodeFromString(it)) }, errorListener ) { diff --git a/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/schedule/ScheduleGetTeacher.kt b/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/schedule/ScheduleGetTeacher.kt index 508999e..d9103d2 100644 --- a/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/schedule/ScheduleGetTeacher.kt +++ b/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/schedule/ScheduleGetTeacher.kt @@ -15,7 +15,7 @@ class ScheduleGetTeacher( ) : CachedRequest( context, Method.GET, - "v2/schedule/teacher/$teacher", + "v3/schedule/teacher/$teacher", { listener.onResponse(Json.decodeFromString(it)) }, errorListener ) { diff --git a/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/schedule/ScheduleUpdate.kt b/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/schedule/ScheduleUpdate.kt index 22dae1a..9fcefa3 100644 --- a/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/schedule/ScheduleUpdate.kt +++ b/app/src/main/java/ru/n08i40k/polytechnic/next/network/request/schedule/ScheduleUpdate.kt @@ -15,7 +15,7 @@ class ScheduleUpdate( ) : AuthorizedRequest( context, Method.PATCH, - "v2/schedule/update-download-url", + "v4/schedule/update-download-url", { listener.onResponse(Json.decodeFromString(it)) }, errorListener ) { diff --git a/app/src/main/java/ru/n08i40k/polytechnic/next/ui/MainActivity.kt b/app/src/main/java/ru/n08i40k/polytechnic/next/ui/MainActivity.kt index 8ceb827..18f0aeb 100644 --- a/app/src/main/java/ru/n08i40k/polytechnic/next/ui/MainActivity.kt +++ b/app/src/main/java/ru/n08i40k/polytechnic/next/ui/MainActivity.kt @@ -25,9 +25,6 @@ import androidx.work.OneTimeWorkRequestBuilder import androidx.work.PeriodicWorkRequest import androidx.work.WorkManager import androidx.work.workDataOf -import com.google.firebase.Firebase -import com.google.firebase.remoteconfig.FirebaseRemoteConfig -import com.google.firebase.remoteconfig.remoteConfig import com.google.firebase.remoteconfig.remoteConfigSettings import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.flow.first @@ -44,8 +41,6 @@ import java.util.concurrent.TimeUnit @AndroidEntryPoint class MainActivity : ComponentActivity() { - val remoteConfig: FirebaseRemoteConfig = Firebase.remoteConfig - private val configSettings = remoteConfigSettings { minimumFetchIntervalInSeconds = 3600 } @@ -118,6 +113,8 @@ class MainActivity : ComponentActivity() { } private fun setupFirebaseConfig() { + val remoteConfig = (application as PolytechnicApplication).container.remoteConfig + remoteConfig.setConfigSettingsAsync(configSettings) remoteConfig.setDefaultsAsync(R.xml.remote_config_defaults) diff --git a/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/MainScreen.kt b/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/MainScreen.kt index f832243..a7b68d0 100644 --- a/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/MainScreen.kt +++ b/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/MainScreen.kt @@ -63,7 +63,6 @@ import ru.n08i40k.polytechnic.next.PolytechnicApplication import ru.n08i40k.polytechnic.next.R import ru.n08i40k.polytechnic.next.model.UserRole import ru.n08i40k.polytechnic.next.settings.settingsDataStore -import ru.n08i40k.polytechnic.next.ui.MainActivity import ru.n08i40k.polytechnic.next.ui.icons.AppIcons import ru.n08i40k.polytechnic.next.ui.icons.appicons.Filled import ru.n08i40k.polytechnic.next.ui.icons.appicons.filled.Download @@ -289,7 +288,7 @@ fun MainScreen( viewModel( factory = RemoteConfigViewModel.provideFactory( appContext = LocalContext.current, - remoteConfig = (LocalContext.current as MainActivity).remoteConfig + remoteConfig = (LocalContext.current.applicationContext as PolytechnicApplication).container.remoteConfig ) ) diff --git a/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/schedule/DayCard.kt b/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/schedule/DayCard.kt index 46905c9..a58223a 100644 --- a/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/schedule/DayCard.kt +++ b/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/schedule/DayCard.kt @@ -7,6 +7,8 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults import androidx.compose.material3.MaterialTheme @@ -66,6 +68,10 @@ fun DayCard( containerColor = MaterialTheme.colorScheme.primaryContainer, contentColor = MaterialTheme.colorScheme.onPrimaryContainer, ) + val examCardColors = CardDefaults.cardColors( + containerColor = MaterialTheme.colorScheme.errorContainer, + contentColor = MaterialTheme.colorScheme.onErrorContainer, + ) Card( modifier = modifier, @@ -93,18 +99,29 @@ fun DayCard( text = day.name, ) + if (day.street != null) { + Text( + modifier = Modifier.fillMaxWidth(), + fontWeight = FontWeight.ExtraLight, + textAlign = TextAlign.Center, + text = day.street, + ) + } + if (distance >= -1 && distance <= 1) { Text( modifier = Modifier.fillMaxWidth(), fontWeight = FontWeight.Bold, textAlign = TextAlign.Center, style = MaterialTheme.typography.bodyMedium, - text = stringResource(when (distance) { - -1 -> R.string.yesterday - 0 -> R.string.today - 1 -> R.string.tomorrow - else -> throw RuntimeException() - }), + text = stringResource( + when (distance) { + -1 -> R.string.yesterday + 0 -> R.string.today + 1 -> R.string.tomorrow + else -> throw RuntimeException() + } + ), ) } @@ -112,7 +129,9 @@ fun DayCard( .collectAsStateWithLifecycle(0) Column( - modifier = Modifier.fillMaxWidth(), + modifier = Modifier + .fillMaxWidth() + .verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(0.5.dp) ) { if (day.lessons.isEmpty()) { @@ -125,8 +144,12 @@ fun DayCard( val cardColors = when (lesson.type) { LessonType.DEFAULT -> defaultCardColors - LessonType.ADDITIONAL -> customCardColors + LessonType.ADDITIONAL -> noneCardColors LessonType.BREAK -> noneCardColors + LessonType.CONSULTATION -> customCardColors + LessonType.INDEPENDENT_WORK -> customCardColors + LessonType.EXAM -> examCardColors + LessonType.EXAM_WITH_GRADE -> examCardColors } val mutableExpanded = remember { mutableStateOf(false) } @@ -139,14 +162,15 @@ fun DayCard( val now = lessonIdx == currentLessonIdx if (lesson.type === LessonType.BREAK) - FreeLessonRow(lesson, lesson, cardColors, now) + FreeLessonRow(lesson, cardColors, now) else - LessonRow(day, lesson, cardColors, now) + LessonRow(lesson, cardColors, now) } if (mutableExpanded.value) LessonExtraInfo(lesson, mutableExpanded) } + } } } \ No newline at end of file diff --git a/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/schedule/DayPager.kt b/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/schedule/DayPager.kt index 6d18979..419f770 100644 --- a/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/schedule/DayPager.kt +++ b/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/schedule/DayPager.kt @@ -53,7 +53,7 @@ fun DayPager(groupOrTeacher: GroupOrTeacher = FakeScheduleRepository.exampleGrou } HorizontalPager( state = pagerState, - contentPadding = PaddingValues(horizontal = 20.dp), + contentPadding = PaddingValues(horizontal = 7.dp), verticalAlignment = Alignment.Top, modifier = Modifier .height(600.dp) diff --git a/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/schedule/LessonView.kt b/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/schedule/LessonView.kt index 884d44c..5d31bdc 100644 --- a/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/schedule/LessonView.kt +++ b/app/src/main/java/ru/n08i40k/polytechnic/next/ui/main/schedule/LessonView.kt @@ -27,14 +27,10 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Dialog -import kotlinx.datetime.LocalDateTime import ru.n08i40k.polytechnic.next.R import ru.n08i40k.polytechnic.next.data.schedule.impl.FakeScheduleRepository -import ru.n08i40k.polytechnic.next.model.Day import ru.n08i40k.polytechnic.next.model.Lesson -import ru.n08i40k.polytechnic.next.model.LessonTime import ru.n08i40k.polytechnic.next.model.LessonType -import ru.n08i40k.polytechnic.next.model.SubGroup import ru.n08i40k.polytechnic.next.utils.dayMinutes import ru.n08i40k.polytechnic.next.utils.fmtAsClock @@ -55,7 +51,7 @@ private fun fmtTime(start: Int, end: Int, format: LessonTimeFormat): ArrayList { val duration = end - start - arrayListOf("$duration " + stringResource(R.string.minutes)) + arrayListOf("$duration" + stringResource(R.string.minutes)) } } } @@ -109,15 +105,8 @@ fun LessonExtraInfo( @Preview(showBackground = true) @Composable private fun LessonViewRow( - range: List? = listOf(1, 3), - time: LessonTime = LessonTime.fromLocalDateTime( - LocalDateTime(2024, 1, 1, 0, 0), - LocalDateTime(2024, 1, 1, 1, 0), - ), + lesson: Lesson = FakeScheduleRepository.exampleGroup.days[0].lessons[4], timeFormat: LessonTimeFormat = LessonTimeFormat.FROM_TO, - name: String = "Test", - subGroups: List = listOf(), - group: String? = "ИС-214/23", cardColors: CardColors = CardDefaults.cardColors(), verticalPadding: Dp = 10.dp, now: Boolean = true, @@ -126,7 +115,9 @@ private fun LessonViewRow( if (timeFormat == LessonTimeFormat.FROM_TO) cardColors.contentColor else cardColors.disabledContentColor - val rangeSize = if (range == null) 1 else (range[1] - range[0] + 1) * 2 + val rangeSize = + if (lesson.defaultRange == null) 1 + else (lesson.defaultRange[1] - lesson.defaultRange[0] + 1) * 2 Box( if (now) Modifier.border( @@ -146,17 +137,18 @@ private fun LessonViewRow( verticalAlignment = Alignment.CenterVertically, ) { val rangeString = run { - if (range == null) + if (lesson.defaultRange == null) " " else buildString { - val same = range[0] == range[1] + val same = lesson.defaultRange[0] == lesson.defaultRange[1] - append(if (same) " " else range[0]) - append(if (same) range[0] else "-") - append(if (same) " " else range[1]) + append(if (same) " " else lesson.defaultRange[0]) + append(if (same) lesson.defaultRange[0] else "-") + append(if (same) " " else lesson.defaultRange[1]) } } + // 1-2 Text( text = rangeString, fontFamily = FontFamily.Monospace, @@ -170,8 +162,9 @@ private fun LessonViewRow( verticalArrangement = Arrangement.Center ) { val formattedTime: ArrayList = - fmtTime(time.start.dayMinutes, time.end.dayMinutes, timeFormat) + fmtTime(lesson.time.start.dayMinutes, lesson.time.end.dayMinutes, timeFormat) + // 10:20 - 11:40 Text( text = formattedTime[0], fontFamily = FontFamily.Monospace, @@ -194,17 +187,32 @@ private fun LessonViewRow( verticalAlignment = Alignment.CenterVertically ) { Column(modifier = Modifier.weight(1f)) { + if (lesson.type.value > LessonType.BREAK.value) { + Text( + text = when (lesson.type) { + LessonType.CONSULTATION -> stringResource(R.string.lesson_type_consultation) + LessonType.INDEPENDENT_WORK -> stringResource(R.string.lesson_type_independent_work) + LessonType.EXAM -> stringResource(R.string.lesson_type_exam) + LessonType.EXAM_WITH_GRADE -> stringResource(R.string.lesson_type_exam_with_grade) + else -> throw Error("Unknown lesson type!") + }, + fontWeight = FontWeight.Bold, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + color = contentColor + ) + } Text( - text = name, + text = lesson.name ?: stringResource(R.string.lesson_break), fontWeight = FontWeight.Medium, maxLines = 1, overflow = TextOverflow.Ellipsis, color = contentColor ) - if (group != null) { + if (lesson.group != null) { Text( - text = group, + text = lesson.group, fontWeight = FontWeight.Medium, maxLines = 1, overflow = TextOverflow.Ellipsis, @@ -212,9 +220,10 @@ private fun LessonViewRow( ) } - for (subGroup in subGroups) { + for (subGroup in lesson.subGroups) { Text( text = subGroup.teacher, + fontWeight = FontWeight.Thin, maxLines = 1, overflow = TextOverflow.Ellipsis, color = contentColor @@ -223,14 +232,17 @@ private fun LessonViewRow( } Column(modifier = Modifier.wrapContentWidth()) { - if (subGroups.size != 1) { - for (i in 0..<(if (group != null) 2 else 1)) + if (lesson.subGroups.size != 1) { + Text(text = "") + + if (lesson.group != null) Text(text = "") } - for (subGroup in subGroups) { + for (subGroup in lesson.subGroups) { Text( text = subGroup.cabinet, maxLines = 1, + fontWeight = FontWeight.Thin, fontFamily = FontFamily.Monospace, color = contentColor ) @@ -247,17 +259,12 @@ private fun LessonViewRow( @Composable fun FreeLessonRow( lesson: Lesson = FakeScheduleRepository.exampleGroup.days[0].lessons[0], - nextLesson: Lesson = FakeScheduleRepository.exampleGroup.days[0].lessons[1], cardColors: CardColors = CardDefaults.cardColors(), now: Boolean = true ) { LessonViewRow( - lesson.defaultRange, - LessonTime(lesson.time.start, nextLesson.time.end), + lesson, LessonTimeFormat.ONLY_MINUTES_DURATION, - stringResource(R.string.lesson_break), - lesson.subGroups, - lesson.group, cardColors, 2.5.dp, now @@ -267,18 +274,13 @@ fun FreeLessonRow( @Preview(showBackground = true) @Composable fun LessonRow( - day: Day = FakeScheduleRepository.exampleGroup.days[0], lesson: Lesson = FakeScheduleRepository.exampleGroup.days[0].lessons[0], cardColors: CardColors = CardDefaults.cardColors(), now: Boolean = true, ) { LessonViewRow( - lesson.defaultRange, - lesson.time, + lesson, LessonTimeFormat.FROM_TO, - lesson.name!!, - lesson.subGroups, - lesson.group, cardColors, 5.dp, now diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 22bfd20..fb6f9f0 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -80,4 +80,8 @@ ФИО преподавателя Преподаватель не выбран или вы допустили ошибку в его ФИО. Не удалось получить список ФИО преподавателей! + Консультация + Самостоятельная работа + ЗАЧЁТ + ЗАЧЁТ С ОЦЕНКОЙ \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b5143bb..9ff2246 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -80,4 +80,8 @@ Teacher name Teacher not selected or you made mistake in his name. Failed to fetch teacher names! + Consultation + Independent work + EXAM + EXAM WITH GRADE \ No newline at end of file diff --git a/app/src/main/res/xml/remote_config_defaults.xml b/app/src/main/res/xml/remote_config_defaults.xml index 33683e0..74c6f74 100644 --- a/app/src/main/res/xml/remote_config_defaults.xml +++ b/app/src/main/res/xml/remote_config_defaults.xml @@ -1,27 +1,31 @@ + + serverVersion + 2.2.2 + linkUpdateDelay 15 minVersion - 1.3.0 - - - currVersion - 1.5.0 - - - downloadLink - https://t.me/polytechnic_next/16 + 2.0.1 telegramLink https://t.me/polytechnic_next - serverVersion - 1.3.0 + linkParserRegex + <a href="(/\d{4}/[.\w\-_]+\.xls)"> + + + downloadLink + https://t.me/polytechnic_next/68 + + + currVersion + 2.2.1 \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3457c0c..cc867a1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,9 +1,9 @@ [versions] accompanistSwiperefresh = "0.36.0" -agp = "8.7.2" -firebaseBom = "33.5.1" -hiltAndroid = "2.52" -hiltAndroidCompiler = "2.52" +agp = "8.7.3" +firebaseBom = "33.7.0" +hiltAndroid = "2.53.1" +hiltAndroidCompiler = "2.53.1" hiltNavigationCompose = "1.2.0" kotlin = "2.0.10" coreKtx = "1.15.0" @@ -13,12 +13,12 @@ espressoCore = "3.6.1" kotlinxSerializationJson = "1.7.3" lifecycleRuntimeKtx = "2.8.7" activityCompose = "1.9.3" -composeBom = "2024.10.01" +composeBom = "2024.12.01" mockitoKotlin = "5.4.0" protobufLite = "3.0.1" volley = "1.2.1" datastore = "1.1.1" -navigationCompose = "2.8.3" +navigationCompose = "2.8.5" googleFirebaseCrashlytics = "3.0.2" workRuntime = "2.10.0" @@ -41,7 +41,7 @@ androidx-ui = { group = "androidx.compose.ui", name = "ui" } androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" } androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" } androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" } -androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest", version = "1.7.5" } +androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest", version = "1.7.6" } androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" } androidx-material3 = { group = "androidx.compose.material3", name = "material3" } kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.6.1" } @@ -52,8 +52,8 @@ volley = { group = "com.android.volley", name = "volley", version.ref = "volley" androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigationCompose" } firebase-bom = { module = "com.google.firebase:firebase-bom", version.ref = "firebaseBom" } firebase-analytics = { module = "com.google.firebase:firebase-analytics", version = "22.1.2" } -firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashlytics", version = "19.2.1" } -firebase-messaging = { group = "com.google.firebase", name = "firebase-messaging", version = "24.0.3" } +firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashlytics", version = "19.3.0" } +firebase-messaging = { group = "com.google.firebase", name = "firebase-messaging", version = "24.1.0" } firebase-config = { group = "com.google.firebase", name = "firebase-config", version = "22.0.1" } [plugins]