diff options
27 files changed, 124 insertions, 20 deletions
diff --git a/res/layout-land/audioplayer_activity.xml b/res/layout-land/audioplayer_activity.xml index 1e671c745..7900e1ced 100644 --- a/res/layout-land/audioplayer_activity.xml +++ b/res/layout-land/audioplayer_activity.xml @@ -26,6 +26,7 @@ <ImageButton android:id="@+id/butNavLeft" + android:contentDescription="@string/show_shownotes_label" android:layout_width="60dp" android:layout_height="match_parent" android:layout_alignParentLeft="true" @@ -34,6 +35,7 @@ <ImageButton android:id="@+id/butNavRight" + android:contentDescription="@string/show_chapters_label" android:layout_width="60dp" android:layout_height="match_parent" android:layout_alignParentRight="true" @@ -89,6 +91,7 @@ <ImageButton android:id="@+id/butPlay" + android:contentDescription="@string/pause_label" android:layout_width="80dp" android:layout_height="match_parent" android:layout_centerHorizontal="true" @@ -97,6 +100,7 @@ <ImageButton android:id="@+id/butRev" + android:contentDescription="@string/rewind_label" android:layout_width="60dp" android:layout_height="match_parent" android:layout_toLeftOf="@id/butPlay" @@ -105,6 +109,7 @@ <ImageButton android:id="@+id/butFF" + android:contentDescription="@string/fast_forward_label" android:layout_width="60dp" android:layout_height="match_parent" android:layout_toRightOf="@id/butPlay" diff --git a/res/layout-land/videoplayer_activity.xml b/res/layout-land/videoplayer_activity.xml index 13d075b1c..f1e54f7c3 100644 --- a/res/layout-land/videoplayer_activity.xml +++ b/res/layout-land/videoplayer_activity.xml @@ -20,6 +20,7 @@ <ImageButton android:id="@+id/butPlay" + android:contentDescription="@string/pause_label" android:layout_width="80dp" android:layout_height="80dp" android:layout_gravity="center" diff --git a/res/layout-v14/directory_chooser.xml b/res/layout-v14/directory_chooser.xml index 3bb1d5c9c..f0bef72e4 100644 --- a/res/layout-v14/directory_chooser.xml +++ b/res/layout-v14/directory_chooser.xml @@ -56,6 +56,7 @@ <ImageButton android:id="@+id/butNavUp" + android:contentDescription="@string/navigate_upwards_label" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignParentLeft="true" diff --git a/res/layout/audioplayer_activity.xml b/res/layout/audioplayer_activity.xml index 857d7140f..9b501fbdb 100644 --- a/res/layout/audioplayer_activity.xml +++ b/res/layout/audioplayer_activity.xml @@ -13,6 +13,7 @@ <ImageButton android:id="@+id/butNavLeft" + android:contentDescription="@string/show_shownotes_label" android:layout_width="60dp" android:layout_height="match_parent" android:layout_alignParentLeft="true" @@ -21,6 +22,7 @@ <ImageButton android:id="@+id/butNavRight" + android:contentDescription="@string/show_chapters_label" android:layout_width="60dp" android:layout_height="match_parent" android:layout_alignParentRight="true" @@ -76,6 +78,7 @@ <ImageButton android:id="@+id/butPlay" + android:contentDescription="@string/pause_label" android:layout_width="80dp" android:layout_height="match_parent" android:layout_centerHorizontal="true" @@ -84,6 +87,7 @@ <ImageButton android:id="@+id/butRev" + android:contentDescription="@string/rewind_label" android:layout_width="80dp" android:layout_height="match_parent" android:layout_toLeftOf="@id/butPlay" @@ -92,6 +96,7 @@ <ImageButton android:id="@+id/butFF" + android:contentDescription="@string/fast_forward_label" android:layout_width="80dp" android:layout_height="match_parent" android:layout_toRightOf="@id/butPlay" @@ -100,6 +105,7 @@ <Button android:id="@+id/butPlaybackSpeed" + android:contentDescription="@string/set_playback_speed_label" android:layout_width="80dp" android:layout_height="match_parent" android:layout_toRightOf="@id/butFF" diff --git a/res/layout/cover_fragment.xml b/res/layout/cover_fragment.xml index 9602f1ebc..f9c88ac02 100644 --- a/res/layout/cover_fragment.xml +++ b/res/layout/cover_fragment.xml @@ -7,6 +7,7 @@ <ImageView android:id="@+id/imgvCover" + android:contentDescription="@string/cover_label" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" diff --git a/res/layout/default_feeditemlist_item.xml b/res/layout/default_feeditemlist_item.xml index 28386a264..fdfcca217 100644 --- a/res/layout/default_feeditemlist_item.xml +++ b/res/layout/default_feeditemlist_item.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="0dip" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" android:paddingLeft="4dp" > @@ -31,7 +32,8 @@ android:layout_width="@dimen/enc_icons_size" android:layout_height="@dimen/enc_icons_size" android:layout_below="@id/txtvPublished" - android:padding="2dp" /> + android:padding="2dp" + tools:ignore="ContentDescription"/> <TextView android:id="@+id/txtvLenSize" diff --git a/res/layout/directory_chooser.xml b/res/layout/directory_chooser.xml index 842e5d458..738c00842 100644 --- a/res/layout/directory_chooser.xml +++ b/res/layout/directory_chooser.xml @@ -34,6 +34,7 @@ <ImageButton android:id="@+id/butNavUp" + android:contentDescription="@string/navigate_upwards_label" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignParentLeft="true" diff --git a/res/layout/external_itemlist_item.xml b/res/layout/external_itemlist_item.xml index 2d0093641..20c63c2cf 100644 --- a/res/layout/external_itemlist_item.xml +++ b/res/layout/external_itemlist_item.xml @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" android:layout_height="match_parent" > <ImageView android:id="@+id/imgvFeedimage" + android:contentDescription="@string/cover_label" android:layout_width="@dimen/thumbnail_length_itemlist" android:layout_height="@dimen/thumbnail_length_itemlist" android:layout_alignParentLeft="true" @@ -12,6 +14,7 @@ <ImageButton android:id="@+id/butAction" + android:contentDescription="@string/butAction_label" android:layout_width="48dp" android:layout_height="match_parent" android:layout_alignParentBottom="true" @@ -83,7 +86,8 @@ android:layout_height="@dimen/enc_icons_size" android:layout_alignParentRight="true" android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" /> + android:layout_marginRight="8dp" + tools:ignore="ContentDescription"/> <ProgressBar android:id="@+id/pbar_episode_progress" @@ -97,6 +101,7 @@ <ImageView android:id="@+id/statusPlaying" + android:contentDescription="@string/status_playing_label" android:layout_width="@dimen/status_indicator_width" android:layout_height="18dp" android:layout_alignParentRight="true" diff --git a/res/layout/external_player_fragment.xml b/res/layout/external_player_fragment.xml index d777fc8b7..d619d7a77 100644 --- a/res/layout/external_player_fragment.xml +++ b/res/layout/external_player_fragment.xml @@ -24,6 +24,7 @@ <ImageView android:id="@+id/imgvCover" + android:contentDescription="@string/cover_label" android:layout_width="@dimen/external_player_height" android:layout_height="@dimen/external_player_height" android:layout_alignParentLeft="true" @@ -76,6 +77,7 @@ <ImageButton android:id="@+id/butPlay" + android:contentDescription="@string/pause_label" android:layout_width="@dimen/external_player_height" android:layout_height="@dimen/external_player_height" android:background="?attr/borderless_button" /> diff --git a/res/layout/feedinfo.xml b/res/layout/feedinfo.xml index 8dcf3ca85..d975ef549 100644 --- a/res/layout/feedinfo.xml +++ b/res/layout/feedinfo.xml @@ -12,6 +12,7 @@ <ImageView android:id="@+id/imgvCover" + android:contentDescription="@string/cover_label" android:layout_width="70dp" android:layout_height="70dp" android:layout_alignParentLeft="true" diff --git a/res/layout/feeditemlist_header.xml b/res/layout/feeditemlist_header.xml index 31ccb7e96..560013abd 100644 --- a/res/layout/feeditemlist_header.xml +++ b/res/layout/feeditemlist_header.xml @@ -27,6 +27,7 @@ <ImageButton android:id="@+id/butAction" + android:contentDescription="@string/butAction_label" android:layout_width="48dp" android:layout_height="match_parent" android:layout_alignParentBottom="true" diff --git a/res/layout/feeditemlist_item.xml b/res/layout/feeditemlist_item.xml index ed4b0d46d..e2898b601 100644 --- a/res/layout/feeditemlist_item.xml +++ b/res/layout/feeditemlist_item.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="0dip" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" android:paddingLeft="4dp" > @@ -45,10 +46,12 @@ android:layout_height="@dimen/enc_icons_size" android:layout_below="@id/txtvPublished" android:layout_toLeftOf="@+id/imgvInPlaylist" - android:padding="2dp" /> + android:padding="2dp" + tools:ignore="ContentDescription"/> <ImageView android:id="@id/imgvInPlaylist" + android:contentDescription="@string/in_queue_label" android:layout_width="@dimen/enc_icons_size" android:layout_height="@dimen/enc_icons_size" android:layout_below="@id/txtvPublished" @@ -59,6 +62,7 @@ <ImageView android:id="@id/imgvDownloaded" + android:contentDescription="@string/status_downloaded_label" android:layout_width="@dimen/enc_icons_size" android:layout_height="@dimen/enc_icons_size" android:layout_below="@id/txtvPublished" @@ -69,6 +73,7 @@ <ImageView android:id="@id/imgvDownloading" + android:contentDescription="@string/downloading_label" android:layout_width="@dimen/enc_icons_size" android:layout_height="@dimen/enc_icons_size" android:layout_below="@id/txtvPublished" @@ -102,6 +107,7 @@ <ImageButton android:id="@id/butAction" + android:contentDescription="@string/butAction_label" android:layout_width="48dp" android:layout_height="match_parent" android:layout_alignParentBottom="true" @@ -118,6 +124,7 @@ <TextView android:id="@+id/statusUnread" + android:contentDescription="@string/status_unread_label" android:layout_width="wrap_content" android:layout_height="18dp" android:layout_alignParentRight="true" @@ -134,6 +141,7 @@ <ImageView android:id="@+id/statusPlaying" + android:contentDescription="@string/status_playing_label" android:layout_width="@dimen/status_indicator_width" android:layout_height="18dp" android:layout_alignParentRight="true" diff --git a/res/layout/feedlist_item.xml b/res/layout/feedlist_item.xml index 90a9e3bf0..f6c43675d 100644 --- a/res/layout/feedlist_item.xml +++ b/res/layout/feedlist_item.xml @@ -1,11 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" android:layout_height="match_parent" android:paddingRight="8dp" > <ImageView android:id="@+id/imgvFeedimage" + android:contentDescription="@string/cover_label" android:layout_width="@dimen/thumbnail_length" android:layout_height="@dimen/thumbnail_length" android:layout_alignParentLeft="true" @@ -25,6 +27,7 @@ <RelativeLayout android:id="@+id/lNewStatusLabel" + android:contentDescription="@string/new_episodes_count_label" android:layout_width="@dimen/status_indicator_width" android:layout_height="0dip" android:layout_marginBottom="8dp" @@ -38,7 +41,8 @@ android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="4dp" - android:src="@drawable/white_circle" /> + android:src="@drawable/white_circle" + tools:ignore="ContentDescription"/> <TextView android:id="@+id/txtvNewEps" @@ -57,6 +61,7 @@ <RelativeLayout android:id="@+id/lProgressStatusLabel" + android:contentDescription="@string/in_progress_episodes_count_label" android:layout_width="@dimen/status_indicator_width" android:layout_height="0dip" android:layout_marginBottom="8dp" @@ -84,7 +89,8 @@ android:layout_centerVertical="true" android:layout_marginRight="2dp" android:layout_marginLeft="2dp" - android:src="@drawable/av_play_dark" /> + android:src="@drawable/av_play_dark" + tools:ignore="ContentDescription"/> </RelativeLayout> </LinearLayout> diff --git a/res/layout/feedlist_item_grid.xml b/res/layout/feedlist_item_grid.xml index c761a3a84..934904374 100644 --- a/res/layout/feedlist_item_grid.xml +++ b/res/layout/feedlist_item_grid.xml @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:id="@+id/imgvFeedimage" + android:contentDescription="@string/cover_label" android:layout_width="@dimen/thumbnail_length" android:layout_height="@dimen/thumbnail_length" android:layout_alignParentTop="true" @@ -25,6 +27,7 @@ <RelativeLayout android:id="@+id/lNewStatusLabel" + android:contentDescription="@string/new_episodes_count_label" android:layout_width="@dimen/status_indicator_width" android:layout_height="0dip" android:layout_marginBottom="8dp" @@ -38,7 +41,8 @@ android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="4dp" - android:src="@drawable/white_circle"/> + android:src="@drawable/white_circle" + tools:ignore="ContentDescription"/> <TextView android:id="@+id/txtvNewEps" @@ -57,6 +61,7 @@ <RelativeLayout android:id="@+id/lProgressStatusLabel" + android:contentDescription="@string/in_progress_episodes_count_label" android:layout_width="@dimen/status_indicator_width" android:layout_height="0dip" android:layout_marginBottom="8dp" @@ -84,7 +89,8 @@ android:layout_centerVertical="true" android:layout_marginLeft="2dp" android:layout_marginRight="2dp" - android:src="@drawable/av_play_dark"/> + android:src="@drawable/av_play_dark" + tools:ignore="ContentDescription"/> </RelativeLayout> </LinearLayout> diff --git a/res/layout/gpodnet_podcast_listitem.xml b/res/layout/gpodnet_podcast_listitem.xml index f6ddb3bd8..1f6cdd1d0 100644 --- a/res/layout/gpodnet_podcast_listitem.xml +++ b/res/layout/gpodnet_podcast_listitem.xml @@ -5,6 +5,7 @@ android:layout_height="match_parent"> <ImageView android:id="@+id/imgvCover" + android:contentDescription="@string/cover_label" android:layout_width="@dimen/thumbnail_length_itemlist" android:layout_height="@dimen/thumbnail_length_itemlist" android:layout_alignParentLeft="true" diff --git a/res/layout/onlinefeedview_header.xml b/res/layout/onlinefeedview_header.xml index 85f0f32f8..441df6174 100644 --- a/res/layout/onlinefeedview_header.xml +++ b/res/layout/onlinefeedview_header.xml @@ -6,6 +6,7 @@ <ImageView android:id="@+id/imgvCover" + android:contentDescription="@string/cover_label" android:layout_width="@dimen/thumbnail_length_onlinefeedview" android:layout_height="@dimen/thumbnail_length_onlinefeedview" android:layout_alignParentLeft="true" diff --git a/res/layout/organize_queue_listitem.xml b/res/layout/organize_queue_listitem.xml index 5cac6e85b..ded2a900b 100644 --- a/res/layout/organize_queue_listitem.xml +++ b/res/layout/organize_queue_listitem.xml @@ -5,6 +5,7 @@ <ImageView android:id="@+id/imgvFeedimage" + android:contentDescription="@string/cover_label" android:layout_width="@dimen/thumbnail_length_itemlist" android:layout_height="@dimen/thumbnail_length_itemlist" android:layout_alignParentLeft="true" diff --git a/res/layout/player_widget.xml b/res/layout/player_widget.xml index 9866da449..b6946f7a8 100644 --- a/res/layout/player_widget.xml +++ b/res/layout/player_widget.xml @@ -11,6 +11,7 @@ <ImageButton android:id="@+id/butPlay" + android:contentDescription="@string/play_label" android:layout_width="56dp" android:layout_height="match_parent" android:layout_alignParentRight="true" diff --git a/res/layout/searchlist_item.xml b/res/layout/searchlist_item.xml index 71c09c16d..889f40eef 100644 --- a/res/layout/searchlist_item.xml +++ b/res/layout/searchlist_item.xml @@ -6,6 +6,7 @@ <ImageView android:id="@+id/imgvFeedimage" + android:contentDescription="@string/cover_label" android:layout_width="55dip" android:layout_height="55dip" android:layout_alignParentLeft="true" diff --git a/res/layout/storage_error.xml b/res/layout/storage_error.xml index f2e412f46..c1ee77262 100644 --- a/res/layout/storage_error.xml +++ b/res/layout/storage_error.xml @@ -5,6 +5,7 @@ <ImageView android:id="@+id/imageView1" + android:contentDescription="@string/external_storage_error_msg" android:layout_width="30dp" android:layout_height="30dp" android:layout_centerHorizontal="true" diff --git a/res/values/strings.xml b/res/values/strings.xml index 8c05e42b5..4d7d73af0 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -319,4 +319,22 @@ <string name="subscribe_label">Subscribe</string> <string name="subscribed_label">Subscribed</string> <string name="downloading_label">Downloading...</string> + + <!-- Content descriptions for image buttons --> + <string name="show_chapters_label">Show chapters</string> + <string name="show_shownotes_label">Show shownotes</string> + <string name="show_cover_label">Show cover</string> + <string name="rewind_label">Rewind</string> + <string name="fast_forward_label">Fast forward</string> + <string name="media_type_audio_label">Audio</string> + <string name="media_type_video_label">Video</string> + <string name="navigate_upwards_label">Navigate upwards</string> + <string name="butAction_label">More actions</string> + <string name="status_playing_label">Episode is being played</string> + <string name="status_downloading_label">Episode is being downloaded</string> + <string name="status_downloaded_label">Episode is downloaded</string> + <string name="status_unread_label">Item is new</string> + <string name="in_queue_label">Episode is in the queue</string> + <string name="new_episodes_count_label">Number of new episodes</string> + <string name="in_progress_episodes_count_label">Number of episodes you have started listening to</string> </resources> diff --git a/src/de/danoeh/antennapod/activity/AudioplayerActivity.java b/src/de/danoeh/antennapod/activity/AudioplayerActivity.java index dc79bd3da..a55f8120e 100644 --- a/src/de/danoeh/antennapod/activity/AudioplayerActivity.java +++ b/src/de/danoeh/antennapod/activity/AudioplayerActivity.java @@ -322,7 +322,11 @@ public class AudioplayerActivity extends MediaplayerActivity { } private void updateNavButtonDrawable() { - TypedArray drawables = obtainStyledAttributes(new int[]{ + + final int[] buttonTexts = new int[] {R.string.show_shownotes_label, + R.string.show_chapters_label, R.string.show_cover_label}; + + final TypedArray drawables = obtainStyledAttributes(new int[]{ R.attr.navigation_shownotes, R.attr.navigation_chapters}); final Playable media = controller.getMedia(); if (butNavLeft != null && butNavRight != null && media != null) { @@ -330,7 +334,11 @@ public class AudioplayerActivity extends MediaplayerActivity { case POS_COVER: butNavLeft.setScaleType(ScaleType.CENTER); butNavLeft.setImageDrawable(drawables.getDrawable(0)); + butNavLeft.setContentDescription(getString(buttonTexts[0])); + butNavRight.setImageDrawable(drawables.getDrawable(1)); + butNavRight.setContentDescription(getString(buttonTexts[1])); + break; case POS_DESCR: butNavLeft.setScaleType(ScaleType.CENTER_CROP); @@ -342,7 +350,10 @@ public class AudioplayerActivity extends MediaplayerActivity { butNavLeft); } }); + butNavLeft.setContentDescription(getString(buttonTexts[2])); + butNavRight.setImageDrawable(drawables.getDrawable(1)); + butNavRight.setContentDescription(getString(buttonTexts[1])); break; case POS_CHAPTERS: butNavLeft.setScaleType(ScaleType.CENTER_CROP); @@ -354,7 +365,10 @@ public class AudioplayerActivity extends MediaplayerActivity { butNavLeft); } }); + butNavLeft.setContentDescription(getString(buttonTexts[2])); + butNavRight.setImageDrawable(drawables.getDrawable(0)); + butNavRight.setContentDescription(getString(buttonTexts[0])); break; } } diff --git a/src/de/danoeh/antennapod/adapter/DefaultFeedItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/DefaultFeedItemlistAdapter.java index 2b49795c3..e384ecffc 100644 --- a/src/de/danoeh/antennapod/adapter/DefaultFeedItemlistAdapter.java +++ b/src/de/danoeh/antennapod/adapter/DefaultFeedItemlistAdapter.java @@ -91,10 +91,12 @@ public class DefaultFeedItemlistAdapter extends BaseAdapter { MediaType mediaType = item.getMedia().getMediaType(); if (mediaType == MediaType.AUDIO) { holder.type.setImageDrawable(typeDrawables.getDrawable(0)); + holder.type.setContentDescription(context.getString(R.string.media_type_audio_label)); holder.type.setVisibility(View.VISIBLE); } else if (mediaType == MediaType.VIDEO) { holder.type.setImageDrawable(typeDrawables.getDrawable(1)); - holder.type.setVisibility(View.VISIBLE); + holder.type.setContentDescription(context.getString(R.string.media_type_video_label)); + holder.type.setVisibility(View.VISIBLE); } else { holder.type.setImageBitmap(null); holder.type.setVisibility(View.GONE); diff --git a/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java b/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java index b00066eca..aed988b59 100644 --- a/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java +++ b/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java @@ -148,12 +148,14 @@ public class ExternalEpisodesListAdapter extends BaseExpandableListAdapter { TypedArray drawables = context.obtainStyledAttributes(new int[] { R.attr.av_download, R.attr.navigation_refresh }); + final int[] labels = new int[] {R.string.status_downloaded_label, R.string.downloading_label}; holder.lenSize.setVisibility(View.VISIBLE); if (!media.isDownloaded()) { if (DownloadRequester.getInstance().isDownloadingFile(media)) { holder.downloadStatus.setVisibility(View.VISIBLE); holder.downloadStatus.setImageDrawable(drawables .getDrawable(1)); + holder.downloadStatus.setContentDescription(context.getString(labels[1])); } else { holder.downloadStatus.setVisibility(View.INVISIBLE); } @@ -161,6 +163,7 @@ public class ExternalEpisodesListAdapter extends BaseExpandableListAdapter { holder.downloadStatus.setVisibility(View.VISIBLE); holder.downloadStatus .setImageDrawable(drawables.getDrawable(0)); + holder.downloadStatus.setContentDescription(context.getString(labels[0])); } } else { holder.downloadStatus.setVisibility(View.INVISIBLE); diff --git a/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java index b8bec44c8..238ae29c6 100644 --- a/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java +++ b/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java @@ -176,12 +176,16 @@ public class InternalFeedItemlistAdapter extends DefaultFeedItemlistAdapter { TypedArray typeDrawables = getContext().obtainStyledAttributes( new int[] { R.attr.type_audio, R.attr.type_video }); + final int[] labels = new int[] {R.string.media_type_audio_label, R.string.media_type_video_label}; + MediaType mediaType = item.getMedia().getMediaType(); if (mediaType == MediaType.AUDIO) { holder.type.setImageDrawable(typeDrawables.getDrawable(0)); + holder.type.setContentDescription(getContext().getString(labels[0])); holder.type.setVisibility(View.VISIBLE); } else if (mediaType == MediaType.VIDEO) { holder.type.setImageDrawable(typeDrawables.getDrawable(1)); + holder.type.setContentDescription(getContext().getString(labels[1])); holder.type.setVisibility(View.VISIBLE); } else { holder.type.setImageBitmap(null); diff --git a/src/de/danoeh/antennapod/service/playback/PlayerWidgetService.java b/src/de/danoeh/antennapod/service/playback/PlayerWidgetService.java index f4674d395..90ad7a9fa 100644 --- a/src/de/danoeh/antennapod/service/playback/PlayerWidgetService.java +++ b/src/de/danoeh/antennapod/service/playback/PlayerWidgetService.java @@ -6,6 +6,7 @@ import android.appwidget.AppWidgetManager; import android.content.ComponentName; import android.content.Intent; import android.content.ServiceConnection; +import android.os.Build; import android.os.IBinder; import android.util.Log; import android.view.KeyEvent; @@ -97,8 +98,14 @@ public class PlayerWidgetService extends Service { views.setTextViewText(R.id.txtvProgress, progressString); } views.setImageViewResource(R.id.butPlay, R.drawable.av_pause_dark); + if (Build.VERSION.SDK_INT >= 15) { + views.setContentDescription(R.id.butPlay, getString(R.string.pause_label)); + } } else { views.setImageViewResource(R.id.butPlay, R.drawable.av_play_dark); + if (Build.VERSION.SDK_INT >= 15) { + views.setContentDescription(R.id.butPlay, getString(R.string.play_label)); + } } views.setOnClickPendingIntent(R.id.butPlay, createMediaButtonIntent()); diff --git a/src/de/danoeh/antennapod/util/playback/PlaybackController.java b/src/de/danoeh/antennapod/util/playback/PlaybackController.java index 55ba4baca..0781800aa 100644 --- a/src/de/danoeh/antennapod/util/playback/PlaybackController.java +++ b/src/de/danoeh/antennapod/util/playback/PlaybackController.java @@ -397,6 +397,9 @@ public abstract class PlaybackController { private void handleStatus() { final int playResource; final int pauseResource; + final CharSequence playText = activity.getString(R.string.play_label); + final CharSequence pauseText = activity.getString(R.string.pause_label); + if (PlaybackService.getCurrentMediaType() == MediaType.AUDIO) { TypedArray res = activity.obtainStyledAttributes(new int[]{ R.attr.av_play, R.attr.av_pause}); @@ -418,7 +421,7 @@ public abstract class PlaybackController { clearStatusMsg(); checkMediaInfoLoaded(); cancelPositionObserver(); - updatePlayButtonAppearance(playResource); + updatePlayButtonAppearance(playResource, playText); break; case PLAYING: clearStatusMsg(); @@ -427,16 +430,16 @@ public abstract class PlaybackController { onAwaitingVideoSurface(); } setupPositionObserver(); - updatePlayButtonAppearance(pauseResource); + updatePlayButtonAppearance(pauseResource, pauseText); break; case PREPARING: postStatusMsg(R.string.player_preparing_msg); checkMediaInfoLoaded(); if (playbackService != null) { if (playbackService.isStartWhenPrepared()) { - updatePlayButtonAppearance(pauseResource); + updatePlayButtonAppearance(pauseResource, pauseText); } else { - updatePlayButtonAppearance(playResource); + updatePlayButtonAppearance(playResource, playText); } } break; @@ -446,7 +449,7 @@ public abstract class PlaybackController { case PREPARED: checkMediaInfoLoaded(); postStatusMsg(R.string.player_ready_msg); - updatePlayButtonAppearance(playResource); + updatePlayButtonAppearance(playResource, playText); break; case SEEKING: postStatusMsg(R.string.player_seeking_msg); @@ -454,7 +457,7 @@ public abstract class PlaybackController { case INITIALIZED: checkMediaInfoLoaded(); clearStatusMsg(); - updatePlayButtonAppearance(playResource); + updatePlayButtonAppearance(playResource, playText); break; } } @@ -463,9 +466,10 @@ public abstract class PlaybackController { mediaInfoLoaded = (mediaInfoLoaded || loadMediaInfo()); } - private void updatePlayButtonAppearance(int resource) { + private void updatePlayButtonAppearance(int resource, CharSequence contentDescription) { ImageButton butPlay = getPlayButton(); butPlay.setImageResource(resource); + butPlay.setContentDescription(contentDescription); } public abstract ImageButton getPlayButton(); |