Merge "Fix 5249234: Add contentDescription to buttons on transport control on lock screen."

This commit is contained in:
Jim Miller
2011-10-10 20:06:29 -07:00
committed by Android (Google) Code Review
3 changed files with 28 additions and 7 deletions

View File

@@ -336,20 +336,27 @@ public class TransportControlView extends FrameLayout implements OnClickListener
if (state == mPlayState) { if (state == mPlayState) {
return; return;
} }
final int imageResId;
final int imageDescId;
switch (state) { switch (state) {
case RemoteControlClient.PLAYSTATE_PLAYING: case RemoteControlClient.PLAYSTATE_PLAYING:
mBtnPlay.setImageResource(com.android.internal.R.drawable.ic_media_pause); imageResId = com.android.internal.R.drawable.ic_media_pause;
imageDescId = com.android.internal.R.string.lockscreen_transport_pause_description;
break; break;
case RemoteControlClient.PLAYSTATE_BUFFERING: case RemoteControlClient.PLAYSTATE_BUFFERING:
mBtnPlay.setImageResource(com.android.internal.R.drawable.ic_media_stop); imageResId = com.android.internal.R.drawable.ic_media_stop;
imageDescId = com.android.internal.R.string.lockscreen_transport_stop_description;
break; break;
case RemoteControlClient.PLAYSTATE_PAUSED: case RemoteControlClient.PLAYSTATE_PAUSED:
default: default:
mBtnPlay.setImageResource(com.android.internal.R.drawable.ic_media_play); imageResId = com.android.internal.R.drawable.ic_media_play;
imageDescId = com.android.internal.R.string.lockscreen_transport_play_description;
break; break;
} }
mBtnPlay.setImageResource(imageResId);
mBtnPlay.setContentDescription(getResources().getString(imageDescId));
mPlayState = state; mPlayState = state;
} }

View File

@@ -66,7 +66,8 @@
android:src="@drawable/ic_media_rew" android:src="@drawable/ic_media_rew"
android:clickable="true" android:clickable="true"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:padding="10dip"/> android:padding="10dip"
android:contentDescription="@string/lockscreen_transport_prev_description"/>
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -80,7 +81,8 @@
android:clickable="true" android:clickable="true"
android:src="@drawable/ic_media_play" android:src="@drawable/ic_media_play"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:padding="10dip"/> android:padding="10dip"
android:contentDescription="@string/lockscreen_transport_play_description"/>
</FrameLayout> </FrameLayout>
<FrameLayout <FrameLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -94,7 +96,8 @@
android:clickable="true" android:clickable="true"
android:src="@drawable/ic_media_ff" android:src="@drawable/ic_media_ff"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:padding="10dip"/> android:padding="10dip"
android:contentDescription="@string/lockscreen_transport_next_description"/>
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View File

@@ -953,7 +953,7 @@
social updates from your friends. Malicious apps can use this to pretend to be a friend social updates from your friends. Malicious apps can use this to pretend to be a friend
and trick you into revealing passwords or other confidential information.</string> and trick you into revealing passwords or other confidential information.</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. --> <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_readCalendar">read calendar events plus confidential information</string> <string name="permlab_readCalendar">read calendar events plus confidential information</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. --> <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
@@ -1831,6 +1831,17 @@
<string name="lockscreen_permanent_disabled_sim_instructions">Your SIM card is permanently disabled.\n <string name="lockscreen_permanent_disabled_sim_instructions">Your SIM card is permanently disabled.\n
Please contact your wireless service provider to obtain another SIM card.</string> Please contact your wireless service provider to obtain another SIM card.</string>
<!-- Shown on transport control of lockscreen. Pressing button goes to previous track. -->
<string name="lockscreen_transport_prev_description">Previous track button</string>
<!-- Shown on transport control of lockscreen. Pressing button goes to next track. -->
<string name="lockscreen_transport_next_description">Next track button</string>
<!-- Shown on transport control of lockscreen. Pressing button pauses playback -->
<string name="lockscreen_transport_pause_description">Pause button</string>
<!-- Shown on transport control of lockscreen. Pressing button pauses playback -->
<string name="lockscreen_transport_play_description">Play button</string>
<!-- Shown on transport control of lockscreen. Pressing button pauses playback -->
<string name="lockscreen_transport_stop_description">Stop button</string>
<!-- Shown in the lock screen when there is emergency calls only mode. --> <!-- Shown in the lock screen when there is emergency calls only mode. -->
<string name="emergency_calls_only" msgid="2485604591272668370">Emergency calls only</string> <string name="emergency_calls_only" msgid="2485604591272668370">Emergency calls only</string>