Skip to content

Commit

Permalink
fixed background items run
Browse files Browse the repository at this point in the history
  • Loading branch information
Hcnc100 committed Oct 2, 2022
1 parent 85fd153 commit 8d00686
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
Expand All @@ -24,7 +23,6 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import coil.compose.AsyncImagePainter
import coil.compose.rememberAsyncImagePainter
import coil.request.ImageRequest
import com.nullpointer.runningcompose.R
Expand All @@ -45,14 +43,14 @@ fun ItemRun(
) {

val colorSelect by animateColorAsState(
if (itemRun.isSelected) MaterialTheme.colors.secondaryVariant else Color.Transparent
if (itemRun.isSelected) MaterialTheme.colors.secondaryVariant else MaterialTheme.colors.surface
)

Surface(
color = colorSelect,
shape = MaterialTheme.shapes.small,
elevation = 3.dp,
modifier = modifier
.padding(3.dp)
.combinedClickable(
onClick = {
val action = if (isSelectEnable) ActionRun.SELECT else ActionRun.DETAILS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ fun ListRuns(
LazyVerticalGrid(
columns = GridCells.Adaptive(dimensionResource(id = R.dimen.size_item_run)),
state = listState,
modifier = modifier
modifier = modifier,
contentPadding = PaddingValues(4.dp),
horizontalArrangement = Arrangement.spacedBy(5.dp),
verticalArrangement = Arrangement.spacedBy(5.dp)
) {
item(span = { GridItemSpan(maxLineSpan) }, key = "header-sort") {
if (!isSelectEnable)
Expand Down

0 comments on commit 8d00686

Please sign in to comment.