diff options
author | Roshan Pius <rpius@google.com> | 2015-08-27 20:42:39 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-27 20:42:39 +0000 |
commit | ba0f101d90cbcc60a37fa8ef5e1d4e0f205b558a (patch) | |
tree | aca40b64552e15c5a7a4ff66cbea3b5afdb0c091 /src/com | |
parent | 7002f8cfd9c344a082e241e5161d4efc9261212c (diff) | |
parent | b9b04b271338756bf7523da5730a0ead84795e0f (diff) |
Merge branch 'master' of https://googleplex-android.googlesource.com/_direct/platform/packages/apps/Dialer
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAdapter.java | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index 477e449b3..aa307b6c6 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -202,10 +202,9 @@ public class CallLogAdapter extends GroupingListAdapter private final View.OnCreateContextMenuListener mOnCreateContextMenuListener = new View.OnCreateContextMenuListener() { @Override - public void onCreateContextMenu(ContextMenu menu, View v, - ContextMenuInfo menuInfo) { - final CallLogListItemViewHolder vh = - (CallLogListItemViewHolder) v.getTag(); + public void onCreateContextMenu( + ContextMenu menu, View v, ContextMenuInfo menuInfo) { + final CallLogListItemViewHolder vh = (CallLogListItemViewHolder) v.getTag(); if (TextUtils.isEmpty(vh.number)) { return; } @@ -225,8 +224,7 @@ public class CallLogAdapter extends GroupingListAdapter copyItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { - ClipboardUtils.copyText(CallLogAdapter.this.mContext, null, - vh.number, true); + ClipboardUtils.copyText(mContext, null, vh.number, true); return true; } }); @@ -248,8 +246,8 @@ public class CallLogAdapter extends GroupingListAdapter editItem.setOnMenuItemClickListener(new OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { - final Intent intent = new Intent(Intent.ACTION_DIAL, - CallUtil.getCallUri(vh.number)); + final Intent intent = new Intent( + Intent.ACTION_DIAL, CallUtil.getCallUri(vh.number)); intent.setClass(mContext, DialtactsActivity.class); DialerUtils.startActivityWithErrorToast(mContext, intent); return true; @@ -257,27 +255,25 @@ public class CallLogAdapter extends GroupingListAdapter }); } - if (vh.callType == CallLog.Calls.VOICEMAIL_TYPE) { + final TextView transcriptView = + vh.phoneCallDetailsViews.voicemailTranscriptionView; + if (vh.callType == CallLog.Calls.VOICEMAIL_TYPE + && transcriptView.length() > 0) { final MenuItem copyTranscriptItem = menu.add( ContextMenu.NONE, R.id.context_menu_copy_transcript_to_clipboard, ContextMenu.NONE, - R.string.copy_transcript_text - ); + R.string.copy_transcript_text); + copyTranscriptItem.setOnMenuItemClickListener( new OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem item) { - final TextView view = vh.phoneCallDetailsViews. - voicemailTranscriptionView; - ClipboardUtils.copyText( - CallLogAdapter.this.mContext, - null, - view.getText(), - true); - return true; - } - }); + @Override + public boolean onMenuItemClick(MenuItem item) { + ClipboardUtils.copyText( + mContext, null, transcriptView.getText(), true); + return true; + } + }); } } }; |