Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing play button on media gallery page #1626

Merged
merged 5 commits into from
Aug 19, 2024
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
24 changes: 20 additions & 4 deletions app/src/main/java/org/thoughtcrime/securesms/media/MediaPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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)
)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/drone-static-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down