[Slider] Slider.LabelFormatter is no longer accessible from Kotlin code in version 1.2.0-beta01
See original GitHub issueDescription: The Slider.LabelFormatter
class cannot be accessed from Kotlin code anymore. See screenshots below for an example.
Java code:
Kotlin code:
Workaround is to just use a Kotlin lambda:
But adding Slider.LabelFormatter breaks it again:
Expected behavior: No compile errors
Material Library version: 1.2.0-beta01
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
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.