Fix text color of recent conversations in share activity.

fork-5.53.8
Greyson Parrelli 2021-01-23 15:55:56 -05:00
rodzic f180066058
commit 68381f8b64
3 zmienionych plików z 10 dodań i 9 usunięć

Wyświetl plik

@ -46,11 +46,11 @@ public class ContactRepository {
static final String ABOUT_COLUMN = "about"; static final String ABOUT_COLUMN = "about";
static final int NORMAL_TYPE = 0; static final int NORMAL_TYPE = 0;
static final int PUSH_TYPE = 1; static final int PUSH_TYPE = 1 << 0;
static final int NEW_PHONE_TYPE = 2; static final int NEW_PHONE_TYPE = 1 << 2;
static final int NEW_USERNAME_TYPE = 3; static final int NEW_USERNAME_TYPE = 1 << 3;
static final int RECENT_TYPE = 4; static final int RECENT_TYPE = 1 << 4;
static final int DIVIDER_TYPE = 5; static final int DIVIDER_TYPE = 1 << 5;
/** Maps the recipient results to the legacy contact column names */ /** Maps the recipient results to the legacy contact column names */
private static final List<Pair<String, ValueMapper>> SEARCH_CURSOR_MAPPERS = new ArrayList<Pair<String, ValueMapper>>() {{ private static final List<Pair<String, ValueMapper>> SEARCH_CURSOR_MAPPERS = new ArrayList<Pair<String, ValueMapper>>() {{

Wyświetl plik

@ -215,8 +215,9 @@ public class ContactSelectionListAdapter extends CursorRecyclerViewAdapter<ViewH
String label = CursorUtil.requireString(cursor, ContactRepository.LABEL_COLUMN); String label = CursorUtil.requireString(cursor, ContactRepository.LABEL_COLUMN);
String labelText = ContactsContract.CommonDataKinds.Phone.getTypeLabel(getContext().getResources(), String labelText = ContactsContract.CommonDataKinds.Phone.getTypeLabel(getContext().getResources(),
numberType, label).toString(); numberType, label).toString();
boolean isPush = (contactType & ContactRepository.PUSH_TYPE) > 0;
int color = (contactType == ContactRepository.PUSH_TYPE) ? ContextCompat.getColor(getContext(), R.color.signal_text_primary) int color = isPush ? ContextCompat.getColor(getContext(), R.color.signal_text_primary)
: ContextCompat.getColor(getContext(), R.color.signal_inverse_transparent_60); : ContextCompat.getColor(getContext(), R.color.signal_inverse_transparent_60);
boolean currentContact = currentContacts.contains(id); boolean currentContact = currentContacts.contains(id);
@ -314,7 +315,7 @@ public class ContactSelectionListAdapter extends CursorRecyclerViewAdapter<ViewH
private @NonNull String getHeaderString(int position) { private @NonNull String getHeaderString(int position) {
int contactType = getContactType(position); int contactType = getContactType(position);
if (contactType == ContactRepository.RECENT_TYPE || contactType == ContactRepository.DIVIDER_TYPE) { if ((contactType & ContactRepository.RECENT_TYPE) > 0 || contactType == ContactRepository.DIVIDER_TYPE) {
return " "; return " ";
} }

Wyświetl plik

@ -287,7 +287,7 @@ public class ContactsCursorLoader extends CursorLoader {
stringId, stringId,
ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE, ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE,
"", "",
ContactRepository.RECENT_TYPE, ContactRepository.RECENT_TYPE | (recipient.isRegistered() && !recipient.isForceSmsSelection() ? ContactRepository.PUSH_TYPE : 0),
recipient.getCombinedAboutAndEmoji() }); recipient.getCombinedAboutAndEmoji() });
} }
} }