Skip to content

Commit

Permalink
Remove usages of glow (unsupported before Android 10)
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed Sep 18, 2024
1 parent 9b90ac9 commit 32baa94
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package nl.ndat.tvlauncher.ui.component

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
Expand All @@ -15,7 +16,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Popup
import androidx.compose.ui.window.PopupPositionProvider
import androidx.compose.ui.window.PopupProperties
import androidx.tv.material3.Glow
import androidx.tv.material3.Border
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.Surface
import androidx.tv.material3.SurfaceDefaults
Expand Down Expand Up @@ -69,7 +70,10 @@ fun PopupContainer(
contentColor = MaterialTheme.colorScheme.onSecondaryContainer,
),
shape = RoundedCornerShape(8.dp),
glow = Glow(Color.White, 6.dp),
border = Border(
border = BorderStroke(2.dp, Color.White),
shape = RoundedCornerShape(8.dp),
),
) {
Box(modifier = Modifier.padding(8.dp)) {
popupContent()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package nl.ndat.tvlauncher.ui.component.card

import android.content.Intent
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.basicMarquee
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsFocusedAsState
Expand All @@ -26,7 +27,6 @@ import androidx.palette.graphics.Palette
import androidx.tv.material3.Border
import androidx.tv.material3.Card
import androidx.tv.material3.CardDefaults
import androidx.tv.material3.Glow
import androidx.tv.material3.MaterialTheme
import androidx.tv.material3.StandardCardContainer
import androidx.tv.material3.Text
Expand Down Expand Up @@ -87,13 +87,11 @@ fun AppCard(
.height(baseHeight)
.aspectRatio(16f / 9f),
interactionSource = interactionSource,
glow = CardDefaults.glow(
focusedGlow = Glow(
elevationColor = imagePrimaryColor ?: MaterialTheme.colorScheme.border,
elevation = 10.dp
border = CardDefaults.border(
focusedBorder = Border(
border = BorderStroke(2.dp, imagePrimaryColor ?: MaterialTheme.colorScheme.border),
)
),
border = CardDefaults.border(focusedBorder = Border.None),
onClick = {
if (launchIntentUri != null) {
context.startActivity(Intent.parseUri(launchIntentUri, 0))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package nl.ndat.tvlauncher.ui.component.card

import android.content.Intent
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
Expand All @@ -20,7 +21,6 @@ import androidx.palette.graphics.Palette
import androidx.tv.material3.Border
import androidx.tv.material3.Card
import androidx.tv.material3.CardDefaults
import androidx.tv.material3.Glow
import androidx.tv.material3.MaterialTheme
import coil.compose.AsyncImage
import coil.request.ImageRequest
Expand All @@ -39,13 +39,11 @@ fun ChannelProgramCard(
modifier = modifier
.height(baseHeight)
.aspectRatio(program.posterArtAspectRatio?.floatValue ?: 1f),
glow = CardDefaults.glow(
focusedGlow = Glow(
elevationColor = imagePrimaryColor ?: MaterialTheme.colorScheme.border,
elevation = 10.dp
border = CardDefaults.border(
focusedBorder = Border(
border = BorderStroke(2.dp, imagePrimaryColor ?: MaterialTheme.colorScheme.border),
)
),
border = CardDefaults.border(focusedBorder = Border.None),
onClick = {
if (program.intentUri != null) {
context.startActivity(Intent.parseUri(program.intentUri, 0))
Expand Down

0 comments on commit 32baa94

Please sign in to comment.