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

Use any kind of Label as custom label value when creating a CP operation #47

Merged
merged 2 commits into from
Feb 2, 2022

Conversation

alexstyl
Copy link
Owner

@alexstyl alexstyl commented Feb 2, 2022

This PR allows consumers to use any kind of Label they like in any LabeledValue.

Before this PR, creating a LabeledValue(WebAddress("www.web.com"), label = Label.Main) would throw an exception when trying to store or update a contact with this address. This was due to the fact that AOSP defines specific types for each ContactContract item.

After this PR, consumers of the API can mix and match any LabeledValue with any Label they like. The Label used will be resolved using the string resources provided by Android. In the previous example, the website will stored with the custom label of "Κύριο" if the local is set to Greek.

Addresses: #1

This allows the consumers of the library to use any kind of Label for any type of data they prefer, instead of throwing an exception. The custom data will use the localized string provided by Android.
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.

1 participant