summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/layout/call_log_list_item.xml4
-rw-r--r--src/com/android/dialer/calllog/CallLogAdapter.java21
-rw-r--r--src/com/android/dialer/calllog/CallLogFragment.java19
3 files changed, 25 insertions, 19 deletions
diff --git a/res/layout/call_log_list_item.xml b/res/layout/call_log_list_item.xml
index 3fbe7e9ce..76457368f 100644
--- a/res/layout/call_log_list_item.xml
+++ b/res/layout/call_log_list_item.xml
@@ -65,8 +65,9 @@
android:id="@+id/quick_contact_photo"
android:layout_width="@dimen/contact_photo_size"
android:layout_height="@dimen/contact_photo_size"
+ android:paddingTop="2dp"
android:nextFocusRight="@id/primary_action_view"
- android:layout_alignParentStart="true"
+ android:layout_gravity="top"
android:focusable="true"
/>
<LinearLayout
@@ -141,6 +142,7 @@
android:src="@drawable/ic_card_phone"
android:tint="@color/recent_call_log_item_phone_icon_tint"
android:alpha="0.3"
+ android:importantForAccessibility="no"
android:visibility="gone"
/>
</LinearLayout>
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 64b10553c..b12bbec4a 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -16,7 +16,6 @@
package com.android.dialer.calllog;
-import android.content.ComponentName;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
@@ -29,9 +28,7 @@ import android.os.Message;
import android.provider.CallLog.Calls;
import android.provider.ContactsContract.PhoneLookup;
import android.telecomm.PhoneAccountHandle;
-import android.telecomm.TelecommManager;
import android.text.TextUtils;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.AccessibilityDelegate;
@@ -39,7 +36,6 @@ import android.view.ViewGroup;
import android.view.ViewStub;
import android.view.ViewTreeObserver;
import android.view.accessibility.AccessibilityEvent;
-import android.view.accessibility.AccessibilityRecord;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
@@ -66,6 +62,8 @@ import java.util.LinkedList;
public class CallLogAdapter extends GroupingListAdapter
implements ViewTreeObserver.OnPreDrawListener, CallLogGroupBuilder.GroupCreator {
+ private static final int VOICEMAIL_TRANSCRIPTION_MAX_LINES = 10;
+
/** The enumeration of {@link android.os.AsyncTask} objects used in this class. */
public enum Tasks {
REMOVE_CALL_LOG_ENTRIES,
@@ -887,6 +885,7 @@ public class CallLogAdapter extends GroupingListAdapter
private void expandOrCollapseActions(CallLogListItemView callLogItem, boolean isExpanded) {
final CallLogListItemViews views = (CallLogListItemViews)callLogItem.getTag();
+ expandVoicemailTranscriptionView(views, isExpanded);
if (isExpanded) {
// Inflate the view stub if necessary, and wire up the event handlers.
inflateActionViewStub(callLogItem);
@@ -909,6 +908,20 @@ public class CallLogAdapter extends GroupingListAdapter
}
}
+ public static void expandVoicemailTranscriptionView(CallLogListItemViews views,
+ boolean isExpanded) {
+ if (views.callType != Calls.VOICEMAIL_TYPE) {
+ return;
+ }
+
+ final TextView view = views.phoneCallDetailsViews.voicemailTranscriptionView;
+ if (TextUtils.isEmpty(view.getText())) {
+ return;
+ }
+ view.setMaxLines(isExpanded ? VOICEMAIL_TRANSCRIPTION_MAX_LINES : 1);
+ view.setSingleLine(!isExpanded);
+ }
+
/**
* Configures the action buttons in the expandable actions ViewStub. The ViewStub is not
* inflated during initial binding, so click handlers, tags and accessibility text must be set
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java
index ded65ed64..b75e1c62d 100644
--- a/src/com/android/dialer/calllog/CallLogFragment.java
+++ b/src/com/android/dialer/calllog/CallLogFragment.java
@@ -17,8 +17,8 @@
package com.android.dialer.calllog;
import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
-import android.animation.Animator.AnimatorListener;
import android.app.Activity;
import android.app.DialogFragment;
import android.app.KeyguardManager;
@@ -26,28 +26,24 @@ import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
import android.database.Cursor;
-import android.graphics.Outline;
-import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.provider.CallLog;
import android.provider.CallLog.Calls;
import android.provider.ContactsContract;
import android.provider.VoicemailContract.Status;
+import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
-import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.android.common.io.MoreCloseables;
-import com.android.contacts.common.CallUtil;
import com.android.contacts.common.GeoUtil;
-import com.android.contacts.common.util.PhoneNumberHelper;
import com.android.contacts.common.util.ViewUtil;
import com.android.dialer.R;
import com.android.dialer.list.ListsFragment.HostInterface;
@@ -574,6 +570,7 @@ public class CallLogFragment extends AnalyticsListFragment
if (!isExpand) {
viewHolder.actionsView.setVisibility(View.VISIBLE);
}
+ CallLogAdapter.expandVoicemailTranscriptionView(viewHolder, !isExpand);
// Set up the fade effect for the action buttons.
if (isExpand) {
@@ -612,7 +609,7 @@ public class CallLogFragment extends AnalyticsListFragment
}
});
// Set everything to their final values when the animation's done.
- animator.addListener(new AnimatorListener() {
+ animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
view.getLayoutParams().height = LayoutParams.WRAP_CONTENT;
@@ -625,14 +622,8 @@ public class CallLogFragment extends AnalyticsListFragment
// is defaulting to the value (0) at the start of the expand animation.
viewHolder.actionsView.setAlpha(1);
}
+ CallLogAdapter.expandVoicemailTranscriptionView(viewHolder, isExpand);
}
-
- @Override
- public void onAnimationCancel(Animator animation) { }
- @Override
- public void onAnimationRepeat(Animator animation) { }
- @Override
- public void onAnimationStart(Animator animation) { }
});
animator.setDuration(mExpandCollapseDuration);