public void play() {
    if (myIsPlaying) {
      myCycleModel.setDot(Float.NaN);
      pause();
      myIsPlaying = false;
      return;
    }
    myPlayButton.setText("pause");
    myIsPlaying = true;
    myAttributeMask = myCycleModel.getAttributeMask();
    myPlayTimer.start();
  }
This panel simulates and Android view parameter for controlling a button
ConstraintLayoutExamples/CycleEditor/src/com/google/androidstudio/motionlayoutcycles/AnimationPanel.java