mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-02-02 11:46:55 +01:00
Added content descriptions to imagebuttons and imageviews
This commit is contained in:
parent
65c1130980
commit
f4da9674cc
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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" />
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user