applibgroup / HarmonyOS-Knowledgebase

This repository contains code samples of HarmonyOS Training
Apache License 2.0
17 stars 6 forks source link

What is the alternative in harmonyos for ValueAnimator.ofInt(int… values)?[Query] #13

Closed Click2cloud-Eros closed 3 years ago

Click2cloud-Eros commented 3 years ago

Description

I am creating a custom component in HarmonyOS using Java SDK. Where I have to work on Animation for animate component. I have to animates component between int values. For that I need the instance of AnimatorValue(In Android ValueAnimator).

In Android we can create instance of ValueAnimator and pass int values like this:

ValueAnimator finalPositionAnimator = ValueAnimator.ofInt(10, 100); but, In HMOS I am able to create instance of AnimatorValue using below code:

AnimatorValue finalPositionAnimator = new AnimatorValue(); but, I am not able to set int values.

stackoverflow link here:

https://stackoverflow.com/questions/68543803/what-is-the-alternative-in-harmonyos-for-valueanimator-ofintint-values

Additional information

Developer Platform: Windows DevEco Studio version: 2.1 Beta 4 SDK API version: 5

kanaksony commented 3 years ago

Query replied and answered on Stackoverflow.