Skip to content

Commit

Permalink
add: some tips for select danmaku episode
Browse files Browse the repository at this point in the history
  • Loading branch information
muedsa committed Mar 22, 2024
1 parent 557bcec commit a19e04b
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package com.muedsa.agetv.ui.features.detail

import androidx.activity.compose.BackHandler
import androidx.compose.animation.Crossfade
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsFocusedAsState
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -39,7 +41,7 @@ const val EpisodePageSize = 20
val EpisodeProgressStrokeWidth = 12.dp
val WideButtonCornerRadius = 12.dp

@OptIn(ExperimentalTvMaterial3Api::class)
@OptIn(ExperimentalTvMaterial3Api::class, ExperimentalFoundationApi::class)
@Composable
fun EpisodeListWidget(
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -241,6 +243,7 @@ fun EpisodeListWidget(
items = danEpisodeList,
key = { _, item -> item.episodeId }
) { danEpisodePartIndex, danEpisode ->
val interactionSource = remember { MutableInteractionSource() }
WideButton(
modifier = Modifier.padding(end = 12.dp),
title = {
Expand All @@ -249,6 +252,16 @@ fun EpisodeListWidget(
overflow = TextOverflow.Ellipsis
)
},
subtitle = {
val isFocused by interactionSource.collectIsFocusedAsState()
if (isFocused) {
Text(
modifier = Modifier.basicMarquee(),
text = "选此匹配: ${selectedEpisode[0]}",
overflow = TextOverflow.Ellipsis
)
}
},
onClick = {
onChangeEpisodeRelation(listOf(selectedEpisode[0] to danEpisode))
changeDanEpisodeMode = false
Expand All @@ -266,7 +279,8 @@ fun EpisodeListWidget(
}
})
changeDanEpisodeMode = false
}
},
interactionSource = interactionSource
)
}

Expand Down

0 comments on commit a19e04b

Please sign in to comment.