mirror of
https://github.com/n08i40k/polytechnic-android.git
synced 2025-12-06 09:47:48 +03:00
2.0.3
Фикс запуска постоянного уведомления. Предотвращение запуска фоновых задач до прохождения авторизации. Обновление библиотек.
This commit is contained in:
14
.idea/appInsightsSettings.xml
generated
14
.idea/appInsightsSettings.xml
generated
@@ -17,20 +17,6 @@
|
||||
</option>
|
||||
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
||||
<option name="timeIntervalDays" value="THIRTY_DAYS" />
|
||||
<option name="versions">
|
||||
<list>
|
||||
<VersionSetting>
|
||||
<option name="buildVersion" value="17" />
|
||||
<option name="displayName" value="2.0.1 (17)" />
|
||||
<option name="displayVersion" value="2.0.1" />
|
||||
</VersionSetting>
|
||||
<VersionSetting>
|
||||
<option name="buildVersion" value="16" />
|
||||
<option name="displayName" value="2.0.0prod (16)" />
|
||||
<option name="displayVersion" value="2.0.0prod" />
|
||||
</VersionSetting>
|
||||
</list>
|
||||
</option>
|
||||
<option name="visibilityType" value="ALL" />
|
||||
</InsightsFilterSettings>
|
||||
</value>
|
||||
|
||||
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EntryPointsManager">
|
||||
<list size="2">
|
||||
|
||||
@@ -33,8 +33,8 @@ android {
|
||||
applicationId = "ru.n08i40k.polytechnic.next"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 18
|
||||
versionName = "2.0.2"
|
||||
versionCode = 19
|
||||
versionName = "2.0.3"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
|
||||
@@ -102,7 +102,7 @@ class CurrentLessonViewService : Service() {
|
||||
}
|
||||
|
||||
val firstLessonIdx =
|
||||
day!!.distanceToNextByLocalDateTime(LocalDateTime(0, 0, 0, 0, 0))?.first
|
||||
day!!.distanceToNextByLocalDateTime(LocalDateTime(1, 1, 1, 0, 0))?.first
|
||||
?: throw NullPointerException("Is this even real?")
|
||||
val distanceToFirst = day!!.lessons[firstLessonIdx]!!.time!!.start.dayMinutes - currentMinutes
|
||||
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
package ru.n08i40k.polytechnic.next.ui
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import ru.n08i40k.polytechnic.next.settings.settingsDataStore
|
||||
import ru.n08i40k.polytechnic.next.ui.auth.AuthScreen
|
||||
import ru.n08i40k.polytechnic.next.ui.main.MainScreen
|
||||
import ru.n08i40k.polytechnic.next.ui.theme.AppTheme
|
||||
@@ -15,10 +20,15 @@ import ru.n08i40k.polytechnic.next.ui.theme.AppTheme
|
||||
fun PolytechnicApp() {
|
||||
AppTheme(darkTheme = true, content = {
|
||||
val navController = rememberNavController()
|
||||
val context = LocalContext.current
|
||||
|
||||
val accessToken = runBlocking {
|
||||
context.settingsDataStore.data.map { it.accessToken }.first()
|
||||
}
|
||||
|
||||
NavHost(
|
||||
navController = navController,
|
||||
startDestination = "auth"
|
||||
startDestination = if (accessToken.isEmpty()) "auth" else "main"
|
||||
) {
|
||||
composable(route = "auth") {
|
||||
AuthScreen(navController)
|
||||
|
||||
@@ -47,7 +47,6 @@ import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.IntOffset
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.core.content.ContextCompat.startActivity
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
@@ -134,7 +133,7 @@ private fun NavHostContainer(
|
||||
}
|
||||
|
||||
private fun openLink(context: Context, link: String) {
|
||||
startActivity(context, Intent(Intent.ACTION_VIEW, Uri.parse(link)), null)
|
||||
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(link)), null)
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -3,12 +3,21 @@ package ru.n08i40k.polytechnic.next.work
|
||||
import android.content.Context
|
||||
import androidx.work.Worker
|
||||
import androidx.work.WorkerParameters
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import ru.n08i40k.polytechnic.next.PolytechnicApplication
|
||||
import ru.n08i40k.polytechnic.next.settings.settingsDataStore
|
||||
|
||||
class LinkUpdateWorker(context: Context, params: WorkerParameters) :
|
||||
Worker(context, params) {
|
||||
override fun doWork(): Result {
|
||||
val accessToken = runBlocking {
|
||||
applicationContext.settingsDataStore.data.map { it.accessToken }.first()
|
||||
}
|
||||
if (accessToken.isEmpty())
|
||||
return Result.retry()
|
||||
|
||||
runBlocking {
|
||||
(applicationContext as PolytechnicApplication)
|
||||
.container
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
[versions]
|
||||
accompanistSwiperefresh = "0.36.0"
|
||||
agp = "8.7.1"
|
||||
firebaseBom = "33.4.0"
|
||||
agp = "8.7.2"
|
||||
firebaseBom = "33.5.1"
|
||||
hiltAndroid = "2.52"
|
||||
hiltAndroidCompiler = "2.52"
|
||||
hiltNavigationCompose = "1.2.0"
|
||||
kotlin = "2.0.10"
|
||||
coreKtx = "1.13.1"
|
||||
coreKtx = "1.15.0"
|
||||
junit = "4.13.2"
|
||||
junitVersion = "1.2.1"
|
||||
espressoCore = "3.6.1"
|
||||
kotlinxSerializationJson = "1.7.3"
|
||||
lifecycleRuntimeKtx = "2.8.6"
|
||||
lifecycleRuntimeKtx = "2.8.7"
|
||||
activityCompose = "1.9.3"
|
||||
composeBom = "2024.10.00"
|
||||
composeBom = "2024.10.01"
|
||||
protobufLite = "3.0.1"
|
||||
volley = "1.2.1"
|
||||
datastore = "1.1.1"
|
||||
navigationCompose = "2.8.3"
|
||||
googleFirebaseCrashlytics = "3.0.2"
|
||||
workRuntime = "2.9.1"
|
||||
workRuntime = "2.10.0"
|
||||
|
||||
[libraries]
|
||||
accompanist-swiperefresh = { module = "com.google.accompanist:accompanist-swiperefresh", version.ref = "accompanistSwiperefresh" }
|
||||
@@ -40,7 +40,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.4" }
|
||||
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest", version = "1.7.5" }
|
||||
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" }
|
||||
@@ -49,10 +49,10 @@ protobuf-lite = { module = "com.google.protobuf:protobuf-lite", version.ref = "p
|
||||
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" }
|
||||
firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashlytics" }
|
||||
firebase-messaging = { group = "com.google.firebase", name = "firebase-messaging" }
|
||||
firebase-config = { group = "com.google.firebase", name = "firebase-config" }
|
||||
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-config = { group = "com.google.firebase", name = "firebase-config", version = "22.0.1" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
|
||||
Reference in New Issue
Block a user