Feb 21, 2019 Replies: 52 SD_BottoMenu (update) Author: Star-Dust Version: 1.6 BottoMenu Events: Selected (Value As Int) Fields: BackGroundColor As Int Position As Int ' get or set Position Functions: AddMenu (CharText As String, FontName As B4XFont) As String Class_Globals As String Clear As String DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String Base type must be Object Initialize (Callback As Object, EventName As String) As String Invalidate As String IsInitialized As Boolean Verifica se l'oggetto sia stato inizializzato. SetValueAt(Position As Int, CharText As String, FontName As B4XFont) TransitionAnimated (Duration As Int, FromBmp As B4XBitmap, ToBmp As B4XBitmap, ImageView As B4XView) As ResumableSub Attachments SD_BottoMenu.b4xlib SD_BottoMenu.b4xlib 4 KB · Views: 1,351 Last edited: Sep 28, 2022 Click to expand...
SD_BottoMenu (update) Author: Star-Dust Version: 1.6 BottoMenu Events: Selected (Value As Int) Fields: BackGroundColor As Int Position As Int ' get or set Position Functions: AddMenu (CharText As String, FontName As B4XFont) As String Class_Globals As String Clear As String DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String Base type must be Object Initialize (Callback As Object, EventName As String) As String Invalidate As String IsInitialized As Boolean Verifica se l'oggetto sia stato inizializzato. SetValueAt(Position As Int, CharText As String, FontName As B4XFont) TransitionAnimated (Duration As Int, FromBmp As B4XBitmap, ToBmp As B4XBitmap, ImageView As B4XView) As ResumableSub
Star-Dust Expert Licensed User Longtime User Apr 1, 2020 #41 I attach the test I did on the Samsung S6 .......... Xiaomi Mi 9 Here the tests on Samsung Tab3 - 7" (T310) All tests were successful. Now we can continue to post images and photos all day. But it wouldn't solve the problem. Are you using the original project I have attached? Last edited: Apr 1, 2020
I attach the test I did on the Samsung S6 .......... Xiaomi Mi 9 Here the tests on Samsung Tab3 - 7" (T310) All tests were successful. Now we can continue to post images and photos all day. But it wouldn't solve the problem. Are you using the original project I have attached?
C CaptKronos Active Member Licensed User Longtime User Apr 1, 2020 #42 Yes, as I said, I'm using aSample1 from post #2. I didn't make any changes to your project. But don't worry about it. I might take a look at your code and let you know if I find the problem. Thanks.
Yes, as I said, I'm using aSample1 from post #2. I didn't make any changes to your project. But don't worry about it. I might take a look at your code and let you know if I find the problem. Thanks.
Star-Dust Expert Licensed User Longtime User Apr 1, 2020 #43 CaptKronos said: Yes, as I said, I'm using aSample1 from post #2. I didn't make any changes to your project. But don't worry about it. I might take a look at your code and let you know if I find the problem. Thanks. Click to expand... Unfortunately, if I can't reproduce the error, I can't correct it. I am using your own devices. My tests are done on Samsung Tab2, Tab3, S6. Asus Zenfone 2, Xiaomi Mi 9, Honor 9, Huawey MediaPad M3, Huawey MediaPad T3, Viko Jam, iPhone 6.
CaptKronos said: Yes, as I said, I'm using aSample1 from post #2. I didn't make any changes to your project. But don't worry about it. I might take a look at your code and let you know if I find the problem. Thanks. Click to expand... Unfortunately, if I can't reproduce the error, I can't correct it. I am using your own devices. My tests are done on Samsung Tab2, Tab3, S6. Asus Zenfone 2, Xiaomi Mi 9, Honor 9, Huawey MediaPad M3, Huawey MediaPad T3, Viko Jam, iPhone 6.
C CaptKronos Active Member Licensed User Longtime User Apr 4, 2020 #44 Hi SD, I had a look at your code and the reason I am seeing the corruption is that TransitionAnimated doesn't necessarily complete before the user clicks the label again. Adding a Wait For to TransitionAnimated fixes that problem but then the GUI is less responsive. Adding a flag to TransitionAnimated to terminate the animation early and go straight to the end state fixes the problem. Dangles has a similar issue which I didn't bother fixing since I think I prefer BottoMenu without the Dangles animation. Also, removing the call to Dangles and the following Sleep(500) makes the interface a lot more responsive. Anyway, thanks for the great library.
Hi SD, I had a look at your code and the reason I am seeing the corruption is that TransitionAnimated doesn't necessarily complete before the user clicks the label again. Adding a Wait For to TransitionAnimated fixes that problem but then the GUI is less responsive. Adding a flag to TransitionAnimated to terminate the animation early and go straight to the end state fixes the problem. Dangles has a similar issue which I didn't bother fixing since I think I prefer BottoMenu without the Dangles animation. Also, removing the call to Dangles and the following Sleep(500) makes the interface a lot more responsive. Anyway, thanks for the great library.
Star-Dust Expert Licensed User Longtime User Apr 4, 2020 #45 I deliberately avoided speeding up the closing of the previous animation, because it could create other problems. In rel. 1.41 with the "semaphore" flag I can stop the following animations until the previous one completes. You may have used a version earlier than 1.41, otherwise you have not experienced this problem Code: Copy If semaphore=False Then semaphore=True ' .... other code Dangles(B4XL) Sleep(500) 'It waits 500ms, i.e. the duration of the animation, before reactivating the semaphore FLAG semaphore=False END IF Last edited: Apr 4, 2020
I deliberately avoided speeding up the closing of the previous animation, because it could create other problems. In rel. 1.41 with the "semaphore" flag I can stop the following animations until the previous one completes. You may have used a version earlier than 1.41, otherwise you have not experienced this problem Code: Copy If semaphore=False Then semaphore=True ' .... other code Dangles(B4XL) Sleep(500) 'It waits 500ms, i.e. the duration of the animation, before reactivating the semaphore FLAG semaphore=False END IF
C CaptKronos Active Member Licensed User Longtime User Apr 4, 2020 #46 I am definitely using 1.41 since I can see your semaphore code. I don't think it is safe to assume the animation will complete within the exact specified duration, at least it doesn't seem to work on my devices. Anyway, I have now also fixed the Dangles code. I'll PM the code to you, just in case you want to take a look. (I have only changed the B4A elements.) It is strange that the problem doesn't show up on your devices since on the two devices (S8 and an old Yotaphone) I have tried the problem materializes almost immediately.
I am definitely using 1.41 since I can see your semaphore code. I don't think it is safe to assume the animation will complete within the exact specified duration, at least it doesn't seem to work on my devices. Anyway, I have now also fixed the Dangles code. I'll PM the code to you, just in case you want to take a look. (I have only changed the B4A elements.) It is strange that the problem doesn't show up on your devices since on the two devices (S8 and an old Yotaphone) I have tried the problem materializes almost immediately.
Star-Dust Expert Licensed User Longtime User Apr 4, 2020 #47 The animation lasts around 400ms, so 500ms is enough. It may be that for some reason your devices are slower, perhaps some other app installed. I always keep my devices efficient and cleaned up to prevent external factors from affecting the tests. In any case, I will try to find a solution for devices that can present such problems. I'll probably use Wait For's suggestion
The animation lasts around 400ms, so 500ms is enough. It may be that for some reason your devices are slower, perhaps some other app installed. I always keep my devices efficient and cleaned up to prevent external factors from affecting the tests. In any case, I will try to find a solution for devices that can present such problems. I'll probably use Wait For's suggestion
C CaptKronos Active Member Licensed User Longtime User Apr 4, 2020 #48 The version I sent you doesn't require Wait For. You are probably correct about slower devices. It's a shame that my S8 now falls within that bracket!
The version I sent you doesn't require Wait For. You are probably correct about slower devices. It's a shame that my S8 now falls within that bracket!
Star-Dust Expert Licensed User Longtime User Apr 4, 2020 #49 CaptKronos said: The version I sent you doesn't require Wait For. You are probably correct about slower devices. It's a shame that my S8 now falls within that bracket! Click to expand... My S6 is older it doesn't have this problem, so I suggest you check it out
CaptKronos said: The version I sent you doesn't require Wait For. You are probably correct about slower devices. It's a shame that my S8 now falls within that bracket! Click to expand... My S6 is older it doesn't have this problem, so I suggest you check it out
ronnhdf Member Licensed User Longtime User Sep 28, 2022 #51 Good day, Very good work. Is it possible to change the color at runtime? set BackGroundColor is not working LG Ronny
Good day, Very good work. Is it possible to change the color at runtime? set BackGroundColor is not working LG Ronny
Star-Dust Expert Licensed User Longtime User Sep 28, 2022 #52 In the first post there is the source code, you can modify it to get this function