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

Commit

Permalink
Merge pull request #164 from benetech/FBR-387--fix-auto-play-when-pau…
Browse files Browse the repository at this point in the history
…sed-

FBR 387  fix auto play when paused
  • Loading branch information
nimbooce committed Nov 12, 2015
2 parents 5d21c2a + 9d1e0c2 commit a3d5ab7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
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>

0 comments on commit a3d5ab7

Please sign in to comment.