vk.com -> vk.ru

This commit is contained in:
2025-09-10 10:24:53 +03:00
parent 42ad04093d
commit db92b261c0
9 changed files with 17 additions and 25 deletions
@@ -18,7 +18,6 @@ import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.Scaffold import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
@@ -76,28 +75,20 @@ fun MainScreen(
} }
BackHandler(enabled = selectedItemIndex != 1) { BackHandler(enabled = selectedItemIndex != 1) {
val index = 1
val currentRoute = navigationItems[selectedItemIndex].route val currentRoute = navigationItems[selectedItemIndex].route
selectedItemIndex = 1 selectedItemIndex = 1
navController.navigate(navigationItems[index].route) { navController.navigate(navigationItems[selectedItemIndex].route) {
popUpTo(route = currentRoute) { popUpTo(route = currentRoute) {
inclusive = true inclusive = true
} }
} }
} }
val user = LocalUser.current val profileImageUrl = LocalUser.current?.photo100
val profileImageUrl by remember(user) {
derivedStateOf { user?.photo100 }
}
var tabReselected by remember { var tabReselected by remember {
mutableStateOf( mutableStateOf(navigationItems.associate { it.route to false })
navigationItems.associate {
it.route to false
}
)
} }
Scaffold( Scaffold(
@@ -109,7 +100,7 @@ fun MainScreen(
if (theme.enableBlur) { if (theme.enableBlur) {
Modifier.hazeEffect( Modifier.hazeEffect(
state = hazeState, state = hazeState,
style = HazeMaterials.thick() style = HazeMaterials.regular(NavigationBarDefaults.containerColor)
) )
} else Modifier } else Modifier
), ),
@@ -5,8 +5,8 @@ object AppConstants {
const val INSTALL_APP_MIME_TYPE = "application/vnd.android.package-archive" const val INSTALL_APP_MIME_TYPE = "application/vnd.android.package-archive"
const val API_VERSION = "5.238" const val API_VERSION = "5.238"
const val URL_OAUTH = "https://oauth.vk.com" const val URL_OAUTH = "https://oauth.vk.ru"
const val URL_API = "https://api.vk.com/method" const val URL_API = "https://api.vk.ru/method"
const val NOTIFICATION_CHANNEL_UNCATEGORIZED = "uncategorized" const val NOTIFICATION_CHANNEL_UNCATEGORIZED = "uncategorized"
const val NOTIFICATION_CHANNEL_LONG_POLLING = "long_polling" const val NOTIFICATION_CHANNEL_LONG_POLLING = "long_polling"
@@ -27,6 +27,6 @@ data class VkStickerDomain(
backgroundImages.firstOrNull { it.width >= width }?.url backgroundImages.firstOrNull { it.width >= width }?.url
} }
images != null -> images.firstOrNull { it.width >= width }?.url images != null -> images.firstOrNull { it.width >= width }?.url
else -> "https://vk.com/sticker/1-${id}-${width}b" else -> "https://vk.ru/sticker/1-${id}-${width}b"
} }
} }
@@ -35,7 +35,7 @@ data class AuthDirectRequest(
} }
data class AuthWithAppRequest( data class AuthWithAppRequest(
val redirectUrl: String = "https://oauth.vk.com/blank.html", val redirectUrl: String = "https://oauth.vk.ru/blank.html",
val display: String = "page", val display: String = "page",
val responseType: String = "token", val responseType: String = "token",
val accessToken: String, val accessToken: String,
@@ -50,6 +50,7 @@ import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
import coil.compose.AsyncImage import coil.compose.AsyncImage
import dev.meloda.fast.auth.captcha.CaptchaViewModel import dev.meloda.fast.auth.captcha.CaptchaViewModel
import dev.meloda.fast.auth.captcha.CaptchaViewModelImpl import dev.meloda.fast.auth.captcha.CaptchaViewModelImpl
@@ -66,6 +67,7 @@ fun CaptchaRoute(
onResult: (String) -> Unit, onResult: (String) -> Unit,
viewModel: CaptchaViewModel = koinViewModel<CaptchaViewModelImpl>() viewModel: CaptchaViewModel = koinViewModel<CaptchaViewModelImpl>()
) { ) {
LocalViewModelStoreOwner.current
val screenState by viewModel.screenState.collectAsStateWithLifecycle() val screenState by viewModel.screenState.collectAsStateWithLifecycle()
val isNeedToOpenLogin by viewModel.isNeedToOpenLogin.collectAsStateWithLifecycle() val isNeedToOpenLogin by viewModel.isNeedToOpenLogin.collectAsStateWithLifecycle()
@@ -3,6 +3,7 @@ package dev.meloda.fast.auth.login.navigation
import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
import androidx.navigation.NavBackStackEntry import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavController import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder import androidx.navigation.NavGraphBuilder
@@ -393,7 +393,7 @@ fun LoginScreen(
TextButton( TextButton(
onClick = { onClick = {
context.startActivity( context.startActivity(
Intent(Intent.ACTION_VIEW, "https://vk.com/join".toUri()) Intent(Intent.ACTION_VIEW, "https://vk.ru/join".toUri())
) )
} }
) { ) {
@@ -408,7 +408,7 @@ fun LoginScreen(
TextButton( TextButton(
onClick = { onClick = {
context.startActivity( context.startActivity(
Intent(Intent.ACTION_VIEW, "https://vk.com/restore".toUri()) Intent(Intent.ACTION_VIEW, "https://vk.ru/restore".toUri())
) )
} }
) { ) {
@@ -168,10 +168,8 @@ fun ConversationsScreen(
val toolbarContainerColor by animateColorAsState( val toolbarContainerColor by animateColorAsState(
targetValue = targetValue =
if (currentTheme.enableBlur || !listState.canScrollBackward) if (!listState.canScrollBackward) MaterialTheme.colorScheme.surface
MaterialTheme.colorScheme.surface else MaterialTheme.colorScheme.surfaceColorAtElevation(3.dp),
else
MaterialTheme.colorScheme.surfaceColorAtElevation(3.dp),
label = "toolbarColorAlpha", label = "toolbarColorAlpha",
animationSpec = tween(durationMillis = 50) animationSpec = tween(durationMillis = 50)
) )
@@ -266,7 +264,7 @@ fun ConversationsScreen(
if (currentTheme.enableBlur) { if (currentTheme.enableBlur) {
Modifier.hazeEffect( Modifier.hazeEffect(
state = hazeState, state = hazeState,
style = HazeMaterials.thick() style = HazeMaterials.regular(toolbarContainerColor)
) )
} else Modifier } else Modifier
) )
@@ -107,7 +107,7 @@ fun SettingsScreen(
if (themeConfig.enableBlur) { if (themeConfig.enableBlur) {
Modifier.hazeEffect( Modifier.hazeEffect(
state = hazeState, state = hazeState,
style = HazeMaterials.thick() style = HazeMaterials.regular()
) )
} else { } else {
Modifier Modifier