Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to click/interact with JetLimeItem? #11

Closed
MauResendez opened this issue Oct 21, 2022 · 3 comments · Fixed by #19
Closed

Way to click/interact with JetLimeItem? #11

MauResendez opened this issue Oct 21, 2022 · 3 comments · Fixed by #19
Assignees
Labels
enhancement New feature or request

Comments

@MauResendez
Copy link

Is there a way to be able to click on a JetLimeItem? I'm currently looking to add a dialog once the user clicks on a JetLimeItem to display the route's information and to navigate to a map screen.

@pushpalroy
Copy link
Owner

Will add support for this soon.

@pushpalroy pushpalroy added the enhancement New feature or request label Jan 20, 2024
@pushpalroy pushpalroy self-assigned this Jan 20, 2024
@pushpalroy
Copy link
Owner

Right now with the release v1.0.6 this can be only achieved using the content parameter of JetLimeItem which is a Composable lambda. We can drop all other arguments of JetLimeItem and pass only the content like this:

JetLimeItem {
      val context = LocalContext.current
      Text(
        text = "Click me to show a toast",
        style = JetLimeTypography.body1,
        modifier = Modifier
          .clickable {
          Toast.makeText(context, "This item has been clicked", Toast.LENGTH_SHORT).show()
        }
      )
    }

Note this is not the best solution as right now it's impossible to add a click listener to the entire JetLimeItem by design.
The only solution is the one that I just mentioned above.

I have created a separate issue here to make this library more flexible and redesign its API: #18

I will close this issue for now and track this on the new issue created.

@pushpalroy
Copy link
Owner

Closing this issue as this will be further tracked in #18

@pushpalroy pushpalroy linked a pull request Jan 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants