Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

FBR 387 fix auto play when paused #164

Merged
merged 2 commits into from
Nov 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public boolean onSingleTapConfirmed(MotionEvent arg0) {
}


public static interface SimpleGestureListener {
public interface SimpleGestureListener {
void onSwipe(int direction);

void onDoubleTap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,16 +578,20 @@ private void enablePauseButton() {
private void changePlayPauseButtonState(final boolean isPlayButton) {
runOnUiThread(new Runnable() {
public void run() {
if (accessibilityManager.isEnabled())
return;

ImageButton playButton = (ImageButton) findViewById(R.id.navigation_bar_play);
final int resourceIdForButton = getPlayButtonImageResource(isPlayButton);
playButton.setImageResource(resourceIdForButton);
playButton.setImageResource(getPlayButtonImageResource(isPlayButton));
playButton.setContentDescription(getString(getPlayButtonContentDescription(isPlayButton)));
}
});
}

private int getPlayButtonContentDescription(boolean isPlayButton) {
if (isPlayButton)
return R.string.content_description_play;

return R.string.content_description_pause;
}

private int getPlayButtonImageResource(boolean isPlayButton) {
if (isPlayButton)
return R.drawable.ic_play_arrow_white_24dp;
Expand Down
3 changes: 3 additions & 0 deletions FBReader/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,7 @@
<string name="tab_label_page">Page</string>
<string name="tab_label_bookmark">Bookmark</string>

<string name="content_description_play">play</string>
<string name="content_description_pause">pause</string>

</resources>