Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ android {
applicationId = "dev.typetype.android"
minSdk = 23
targetSdk = 37
versionCode = 10806
versionName = "1.8.0-beta.6"
versionCode = 10807
versionName = "1.8.0-beta.7"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
resValue("string", "app_name", "TypeType")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ internal class StreamRepositoryImpl @Inject constructor(
subtitles = subtitles.mapIndexedNotNull { index, subtitle ->
subtitle.toClientSubtitleSource(index)
},
storyboard = previewFrames.firstNotNullOfOrNull { it.toDomainStoryboard() },
storyboard = previewFrames
.mapNotNull { it.toDomainStoryboard() }
.maxByOrNull { it.frameWidth },
startPositionMillis = startPosition * 1000L,
sponsorBlockSegments = sponsorBlockSegments.mapNotNull {
it.toDomainSponsorBlockSegment(duration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ internal fun PlayerDetails(
title = branding.title,
viewCount = stream.viewCount,
likeCount = stream.likeCount,
releaseDateMillis = stream.uploadedAtMillis,
description = stream.description,
onTimestampClick = { player?.seekTo(it) },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.compose.material.icons.filled.KeyboardArrowDown
import androidx.compose.material.icons.filled.KeyboardArrowUp
import androidx.compose.material.icons.outlined.ThumbUp
import androidx.compose.material.icons.outlined.Visibility
import androidx.compose.material.icons.outlined.Event
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
Expand All @@ -30,25 +31,35 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalLocale
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.core.net.toUri
import androidx.compose.ui.unit.sp
import java.text.DateFormat
import java.util.Date

@Composable
fun DescriptionSection(
title: String,
viewCount: Long,
likeCount: Long,
releaseDateMillis: Long,
description: String,
onTimestampClick: (Long) -> Unit,
modifier: Modifier = Modifier,
) {
var expanded by remember { mutableStateOf(false) }
var pendingUrl by remember { mutableStateOf<String?>(null) }
val context = LocalContext.current
val releaseDate = releaseDateMillis.takeIf { it > 0L }?.let { millis ->
DateFormat.getDateInstance(
DateFormat.MEDIUM,
LocalLocale.current.platformLocale,
).format(Date(millis))
}

Column(
modifier = modifier
Expand Down Expand Up @@ -93,6 +104,17 @@ fun DescriptionSection(
),
)
}
releaseDate?.let {
Spacer(Modifier.width(16.dp))
VideoStat(
value = it,
icon = Icons.Outlined.Event,
contentDescription = stringResource(
dev.typetype.android.R.string.player_release_date,
it,
),
)
}
Spacer(Modifier.weight(1f))
Icon(
imageVector = if (expanded) Icons.Filled.KeyboardArrowUp else Icons.Filled.KeyboardArrowDown,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ fun PlayerTimeBar(
if (classicScrubPositionMs != null) {
Box(
modifier = Modifier
.align(Alignment.BottomCenter)
.align(Alignment.TopStart)
.offset(x = previewOffsetX, y = -CLASSIC_PREVIEW_LIFT),
) {
SeekStoryboardPreview(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.requiredSize
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
Expand All @@ -33,7 +34,9 @@ internal fun SeekStoryboardPreview(
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = modifier.testTag(PLAYER_SEEK_STORYBOARD_PREVIEW_TAG),
modifier = modifier
.width(PREVIEW_WIDTH)
.testTag(PLAYER_SEEK_STORYBOARD_PREVIEW_TAG),
) {
frame?.let { StoryboardFrame(frame = it) }
Text(
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<string name="player_autoplay_short">Autoplay</string>
<string name="player_views_count">%1$s views</string>
<string name="player_likes_count">%1$s likes</string>
<string name="player_release_date">Release date: %1$s</string>
<string name="player_action_play">Resume playback</string>
<string name="player_action_pause">Pause playback</string>
<string name="player_state_playing">Playing</string>
Expand Down