-
Notifications
You must be signed in to change notification settings - Fork 3
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
AND-145: add TextValue #63
base: main
Are you sure you want to change the base?
Conversation
@Composable | ||
@ReadOnlyComposable | ||
public fun stringResource(text: TextValue): String { | ||
val resources = resources() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Просто ресурсы resources() выносить не имеет смысла,
либо все в return
return resources.getString(text)
либо
val string = resources().getString(text)
return string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Он вынесен в отдельный метод по аналогии с реализацией оригинального stringResource
. Имеет смысл ориентироваться на реализацию из Compose.
@Composable | ||
@ReadOnlyComposable | ||
private fun resources(): Resources { | ||
LocalConfiguration.current |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
зачем это нужно?
@Composable | ||
@ReadOnlyComposable | ||
public fun stringResource(text: TextValue): String { | ||
val resources = resources() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Он вынесен в отдельный метод по аналогии с реализацией оригинального stringResource
. Имеет смысл ориентироваться на реализацию из Compose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one minor comment left
- [![Version](https://img.shields.io/maven-central/v/com.redmadrobot.gears/kotlin?style=flat-square&label=viewmodelevents-compose)][viewmodelevents-compose] — A set of extensions for dealing with ViewModelEvents inside `@Composable` functions | ||
- [![Version](https://img.shields.io/maven-central/v/com.redmadrobot.gears/kotlin?style=flat-square&label=viewmodelevents-flow)][viewmodelevents-flow] — An implementation of ViewModelEvents via `Flow` | ||
- [![Version](https://img.shields.io/maven-central/v/com.redmadrobot.gears/kotlin?style=flat-square&label=viewmodelevents-livedata)][viewmodelevents-livedata] — An implementation of ViewModelEvents via `LiveData` | ||
`ViewModelEvents` addresses the challenge of buffering and consuming one-time events: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`ViewModelEvents` addresses the challenge of buffering and consuming one-time events: | |
`ViewModelEvents` addresses the challenge of buffering and consuming one-time events. |
No description provided.