From 54d1103944065ef28099daaa9a42bc2eac5223c9 Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 13 Jan 2026 13:14:55 +0100 Subject: [PATCH] Updated on 2026-08-14 --- .../MarketsListBatchFlowManager.kt | 2 +- .../feed/model/news/list/NewsListModel.kt | 2 +- .../NewsListStateManager.kt | 2 +- .../feed/ui/market/list/MarketsList.kt | 22 ++++++++++++------- .../list/components/NewsListLazyColumn.kt | 11 +++++++++- 5 files changed, 27 insertions(+), 12 deletions(-) rename features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/news/list/{calculator => statemanager}/NewsListStateManager.kt (96%) diff --git a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/market/list/statemanager/MarketsListBatchFlowManager.kt b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/market/list/statemanager/MarketsListBatchFlowManager.kt index 5e87294672..779f8af9e3 100644 --- a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/market/list/statemanager/MarketsListBatchFlowManager.kt +++ b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/market/list/statemanager/MarketsListBatchFlowManager.kt @@ -55,7 +55,7 @@ internal class MarketsListBatchFlowManager( private val internalConverter: MarketsTokenItemConverter get() = MarketsTokenItemConverter( - currentTrendInterval = currentTrendInterval(), // Теперь тут всегда актуальное значение + currentTrendInterval = currentTrendInterval(), appCurrency = currentAppCurrency(), ) diff --git a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/news/list/NewsListModel.kt b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/news/list/NewsListModel.kt index 1e205fe187..1acfe71d32 100644 --- a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/news/list/NewsListModel.kt +++ b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/news/list/NewsListModel.kt @@ -8,7 +8,7 @@ import com.tangem.domain.news.model.NewsListConfig import com.tangem.domain.news.usecase.GetNewsCategoriesUseCase import com.tangem.domain.news.usecase.GetNewsListBatchFlowUseCase import com.tangem.features.feed.components.news.list.DefaultNewsListComponent -import com.tangem.features.feed.model.news.list.calculator.NewsListStateManager +import com.tangem.features.feed.model.news.list.statemanager.NewsListStateManager import com.tangem.features.feed.model.news.list.loader.NewsCategoriesLoader import com.tangem.features.feed.model.news.list.statemanager.NewsListBatchFlowManager import com.tangem.features.feed.ui.news.list.state.NewsListState diff --git a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/news/list/calculator/NewsListStateManager.kt b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/news/list/statemanager/NewsListStateManager.kt similarity index 96% rename from features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/news/list/calculator/NewsListStateManager.kt rename to features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/news/list/statemanager/NewsListStateManager.kt index b711909253..c4e30a7ff1 100644 --- a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/news/list/calculator/NewsListStateManager.kt +++ b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/model/news/list/statemanager/NewsListStateManager.kt @@ -1,4 +1,4 @@ -package com.tangem.features.feed.model.news.list.calculator +package com.tangem.features.feed.model.news.list.statemanager import com.tangem.common.ui.news.ArticleConfigUM import com.tangem.features.feed.ui.news.list.state.NewsListState diff --git a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/list/MarketsList.kt b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/list/MarketsList.kt index 85ebbae800..ea208ba663 100644 --- a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/list/MarketsList.kt +++ b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/market/list/MarketsList.kt @@ -47,6 +47,7 @@ import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.delay private const val SHOW_MORE_KEY = "privacyPolicy" +private const val DELAY_FOR_FOCUS_REQUEST = 200L @Composable internal fun TopBarWithSearch( @@ -56,13 +57,17 @@ internal fun TopBarWithSearch( marketsSearchBar: MarketsSearchBar, ) { val background = LocalMainBottomSheetColor.current.value - val focusRequester: FocusRequester = remember { FocusRequester() } + val focusRequester = remember { FocusRequester() } + + val shouldShowAppBar = !marketsSearchBar.shouldAlwaysShowSearchBar && + !marketsSearchBar.searchBarUM.isActive && + marketsSearchBar.searchBarUM.query.isEmpty() AnimatedContent( - targetState = !marketsSearchBar.shouldAlwaysShowSearchBar && - !marketsSearchBar.searchBarUM.isActive && marketsSearchBar.searchBarUM.query.isEmpty(), - ) { showAppBarWithBackIcon -> - if (showAppBarWithBackIcon) { + targetState = shouldShowAppBar, + label = "TopBarTransition", + ) { showAppBar -> + if (showAppBar) { AppBarWithBackButtonAndIcon( onBackClick = onBackClick, backButtonEnabled = buttonsEnabled, @@ -85,9 +90,10 @@ internal fun TopBarWithSearch( ), focusRequester = focusRequester, ) - LaunchedEffect(marketsSearchBar.shouldAlwaysShowSearchBar) { - if (marketsSearchBar.shouldAlwaysShowSearchBar) { - delay(timeMillis = 200) + + if (marketsSearchBar.shouldAlwaysShowSearchBar || marketsSearchBar.searchBarUM.isActive) { + LaunchedEffect(Unit) { + delay(DELAY_FOR_FOCUS_REQUEST) focusRequester.requestFocus() } } diff --git a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/news/list/components/NewsListLazyColumn.kt b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/news/list/components/NewsListLazyColumn.kt index 52d66787a6..1b06a93082 100644 --- a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/news/list/components/NewsListLazyColumn.kt +++ b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/ui/news/list/components/NewsListLazyColumn.kt @@ -1,6 +1,9 @@ package com.tangem.features.feed.ui.news.list.components import androidx.compose.animation.AnimatedContent +import androidx.compose.animation.fadeIn +import androidx.compose.animation.fadeOut +import androidx.compose.animation.togetherWith import androidx.compose.foundation.layout.* import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyListState @@ -44,7 +47,13 @@ internal fun NewsListLazyColumn( } } - AnimatedContent(targetState = screenState, label = "NewsListTransition") { state -> + AnimatedContent( + transitionSpec = { + fadeIn() togetherWith fadeOut() + }, + targetState = screenState, + label = "NewsListTransition", + ) { state -> when (state) { NewsListScreenState.Content -> { Content(