kiwicom / orbit-compose Goto Github PK
View Code? Open in Web Editor NEWAndroid Jetpack Compose components of open-source Orbit design system by Kiwi.com.
Home Page: https://orbit.kiwi
License: MIT License
Android Jetpack Compose components of open-source Orbit design system by Kiwi.com.
Home Page: https://orbit.kiwi
License: MIT License
@Composable
public fun SeatStandard(
selected: Boolean,
label: @Composable () -> Unit,
price: @Composable () -> Unit,
onClick: () -> Unit,
modifier: Modifier = Modifier,
)
@Composable
public fun SeatExtraLegroom(
selected: Boolean,
label: @Composable () -> Unit,
price: @Composable () -> Unit,
onClick: () -> Unit,
modifier: Modifier = Modifier,
)
@Composable
public fun SeatUnavailable(
modifier: Modifier = Modifier,
)
In your sample app, in the Text Fields controls if I focus a field and keyboard shows up then TextFields also scroll and appear above primary button
How does that work? on my app, with your components, this is the results
TextField is below the keyboard with textSelectHandle on top of it :D
Catalog app has android:windowSoftInputMode="adjustResize"
, but adding it on my app has no effect.
My layout is like this:
@Preview(showSystemUi = true)
@Composable
fun LoginScreen() {
val viewModel: LoginScreenViewModel = hiltViewModel()
var server by remember { mutableStateOf("192.168.") }
val discoveredServer = viewModel.foundServers.collectAsState(initial = emptyList())
Column(modifier = Modifier
.systemBarsPadding()
.fillMaxSize()
.padding(10.dp),
verticalArrangement = Arrangement.Bottom) {
LazyColumn {
items(discoveredServer.value.size) { index ->
Card(onClick = { viewModel.connectToServer(discoveredServer.value[index]) }) {
Text(text = discoveredServer.value[index].address ?: "")
}
}
}
TextField(value = server,
onValueChange = { server = it },
label = { Text(text = "Server") },
leadingIcon = { Icon(Icons.Trip, contentDescription = null) },
modifier = Modifier.fillMaxWidth(),
maxLines = 1)
Button(onClick = { /*TODO*/ }, modifier = Modifier.align(Alignment.End), enabled = false) {
Text(text = "Next", modifier = Modifier)
}
}
}
which is included inside OrbitTheme
-> Scaffold
-> Jetpack Navigation...
Hi, there have been few useful composables added since version 0.14.0. When is the next release?
@Composable
public fun CountryFlag(
url: String,
contentDescription: String?,
modifier: Modifier = Modifier,
)
Icon()
sizeUpdate component-status.yml
Hi, thanks for those awesome composables.
On your website there is a Tile component which on android has green dot with thext "Released". Where can I find it? typing Tile
in Android Studio gives autocompletions for ChoiceTile
and ChoiceTileCentered
Maybe we could allow to hoist the interaction source and make it a parameter with a default value.
Add
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
to button composables.
Originally posted by @shanio in #112 (comment)
secondary -> neutral
neutral -> ...
We need to mirror some of the directional icons to match mirrored layout for RTL languages. Icons that are supposed to be automatically mirrored:
e.g. when setting Modifier.fillMaxWidth()
@Composable
fun ListChoice(
modifier: Modifier = Modifier,
icon: @Composable RowScope.() -> Unit = {},
trailingIcon: @Composable RowScope.() -> Unit = {},
withSeparator: Boolean = true,
content: @Composable RowScope.() -> Unit,
)
Decided to use the TextField's error
argument. But the red icon is always visible
How do I use it? my first try was this
TextField(value = server,
modifier = Modifier.fillMaxWidth(),
error = {
if (errors.value is Errors.BadServer) {
Text(text = "Can not connect to this server")
}
},)
That did not work because it checks if the argument is null and then displays red icon. My second try was:
val error = @Composable { if (errors.value is Errors.BadServer) {
Text(text = "Can not connect to this server")
} else null }
TextField(value = server,
modifier = Modifier.fillMaxWidth(),
error = error) // here I get error "The feature "unit conversion" is disabled"
But there I get compilation error. Of course I could duplicate it and wrap whole TextField in if statement, but this feels wrong (lots of arguments will be duplicated). So how can I use it?
@Composable
fun KeyValue(
key: @Composable () -> Unit,
value: @Composable () -> Unit,
modifier: Modidifier = Modifier,
)
@Composable
fun KeyValue(
key: String,
value: String,
modifier: Modidifier = Modifier,
)
List(
contentColor: Color = OrbitTheme.colors.content.normal,
) {
Text("")
Text("")
Text("")
}
List(icon = { Icon() }) {
}
ListLarge {
Text("")
Text("")
Text("")
}
I am trying to set icon to ChoiceTile , but it does not works:
@Composable
fun CreateKiwiUI() {
var selected by remember {
mutableStateOf(false)
}
Column() {
ChoiceTile(
icon = {
painterResource(id = R.drawable.ic_correct)
},
selected = selected,
onSelect = {
selected = !selected
},
showRadio = true,
content = {
Text(text = "Some text")
}
)
}
}
lib versions:
implementation "kiwi.orbit.compose:ui:0.13.0"
implementation "androidx.compose.ui:ui:1.2.0-beta01"
implementation "androidx.compose.material:material:1.2.0-beta01"
I even tried latest release version of compose 1.1.1 but still does not works
Possibly simply reuse the Material version.
Move over from :shared:ui and create proper slotting API.
Update component-status.yml
I have always met those warnings asking me to add some descriptions to ImageViews, same is for Composables. Do you guys regulary set them up? Personaly, I always ignore them, or just pass nulls everywhere...
So since we have wrappers around Image
and Icon
why not add default parameter for contentDescription: String? = null
? I can send PR if you consider it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.