Kashismails
01/12/2024, 7:29 AMIvan Matkov
01/12/2024, 8:16 AMKonstantin Tskhovrebov
01/12/2024, 9:40 AMKonstantin Tskhovrebov
01/12/2024, 9:41 AMcomposeResources/files
and function
Res.readResource("path")Kashismails
01/12/2024, 9:43 AMKonstantin Tskhovrebov
01/12/2024, 9:45 AMKashismails
01/12/2024, 9:45 AMKonstantin Tskhovrebov
01/12/2024, 9:45 AMKonstantin Tskhovrebov
01/12/2024, 9:47 AMKonstantin Tskhovrebov
01/12/2024, 9:47 AMKashismails
01/12/2024, 9:49 AMKonstantin Tskhovrebov
01/12/2024, 9:52 AMKashismails
01/12/2024, 9:54 AMmohamed rejeb
01/12/2024, 9:56 AMinterface Resource {
suspend fun loadRes(path: String): ByteArray
}
And it can be implemented in the shared module with all the resources, it can receive an Enum instead of String also
class ResourceImpl: Resource {
override suspend fun loadRes(res: Res): ByteArray = when(res) {
Res.Close -> ...
}
}
And then provide this interface from shared module to the rest of the app with DI or CompositionLocalsKashismails
01/12/2024, 9:57 AMmohamed rejeb
01/12/2024, 9:58 AMKashismails
01/12/2024, 9:58 AMmohamed rejeb
01/12/2024, 9:59 AMKonstantin Tskhovrebov
01/12/2024, 10:11 AMKashismails
01/12/2024, 6:07 PMKonstantin Tskhovrebov
01/12/2024, 6:13 PMKashismails
01/12/2024, 6:23 PMKashismails
01/15/2024, 8:30 AMJoel Denke
01/25/2024, 8:36 AMin the future resources will be isolated by modules. so, to have access to some module's resources, module has to provide own api for that. like "readMyResourceA()"
Does this mean if I have lets say a core module shared module and other feature modules depending on, I cant access it? In similar way that android has transitiveR8Class, isnt it possible to share Res class across all Gradle modules somehow, where all modules inject their resources into a global Res class?