From 9c5d723468ff0046419d286729060221f00f7577 Mon Sep 17 00:00:00 2001 From: uabdullah Date: Wed, 15 Nov 2017 10:24:04 -0800 Subject: Replace NUI voicemail media buttons with image buttons Replaces the existing buttons with Image Buttons using standards images. Also added a phone button. Bug: 64882313,68382421 Test: Unit Tests PiperOrigin-RevId: 175843834 Change-Id: I21898f7da72f3dd17fce0047b11349737b373513 --- .../listui/NewVoicemailMediaPlayerView.java | 22 +++++++++--- .../layout/new_voicemail_media_player_layout.xml | 42 ++++++++++++++-------- .../dialer/voicemail/listui/res/values/dimens.xml | 5 +++ .../dialer/voicemail/listui/res/values/styles.xml | 25 +++++++++++++ 4 files changed, 76 insertions(+), 18 deletions(-) create mode 100644 java/com/android/dialer/voicemail/listui/res/values/styles.xml (limited to 'java') diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java b/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java index 4629ce277..d5db60846 100644 --- a/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java +++ b/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java @@ -30,7 +30,7 @@ import android.support.v4.util.Pair; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; -import android.widget.Button; +import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.TextView; import com.android.dialer.common.Assert; @@ -45,9 +45,10 @@ import com.android.dialer.voicemail.model.VoicemailEntry; */ public class NewVoicemailMediaPlayerView extends LinearLayout { - private Button playButton; - private Button speakerButton; - private Button deleteButton; + private ImageButton playButton; + private ImageButton speakerButton; + private ImageButton phoneButton; + private ImageButton deleteButton; private TextView totalDurationView; private Uri voicemailUri; private FragmentManager fragmentManager; @@ -72,6 +73,7 @@ public class NewVoicemailMediaPlayerView extends LinearLayout { private void initializeMediaPlayerButtonsAndViews() { playButton = findViewById(R.id.playButton); speakerButton = findViewById(R.id.speakerButton); + phoneButton = findViewById(R.id.phoneButton); deleteButton = findViewById(R.id.deleteButton); totalDurationView = findViewById(R.id.playback_seek_total_duration); } @@ -79,6 +81,7 @@ public class NewVoicemailMediaPlayerView extends LinearLayout { private void setupListenersForMediaPlayerButtons() { playButton.setOnClickListener(playButtonListener); speakerButton.setOnClickListener(speakerButtonListener); + phoneButton.setOnClickListener(phoneButtonListener); deleteButton.setOnClickListener(deleteButtonListener); } @@ -164,6 +167,17 @@ public class NewVoicemailMediaPlayerView extends LinearLayout { } }; + private final View.OnClickListener phoneButtonListener = + new View.OnClickListener() { + @Override + public void onClick(View view) { + LogUtil.i( + "NewVoicemailMediaPlayer.phoneButtonListener", + "speaker request for voicemailUri: %s", + voicemailUri.toString()); + } + }; + private final View.OnClickListener deleteButtonListener = new View.OnClickListener() { @Override diff --git a/java/com/android/dialer/voicemail/listui/res/layout/new_voicemail_media_player_layout.xml b/java/com/android/dialer/voicemail/listui/res/layout/new_voicemail_media_player_layout.xml index e8e560059..07ce86a1d 100644 --- a/java/com/android/dialer/voicemail/listui/res/layout/new_voicemail_media_player_layout.xml +++ b/java/com/android/dialer/voicemail/listui/res/layout/new_voicemail_media_player_layout.xml @@ -67,22 +67,36 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:paddingTop="10dp" - android:orientation="horizontal"> - -