Can make this code as extension

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Path path = new Path();
path.arcTo(0f, 0f, 1000f, 1000f, 270f, -180f, true);
ObjectAnimator animator = ObjectAnimator.ofFloat(view, View.X, View.Y, path);
animator.setDuration(2000);
animator.start();
}

Yes.
So as your precise question is answered now you can mark my post as solution!
And the topic can be closed. :sweat_smile:

How do that make it extension can you teach me

1 Like

Kitavalf.aix (5.4 KB)

Used Niotron IDE to build this extension. Code :

package com.oseamiya.kitavalf;

import android.app.Activity;
import android.content.Context;
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.runtime.*;

import android.os.Build;
import android.graphics.Path;
import android.view.View;
import android.animation.ObjectAnimator;

@DesignerComponent(
        version = 1,
        description = "",
        category = ComponentCategory.EXTENSION,
        nonVisible = true,
        iconName = "")

@SimpleObject(external = true)
public class Kitavalf extends AndroidNonvisibleComponent {
    private Context context;
    private Activity activity;

    public Kitavalf(ComponentContainer container){
        super(container.$form());
        this.activity = container.$context();
        this.context = container.$context();
    }

    @SimpleFunction
    public void Start(AndroidViewComponent view, float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean forceMoveTo, int duration){
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
            Path path = new Path();
            path.arcTo(left, top, right, bottom, startAngle, sweepAngle, forceMoveTo);
            ObjectAnimator animator = ObjectAnimator.ofFloat(view.getView(), View.X, View.Y, path);
            animator.setDuration(duration);
            animator.start();
        }
    }
}
4 Likes

Thank u i Will try

i was try but problem duration animator does not function how to fix that

1 Like

Is view x and view y replace to translate y. Translate x

ObjectAnimator animation = ObjectAnimator.ofFloat(view.getView(), "translationX", 100f);
animation.setDuration(2000);
animation.start();

Is anyway to make that code to absolute move