Wikipedia: always show card background (Compose)

This commit is contained in:
MM20
2021-09-24 21:31:13 +02:00
parent 5f2dd67486
commit d1244ae198
2 changed files with 13 additions and 8 deletions
@@ -28,12 +28,11 @@ fun WikipediaItem(
initialRepresentation: Representation, initialRepresentation: Representation,
onRepresentationChange: ((Representation) -> Unit) onRepresentationChange: ((Representation) -> Unit)
) { ) {
val hPadding = if (initialRepresentation == Representation.Full) 8.dp else 16.dp
Column( Column(
modifier = Modifier modifier = Modifier
) { ) {
Column( Column(
modifier = Modifier.padding(start = hPadding, end = hPadding, top = 16.dp) modifier = Modifier.padding(start = 16.dp, end = 24.dp, top = 16.dp)
) { ) {
Text( Text(
text = wikipedia.label, text = wikipedia.label,
@@ -1,9 +1,11 @@
package de.mm20.launcher2.ui.search package de.mm20.launcher2.ui.search
import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.material.Card
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel import androidx.lifecycle.viewmodel.compose.viewModel
import de.mm20.launcher2.ui.SectionDivider import de.mm20.launcher2.ui.SectionDivider
import de.mm20.launcher2.wikipedia.WikipediaViewModel import de.mm20.launcher2.wikipedia.WikipediaViewModel
@@ -15,6 +17,9 @@ fun wikipediaResult(): LazyListScope.() -> Unit {
return { return {
wikipedia?.let { wikipedia?.let {
item { item {
Card(
elevation = 0.dp
) {
WikipediaItem( WikipediaItem(
wikipedia = it, wikipedia = it,
representation = Representation.Full, representation = Representation.Full,
@@ -22,6 +27,7 @@ fun wikipediaResult(): LazyListScope.() -> Unit {
onRepresentationChange = {} onRepresentationChange = {}
) )
} }
}
SectionDivider() SectionDivider()
} }
} }