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

AND-145: add TextValue #63

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

EmogurovAnton
Copy link
Contributor

No description provided.

@Composable
@ReadOnlyComposable
public fun stringResource(text: TextValue): String {
val resources = resources()
Copy link

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

Copy link
Collaborator

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
Copy link

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()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Он вынесен в отдельный метод по аналогии с реализацией оригинального stringResource. Имеет смысл ориентироваться на реализацию из Compose.

textvalue/textvalue-common/build.gradle.kts Outdated Show resolved Hide resolved
textvalue/README.md Outdated Show resolved Hide resolved
textvalue/README.md Outdated Show resolved Hide resolved
textvalue/README.md Outdated Show resolved Hide resolved
textvalue/README.md Outdated Show resolved Hide resolved
textvalue/README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@osipxd osipxd left a 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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`ViewModelEvents` addresses the challenge of buffering and consuming one-time events:
`ViewModelEvents` addresses the challenge of buffering and consuming one-time events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants