Skip to content

Commit

Permalink
Search by company on Android (#377)
Browse files Browse the repository at this point in the history
* Add ability to search by company
* Android update gradle

On iOS this library searches based on name and company (and possibly other fields), but on Android only the name was used to match. This adds the ability to match based on the company.
  • Loading branch information
paour authored and morenoh149 committed Mar 27, 2019
1 parent 45d66a9 commit ec9774d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Empty file modified android/gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ public WritableArray getContactsMatchingString(String searchString) {
Cursor cursor = contentResolver.query(
ContactsContract.Data.CONTENT_URI,
FULL_PROJECTION.toArray(new String[FULL_PROJECTION.size()]),
ContactsContract.Contacts.DISPLAY_NAME_PRIMARY + " LIKE ?",
new String[]{"%" + searchString + "%"},
ContactsContract.Contacts.DISPLAY_NAME_PRIMARY + " LIKE ? OR " +
Organization.COMPANY + " LIKE ?",
new String[]{"%" + searchString + "%", "%" + searchString + "%"},
null
);

Expand Down

0 comments on commit ec9774d

Please sign in to comment.