diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-02-27 23:20:36 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-02-27 23:20:36 +0000 |
commit | 79eb6bd9693a0042943d66648f0d8768cb15dfb6 (patch) | |
tree | 8d3056e45514b451c94898c3731ccb700f43e5a4 /java/com/android/dialer/searchfragment/directories | |
parent | ffdd9c7513dfe72e02722889baaaab241d244d8c (diff) | |
parent | c3d3c3dfbcf96f6db92b747463ac84ee244a0c85 (diff) |
Merge "Move DirectoryCompat from "contacts/common" to "dialer/common/cp2"."
Diffstat (limited to 'java/com/android/dialer/searchfragment/directories')
4 files changed, 10 insertions, 11 deletions
diff --git a/java/com/android/dialer/searchfragment/directories/DirectoryContactViewHolder.java b/java/com/android/dialer/searchfragment/directories/DirectoryContactViewHolder.java index fc5bce1b2..aef1e9ece 100644 --- a/java/com/android/dialer/searchfragment/directories/DirectoryContactViewHolder.java +++ b/java/com/android/dialer/searchfragment/directories/DirectoryContactViewHolder.java @@ -29,9 +29,9 @@ import android.view.View; import android.widget.ImageView; import android.widget.QuickContactBadge; import android.widget.TextView; -import com.android.contacts.common.compat.DirectoryCompat; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallIntentBuilder; +import com.android.dialer.common.cp2.DirectoryCompat; import com.android.dialer.contactphoto.ContactPhotoManager; import com.android.dialer.lettertile.LetterTileDrawable; import com.android.dialer.precall.PreCall; @@ -73,14 +73,11 @@ public final class DirectoryContactViewHolder extends RecyclerView.ViewHolder String secondaryInfo = TextUtils.isEmpty(label) ? number - : context.getString( - com.android.contacts.common.R.string.call_subject_type_and_number, label, number); + : context.getString(R.string.call_subject_type_and_number, label, number); nameView.setText(QueryBoldingUtil.getNameWithQueryBolded(query, name, context)); numberView.setText(QueryBoldingUtil.getNameWithQueryBolded(query, secondaryInfo, context)); workBadge.setVisibility( - // TODO(a bug): Consider moving DirectoryCompat out of "contacts/common" and share it - // with PhoneLookups. DirectoryCompat.isOnlyEnterpriseDirectoryId(cursor.getDirectoryId()) ? View.VISIBLE : View.GONE); diff --git a/java/com/android/dialer/searchfragment/directories/DirectoryContactsCursor.java b/java/com/android/dialer/searchfragment/directories/DirectoryContactsCursor.java index 8f9ab0e60..0c1ad8318 100644 --- a/java/com/android/dialer/searchfragment/directories/DirectoryContactsCursor.java +++ b/java/com/android/dialer/searchfragment/directories/DirectoryContactsCursor.java @@ -22,8 +22,8 @@ import android.database.MatrixCursor; import android.database.MergeCursor; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; -import com.android.contacts.common.compat.DirectoryCompat; import com.android.dialer.common.Assert; +import com.android.dialer.common.cp2.DirectoryCompat; import com.android.dialer.searchfragment.common.SearchCursor; import com.android.dialer.searchfragment.directories.DirectoriesCursorLoader.Directory; import java.util.ArrayList; @@ -101,8 +101,6 @@ public final class DirectoryContactsCursor extends MergeCursor implements Search private static MatrixCursor createHeaderCursor(Context context, String name, long id) { MatrixCursor headerCursor = new MatrixCursor(PROJECTION, 1); - // TODO(a bug): Consider moving DirectoryCompat out of "contacts/common" and share it - // with PhoneLookups. if (DirectoryCompat.isOnlyEnterpriseDirectoryId(id)) { headerCursor.addRow( new Object[] {context.getString(R.string.directory_search_label_work), id}); diff --git a/java/com/android/dialer/searchfragment/directories/DirectoryContactsCursorLoader.java b/java/com/android/dialer/searchfragment/directories/DirectoryContactsCursorLoader.java index a94878577..d719cb9d9 100644 --- a/java/com/android/dialer/searchfragment/directories/DirectoryContactsCursorLoader.java +++ b/java/com/android/dialer/searchfragment/directories/DirectoryContactsCursorLoader.java @@ -27,7 +27,7 @@ import android.provider.ContactsContract; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting; -import com.android.contacts.common.compat.DirectoryCompat; +import com.android.dialer.common.cp2.DirectoryCompat; import com.android.dialer.searchfragment.common.Projections; import com.android.dialer.searchfragment.directories.DirectoriesCursorLoader.Directory; import java.util.ArrayList; @@ -71,8 +71,6 @@ public final class DirectoryContactsCursorLoader extends CursorLoader { for (int i = 0; i < directories.size(); i++) { Directory directory = directories.get(i); - // TODO(a bug): Consider moving DirectoryCompat out of "contacts/common" and share it - // with PhoneLookups. if (!DirectoryCompat.isRemoteDirectoryId(directory.getId()) && !DirectoryCompat.isEnterpriseDirectoryId(directory.getId())) { cursors[i] = null; diff --git a/java/com/android/dialer/searchfragment/directories/res/values/strings.xml b/java/com/android/dialer/searchfragment/directories/res/values/strings.xml index beabba135..097f353ea 100644 --- a/java/com/android/dialer/searchfragment/directories/res/values/strings.xml +++ b/java/com/android/dialer/searchfragment/directories/res/values/strings.xml @@ -17,4 +17,10 @@ <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- Label for a list of contacts stored in a seperate directory [CHAR LIMIT=30]--> <string name="directory">Directory <xliff:g example="google.com" id="email">%1$s</xliff:g></string> + + <!-- String used to build a phone number type and phone number string. + Example: Mobile 650-555-1212 --> + <string name="call_subject_type_and_number"> + <xliff:g example="Mobile" id="type">%1$s</xliff:g> <xliff:g example="(650) 555-1212" id="number">%2$s</xliff:g> + </string> </resources>
\ No newline at end of file |