Giter VIP home page Giter VIP logo

orbit-compose's People

Contributors

actions-user avatar drekorian avatar github-actions[bot] avatar hrach avatar kiwiprbot[bot] avatar nodrex avatar renovate[bot] avatar shalva97 avatar shanio avatar yveskalume avatar zurdus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

orbit-compose's Issues

Add Seat component

@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,
)

How does composables know about keyboard

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
Screenshot 2022-05-17 at 22 47 40

How does that work? on my app, with your components, this is the results
Screenshot 2022-05-17 at 22 49 14
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...

Flag component

@Composable
public fun CountryFlag(
    url: String,
    contentDescription: String?,
    modifier: Modifier = Modifier,
)
  • Use URL & Coil to show the flag.
  • Add Coil as a dependency.
  • Set default size by height and calculate it from current line-heigt, similarly we calculate Icon() size

Update component-status.yml

`Tile` component

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

Add LinearProgressIndicator component

indicator2-still

@Composable
fun LinearProgressIndicator(
    @FloatRange(from = 0.0, to = 1.0) progress: Float,
    modifier: Modifier = Modifier,
    indicatorColor: Color = OrbitTheme.colors.primary.strong,
    trackColor: Color = OrbitTheme.colors.surface.strong,
)

[Icon request] add an icon for password

Correct me if i missed but could not find it.

There is already Icons.AccountCircle so I think also adding password icon would make a nice pair for login screens!

For example:
image

Hoist InteractionSource for Buttons

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)

Utilize auto mirroring for vector painter

We need to mirror some of the directional icons to match mirrored layout for RTL languages. Icons that are supposed to be automatically mirrored:

  • Chevron forward
  • Chevron backward
  • Chevron double forward
  • Chevron double backward
  • Flight Direct
  • Flight Multicity
  • Flight Nomad
  • Flight Return
  • Route No stops
  • Route One stop
  • Route Two stops

ListChoice component

@Composable
fun ListChoice(
  modifier: Modifier = Modifier,
  icon: @Composable RowScope.() -> Unit = {},
  trailingIcon: @Composable RowScope.() -> Unit = {},
  withSeparator: Boolean = true,
  content: @Composable RowScope.() -> Unit,
)
  • see Figma Native Components
  • don't forget apply small buttons scope to true
  • prepare demos as presented in Native Figma
  • update components-status.yml

image

Card composable is not properly shown on dark theme

on white theme it is all pretty but on dark theme it is not visible at all

dark theme light theme
Screenshot_20220606-222627_JellyList Screenshot_20220606-222601_JellyList

Sorry about toast, im lazy to screenshot it again. Anyways as you can see the Card composable's shadow is barly noticable compared to light theme variant

Introduce Scaffold lint to remind contentPadding usage

When I use Scaffold in orbit for compose, i found a bug in it.
image
However, it's not working well, like this.
image
The topAppBar is override my Alert.
But, When i use Scaffold in compose. It's woking well
image
image

Config :
Jetpack Compose 1.2.0 alpha-03

How to use TextField's error composable

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?

KeyValue component

@Composable
fun KeyValue(
  key: @Composable () -> Unit,
  value: @Composable () -> Unit,
  modifier: Modidifier = Modifier,
)
  • simplified API
@Composable
fun KeyValue(
  key: String,
  value: String,
  modifier: Modidifier = Modifier,
)

List component

  • basic with middot
  • advance with custom icon
  • very long linevery long linevery long linevery long linevery long linevery long linevery long linevery long linevery long linevery long linevery long linevery long line
List(
  contentColor: Color = OrbitTheme.colors.content.normal,
) {
    Text("")
    Text("")
    Text("")
}

List(icon = { Icon() }) {
}

ListLarge {
    Text("")
    Text("")
    Text("")
}

Support circled Badge

image

@Composable
fun BadgeCirclePrimary(
  value: Int,
  modifier: Modifier = Modifier,
  subtle: Boolean = false,
)

Problem with ChoiceTile Icon

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

EmptyState component

Move over from :shared:ui and create proper slotting API.

Update component-status.yml

Default argument for contentDescriptin

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.