Skip to content

Commit

Permalink
provide content description for shuffle on/off button
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 266884166
  • Loading branch information
marcbaechinger authored and tonihei committed Sep 5, 2019
1 parent e4eb6b7 commit a12c664
Show file tree
Hide file tree
Showing 84 changed files with 1,217 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ public interface ProgressUpdateListener {
private final Drawable shuffleOffButtonDrawable;
private final float buttonAlphaEnabled;
private final float buttonAlphaDisabled;
private final String shuffleOnContentDescription;
private final String shuffleOffContentDescription;

@Nullable private Player player;
private com.google.android.exoplayer2.ControlDispatcher controlDispatcher;
Expand Down Expand Up @@ -426,6 +428,9 @@ public PlayerControlView(
resources.getString(R.string.exo_controls_repeat_one_description);
repeatAllButtonContentDescription =
resources.getString(R.string.exo_controls_repeat_all_description);
shuffleOnContentDescription = resources.getString(R.string.exo_controls_shuffle_on_description);
shuffleOffContentDescription =
resources.getString(R.string.exo_controls_shuffle_off_description);
}

@SuppressWarnings("ResourceType")
Expand Down Expand Up @@ -800,6 +805,8 @@ private void updateRepeatModeButton() {
}
if (player == null) {
setButtonEnabled(false, repeatToggleButton);
repeatToggleButton.setImageDrawable(repeatOffButtonDrawable);
repeatToggleButton.setContentDescription(repeatOffButtonContentDescription);
return;
}
setButtonEnabled(true, repeatToggleButton);
Expand Down Expand Up @@ -831,10 +838,15 @@ private void updateShuffleButton() {
} else if (player == null) {
setButtonEnabled(false, shuffleButton);
shuffleButton.setImageDrawable(shuffleOffButtonDrawable);
shuffleButton.setContentDescription(shuffleOffContentDescription);
} else {
setButtonEnabled(true, shuffleButton);
shuffleButton.setImageDrawable(
player.getShuffleModeEnabled() ? shuffleOnButtonDrawable : shuffleOffButtonDrawable);
shuffleButton.setContentDescription(
player.getShuffleModeEnabled()
? shuffleOnContentDescription
: shuffleOffContentDescription);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
style="@style/ExoMediaButton.Rewind"/>

<ImageButton android:id="@id/exo_shuffle"
style="@style/ExoMediaButton.Shuffle"/>
style="@style/ExoMediaButton"/>

<ImageButton android:id="@id/exo_repeat_toggle"
style="@style/ExoMediaButton"/>
Expand Down
16 changes: 15 additions & 1 deletion library/ui/src/main/res/values-af/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="exo_controls_previous_description">Vorige snit</string>
<string name="exo_controls_next_description">Volgende snit</string>
Expand All @@ -10,7 +24,7 @@
<string name="exo_controls_repeat_off_description">Herhaal niks</string>
<string name="exo_controls_repeat_one_description">Herhaal een</string>
<string name="exo_controls_repeat_all_description">Herhaal alles</string>
<string name="exo_controls_shuffle_description">Skommel</string>
<string name="exo_controls_shuffle_on_description">Skommel</string>
<string name="exo_controls_fullscreen_description">Volskermmodus</string>
<string name="exo_controls_vr_description">VR-modus</string>
<string name="exo_download_description">Aflaai</string>
Expand Down
16 changes: 15 additions & 1 deletion library/ui/src/main/res/values-am/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="exo_controls_previous_description">ቀዳሚ ትራክ</string>
<string name="exo_controls_next_description">ቀጣይ ትራክ</string>
Expand All @@ -10,7 +24,7 @@
<string name="exo_controls_repeat_off_description">ምንም አትድገም</string>
<string name="exo_controls_repeat_one_description">አንድ ድገም</string>
<string name="exo_controls_repeat_all_description">ሁሉንም ድገም</string>
<string name="exo_controls_shuffle_description">በውዝ</string>
<string name="exo_controls_shuffle_on_description">በውዝ</string>
<string name="exo_controls_fullscreen_description">የሙሉ ማያ ሁነታ</string>
<string name="exo_controls_vr_description">የቪአር ሁነታ</string>
<string name="exo_download_description">አውርድ</string>
Expand Down
16 changes: 15 additions & 1 deletion library/ui/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="exo_controls_previous_description">المقطع الصوتي السابق</string>
<string name="exo_controls_next_description">المقطع الصوتي التالي</string>
Expand All @@ -10,7 +24,7 @@
<string name="exo_controls_repeat_off_description">عدم التكرار</string>
<string name="exo_controls_repeat_one_description">تكرار مقطع صوتي واحد</string>
<string name="exo_controls_repeat_all_description">تكرار الكل</string>
<string name="exo_controls_shuffle_description">ترتيب عشوائي</string>
<string name="exo_controls_shuffle_on_description">ترتيب عشوائي</string>
<string name="exo_controls_fullscreen_description">وضع ملء الشاشة</string>
<string name="exo_controls_vr_description">وضع VR</string>
<string name="exo_download_description">تنزيل</string>
Expand Down
16 changes: 15 additions & 1 deletion library/ui/src/main/res/values-az/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="exo_controls_previous_description">Əvvəlki trek</string>
<string name="exo_controls_next_description">Növbəti trek</string>
Expand All @@ -10,7 +24,7 @@
<string name="exo_controls_repeat_off_description">Heç biri təkrarlanmasın</string>
<string name="exo_controls_repeat_one_description">Biri təkrarlansın</string>
<string name="exo_controls_repeat_all_description">Hamısı təkrarlansın</string>
<string name="exo_controls_shuffle_description">Qarışdırın</string>
<string name="exo_controls_shuffle_on_description">Qarışdırın</string>
<string name="exo_controls_fullscreen_description">Tam ekran rejimi</string>
<string name="exo_controls_vr_description">VR rejimi</string>
<string name="exo_download_description">Endirin</string>
Expand Down
16 changes: 15 additions & 1 deletion library/ui/src/main/res/values-b+sr+Latn/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="exo_controls_previous_description">Prethodna pesma</string>
<string name="exo_controls_next_description">Sledeća pesma</string>
Expand All @@ -10,7 +24,7 @@
<string name="exo_controls_repeat_off_description">Ne ponavljaj nijednu</string>
<string name="exo_controls_repeat_one_description">Ponovi jednu</string>
<string name="exo_controls_repeat_all_description">Ponovi sve</string>
<string name="exo_controls_shuffle_description">Pusti nasumično</string>
<string name="exo_controls_shuffle_on_description">Pusti nasumično</string>
<string name="exo_controls_fullscreen_description">Režim celog ekrana</string>
<string name="exo_controls_vr_description">VR režim</string>
<string name="exo_download_description">Preuzmi</string>
Expand Down
16 changes: 15 additions & 1 deletion library/ui/src/main/res/values-be/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="exo_controls_previous_description">Папярэдні трэк</string>
<string name="exo_controls_next_description">Наступны трэк</string>
Expand All @@ -10,7 +24,7 @@
<string name="exo_controls_repeat_off_description">Не паўтараць нічога</string>
<string name="exo_controls_repeat_one_description">Паўтарыць адзін элемент</string>
<string name="exo_controls_repeat_all_description">Паўтарыць усе</string>
<string name="exo_controls_shuffle_description">Перамяшаць</string>
<string name="exo_controls_shuffle_on_description">Перамяшаць</string>
<string name="exo_controls_fullscreen_description">Поўнаэкранны рэжым</string>
<string name="exo_controls_vr_description">VR-рэжым</string>
<string name="exo_download_description">Спампаваць</string>
Expand Down
16 changes: 15 additions & 1 deletion library/ui/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="exo_controls_previous_description">Предишен запис</string>
<string name="exo_controls_next_description">Следващ запис</string>
Expand All @@ -10,7 +24,7 @@
<string name="exo_controls_repeat_off_description">Без повтаряне</string>
<string name="exo_controls_repeat_one_description">Повтаряне на един елемент</string>
<string name="exo_controls_repeat_all_description">Повтаряне на всички</string>
<string name="exo_controls_shuffle_description">Разбъркване</string>
<string name="exo_controls_shuffle_on_description">Разбъркване</string>
<string name="exo_controls_fullscreen_description">Режим на цял екран</string>
<string name="exo_controls_vr_description">режим за VR</string>
<string name="exo_download_description">Изтегляне</string>
Expand Down
16 changes: 15 additions & 1 deletion library/ui/src/main/res/values-bn/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="exo_controls_previous_description">আগের ট্র্যাক</string>
<string name="exo_controls_next_description">পরবর্তী ট্র্যাক</string>
Expand All @@ -10,7 +24,7 @@
<string name="exo_controls_repeat_off_description">কোনও আইটেম আবার চালাবেন না</string>
<string name="exo_controls_repeat_one_description">একটি আইটেম আবার চালান</string>
<string name="exo_controls_repeat_all_description">সবগুলি আইটেম আবার চালান</string>
<string name="exo_controls_shuffle_description">শাফেল করুন</string>
<string name="exo_controls_shuffle_on_description">শাফেল করুন</string>
<string name="exo_controls_fullscreen_description">পূর্ণ স্ক্রিন মোড</string>
<string name="exo_controls_vr_description">ভিআর মোড</string>
<string name="exo_download_description">ডাউনলোড করুন</string>
Expand Down
16 changes: 15 additions & 1 deletion library/ui/src/main/res/values-bs/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="exo_controls_previous_description">Prethodna numera</string>
<string name="exo_controls_next_description">Sljedeća numera</string>
Expand All @@ -10,7 +24,7 @@
<string name="exo_controls_repeat_off_description">Ne ponavljaj</string>
<string name="exo_controls_repeat_one_description">Ponovi jedno</string>
<string name="exo_controls_repeat_all_description">Ponovi sve</string>
<string name="exo_controls_shuffle_description">Izmiješaj</string>
<string name="exo_controls_shuffle_on_description">Izmiješaj</string>
<string name="exo_controls_fullscreen_description">Način rada preko cijelog ekrana</string>
<string name="exo_controls_vr_description">VR način rada</string>
<string name="exo_download_description">Preuzmi</string>
Expand Down
16 changes: 15 additions & 1 deletion library/ui/src/main/res/values-ca/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="exo_controls_previous_description">Pista anterior</string>
<string name="exo_controls_next_description">Pista següent</string>
Expand All @@ -10,7 +24,7 @@
<string name="exo_controls_repeat_off_description">No en repeteixis cap</string>
<string name="exo_controls_repeat_one_description">Repeteix una</string>
<string name="exo_controls_repeat_all_description">Repeteix tot</string>
<string name="exo_controls_shuffle_description">Reprodueix aleatòriament</string>
<string name="exo_controls_shuffle_on_description">Reprodueix aleatòriament</string>
<string name="exo_controls_fullscreen_description">Mode de pantalla completa</string>
<string name="exo_controls_vr_description">Mode RV</string>
<string name="exo_download_description">Baixa</string>
Expand Down
16 changes: 15 additions & 1 deletion library/ui/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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 xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="exo_controls_previous_description">Předchozí skladba</string>
<string name="exo_controls_next_description">Další skladba</string>
Expand All @@ -10,7 +24,7 @@
<string name="exo_controls_repeat_off_description">Neopakovat</string>
<string name="exo_controls_repeat_one_description">Opakovat jednu</string>
<string name="exo_controls_repeat_all_description">Opakovat vše</string>
<string name="exo_controls_shuffle_description">Náhodně</string>
<string name="exo_controls_shuffle_on_description">Náhodně</string>
<string name="exo_controls_fullscreen_description">Režim celé obrazovky</string>
<string name="exo_controls_vr_description">Režim VR</string>
<string name="exo_download_description">Stáhnout</string>
Expand Down
Loading

0 comments on commit a12c664

Please sign in to comment.