Android Question [SOLUTION] AnotherProgressBar resize issue help

giggetto71

Active Member
Licensed User
Longtime User
Hi,
I am facing a strange issue with the XUI progressbar. I am sure I am not using it in the right way so I am asking for some help.
In the attached test project I have a panel and pb (progressbar). I have facing the following two issues:

1- upon activity create I would like to extend the pb width to the entire containing panel width by doing

B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Layout")
    pb1.mBase.Width = Panel1.Width
    pb1.mBase.Left = 0
    pb1.Value = 0     
End Sub

for some reasons the pb does not change size.

2- when I press the pushbutton the value increases by 5 so for example I reach 50%, then I suspend the app and when I resume, when I press the increase button the value increases but the bar does not move..


please help..
thanks!!
 

Attachments

  • TestPB.zip
    9.4 KB · Views: 20

Alexander Stolte

Expert
Licensed User
Longtime User
pb1.mBase.Width = Panel1.Width
You need call "Base_Resize". The Base_Resize is private, so you need to call it this way:
B4X:
    pb1.mBase.Width = Panel1.Width
    pb1.mBase.Left = 0
    CallSub3(pb1,"Base_Resize",pb1.mBase.Width,pb1.mBase.Height) 'Update the Width
    pb1.Value = 100

2- when I press the pushbutton the value increases by 5 so for example I reach 50%, then I suspend the app and when I resume, when I press the increase button the value increases but the bar does not move..
You need to call UpdateGraphics in the Resume event
B4X:
Sub Activity_Resume
   pb1.mBase.Width = Panel1.Width
   pb1.UpdateGraphics
End Sub
 

Attachments

  • TestPB.zip
    3.6 KB · Views: 20
Upvote 0
Top