If I set a view's PivotX and PivotY values with a JavaObject prior to invoking B4XView.SetRoation, it still rotates around the center of the view:
B4X:
Dim poB4V As B4XView = lblRotate
Dim j As JavaObject = lblRotate
Dim X As Float = lblRotate.Width ' make the pivot point the lower right-hand corner
Dim y As Float = lblRotate.Height
j.RunMethod("setPivotX", Array As Object(X))
j.RunMethod("setPivotY", Array As Object(Y))
poB4V.SetRotationAnimated(200, 0)
If I use the same JavaObject and call the "setRotation" method directly, the rotation is performed as expected on the requested pivot point (without the animation, of course).
Is there a method to make the SetRotationAnimated utilize a specific pivot point that I missed?
My goal here, is to animate the rotation of the label at the lower right-hand corner, not its center. There is no pivotx/y property in the B4XView object, therefore: javaobject and setPivotX/setPivotY.
I could, I suppose, manually calculate the linear rotation angle over time and achieve what I am looking for with javaobject setRotation in a loop, but that seems overkill. I had been using @Informatix's animation library, which still works fine. I was in the process of seeing if I could replace it with the native XUI methods and simplify the class in the process.
Subject: Set and get the 'padding' of a view. Sub: setPadding Description: Sets the padding'of a view. 'Sets the padding of a view 'v = view 'Left, Top, Right, Bottom padding values in pixels Sub setPadding(v As View, Left As Int, Top As Int, Right As Int, Bottom As Int) Dim jo = v As...
I would like to rotate a label and found this topic: https://www.b4x.com/android/forum/threads/rotate-a-view-degrees.75939/#content I'm using the setRotate method and although it does seem to rotate the label, it doesn not rotate around the center but it seems it is rotating around one of the...
Thanks for the links! I'm currently using @Informatix's Excellent AnimationPlus library, for which I wrote a helper class to simplify the animation overhead. It works well, I was attempting to see if I could just utilize the (new-to-me) built-in XUI methods to remove the library dependency at some point. Currently not enough of the underlying translation methods/properties are exposed to make that happen.
Our focus currently is B4A only, I was just hoping to "freshen up" the app and take advantage of the new features. For the app in question it was written long before resumable subs were available (early 2015 IIRC).