Wikipedia: always show card background (Compose)
This commit is contained in:
parent
5f2dd67486
commit
d1244ae198
@ -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,12 +17,16 @@ fun wikipediaResult(): LazyListScope.() -> Unit {
|
|||||||
return {
|
return {
|
||||||
wikipedia?.let {
|
wikipedia?.let {
|
||||||
item {
|
item {
|
||||||
WikipediaItem(
|
Card(
|
||||||
wikipedia = it,
|
elevation = 0.dp
|
||||||
representation = Representation.Full,
|
) {
|
||||||
initialRepresentation = Representation.Full,
|
WikipediaItem(
|
||||||
onRepresentationChange = {}
|
wikipedia = it,
|
||||||
)
|
representation = Representation.Full,
|
||||||
|
initialRepresentation = Representation.Full,
|
||||||
|
onRepresentationChange = {}
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SectionDivider()
|
SectionDivider()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user