diff options
author | Sailesh Nepal <sail@google.com> | 2016-02-22 21:08:06 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-02-22 21:08:06 +0000 |
commit | 8c8d25efd5e0299f9ea6aa476f42394c068f9518 (patch) | |
tree | a6b81db82a14198ed3be00582218c6983e521b29 /src/com/android/dialer/calllog | |
parent | 85fb363e266b224865fea75c251fac822b59f04d (diff) | |
parent | 429e15a3de2e5cfbc2c44071e97981e583f1ed15 (diff) |
[Gradle] Allow dialer to be compiled as a library am: 68d86c656e
am: 429e15a3de
* commit '429e15a3de2e5cfbc2c44071e97981e583f1ed15':
[Gradle] Allow dialer to be compiled as a library
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; } |