https://kotlinlang.org logo
#doodle
Title
# doodle
n

Nick

03/28/2023, 7:04 PM
The constructor is internal so you can't create it yourself. The
application()
is the only way to get one. What's your use case?
c

Cherrio LLC

03/28/2023, 7:53 PM
We wanna theme Label, where-by it'll be themed before being added to the App
We thought since themes can be passed into the application so is TextMetrics.
n

Nick

03/28/2023, 7:58 PM
Are you using the ThemeManager? Setting a theme will ensure any View added to the app, even if the all has already been running, will be themed (if the theme has the right behavior for the view).
TextMetrics can be passed in as well.
c

Cherrio LLC

03/28/2023, 7:59 PM
As a module??
Like we inject
Modules.PointerModule
n

Nick

03/28/2023, 8:22 PM
No need for an additional module. It is available for injection just like Display. Simply do:
Copy code
application() {
    YourApp(
        //…
        textMetrics = instance(),
        // …
    )
}
5 Views