How is stop rotate this code

@SimpleFunction

 public void Start (AndroidViewComponent view, float awal, float akhir, int duration, int repeat, int delay) {

    

    ObjectAnimator rotate = ObjectAnimator.ofFloat(view.getView(), "rotation", awal, akhir);

    rotate.setStartDelay(delay); 

    rotate.setRepeatCount(repeat);

    rotate.setInterpolator(new LinearInterpolator());

    rotate.setDuration(duration);

    rotate.start();



}

@SimpleFunction

 public void stop (AndroidViewComponent view){

    ObjectAnimator.rotate.setFillAfter(true)

 }

}

rotate.cancel();

1 Like

@SimpleFunction

 public void stop (){

    rotate.cancel();

 }

error like this
[javac] symbol: variable rotate
[javac] location: class RotaTion
[javac] 1 error
[javac] 8 warnings

Declare rotate variable as public

1 Like

that is i dont know how do that

  private ObjectAnimator rotate;

@SimpleFunction
  public void Start (AndroidViewComponent view, float awal, float akhir, int duration, int repeat, int delay) {
    rotate = ObjectAnimator.ofFloat(view.getView(), "rotation", awal, akhir);
    rotate.setStartDelay(delay);
    rotate.setRepeatCount(repeat);
    rotate.setInterpolator(new LinearInterpolator());
    rotate.setDuration(duration);
    rotate.start();
  }

  @SimpleFunction
  public void stop (){
    rotate.cancel();
  }

try this

@dewibatiah

1 Like

ok ill try

ok thank its work

1 Like

how make @SimpleEvent animation end
if in android studio i use this code
setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {}
}
i dont know with @SimpleEvent

 private ObjectAnimator rotate;

  @SimpleFunction
  public void Start (AndroidViewComponent view, float awal, float akhir, int duration, int repeat, int delay) {
    rotate = ObjectAnimator.ofFloat(view.getView(), "rotation", awal, akhir);
    rotate.setStartDelay(delay);
    rotate.setRepeatCount(repeat);
    rotate.setInterpolator(new LinearInterpolator());
    rotate.setDuration(duration);
    rotate.start();
    rotate.addListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        super.onAnimationEnd(animation);
        OnEnd();
      }
    });
  }
  
  @SimpleEvent
  public void OnEnd()
  {
    EventDispatcher.dispatchEvent(this, "OnEnd");
  }

  @SimpleFunction
  public void stop (){
    rotate.cancel();
  }
1 Like

thank u Shreyaa

1 Like

Please mark as solved.

Shreyaa ,how is build.gradle this in extension```
example like this
dependencies {
compile ‘at.wirecube:additive_animations:1.9.3’
}

Adding dependencies directly in extension isn’t supported

You need to download library from Maven repository

https://mvnrepository.com/artifact/at.wirecube/additive_animations/1.9.3

1 Like

how is compile ,with rush or with extension maker from niotron?

Download library from maven repository and place jar file in deps folder

You can watch this video by @zainulhassan for better understanding

thank u shreyaa

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.