Android Question [B4X] [XUI] Gauge View

abarnett

Member
Licensed User
Longtime User
Make mBase a public variable.
Change its size with Gauge1.mBase.SetLayoutAnimated.

In B4A you also need to make Base_Resize a public sub and call it with the new dimensions (it will be called automatically in B4J and B4i).
Many thanks. Great class

And a Happy New Year
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I tried to resize and re-position Gauge2 programatically, (once to half the size and once to double its size) but it looks pretty shabby:
B4X:
Gauge2.mBase.SetLayoutAnimated(300,25%x,50%y,50%x,50%y)
    Gauge2.Base_Resize(50%x,25%y)

upload_2018-1-1_10-35-5.png

It will also be nice if you can manually move the needle via a finger swipe.
 

Attachments

  • gauge2resized.png
    gauge2resized.png
    11 KB · Views: 190
Last edited:
Upvote 0

Mahares

Expert
Licensed User
Longtime User
The issue is in Canvas.Resize implementation. It is fixed in XUI v1.51
XUI 1.51 fixed the issue I was having.
What do you recommend changing in the Gauge class and be able to move the needle laterallly and manually with a finger in either directions and have the result populate say an edittext?
Thanks
 
Upvote 0
Top