summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/voicemail/listui
diff options
context:
space:
mode:
authoruabdullah <uabdullah@google.com>2017-11-15 10:24:04 -0800
committerzachh <zachh@google.com>2017-11-18 07:29:16 +0000
commit9c5d723468ff0046419d286729060221f00f7577 (patch)
tree1ccd267e1bf16b832d75fe13d7bcc26fb1e1311a /java/com/android/dialer/voicemail/listui
parent725c2514c529e4542eeeca30fccf8eb7ad407dc1 (diff)
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
Diffstat (limited to 'java/com/android/dialer/voicemail/listui')
-rw-r--r--java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java22
-rw-r--r--java/com/android/dialer/voicemail/listui/res/layout/new_voicemail_media_player_layout.xml42
-rw-r--r--java/com/android/dialer/voicemail/listui/res/values/dimens.xml5
-rw-r--r--java/com/android/dialer/voicemail/listui/res/values/styles.xml25
4 files changed, 76 insertions, 18 deletions
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">
- <!-- TODO(a bug): Remove these buttons as this is a place holder for the Media Player -->
- <Button
+ android:gravity="center"
+ android:orientation="horizontal"
+ android:weightSum="4">
+
+
+ <ImageButton
android:id="@+id/playButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Play"/>
- <Button
+ style="@style/voicemail_media_player_buttons"
+ android:layout_weight="1"
+ android:src="@drawable/quantum_ic_play_arrow_vd_theme_24"/>
+
+
+ <ImageButton
android:id="@+id/speakerButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Speaker"/>
- <Button
+ style="@style/voicemail_media_player_buttons"
+ android:layout_weight="1"
+ android:src="@drawable/quantum_ic_volume_up_vd_theme_24"/>
+
+
+ <ImageButton
+ android:id="@+id/phoneButton"
+ style="@style/voicemail_media_player_buttons"
+ android:layout_weight="1"
+ android:src="@drawable/quantum_ic_phone_vd_theme_24"/>
+
+ <ImageButton
android:id="@+id/deleteButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Delete"/>
+ style="@style/voicemail_media_player_buttons"
+ android:layout_weight="1"
+ android:src="@drawable/quantum_ic_delete_vd_theme_24"/>
+
</LinearLayout>
</LinearLayout> \ No newline at end of file
diff --git a/java/com/android/dialer/voicemail/listui/res/values/dimens.xml b/java/com/android/dialer/voicemail/listui/res/values/dimens.xml
index 6c062ae28..e37bc65fe 100644
--- a/java/com/android/dialer/voicemail/listui/res/values/dimens.xml
+++ b/java/com/android/dialer/voicemail/listui/res/values/dimens.xml
@@ -29,6 +29,11 @@
<dimen name="voicemail_icon_size">16dp</dimen>
<dimen name="voicemail_playback_state_text_size">14sp</dimen>
+ <!-- TODO(uabdullah): Work with UX on this value to ensure proper spacing between
+ the seekbar and transcription -->
<dimen name="voicemail_media_player_padding_top">20dp</dimen>
<dimen name="voicemail_duration_size">14sp</dimen>
+ <!-- TODO(uabdullah): Work with UX on these values so that the touch target is not too small -->
+ <dimen name="voicemail_media_player_height">56dp</dimen>
+ <dimen name="voicemail_media_player_width">0dp</dimen>
</resources>
diff --git a/java/com/android/dialer/voicemail/listui/res/values/styles.xml b/java/com/android/dialer/voicemail/listui/res/values/styles.xml
new file mode 100644
index 000000000..aec46090a
--- /dev/null
+++ b/java/com/android/dialer/voicemail/listui/res/values/styles.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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
+ -->
+
+<resources>
+
+ <style name="voicemail_media_player_buttons">
+ <item name="android:layout_width">@dimen/voicemail_media_player_width</item>
+ <item name="android:layout_height">@dimen/voicemail_media_player_height</item>
+ <item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
+ </style>
+</resources> \ No newline at end of file