Skip to content

Commit

Permalink
Replace usage of deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstyl committed Feb 19, 2022
1 parent b4984b2 commit 21a540e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/fetch_contacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ accessed which was not queried, an `Exception` is thrown.
You can use Contact Store to retrieve any information that is linked to any contact of the device.
Such information could be phone numbers, e-mails, postal addresses and others.

> 💡 You can use the `standardColumns()` function to request all available Columns.
> 💡 You can use the `allContactColumns()` function to request all available Columns.
### Available columns

Expand Down Expand Up @@ -107,7 +107,7 @@ store.fetchContacts(
predicate = ContactLookup(
inContactIds = listOf(contactId)
),
columnsToFetch = standardColumns()
columnsToFetch = allContactColumns()
)
.collect { contacts ->
val contact = contacts.firstOrNull()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package com.alexstyl.contactstore.test

import com.alexstyl.contactstore.ExperimentalContactStoreApi
import com.alexstyl.contactstore.PartialContact
import com.alexstyl.contactstore.allContactColumns
import com.alexstyl.contactstore.mutableCopy
import com.alexstyl.contactstore.standardColumns
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.runBlocking
import org.assertj.core.api.Assertions.assertThat
Expand All @@ -23,9 +23,7 @@ internal class ExecuteTestContactStoreTest {
store.execute {
insert(ContactFixtures.PAOLO_MELENDEZ.mutableCopy())
}
val actual = store.fetchContacts(
columnsToFetch = standardColumns()
).first()
val actual = store.fetchContacts(columnsToFetch = allContactColumns()).first()
assertThat(actual).containsOnly(
ContactFixtures.PAOLO_MELENDEZ
)
Expand Down Expand Up @@ -56,7 +54,7 @@ internal class ExecuteTestContactStoreTest {
)
)

val updated = store.fetchContacts(columnsToFetch = standardColumns()).first()
val updated = store.fetchContacts(columnsToFetch = allContactColumns()).first()
.first { it.contactId == SNAPSHOT_PAOLO.contactId }

store.execute {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public class MutableContact internal constructor(
groups = mutableListOf(),
customDataItems = emptyList(),
imAddresses = mutableListOf(),
columns = standardColumns() // allow editing of all columns for new contacts
columns = allContactColumns() // allow editing of all columns for new contacts
)

override val displayName: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.alexstyl.contactstore.sample.ContactDetailsActivity.Companion.EXTRA_C
import com.alexstyl.contactstore.sample.ContactListState.*
import com.alexstyl.contactstore.sample.ui.SetupSystemUi
import com.alexstyl.contactstore.sample.ui.theme.SampleAppTheme
import com.alexstyl.contactstore.thumbnailUri
import dagger.hilt.android.AndroidEntryPoint

@ExperimentalCoilApi
Expand Down Expand Up @@ -163,7 +164,7 @@ fun ContactRow(contact: Contact, onClick: (Contact) -> Unit) {
) {
Image(
painter = rememberImagePainter(
data = contact.imageUri,
data = contact.thumbnailUri,
builder = {
transformations(CircleCropTransformation())
.placeholder(R.drawable.ic_avatar_placeholder)
Expand Down

0 comments on commit 21a540e

Please sign in to comment.