Nikolay Igotti
3 years ago
7 changed files with 27 additions and 31 deletions
@ -1,12 +1,11 @@ |
|||||||
package org.jetbrains.compose.demo.widgets.platform |
package org.jetbrains.compose.demo.widgets.platform |
||||||
|
|
||||||
import androidx.compose.runtime.Composable |
import androidx.compose.runtime.Composable |
||||||
import androidx.compose.ui.graphics.ImageBitmap |
import androidx.compose.ui.graphics.painter.Painter |
||||||
import androidx.compose.ui.graphics.vector.ImageVector |
|
||||||
|
|
||||||
@Composable |
@Composable |
||||||
expect fun imageResource(res: String): ImageBitmap |
expect fun imageResource(res: String): Painter |
||||||
|
|
||||||
@Composable |
@Composable |
||||||
expect fun vectorResource(res: String): ImageVector |
expect fun vectorResource(res: String): Painter |
||||||
|
|
||||||
|
@ -1,14 +1,13 @@ |
|||||||
package org.jetbrains.compose.demo.widgets.platform |
package org.jetbrains.compose.demo.widgets.platform |
||||||
|
|
||||||
import androidx.compose.runtime.Composable |
import androidx.compose.runtime.Composable |
||||||
|
import androidx.compose.ui.graphics.painter.Painter |
||||||
import androidx.compose.ui.graphics.vector.ImageVector |
import androidx.compose.ui.graphics.vector.ImageVector |
||||||
import androidx.compose.ui.res.vectorXmlResource |
import androidx.compose.ui.res.loadXmlImageVector |
||||||
import androidx.compose.ui.res.imageResource as bitmapImage |
import androidx.compose.ui.res.painterResource |
||||||
|
|
||||||
@Composable |
@Composable |
||||||
actual fun imageResource(res: String) = |
actual fun imageResource(res: String): Painter = painterResource(res) |
||||||
bitmapImage(res) |
|
||||||
|
|
||||||
@Composable |
@Composable |
||||||
actual fun vectorResource(res: String): ImageVector = |
actual fun vectorResource(res: String): Painter = painterResource(res) |
||||||
vectorXmlResource(res) |
|
@ -1,18 +1,13 @@ |
|||||||
package org.jetbrains.compose.demo.widgets |
package org.jetbrains.compose.demo.widgets |
||||||
|
|
||||||
|
import androidx.compose.ui.unit.DpSize |
||||||
import androidx.compose.ui.unit.dp |
import androidx.compose.ui.unit.dp |
||||||
import androidx.compose.ui.window.Window |
|
||||||
import androidx.compose.ui.window.WindowSize |
|
||||||
import androidx.compose.ui.window.WindowState |
import androidx.compose.ui.window.WindowState |
||||||
import androidx.compose.ui.window.application |
import androidx.compose.ui.window.singleWindowApplication |
||||||
import org.jetbrains.compose.demo.widgets.ui.MainView |
import org.jetbrains.compose.demo.widgets.ui.MainView |
||||||
|
|
||||||
fun main() = application { |
fun main() = singleWindowApplication( |
||||||
Window( |
title = "Widgets Gallery", state = WindowState(size = DpSize(800.dp, 800.dp)) |
||||||
onCloseRequest = ::exitApplication, |
) { |
||||||
title = "Widgets Gallery", |
MainView() |
||||||
state = WindowState(size = WindowSize(800.dp, 600.dp)) |
|
||||||
) { |
|
||||||
MainView() |
|
||||||
} |
|
||||||
} |
} |
Loading…
Reference in new issue