Suresh Maidaragi
02/29/2024, 8:21 AMimport org.jetbrains.compose.resources.resource
not found on latest version of Jetbrains Multiplatform Compose v1.6.0-rc01
is this removed? what is the alternative if so?Joel Denke
02/29/2024, 9:32 AMJoel Denke
02/29/2024, 9:35 AMorg.jetbrains.compose.resources.ResourceItem(setOf(), "values/strings.xml")
However do NOT use this, not recommended.Suresh Maidaragi
02/29/2024, 9:59 AMSuresh Maidaragi
02/29/2024, 10:00 AMimport org.jetbrains.compose.resources.readResourceBytes
Joel Denke
02/29/2024, 10:01 AMSanjayKarki
02/29/2024, 10:01 AMJoel Denke
02/29/2024, 10:02 AMSuresh Maidaragi
02/29/2024, 10:05 AMJoel Denke
02/29/2024, 10:06 AMJoel Denke
02/29/2024, 10:06 AMJoel Denke
02/29/2024, 10:07 AM@ExperimentalResourceApi
internal object Res {
/**
* Reads the content of the resource file at the specified path and returns it as a byte array.
*
* Example: `val bytes = Res.readBytes("files/key.bin")`
*
* @param path The path of the file to read in the compose resource's directory.
* @return The content of the file as a byte array.
*/
public suspend fun readBytes(path: String): ByteArray = readResourceBytes(path)
public object drawable
public object string
public object font
}
Joel Denke
02/29/2024, 10:08 AMSuresh Maidaragi
02/29/2024, 10:15 AMSuresh Maidaragi
02/29/2024, 10:15 AMJoel Denke
02/29/2024, 10:20 AMJoel Denke
02/29/2024, 10:22 AMSuresh Maidaragi
02/29/2024, 10:22 AMSuresh Maidaragi
02/29/2024, 10:28 AMv1.6.0-rc02
https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.6.0-rc02Joel Denke
02/29/2024, 10:29 AMJoel Denke
02/29/2024, 10:29 AMJoel Denke
02/29/2024, 10:29 AMJoel Denke
02/29/2024, 10:30 AMJoel Denke
02/29/2024, 10:30 AMJoel Denke
02/29/2024, 10:32 AMpublic suspend fun readBytes(path: String): ByteArray = readResourceBytes(path)
Where not Res to send into readBytes, its the old way had in resource("relativePath")
.
Like Res.readBytes("files/myfile.html")
Joel Denke
02/29/2024, 10:33 AMJoel Denke
02/29/2024, 10:34 AMSanjayKarki
02/29/2024, 10:41 AMJoel Denke
02/29/2024, 10:45 AMSuresh Maidaragi
02/29/2024, 10:55 AMSanjayKarki
02/29/2024, 10:58 AMSuresh Maidaragi
02/29/2024, 11:12 AMimplementation(compose.components.resources)
Due to which Res is not generated...Joel Denke
02/29/2024, 1:10 PM