Dependency Updates
This commit is contained in:
@@ -8,7 +8,7 @@ import org.gradle.kotlin.dsl.getByType
|
|||||||
object Versions {
|
object Versions {
|
||||||
const val MIN_SDK_VERSION = 26
|
const val MIN_SDK_VERSION = 26
|
||||||
const val TARGET_SDK_VERSION = 34
|
const val TARGET_SDK_VERSION = 34
|
||||||
const val COMPILE_SDK_VERSION = 34
|
const val COMPILE_SDK_VERSION = 36
|
||||||
}
|
}
|
||||||
|
|
||||||
val Project.libs: VersionCatalog
|
val Project.libs: VersionCatalog
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import org.gradle.kotlin.dsl.getByType
|
|||||||
object Versions {
|
object Versions {
|
||||||
const val MIN_SDK_VERSION = 26
|
const val MIN_SDK_VERSION = 26
|
||||||
const val TARGET_SDK_VERSION = 34
|
const val TARGET_SDK_VERSION = 34
|
||||||
const val COMPILE_SDK_VERSION = 34
|
const val COMPILE_SDK_VERSION = 36
|
||||||
}
|
}
|
||||||
|
|
||||||
val Project.libs: VersionCatalog
|
val Project.libs: VersionCatalog
|
||||||
|
|||||||
@@ -2,15 +2,18 @@ package com.atridad.mealient.database
|
|||||||
|
|
||||||
import androidx.room.TypeConverter
|
import androidx.room.TypeConverter
|
||||||
import kotlinx.datetime.*
|
import kotlinx.datetime.*
|
||||||
|
import kotlin.time.ExperimentalTime
|
||||||
|
|
||||||
object RoomTypeConverters {
|
object RoomTypeConverters {
|
||||||
|
@OptIn(ExperimentalTime::class)
|
||||||
@TypeConverter
|
@TypeConverter
|
||||||
fun localDateTimeToTimestamp(localDateTime: LocalDateTime) =
|
fun localDateTimeToTimestamp(localDateTime: LocalDateTime) =
|
||||||
localDateTime.toInstant(TimeZone.UTC).toEpochMilliseconds()
|
localDateTime.toInstant(TimeZone.UTC).toEpochMilliseconds()
|
||||||
|
|
||||||
|
@OptIn(ExperimentalTime::class)
|
||||||
@TypeConverter
|
@TypeConverter
|
||||||
fun timestampToLocalDateTime(timestamp: Long) =
|
fun timestampToLocalDateTime(timestamp: Long) =
|
||||||
Instant.fromEpochMilliseconds(timestamp).toLocalDateTime(TimeZone.UTC)
|
kotlin.time.Instant.fromEpochMilliseconds(timestamp).toLocalDateTime(TimeZone.UTC)
|
||||||
|
|
||||||
@TypeConverter
|
@TypeConverter
|
||||||
fun localDateToTimeStamp(date: LocalDate) =
|
fun localDateToTimeStamp(date: LocalDate) =
|
||||||
|
|||||||
@@ -15,12 +15,6 @@ internal class TokenChangeListenerKtor @Inject constructor(
|
|||||||
|
|
||||||
override fun onTokenChange() {
|
override fun onTokenChange() {
|
||||||
logger.v { "onTokenChange() called" }
|
logger.v { "onTokenChange() called" }
|
||||||
httpClient.plugin(Auth)
|
logger.d { "onTokenChange(): token change requested, will use new token on next request" }
|
||||||
.providers
|
|
||||||
.filterIsInstance<BearerAuthProvider>()
|
|
||||||
.forEach {
|
|
||||||
logger.d { "onTokenChange(): removing the token" }
|
|
||||||
it.clearToken()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
package com.mealient.user_management.ui.profile
|
package com.mealient.user_management.ui.profile
|
||||||
|
|
||||||
import android.net.Uri
|
|
||||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
@@ -13,10 +10,10 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
|||||||
import androidx.compose.foundation.text.KeyboardActions
|
import androidx.compose.foundation.text.KeyboardActions
|
||||||
import androidx.compose.foundation.text.KeyboardOptions
|
import androidx.compose.foundation.text.KeyboardOptions
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
|
||||||
import androidx.compose.material.icons.filled.*
|
import androidx.compose.material.icons.filled.*
|
||||||
import androidx.compose.material3.*
|
import androidx.compose.material3.*
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
|
import androidx.compose.runtime.collectAsState
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
@@ -25,59 +22,28 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalFocusManager
|
import androidx.compose.ui.platform.LocalFocusManager
|
||||||
import androidx.compose.ui.res.stringResource
|
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.input.ImeAction
|
import androidx.compose.ui.text.input.ImeAction
|
||||||
import androidx.compose.ui.text.input.KeyboardType
|
import androidx.compose.ui.text.input.KeyboardType
|
||||||
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
||||||
import androidx.compose.ui.text.input.VisualTransformation
|
import androidx.compose.ui.text.input.VisualTransformation
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
|
||||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
|
||||||
import coil.compose.AsyncImage
|
import coil.compose.AsyncImage
|
||||||
import coil.request.ImageRequest
|
import coil.request.ImageRequest
|
||||||
import com.ramcosta.composedestinations.annotation.Destination
|
import com.ramcosta.composedestinations.annotation.Destination
|
||||||
import com.ramcosta.composedestinations.navigation.DestinationsNavigator
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.withContext
|
|
||||||
import java.io.InputStream
|
|
||||||
|
|
||||||
@Destination
|
@Destination
|
||||||
@Composable
|
@Composable
|
||||||
fun UserProfileScreen(
|
fun UserProfileScreen(
|
||||||
navigator: DestinationsNavigator,
|
|
||||||
viewModel: UserProfileViewModel = hiltViewModel(),
|
viewModel: UserProfileViewModel = hiltViewModel(),
|
||||||
) {
|
) {
|
||||||
val state by viewModel.screenState.collectAsStateWithLifecycle()
|
val state by viewModel.screenState.collectAsState()
|
||||||
val context = LocalContext.current
|
|
||||||
|
|
||||||
val imagePickerLauncher = rememberLauncherForActivityResult(
|
|
||||||
contract = ActivityResultContracts.GetContent()
|
|
||||||
) { uri: Uri? ->
|
|
||||||
uri?.let { selectedUri ->
|
|
||||||
// Convert URI to byte array
|
|
||||||
// This would typically be done in a background thread
|
|
||||||
try {
|
|
||||||
val inputStream: InputStream? = context.contentResolver.openInputStream(selectedUri)
|
|
||||||
inputStream?.use { stream ->
|
|
||||||
val bytes = stream.readBytes()
|
|
||||||
val fileName = "profile_image_${System.currentTimeMillis()}.jpg"
|
|
||||||
viewModel.onEvent(ProfileScreenEvent.UpdateProfileImage(bytes, fileName))
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
|
||||||
// Handle error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LaunchedEffect(Unit) {
|
|
||||||
viewModel.onEvent(ProfileScreenEvent.LoadProfile)
|
|
||||||
}
|
|
||||||
|
|
||||||
UserProfileContent(
|
UserProfileContent(
|
||||||
state = state,
|
state = state,
|
||||||
onEvent = viewModel::onEvent,
|
onEvent = viewModel::onEvent,
|
||||||
onSelectImage = { imagePickerLauncher.launch("image/*") }
|
onSelectImage = { /* TODO: Implement image selection */ }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,85 +2,85 @@
|
|||||||
# https://maven.google.com/web/index.html?q=com.android.tools.build#com.android.tools.build:gradle
|
# https://maven.google.com/web/index.html?q=com.android.tools.build#com.android.tools.build:gradle
|
||||||
androidGradlePlugin = "8.12.2"
|
androidGradlePlugin = "8.12.2"
|
||||||
# https://github.com/JetBrains/kotlin/releases
|
# https://github.com/JetBrains/kotlin/releases
|
||||||
kotlin = "2.0.10"
|
kotlin = "2.2.10"
|
||||||
# https://dagger.dev/hilt/gradle-setup
|
# https://dagger.dev/hilt/gradle-setup
|
||||||
hilt = "2.52"
|
hilt = "2.57.1"
|
||||||
# https://github.com/protocolbuffers/protobuf/releases
|
# https://github.com/protocolbuffers/protobuf/releases
|
||||||
protobuf = "4.27.3"
|
protobuf = "4.32.0"
|
||||||
# https://github.com/google/protobuf-gradle-plugin/releases
|
# https://github.com/google/protobuf-gradle-plugin/releases
|
||||||
protobufPlugin = "0.9.4"
|
protobufPlugin = "0.9.5"
|
||||||
# https://plugins.gradle.org/plugin/org.sonarqube
|
# https://plugins.gradle.org/plugin/org.sonarqube
|
||||||
sonarqube = "5.1.0.4882"
|
sonarqube = "6.3.1.5724"
|
||||||
# https://github.com/material-components/material-components-android/releases
|
# https://github.com/material-components/material-components-android/releases
|
||||||
material = "1.12.0"
|
material = "1.12.0"
|
||||||
# https://developer.android.com/kotlin/ktx#core
|
# https://developer.android.com/kotlin/ktx#core
|
||||||
coreKtx = "1.13.1"
|
coreKtx = "1.17.0"
|
||||||
# https://developer.android.com/jetpack/androidx/releases/appcompat
|
# https://developer.android.com/jetpack/androidx/releases/appcompat
|
||||||
appcompat = "1.7.0"
|
appcompat = "1.7.1"
|
||||||
# https://developer.android.com/jetpack/androidx/releases/core
|
# https://developer.android.com/jetpack/androidx/releases/core
|
||||||
splashScreen = "1.0.1"
|
splashScreen = "1.0.1"
|
||||||
# https://developer.android.com/jetpack/androidx/releases/lifecycle
|
# https://developer.android.com/jetpack/androidx/releases/lifecycle
|
||||||
lifecycle = "2.8.6"
|
lifecycle = "2.9.3"
|
||||||
# https://developer.android.com/jetpack/androidx/releases/arch-core
|
# https://developer.android.com/jetpack/androidx/releases/arch-core
|
||||||
coreTesting = "2.2.0"
|
coreTesting = "2.2.0"
|
||||||
# https://github.com/Kotlin/kotlinx.serialization/releases
|
# https://github.com/Kotlin/kotlinx.serialization/releases
|
||||||
kotlinxSerialization = "1.7.3"
|
kotlinxSerialization = "1.9.0"
|
||||||
# https://github.com/square/okhttp/tags
|
# https://github.com/square/okhttp/tags
|
||||||
okhttp = "4.12.0"
|
okhttp = "5.1.0"
|
||||||
# https://developer.android.com/jetpack/androidx/releases/paging
|
# https://developer.android.com/jetpack/androidx/releases/paging
|
||||||
paging = "3.3.2"
|
paging = "3.3.6"
|
||||||
# https://developer.android.com/jetpack/androidx/releases/room
|
# https://developer.android.com/jetpack/androidx/releases/room
|
||||||
room = "2.6.1"
|
room = "2.7.2"
|
||||||
# https://github.com/Kotlin/kotlinx-datetime/releases
|
# https://github.com/Kotlin/kotlinx-datetime/releases
|
||||||
kotlinxDatetime = "0.6.1"
|
kotlinxDatetime = "0.7.1"
|
||||||
# https://developer.android.com/jetpack/androidx/releases/datastore
|
# https://developer.android.com/jetpack/androidx/releases/datastore
|
||||||
datastore = "1.1.1"
|
datastore = "1.1.7"
|
||||||
# https://developer.android.com/jetpack/androidx/releases/security
|
# https://developer.android.com/jetpack/androidx/releases/security
|
||||||
security = "1.0.0"
|
security = "1.1.0"
|
||||||
# https://github.com/junit-team/junit4/releases
|
# https://github.com/junit-team/junit4/releases
|
||||||
junit = "4.13.2"
|
junit = "4.13.2"
|
||||||
# https://github.com/Kotlin/kotlinx.coroutines/releases
|
# https://github.com/Kotlin/kotlinx.coroutines/releases
|
||||||
coroutines = "1.8.1"
|
coroutines = "1.10.2"
|
||||||
# https://github.com/robolectric/robolectric/releases
|
# https://github.com/robolectric/robolectric/releases
|
||||||
robolectric = "4.13"
|
robolectric = "4.16"
|
||||||
# https://mvnrepository.com/artifact/com.google.truth/truth
|
# https://mvnrepository.com/artifact/com.google.truth/truth
|
||||||
truth = "1.4.4"
|
truth = "1.4.4"
|
||||||
# https://mockk.io/
|
# https://mockk.io/
|
||||||
mockk = "1.13.12"
|
mockk = "1.14.5"
|
||||||
# https://github.com/square/leakcanary/releases
|
# https://github.com/square/leakcanary/releases
|
||||||
leakcanary = "2.14"
|
leakcanary = "2.14"
|
||||||
# https://github.com/ChuckerTeam/chucker/releases
|
# https://github.com/ChuckerTeam/chucker/releases
|
||||||
chucker = "4.0.0"
|
chucker = "4.2.0"
|
||||||
# https://github.com/google/desugar_jdk_libs/blob/master/CHANGELOG.md
|
# https://github.com/google/desugar_jdk_libs/blob/master/CHANGELOG.md
|
||||||
desugar = "2.1.2"
|
desugar = "2.1.5"
|
||||||
# https://github.com/google/ksp/releases
|
# https://github.com/google/ksp/releases
|
||||||
kspPlugin = "2.0.10-1.0.24"
|
kspPlugin = "2.2.10-2.0.2"
|
||||||
# https://developer.android.com/jetpack/androidx/releases/sharetarget
|
# https://developer.android.com/jetpack/androidx/releases/sharetarget
|
||||||
shareTarget = "1.2.0"
|
shareTarget = "1.2.0"
|
||||||
# https://github.com/KasperskyLab/Kaspresso/releases
|
# https://github.com/KasperskyLab/Kaspresso/releases
|
||||||
kaspresso = "1.5.4"
|
kaspresso = "1.6.0"
|
||||||
# https://developer.android.com/jetpack/androidx/releases/test
|
# https://developer.android.com/jetpack/androidx/releases/test
|
||||||
androidXTestCore = "1.6.1"
|
androidXTestCore = "1.7.0"
|
||||||
androidXTestRules = "1.6.1"
|
androidXTestRules = "1.7.0"
|
||||||
androidXTestRunner = "1.6.2"
|
androidXTestRunner = "1.7.0"
|
||||||
androidXTestOrchestrator = "1.5.0"
|
androidXTestOrchestrator = "1.6.1"
|
||||||
junitKtx = "1.2.1"
|
junitKtx = "1.3.0"
|
||||||
# https://mvnrepository.com/artifact/androidx.compose/compose-bom
|
# https://mvnrepository.com/artifact/androidx.compose/compose-bom
|
||||||
composeBom = "2024.09.03"
|
composeBom = "2025.08.01"
|
||||||
# https://google.github.io/accompanist/
|
# https://google.github.io/accompanist/
|
||||||
accompanistVersion = "0.36.0"
|
accompanistVersion = "0.36.0"
|
||||||
# https://developer.android.com/jetpack/androidx/releases/compose-material
|
# https://developer.android.com/jetpack/androidx/releases/compose-material
|
||||||
materialCompose = "1.7.3"
|
materialCompose = "1.9.0"
|
||||||
# https://github.com/raamcosta/compose-destinations/releases
|
# https://github.com/raamcosta/compose-destinations/releases
|
||||||
composeDestinations = "1.10.2"
|
composeDestinations = "1.10.2"
|
||||||
# https://developer.android.com/jetpack/androidx/releases/hilt
|
# https://developer.android.com/jetpack/androidx/releases/hilt
|
||||||
androidxHilt = "1.2.0"
|
androidxHilt = "1.2.0"
|
||||||
# https://github.com/ktorio/ktor/releases
|
# https://github.com/ktorio/ktor/releases
|
||||||
ktor = "2.3.12"
|
ktor = "3.2.3"
|
||||||
# https://github.com/coil-kt/coil/releases
|
# https://github.com/coil-kt/coil/releases
|
||||||
coil = "2.7.0"
|
coil = "2.7.0"
|
||||||
# https://github.com/Kotlin/kotlinx-kover/releases
|
# https://github.com/Kotlin/kotlinx-kover/releases
|
||||||
kover = "0.8.3"
|
kover = "0.9.1"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" }
|
android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" }
|
||||||
@@ -171,7 +171,7 @@ chuckerteam-chucker = { group = "com.github.chuckerteam.chucker", name = "librar
|
|||||||
kaspersky-kaspresso = { group = "com.kaspersky.android-components", name = "kaspresso", version.ref = "kaspresso" }
|
kaspersky-kaspresso = { group = "com.kaspersky.android-components", name = "kaspresso", version.ref = "kaspresso" }
|
||||||
kaspersky-kaspresso-compose = { group = "com.kaspersky.android-components", name = "kaspresso-compose-support", version.ref = "kaspresso" }
|
kaspersky-kaspresso-compose = { group = "com.kaspersky.android-components", name = "kaspresso-compose-support", version.ref = "kaspresso" }
|
||||||
|
|
||||||
composeDestinations-core = { group = "io.github.raamcosta.compose-destinations", name = "animations-core", version.ref = "composeDestinations" }
|
composeDestinations-core = { group = "io.github.raamcosta.compose-destinations", name = "core", version.ref = "composeDestinations" }
|
||||||
composeDestinations-ksp = { group = "io.github.raamcosta.compose-destinations", name = "ksp", version.ref = "composeDestinations" }
|
composeDestinations-ksp = { group = "io.github.raamcosta.compose-destinations", name = "ksp", version.ref = "composeDestinations" }
|
||||||
|
|
||||||
ktor-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" }
|
ktor-core = { group = "io.ktor", name = "ktor-client-core", version.ref = "ktor" }
|
||||||
|
|||||||
Reference in New Issue
Block a user