diff --git a/appcompose/src/main/java/com/readrops/app/compose/timelime/TimelineScreenModel.kt b/appcompose/src/main/java/com/readrops/app/compose/timelime/TimelineScreenModel.kt index a6aa5adb..f6423675 100644 --- a/appcompose/src/main/java/com/readrops/app/compose/timelime/TimelineScreenModel.kt +++ b/appcompose/src/main/java/com/readrops/app/compose/timelime/TimelineScreenModel.kt @@ -255,7 +255,10 @@ data class TimelineState( val foldersAndFeeds: Map> = emptyMap(), val itemState: Flow> = emptyFlow(), val dialog: DialogState? = null -) +) { + + val showSubtitle = filters.subFilter != SubFilter.ALL +} sealed interface DialogState { object ConfirmDialog : DialogState diff --git a/appcompose/src/main/java/com/readrops/app/compose/timelime/TimelineTab.kt b/appcompose/src/main/java/com/readrops/app/compose/timelime/TimelineTab.kt index 8b1a8020..ce237915 100644 --- a/appcompose/src/main/java/com/readrops/app/compose/timelime/TimelineTab.kt +++ b/appcompose/src/main/java/com/readrops/app/compose/timelime/TimelineTab.kt @@ -4,6 +4,7 @@ import android.util.Log import androidx.activity.compose.BackHandler import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn @@ -168,19 +169,30 @@ object TimelineTab : Tab { topBar = { TopAppBar( title = { - Text( - text = when (state.filters.subFilter) { - SubFilter.FEED -> state.filterFeedName - SubFilter.FOLDER -> state.filterFolderName - else -> when (state.filters.mainFilter) { + Column { + Text( + text = when (state.filters.mainFilter) { MainFilter.STARS -> stringResource(R.string.favorites) MainFilter.ALL -> stringResource(R.string.articles) MainFilter.NEW -> stringResource(R.string.new_articles) - } - }, - maxLines = 1, - overflow = TextOverflow.Ellipsis - ) + }, + maxLines = 1, + overflow = TextOverflow.Ellipsis + ) + + if (state.showSubtitle) { + Text( + text = when (state.filters.subFilter) { + SubFilter.FEED -> state.filterFeedName + SubFilter.FOLDER -> state.filterFolderName + else -> "" + }, + style = MaterialTheme.typography.labelLarge, + maxLines = 1, + overflow = TextOverflow.Ellipsis + ) + } + } }, navigationIcon = { IconButton(