<!-- button in review mode indicate the user want to retake another photo/video for attachment [
CHAR LIMIT = NONE] -->
<string name="accessibility_review_retake">Review retake</string>
+ <!-- The button to play the video. [CHAR LIMIT = NONE] -->
+ <string name="accessibility_play_video">Play video</string>
+ <!-- The button to pause the video. [CHAR LIMIT = NONE] -->
+ <string name="accessibility_pause_video">Pause video</string>
+ <!-- The button to reload the video. [CHAR LIMIT = NONE] -->
+ <string name="accessibility_reload_video">Reload video</string>
+ <!-- The time bar of the media player. [CHAR LIMIT = NONE] -->
+ <string name="accessibility_time_bar">Video player time bar</string>
+
<!-- TODO: remove the string as it is a work-around solution to bypass the default speak of the element type. -->
<string name="empty" translatable="false">" "</string>
package com.android.gallery3d.app;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.Rect;
import android.view.Gravity;
import android.view.KeyEvent;
// multiple ones for trimming.
createTimeBar(context);
addView(mTimeBar, wrapContent);
-
+ mTimeBar.setContentDescription(
+ context.getResources().getString(R.string.accessibility_time_bar));
mLoadingView = new LinearLayout(context);
mLoadingView.setOrientation(LinearLayout.VERTICAL);
mLoadingView.setGravity(Gravity.CENTER_HORIZONTAL);
mPlayPauseReplayView = new ImageView(context);
mPlayPauseReplayView.setImageResource(R.drawable.ic_vidcontrol_play);
+ mPlayPauseReplayView.setContentDescription(
+ context.getResources().getString(R.string.accessibility_play_video));
mPlayPauseReplayView.setBackgroundResource(R.drawable.bg_vidcontrol);
mPlayPauseReplayView.setScaleType(ScaleType.CENTER);
mPlayPauseReplayView.setFocusable(true);
protected void updateViews() {
mBackground.setVisibility(View.VISIBLE);
mTimeBar.setVisibility(View.VISIBLE);
- mPlayPauseReplayView.setImageResource(
- mState == State.PAUSED ? R.drawable.ic_vidcontrol_play :
- mState == State.PLAYING ? R.drawable.ic_vidcontrol_pause :
- R.drawable.ic_vidcontrol_reload);
+ Resources resources = getContext().getResources();
+ int imageResource = R.drawable.ic_vidcontrol_reload;
+ String contentDescription = resources.getString(R.string.accessibility_reload_video);
+ if (mState == State.PAUSED) {
+ imageResource = R.drawable.ic_vidcontrol_play;
+ contentDescription = resources.getString(R.string.accessibility_play_video);
+ } else if (mState == State.PLAYING) {
+ imageResource = R.drawable.ic_vidcontrol_pause;
+ contentDescription = resources.getString(R.string.accessibility_pause_video);
+ }
+
+ mPlayPauseReplayView.setImageResource(imageResource);
+ mPlayPauseReplayView.setContentDescription(contentDescription);
mPlayPauseReplayView.setVisibility(
(mState != State.LOADING && mState != State.ERROR &&
!(mState == State.ENDED && !mCanReplay))