Unverified Commit a95eb8c1 authored by Alexander Maryanovsky's avatar Alexander Maryanovsky Committed by GitHub

Call `Library.load()` before calling native getCurrentSystemTheme function. (#866)

parent 585f2dd9
package org.jetbrains.skiko package org.jetbrains.skiko
actual val currentSystemTheme: SystemTheme actual val currentSystemTheme: SystemTheme
get() = when (getCurrentSystemTheme()) { get() {
0 -> SystemTheme.LIGHT Library.load()
1 -> SystemTheme.DARK return when (getCurrentSystemTheme()) {
else -> SystemTheme.UNKNOWN 0 -> SystemTheme.LIGHT
1 -> SystemTheme.DARK
else -> SystemTheme.UNKNOWN
}
} }
// Common // Common
......
package org.jetbrains.skiko
import org.junit.Test
/**
* Verifies that the native Skiko library is correctly loaded in various scenarios.
*/
class LibraryLoadedTest {
@Test
fun getSystemTheme() {
currentSystemTheme
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment