summaryrefslogtreecommitdiffstats
path: root/java/com/android/dialer/calldetails
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-03-20 08:50:25 -0700
committerEric Erfanian <erfanian@google.com>2017-03-20 09:03:10 -0700
commit06b6b56e9eaa91ebf757ea641e38a9c885fa40bd (patch)
tree6a0f9f0809cc02004f4be6ef9d20cbced397c3d1 /java/com/android/dialer/calldetails
parent9a090c89e7a0c43a668bd6e2ac5e5e680f323aed (diff)
downloadandroid_packages_apps_Dialer-06b6b56e9eaa91ebf757ea641e38a9c885fa40bd.tar.gz
android_packages_apps_Dialer-06b6b56e9eaa91ebf757ea641e38a9c885fa40bd.tar.bz2
android_packages_apps_Dialer-06b6b56e9eaa91ebf757ea641e38a9c885fa40bd.zip
Update AOSP Dialer source from internal google3 repository at
cl/150622237 Test: make, treehugger, on device testing. This CL updates the AOSP Dialer source with all the changes that have gone into the private google3 repository. This includes all the changes from cl/150392808 (3/16/2017) to cl/150622237 (3/20/2017). This goal of these drops is to keep the AOSP source in sync with the internal google3 repository. Currently these sync are done by hand with very minor modifications to the internal source code. See the Android.mk file for list of modifications. Our current goal is to do frequent drops (daily if possible) and eventually switched to an automated process. Change-Id: Id53e0e580a4ef73760a8afb7bb8c265ee27ad535
Diffstat (limited to 'java/com/android/dialer/calldetails')
-rw-r--r--java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java51
-rw-r--r--java/com/android/dialer/calldetails/res/layout/call_details_entry.xml30
-rw-r--r--java/com/android/dialer/calldetails/res/values/dimens.xml4
3 files changed, 42 insertions, 43 deletions
diff --git a/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java b/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java
index b1a70af0c..55447f8ff 100644
--- a/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java
+++ b/java/com/android/dialer/calldetails/CallDetailsEntryViewHolder.java
@@ -17,9 +17,6 @@
package com.android.dialer.calldetails;
import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.PorterDuff;
-import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.provider.CallLog.Calls;
import android.support.annotation.ColorInt;
@@ -33,10 +30,12 @@ import android.widget.TextView;
import com.android.dialer.calldetails.nano.CallDetailsEntries.CallDetailsEntry;
import com.android.dialer.calllogutils.CallEntryFormatter;
import com.android.dialer.calllogutils.CallTypeHelper;
+import com.android.dialer.calllogutils.CallTypeIconsView;
import com.android.dialer.common.LogUtil;
import com.android.dialer.compat.AppCompatConstants;
import com.android.dialer.enrichedcall.historyquery.proto.nano.HistoryResult;
import com.android.dialer.enrichedcall.historyquery.proto.nano.HistoryResult.Type;
+import com.android.dialer.oem.MotorolaUtils;
import com.android.dialer.util.CallUtil;
import com.android.dialer.util.DialerUtils;
import com.android.dialer.util.IntentUtil;
@@ -44,7 +43,7 @@ import com.android.dialer.util.IntentUtil;
/** ViewHolder for call entries in {@link CallDetailsActivity}. */
public class CallDetailsEntryViewHolder extends ViewHolder {
- private final ImageView callTypeIcon;
+ private final CallTypeIconsView callTypeIcon;
private final TextView callTypeText;
private final TextView callTime;
private final TextView callDuration;
@@ -54,6 +53,7 @@ public class CallDetailsEntryViewHolder extends ViewHolder {
private final View multimediaDivider;
private final TextView multimediaDetails;
+ private final TextView postCallNote;
private final ImageView multimediaImage;
@@ -67,7 +67,7 @@ public class CallDetailsEntryViewHolder extends ViewHolder {
super(container);
context = container.getContext();
- callTypeIcon = (ImageView) container.findViewById(R.id.call_direction);
+ callTypeIcon = (CallTypeIconsView) container.findViewById(R.id.call_direction);
callTypeText = (TextView) container.findViewById(R.id.call_type);
callTime = (TextView) container.findViewById(R.id.call_time);
callDuration = (TextView) container.findViewById(R.id.call_duration);
@@ -76,6 +76,7 @@ public class CallDetailsEntryViewHolder extends ViewHolder {
multimediaDetailsContainer = container.findViewById(R.id.ec_container);
multimediaDivider = container.findViewById(R.id.divider);
multimediaDetails = (TextView) container.findViewById(R.id.multimedia_details);
+ postCallNote = (TextView) container.findViewById(R.id.post_call_note);
multimediaImage = (ImageView) container.findViewById(R.id.multimedia_image);
multimediaAttachmentsNumber =
(TextView) container.findViewById(R.id.multimedia_attachments_number);
@@ -93,11 +94,10 @@ public class CallDetailsEntryViewHolder extends ViewHolder {
boolean isPulledCall =
(entry.features & Calls.FEATURES_PULLED_EXTERNALLY) == Calls.FEATURES_PULLED_EXTERNALLY;
- Drawable callIcon = getIconForCallType(context.getResources(), callType);
- int color = getColorForCallType(context, callType);
- callIcon.setColorFilter(color, PorterDuff.Mode.MULTIPLY);
- callTime.setTextColor(color);
- callTypeIcon.setImageDrawable(callIcon);
+ callTime.setTextColor(getColorForCallType(context, callType));
+ callTypeIcon.add(callType);
+ callTypeIcon.setShowVideo((entry.features & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO);
+ callTypeIcon.setShowHd(MotorolaUtils.shouldShowHdIconInCallLog(context, entry.features));
callTypeText.setText(callTypeHelper.getCallTypeText(callType, isVideoCall, isPulledCall));
callTime.setText(CallEntryFormatter.formatDate(context, entry.date));
@@ -118,8 +118,6 @@ public class CallDetailsEntryViewHolder extends ViewHolder {
multimediaDetailsContainer.setVisibility(View.GONE);
} else {
- // TODO: b/36158891 Add room for 2 pieces of enriched call data. It's possible
- // to have both call composer data and post call data for a single call.
HistoryResult historyResult = entry.historyResults[0];
multimediaDetailsContainer.setVisibility(View.VISIBLE);
multimediaDetailsContainer.setOnClickListener(
@@ -146,6 +144,15 @@ public class CallDetailsEntryViewHolder extends ViewHolder {
} else {
LogUtil.i("CallDetailsEntryViewHolder.setMultimediaDetails", "no text");
}
+
+ if (entry.historyResults.length > 1 && !TextUtils.isEmpty(entry.historyResults[1].text)) {
+ LogUtil.i("CallDetailsEntryViewHolder.setMultimediaDetails", "showing post call note");
+ postCallNote.setVisibility(View.VISIBLE);
+ postCallNote.setText(
+ context.getString(R.string.message_in_quotes, entry.historyResults[1].text));
+ } else {
+ LogUtil.i("CallDetailsEntryViewHolder.setMultimediaDetails", "no post call note");
+ }
}
}
@@ -154,26 +161,6 @@ public class CallDetailsEntryViewHolder extends ViewHolder {
|| historyResult.type == Type.INCOMING_CALL_COMPOSER;
}
- private static Drawable getIconForCallType(Resources resources, int callType) {
- switch (callType) {
- case AppCompatConstants.CALLS_OUTGOING_TYPE:
- return resources.getDrawable(R.drawable.quantum_ic_call_made_white_24);
- case AppCompatConstants.CALLS_BLOCKED_TYPE:
- return resources.getDrawable(R.drawable.quantum_ic_block_white_24);
- case AppCompatConstants.CALLS_INCOMING_TYPE:
- case AppCompatConstants.CALLS_ANSWERED_EXTERNALLY_TYPE:
- case AppCompatConstants.CALLS_REJECTED_TYPE:
- return resources.getDrawable(R.drawable.quantum_ic_call_received_white_24);
- case AppCompatConstants.CALLS_MISSED_TYPE:
- default:
- // It is possible for users to end up with calls with unknown call types in their
- // call history, possibly due to 3rd party call log implementations (e.g. to
- // distinguish between rejected and missed calls). Instead of crashing, just
- // assume that all unknown call types are missed calls.
- return resources.getDrawable(R.drawable.quantum_ic_call_missed_white_24);
- }
- }
-
private static @ColorInt int getColorForCallType(Context context, int callType) {
switch (callType) {
case AppCompatConstants.CALLS_OUTGOING_TYPE:
diff --git a/java/com/android/dialer/calldetails/res/layout/call_details_entry.xml b/java/com/android/dialer/calldetails/res/layout/call_details_entry.xml
index 7f8bb8087..3f2ba7534 100644
--- a/java/com/android/dialer/calldetails/res/layout/call_details_entry.xml
+++ b/java/com/android/dialer/calldetails/res/layout/call_details_entry.xml
@@ -16,29 +16,30 @@
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/call_entry_padding">
- <ImageView
+ <com.android.dialer.calllogutils.CallTypeIconsView
android:id="@+id/call_direction"
- android:layout_width="@dimen/call_entry_icon_size"
- android:layout_height="@dimen/call_entry_icon_size"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:layout_marginStart="@dimen/call_entry_padding"
- android:layout_marginEnd="@dimen/call_entry_left_margin"/>
+ app:useLargeIcons="true"/>
<TextView
android:id="@+id/call_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_toEndOf="@+id/call_direction"
+ android:layout_marginStart="@dimen/call_entry_text_left_margin"
style="@style/PrimaryText"/>
<TextView
android:id="@+id/call_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_toEndOf="@id/call_direction"
+ android:layout_marginStart="@dimen/call_entry_text_left_margin"
android:layout_below="@+id/call_type"
android:layout_marginBottom="@dimen/call_entry_bottom_padding"
style="@style/SecondaryText"/>
@@ -56,18 +57,29 @@
android:id="@+id/ec_container"
android:layout_height="@dimen/ec_container_height"
android:layout_width="match_parent"
- android:layout_marginStart="@dimen/ec_text_left_margin"
+ android:layout_marginStart="@dimen/call_entry_text_left_margin"
android:layout_below="@+id/call_time"
android:visibility="gone"/>
+ <TextView
+ android:id="@+id/post_call_note"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/ec_container_height"
+ android:gravity="center_vertical"
+ android:layout_marginStart="@dimen/ec_post_call_left_margin"
+ android:maxLines="2"
+ android:visibility="gone"
+ android:layout_below="@+id/ec_container"
+ style="@style/SecondaryText"/>
+
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
- android:layout_below="@id/ec_container"
+ android:layout_below="@id/post_call_note"
android:layout_marginTop="@dimen/ec_divider_top_bottom_margin"
android:layout_marginBottom="@dimen/ec_divider_top_bottom_margin"
- android:layout_marginStart="@dimen/ec_text_left_margin"
+ android:layout_marginStart="@dimen/call_entry_text_left_margin"
android:background="#12000000"
android:visibility="gone"/>
</RelativeLayout> \ No newline at end of file
diff --git a/java/com/android/dialer/calldetails/res/values/dimens.xml b/java/com/android/dialer/calldetails/res/values/dimens.xml
index 59f237103..2ca7ea83a 100644
--- a/java/com/android/dialer/calldetails/res/values/dimens.xml
+++ b/java/com/android/dialer/calldetails/res/values/dimens.xml
@@ -29,12 +29,12 @@
<dimen name="call_entry_icon_size">24dp</dimen>
<dimen name="call_entry_padding">16dp</dimen>
<dimen name="call_entry_bottom_padding">14dp</dimen>
- <dimen name="call_entry_left_margin">32dp</dimen>
+ <dimen name="call_entry_text_left_margin">72dp</dimen>
<!-- EC container -->
<dimen name="call_details_ec_text_size">12sp</dimen>
<dimen name="ec_container_height">48dp</dimen>
- <dimen name="ec_text_left_margin">72dp</dimen>
+ <dimen name="ec_post_call_left_margin">73dp</dimen>
<dimen name="ec_photo_size">40dp</dimen>
<dimen name="ec_divider_top_bottom_margin">8dp</dimen>
</resources> \ No newline at end of file