From f1f9455defca82ce14825239aebe060ee61c4c17 Mon Sep 17 00:00:00 2001 From: uabdullah Date: Wed, 1 Nov 2017 18:17:51 -0700 Subject: Expand Voicemails on tapping Currently we only show as much of the voicemail transcription, as we can see on the first line. This CL allows us to tap the voicemail, so that it is expanded and the whole transcription is now visible. Bug: 68382421,64882313 Test: Unit Tests PiperOrigin-RevId: 174267231 Change-Id: I19d3dea028c06d7c31aeb2949a19360eff648dcd --- .../voicemail/listui/NewVoicemailAdapter.java | 48 +++++++++++++++++++++- .../voicemail/listui/NewVoicemailViewHolder.java | 46 ++++++++++++++++++++- .../listui/res/layout/new_voicemail_entry.xml | 9 ++-- 3 files changed, 94 insertions(+), 9 deletions(-) (limited to 'java/com/android/dialer') diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailAdapter.java b/java/com/android/dialer/voicemail/listui/NewVoicemailAdapter.java index ca0b5dcb0..d04143f59 100644 --- a/java/com/android/dialer/voicemail/listui/NewVoicemailAdapter.java +++ b/java/com/android/dialer/voicemail/listui/NewVoicemailAdapter.java @@ -17,17 +17,27 @@ package com.android.dialer.voicemail.listui; import android.database.Cursor; import android.support.v7.widget.RecyclerView; +import android.util.ArraySet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.android.dialer.common.LogUtil; import com.android.dialer.time.Clock; +import com.android.dialer.voicemail.listui.NewVoicemailViewHolder.NewVoicemailViewHolderListener; +import com.android.dialer.voicemail.model.VoicemailEntry; +import java.util.Set; /** {@link RecyclerView.Adapter} for the new voicemail call log fragment. */ -final class NewVoicemailAdapter extends RecyclerView.Adapter { +final class NewVoicemailAdapter extends RecyclerView.Adapter + implements NewVoicemailViewHolderListener { private final Cursor cursor; private final Clock clock; + /** A valid id for {@link VoicemailEntry} is greater than 0 */ + private int currentlyExpandedViewHolderId = -1; + + // A set of (re-usable) view holders being used by the recycler view to display voicemails + private final Set newVoicemailViewHolderSet = new ArraySet<>(); /** @param cursor whose projection is {@link VoicemailCursorLoader.VOICEMAIL_COLUMNS} */ NewVoicemailAdapter(Cursor cursor, Clock clock) { @@ -39,7 +49,8 @@ final class NewVoicemailAdapter extends RecyclerView.Adapter - + - + android:layout_gravity="center_vertical" + android:visibility="gone"/> + -- cgit v1.2.3