Android Question Color animation by xml ?

ArminKH

Well-Known Member
hi
i want to use a color animation which is in a xml file
this animation will changed the background color of a view
here is my xml animation code
B4X:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <objectAnimator
    android:propertyName="backgroundColor"
    android:duration="3000"
    android:valueFrom="#FFFF8080"
    android:valueTo="#FF8080FF"/>
</set>
and in b4a side
B4X:
    Anim = XML.LoadAnimation("search_view_entered","search_view_entered")
    Anim.Start(T8SearchTop)
but this error appared
B4X:
java.lang.RuntimeException: Unknown animation name: objectAnimator
,...
as you can see in following link
http://stackoverflow.com/questions/...tor-to-make-a-textview-blink-different-colors
we have also a java code
B4X:
AnimatorSet set = (AnimatorSet) AnimatorInflater.loadAnimator(myContext,
R.anim.property_animator);
set.setTarget(myTextView);
set.start();
but i'm not familar with java to convert this part of code for b4a
what is the solution?
 

ArminKH

Well-Known Member
You can use View.SetColorAnimated to animate the color.
I know erel
But i want to use that for android lower than 3
This function is support android 3 and above
Can u please correct my code?
 
Last edited:
Upvote 0
Top