Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change between play and pause programatically #4

Open
FastDr1v3r opened this issue Oct 31, 2015 · 1 comment
Open

Change between play and pause programatically #4

FastDr1v3r opened this issue Oct 31, 2015 · 1 comment

Comments

@FastDr1v3r
Copy link

Using toggle method within the PlauPauseView unfortunately it's not enough. I want to have a method such as: setPlayState () and whenever I'm using this method the button to change it's shapes / to draw that play triangle. The same thing for pause. I tried editing the actual source code but I did a completely mess.

@garretyoder
Copy link

Why is that a problem? It's very simple to write. Here, I wrote it for you in a simple function.

public void togglePlayState(boolean play) {
    PlayPauseDrawable pDrawable = (PlayPauseDrawable) playButton.getDrawable(); 
    if (pDrawable.isPlay() ^ play) {
        pDrawable.getPausePlayAnimator().start();
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants