adp-path-morph-play-to-pause icon indicating copy to clipboard operation
adp-path-morph-play-to-pause copied to clipboard

Change between play and pause programatically

Open FastDr1v3r opened this issue 10 years ago • 1 comments

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.

FastDr1v3r avatar Oct 31 '15 08:10 FastDr1v3r

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();
    }
}

garretyoder avatar Mar 20 '16 01:03 garretyoder