Add missing play button on media gallery page (#1626)

This commit is contained in:
Fanchao Liu 2024-08-19 15:38:55 +10:00 committed by GitHub
parent 80933938e1
commit 2a438ac24d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 5 deletions

View File

@ -14,16 +14,20 @@ import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
@ -34,6 +38,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy
import network.loki.messenger.R
import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader
import org.thoughtcrime.securesms.ui.theme.LocalColors
import org.thoughtcrime.securesms.ui.theme.LocalDimensions
import org.thoughtcrime.securesms.ui.theme.LocalType
import kotlin.math.ceil
@ -158,10 +163,21 @@ private fun ThumbnailRow(
when {
item.showPlayOverlay -> {
Image(
painter = painterResource(R.drawable.ic_baseline_play_circle_filled_48),
contentDescription = null
)
// The code below is translated from thumbnail_view.xml:
// Trying to show a green play button on a white background.
Box(
modifier = Modifier
.size(48.dp)
.background(Color.White, shape = CircleShape),
contentAlignment = Alignment.Center,
) {
Image(
modifier = Modifier.padding(start = LocalDimensions.current.xxxsSpacing),
painter = painterResource(R.drawable.triangle_right),
contentDescription = null,
colorFilter = ColorFilter.tint(LocalColors.current.primary)
)
}
}
}

View File

@ -19,7 +19,7 @@ chmod 600 ssh_key
# Define the output paths
build_dir="app/build/outputs/apk/play/debug"
target_path="${build_dir}/$(ls ${build_dir} | grep -o 'session-[^[:space:]]*-universal.apk')"
target_path="${build_dir}/$(ls ${build_dir} | grep -o 'app-[^[:space:]]*-universal-debug.apk')"
# Validate the paths exist
if [ ! -d $build_path ]; then