v0.2.0 - Colossal milestone reached β€οΈπ₯
It's been half a year since the initial release of this project... Now, through (more) hard work, β€οΈ, π₯, and dedication, the biggest project milestone has been reached βοΈ
πΌ Release overview
β οΈ WARNING: This release may potentially trigger seizures for people with photosensitive epilepsy. Viewer discretion is advised.
This release contains...
π‘New featuresπ‘ | βοΈImprovementsβοΈ |
---|---|
πBug fixesπ | π¨Breaking changesπ¨ |
This release marks the completion of the first and biggest milestone in the πΊProject Roadmap! At this point, most of the core features have been implemented with complete πDocumentation.
There is still a lot of work to do to reach v1.0.0, the first true semantic version of this library. Note that versions prior to v1.0.0 does not follow semantic versioning βοΈ
π‘ New features
Blocked phone numbers
You now have read & write access to blocked numbers π
SIM card access
You are now able to read & write contacts from the SIM card π±
Contact LOOKUP_KEY
Lookup keys allow you to load contacts even if they get linked/unlinked, perfect for creating shortcuts to contacts from the launcher π
Google Contacts app custom data
The customdata-googlecontacts
module gives you read & write access to custom data managed by the Google Contacts app π
Pokemon custom data
The customdata-pokemon
module allows you to give your contacts their favorite Pokemons π₯
Role Playing Game (RPG) custom data
The customdata-rpg
module allows you to assign a profession and stats to your contacts βοΈ
βοΈ Improvements
Revamped documentation with MkDocs
Didn't like the old documentation website? Me neither. Now, it's prettified, structured, and searchable using Material for MkDocs π
BroadQuery
matching for phone and email
Narrow down your broad search to just phone or email instead of all data kinds π₯
Get contacts with matching data of any kind (default, unchanged),
val contacts = Contacts(context)
.broadQuery()
.wherePartiallyMatches(searchText)
.find()
Get contacts with matching phone,
.match(Match.PHONE)
Get contacts with matching email,
.match(Match.EMAIL)
Of course, you can use the Query
API to make your own advanced, custom matching criteria.
GroupsDelete
is now available for all supported API versions (19 to 31+)
The library now allows you to delete groups starting with KitKat (API 19) π
val deleteResult = Contacts(context).groups().delete().groups(groups).commit()
π Bug fixes
Fixed Query
returning no results when AND'ing fields of different mime types in WHERE clause
This is one of those rare occasions when binary trees and recursion saves the day. Traversing the binary tree structure of the Where
clause in post order, simplifying as needed, enables you to AND fields of different mime types together π€―
val contacts = Contacts(context)
.query()
.where { Email.Address.isNotNull() and Phone.Number.isNotNull() and Name.DisplayName.isNotNull() and Organization.Company.isNotNull() }
// Or for shorthand...
// .where(listOf(Email.Address, Phone.Number, Name.DisplayName, Organization.Company) whereAnd { isNotNull() })
.find()
Fixed Query
and BroadQuery
returning RawContacts that are pending deletion when includeBlanks(true)
RawContacts that have been marked for deletion but not yet deleted (perhaps because of no network connectivity preventing a sync) are no longer returned in queries of any configuration π€
val contacts = Contacts(context)
.query()
// or .broadQuery()
.includeBlanks(true)
.find()
Fixed GroupsQuery
returning Groups that are pending deletion
Groups that have been marked for deletion but not yet deleted (perhaps because of no network connectivity preventing a sync) are no longer returned in queries π€
val groups = Contacts(context).groups().find()
Fixed possibility of DataContact
, RawContactContact
, and ContactRefresh
extensions returning incorrect result if Contact has been linked/unlinked
The ExistingDataEntity.contact
, ExistingRawContactEntity.contact
, and <T : ExistingContactEntity> T.refresh
will return the correct contact even if it has been linked/unlinked π€
val contactsApi = Contacts(context)
val parentContactOfData = email.contact(contactsApi)
val parentContactOfRawContact = rawContact.contact(contactsApi)
val refreshedContact = contact.refresh(contactsApi)
π¨ Breaking changes
- Installing all modules in a single line is only supported when using the dependencyResolutionManagement in settings.gradle
- Renamed
BroadQuery
functionwhereAnyContactDataPartiallyMatches
towherePartiallyMatches
.
π Full Changelog
The amount of additions from v0.1.10 to v0.2.0 are... colossal!
π Acknowledgements
It has been many months since this project was featured in . It has also been many years since I have relied on Android Weekly to help me stay on the cutting-edge with my Android development. I am extremely grateful for the service that the Android Weekly team have been providing for the entire Android community for the past decade π
In the spirit of giving back to their legendary service and to promote this project's colossal milestone, I proudly placed a sponsored post in the upcoming β€οΈ
π£ Discuss
Have questions, comments, or concerns about this release?
π Please help support this project
You think this project is useful? Are you using it? Are you impressed with this release notes? Would you care to show your appreciation? Then, please βοΈ this repo and maybe even πTweet about it! For more ways to show your support...
β€οΈ I also shared this colossal release with the r/androiddev community.
β This release page has been reviewed and critiqued by the r/opensource community.