diff options
Diffstat (limited to 'src/com/android/dialer/calllog')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogActivity.java | 17 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallLogListItemViewHolder.java | 48 |
2 files changed, 32 insertions, 33 deletions
diff --git a/src/com/android/dialer/calllog/CallLogActivity.java b/src/com/android/dialer/calllog/CallLogActivity.java index 243eda9b1..1823a5bd3 100644 --- a/src/com/android/dialer/calllog/CallLogActivity.java +++ b/src/com/android/dialer/calllog/CallLogActivity.java @@ -192,15 +192,14 @@ public class CallLogActivity extends TransactionSafeActivity implements ViewPage return true; } - switch (item.getItemId()) { - case android.R.id.home: - final Intent intent = new Intent(this, DialtactsActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - startActivity(intent); - return true; - case R.id.delete_all: - ClearCallLogDialog.show(getFragmentManager()); - return true; + if (item.getItemId() == android.R.id.home) { + final Intent intent = new Intent(this, DialtactsActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(intent); + return true; + } else if (item.getItemId() == R.id.delete_all) { + ClearCallLogDialog.show(getFragmentManager()); + return true; } return super.onOptionsItemSelected(item); } diff --git a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java index cfc937547..1c2744073 100644 --- a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java +++ b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java @@ -361,30 +361,30 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder @Override public boolean onMenuItemClick(MenuItem item) { - switch (item.getItemId()) { - case R.id.context_menu_block_number: - BlockNumberDialogFragment.show( - blockId, - number, - countryIso, - displayNumber, - R.id.floating_action_button_container, - ((Activity) mContext).getFragmentManager(), - mFilteredNumberDialogCallback); - return true; - case R.id.context_menu_copy_to_clipboard: - ClipboardUtils.copyText(mContext, null, number, true); - return true; - case R.id.context_menu_copy_transcript_to_clipboard: - ClipboardUtils.copyText(mContext, null, - phoneCallDetailsViews.voicemailTranscriptionView.getText(), true); - return true; - case R.id.context_menu_edit_before_call: - final Intent intent = new Intent( - Intent.ACTION_DIAL, CallUtil.getCallUri(number)); - intent.setClass(mContext, DialtactsActivity.class); - DialerUtils.startActivityWithErrorToast(mContext, intent); - return true; + int resId = item.getItemId(); + if (resId == R.id.context_menu_block_number) { + BlockNumberDialogFragment.show( + blockId, + number, + countryIso, + displayNumber, + R.id.floating_action_button_container, + ((Activity) mContext).getFragmentManager(), + mFilteredNumberDialogCallback); + return true; + } else if (resId == R.id.context_menu_copy_to_clipboard) { + ClipboardUtils.copyText(mContext, null, number, true); + return true; + } else if (resId == R.id.context_menu_copy_transcript_to_clipboard) { + ClipboardUtils.copyText(mContext, null, + phoneCallDetailsViews.voicemailTranscriptionView.getText(), true); + return true; + } else if (resId == R.id.context_menu_edit_before_call) { + final Intent intent = new Intent( + Intent.ACTION_DIAL, CallUtil.getCallUri(number)); + intent.setClass(mContext, DialtactsActivity.class); + DialerUtils.startActivityWithErrorToast(mContext, intent); + return true; } return false; } |