summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/voicemail
diff options
context:
space:
mode:
authoruabdullah <uabdullah@google.com>2018-01-26 11:32:07 -0800
committerCopybara-Service <copybara-piper@google.com>2018-01-26 14:07:21 -0800
commit33d4d88ae74b755501da31906f9393d4c9f6f344 (patch)
treeb0efec8adf6b6bacd0f5ee934375c47f3a082ab8 /java/com/android/dialer/voicemail
parent5e7d12ef1effb30f8f3cef918e3f15aec2eb521c (diff)
Disable seekbar user seeking
By default the seekbar should be disabled unless being played or the voicemails have downloaded. This first part of the seekbar update ensures that a user is not able to seek, and the seekbar will only be updated automatically when the voicemail is being played. Bug: 7252855 Test: N/A PiperOrigin-RevId: 183419966 Change-Id: I4e492279402d76d3e1ece03dded9b402c88138c8
Diffstat (limited to 'java/com/android/dialer/voicemail')
-rw-r--r--java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java12
-rw-r--r--java/com/android/dialer/voicemail/listui/res/drawable-hdpi/ic_handle.pngbin0 -> 218 bytes
-rw-r--r--java/com/android/dialer/voicemail/listui/res/drawable-mdpi/ic_handle.pngbin0 -> 160 bytes
-rw-r--r--java/com/android/dialer/voicemail/listui/res/drawable-xhdpi/ic_handle.pngbin0 -> 285 bytes
-rw-r--r--java/com/android/dialer/voicemail/listui/res/drawable-xxhdpi/ic_handle.pngbin0 -> 311 bytes
-rw-r--r--java/com/android/dialer/voicemail/listui/res/drawable-xxxhdpi/ic_handle.pngbin0 -> 467 bytes
-rw-r--r--java/com/android/dialer/voicemail/listui/res/drawable/ic_voicemail_seek_handle_disabled.xml20
-rw-r--r--java/com/android/dialer/voicemail/listui/res/values/colors.xml19
8 files changed, 51 insertions, 0 deletions
diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java b/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java
index 3becd271f..0234f6495 100644
--- a/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java
+++ b/java/com/android/dialer/voicemail/listui/NewVoicemailMediaPlayerView.java
@@ -20,6 +20,7 @@ import android.app.FragmentManager;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
+import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.net.Uri;
import android.provider.VoicemailContract;
@@ -61,6 +62,8 @@ public final class NewVoicemailMediaPlayerView extends LinearLayout {
private ImageButton deleteButton;
private TextView currentSeekBarPosition;
private SeekBar seekBarView;
+ private Drawable voicemailSeekHandleDisabled;
+
private TextView totalDurationView;
private TextView voicemailLoadingStatusView;
private Uri voicemailUri;
@@ -96,6 +99,11 @@ public final class NewVoicemailMediaPlayerView extends LinearLayout {
deleteButton = findViewById(R.id.deleteButton);
totalDurationView = findViewById(R.id.playback_seek_total_duration);
voicemailLoadingStatusView = findViewById(R.id.playback_state_text);
+
+ voicemailSeekHandleDisabled =
+ getContext()
+ .getResources()
+ .getDrawable(R.drawable.ic_voicemail_seek_handle_disabled, getContext().getTheme());
}
private void setupListenersForMediaPlayerButtons() {
@@ -167,6 +175,10 @@ public final class NewVoicemailMediaPlayerView extends LinearLayout {
initializeMediaPlayerButtonsAndViews();
setupListenersForMediaPlayerButtons();
+ // TODO(uabdullah): Handle seekbar seeking properly (a bug)
+ seekBarView.setEnabled(false);
+ seekBarView.setThumb(voicemailSeekHandleDisabled);
+
// During the binding we only send a request to the adapter to tell us what the
// state of the media player should be and call that function.
// This could be the paused state, or the playing state of the resume state.
diff --git a/java/com/android/dialer/voicemail/listui/res/drawable-hdpi/ic_handle.png b/java/com/android/dialer/voicemail/listui/res/drawable-hdpi/ic_handle.png
new file mode 100644
index 000000000..315a0dd40
--- /dev/null
+++ b/java/com/android/dialer/voicemail/listui/res/drawable-hdpi/ic_handle.png
Binary files differ
diff --git a/java/com/android/dialer/voicemail/listui/res/drawable-mdpi/ic_handle.png b/java/com/android/dialer/voicemail/listui/res/drawable-mdpi/ic_handle.png
new file mode 100644
index 000000000..8bcec11e0
--- /dev/null
+++ b/java/com/android/dialer/voicemail/listui/res/drawable-mdpi/ic_handle.png
Binary files differ
diff --git a/java/com/android/dialer/voicemail/listui/res/drawable-xhdpi/ic_handle.png b/java/com/android/dialer/voicemail/listui/res/drawable-xhdpi/ic_handle.png
new file mode 100644
index 000000000..36f3466a6
--- /dev/null
+++ b/java/com/android/dialer/voicemail/listui/res/drawable-xhdpi/ic_handle.png
Binary files differ
diff --git a/java/com/android/dialer/voicemail/listui/res/drawable-xxhdpi/ic_handle.png b/java/com/android/dialer/voicemail/listui/res/drawable-xxhdpi/ic_handle.png
new file mode 100644
index 000000000..9a1651cee
--- /dev/null
+++ b/java/com/android/dialer/voicemail/listui/res/drawable-xxhdpi/ic_handle.png
Binary files differ
diff --git a/java/com/android/dialer/voicemail/listui/res/drawable-xxxhdpi/ic_handle.png b/java/com/android/dialer/voicemail/listui/res/drawable-xxxhdpi/ic_handle.png
new file mode 100644
index 000000000..c6dbf3875
--- /dev/null
+++ b/java/com/android/dialer/voicemail/listui/res/drawable-xxxhdpi/ic_handle.png
Binary files differ
diff --git a/java/com/android/dialer/voicemail/listui/res/drawable/ic_voicemail_seek_handle_disabled.xml b/java/com/android/dialer/voicemail/listui/res/drawable/ic_voicemail_seek_handle_disabled.xml
new file mode 100644
index 000000000..5e974c45a
--- /dev/null
+++ b/java/com/android/dialer/voicemail/listui/res/drawable/ic_voicemail_seek_handle_disabled.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2015 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
+ -->
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/ic_handle"
+ android:tint="@color/voicemail_icon_disabled_tint">
+</bitmap> \ No newline at end of file
diff --git a/java/com/android/dialer/voicemail/listui/res/values/colors.xml b/java/com/android/dialer/voicemail/listui/res/values/colors.xml
new file mode 100644
index 000000000..6ecf4c229
--- /dev/null
+++ b/java/com/android/dialer/voicemail/listui/res/values/colors.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2018 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>
+ <color name="voicemail_icon_disabled_tint">#80000000</color>
+</resources> \ No newline at end of file