Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-13 13:14:55 +01:00
parent 1ce06627c8
commit 54d1103944
5 changed files with 27 additions and 12 deletions

View file

@ -55,7 +55,7 @@ internal class MarketsListBatchFlowManager(
private val internalConverter: MarketsTokenItemConverter
get() = MarketsTokenItemConverter(
currentTrendInterval = currentTrendInterval(), // Теперь тут всегда актуальное значение
currentTrendInterval = currentTrendInterval(),
appCurrency = currentAppCurrency(),
)

View file

@ -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

View file

@ -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

View file

@ -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()
}
}

View file

@ -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(