Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Compose resources]: Allow custom naming of "Res" class generated #4763

Open
rustamsmax opened this issue May 6, 2024 · 6 comments
Open
Assignees
Labels
enhancement New feature or request resources

Comments

@rustamsmax
Copy link

Using compose resources in multi module project we have to give alias when importing Res classes from multiple modules

import package.name.modulea.Res
import package.name.moduleb.Res as ResB
import package.name.modulec.Res as ResC

It would be good enhancement to allow custom names for this class

import package.name.modulea.ResA
import package.name.moduleb.ResB
import package.name.modulec.ResC
@terrakok
Copy link
Collaborator

terrakok commented May 6, 2024

Have you tried type aliases?
In the modulea:
typealias ResA = Res

@rustamsmax
Copy link
Author

rustamsmax commented May 7, 2024

@terrakok couldn't access inner property ResA.string

telegram-cloud-photo-size-2-5316804612482783469-y

telegram-cloud-photo-size-2-5316804612482783468-x

@rustamsmax
Copy link
Author

The only solution was to create an extra object and expose properties

telegram-cloud-photo-size-2-5316804612482783472-y

@terrakok
Copy link
Collaborator

terrakok commented May 7, 2024

@psuzn
Copy link

psuzn commented May 18, 2024

I'm curious, multi-module resources are not supported yet, are they? @rustamsmax

@rustamsmax
Copy link
Author

@psuzn supports from kotlin 2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request resources
Projects
None yet
Development

No branches or pull requests

4 participants