question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Slider] Slider.LabelFormatter is no longer accessible from Kotlin code in version 1.2.0-beta01

See original GitHub issue

Description: The Slider.LabelFormatter class cannot be accessed from Kotlin code anymore. See screenshots below for an example.

Java code: Screenshot 2020-05-29 at 12 03 32

Kotlin code: Screenshot 2020-05-29 at 12 04 18

Workaround is to just use a Kotlin lambda: Screenshot 2020-05-29 at 12 17 28

But adding Slider.LabelFormatter breaks it again: Screenshot 2020-05-29 at 12 19 06

Expected behavior: No compile errors

Material Library version: 1.2.0-beta01

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ymariancommented, Jun 8, 2020

Thanks for the details @Thomas-Vos it does seem this is an issue with Kotlin, I filled this if you want to follow the resolution:

https://youtrack.jetbrains.com/issue/KT-39265

We’ll address the label formatter though

0reactions
Thomas-Voscommented, May 29, 2020

Great to hear it will be fixed soon!

For the listener issue, I am using Android Studio 4.0 stable and Kotlin 1.3.72. Furthermore I have the new Kotlin type inference enabled (-XXLanguage:+NewInference). It appears that if I remove the option to enable the new inference, all works fine. So it could be a bug in Kotlin instead. Here is a sample project with the new type inference enabled, which reproduces the issue. Android Studio should show the error in MainActivity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to show slider value above the slider also when we are ...
This is currently not supported, the available options in LabelFormatter (which can be applied to sliders with slider.setLabelFormatter(.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found