am 5e67a6ee: am 09231519: am 03aaf389: Visual indicator that voicemail is unread.
* commit '5e67a6ee77d7a8a5e3dc4fb8438e6a1877019ea4':
Visual indicator that voicemail is unread.
diff --git a/src/com/android/dialer/PhoneCallDetails.java b/src/com/android/dialer/PhoneCallDetails.java
index add6315..403c4e8 100644
--- a/src/com/android/dialer/PhoneCallDetails.java
+++ b/src/com/android/dialer/PhoneCallDetails.java
@@ -19,12 +19,9 @@
import com.android.dialer.calllog.PhoneNumberDisplayUtil;
import android.content.Context;
-import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.provider.CallLog.Calls;
-import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.telecom.PhoneAccountHandle;
-import android.text.TextUtils;
/**
* The details of a phone call to be shown in the UI.
@@ -87,10 +84,19 @@
// Voicemail transcription
public String transcription;
+ // The display string for the number.
public String displayNumber;
+
+ // Whether the contact number is a voicemail number.
public boolean isVoicemail;
/**
+ * If this is a voicemail, whether the message is read. For other types of calls, this defaults
+ * to {@code true}.
+ */
+ public boolean isRead = true;
+
+ /**
* Constructor with required fields for the details of a call with a number associated with a
* contact.
*/
@@ -104,7 +110,6 @@
this.numberPresentation = numberPresentation;
this.formattedNumber = formattedNumber;
this.isVoicemail = isVoicemail;
-
this.displayNumber = PhoneNumberDisplayUtil.getDisplayNumber(
context,
this.number,
diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java
index 672a1c8..2dc0810 100644
--- a/src/com/android/dialer/PhoneCallDetailsHelper.java
+++ b/src/com/android/dialer/PhoneCallDetailsHelper.java
@@ -18,6 +18,7 @@
import android.content.Context;
import android.content.res.Resources;
+import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.provider.CallLog;
import android.provider.CallLog.Calls;
@@ -140,6 +141,12 @@
views.voicemailTranscriptionView.setText(null);
views.voicemailTranscriptionView.setVisibility(View.GONE);
}
+
+ // Bold if not read
+ Typeface typeface = details.isRead ? Typeface.SANS_SERIF : Typeface.DEFAULT_BOLD;
+ views.nameView.setTypeface(typeface);
+ views.voicemailTranscriptionView.setTypeface(typeface);
+ views.callLocationAndDate.setTypeface(typeface);
}
/**
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 4304002..5738e97 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -24,6 +24,7 @@
import android.support.v7.widget.RecyclerView;
import android.os.Bundle;
import android.os.Trace;
+import android.provider.CallLog;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.telecom.PhoneAccountHandle;
import android.telephony.PhoneNumberUtils;
@@ -289,7 +290,6 @@
private ViewHolder createCallLogEntryViewHolder(ViewGroup parent) {
LayoutInflater inflater = LayoutInflater.from(mContext);
View view = inflater.inflate(R.layout.call_log_list_item, parent, false);
-
CallLogListItemViewHolder viewHolder = CallLogListItemViewHolder.create(
view,
mContext,
@@ -358,6 +358,9 @@
details.features = getCallFeatures(c, count);
details.geocode = c.getString(CallLogQuery.GEOCODED_LOCATION);
details.transcription = c.getString(CallLogQuery.TRANSCRIPTION);
+ if (details.callTypes[0] == CallLog.Calls.VOICEMAIL_TYPE) {
+ details.isRead = c.getInt(CallLogQuery.IS_READ) == 1;
+ }
if (!c.isNull(CallLogQuery.DATA_USAGE)) {
details.dataUsage = c.getLong(CallLogQuery.DATA_USAGE);