diff options
author | uabdullah <uabdullah@google.com> | 2017-12-15 10:45:50 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-12-15 12:13:12 -0800 |
commit | 4dc34a89ea820d1ca0115ada6fdf776150c1f07f (patch) | |
tree | 05eb175de624c8d998bfb57134ec30d77a9c1b02 /java/com/android/dialer/voicemail/listui/menu/NewVoicemailMenu.java | |
parent | 0f47b8b7b33a39b1bc49ac86b82e3949296ef9f0 (diff) |
Implement basic bottom sheet in NUI Voicemail tab.
Implement the basic bottom sheet that displays name, location add to contacts, send a message and copy number option.
Bug: 64882313,70682949
Test: Unit test, additional unit tests in the next CL that will implement calling from bottom sheet.
PiperOrigin-RevId: 179212401
Change-Id: I23281587a0d42cea595e4dc1608f997036e2dbd0
Diffstat (limited to 'java/com/android/dialer/voicemail/listui/menu/NewVoicemailMenu.java')
-rw-r--r-- | java/com/android/dialer/voicemail/listui/menu/NewVoicemailMenu.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/java/com/android/dialer/voicemail/listui/menu/NewVoicemailMenu.java b/java/com/android/dialer/voicemail/listui/menu/NewVoicemailMenu.java new file mode 100644 index 000000000..9af8de6f5 --- /dev/null +++ b/java/com/android/dialer/voicemail/listui/menu/NewVoicemailMenu.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package com.android.dialer.voicemail.listui.menu; + +import android.content.Context; +import android.view.View; +import com.android.dialer.contactactions.ContactActionBottomSheet; +import com.android.dialer.voicemail.model.VoicemailEntry; + +/** Handles configuration of the bottom sheet menus for voicemail entries. */ +public final class NewVoicemailMenu { + + /** Creates and returns the OnClickListener which opens the menu for the provided row. */ + public static View.OnClickListener createOnClickListener( + Context context, VoicemailEntry voicemailEntry) { + return (view) -> + ContactActionBottomSheet.show( + context, + PrimaryAction.fromVoicemailEntry(context, voicemailEntry), + Modules.fromVoicemailEntry(context, voicemailEntry)); + } +} |