S sultan87 Active Member Licensed User Longtime User Jan 25, 2016 #1 Hello, I wrote code that allows me to display a waiting with drawing and text. I wish I could use it in many activities without being obliged to réinserrer the code in all activities. how to do? Best regards Attachments Test_Attente.zip 2.1 KB · Views: 214
Hello, I wrote code that allows me to display a waiting with drawing and text. I wish I could use it in many activities without being obliged to réinserrer the code in all activities. how to do? Best regards
Erel B4X founder Staff member Licensed User Longtime User Jan 25, 2016 #2 Classes are the best option for reusable code. See the custom view examples (though you don't need to implement your class as a custom view): https://www.b4x.com/android/forum/pages/results/?query=custom+view https://www.b4x.com/android/forum/threads/18626/#content Upvote 0
Classes are the best option for reusable code. See the custom view examples (though you don't need to implement your class as a custom view): https://www.b4x.com/android/forum/pages/results/?query=custom+view https://www.b4x.com/android/forum/threads/18626/#content
S sultan87 Active Member Licensed User Longtime User Jan 25, 2016 #3 Erel said: Classes are the best option for reusable code. See the custom view examples (though you don't need to implement your class as a custom view): https://www.b4x.com/android/forum/pages/results/?query=custom view https://www.b4x.com/android/forum/threads/18626/#content Click to expand... hello, thank's for your response I have difficulty understanding could you do me this example with the following code? Dim panel_wait As Panel Dim wait As WhorlView (library) panel_wait.Initialize("") panel_wait.Color = Colors.Transparent Activity.AddView(panel_wait,0,0,480,800) ' Attente Cercle wait.Initialize("") wait.SweepAngle = 200 wait.StrokeWidth = 5 wait.LayerColors = Array As Int(Colors.Blue,Colors.Red,Colors.Yellow,Colors.Green) wait.AddToParent(panel_wait,130,275,250,250) wait.start Best regards Upvote 0
Erel said: Classes are the best option for reusable code. See the custom view examples (though you don't need to implement your class as a custom view): https://www.b4x.com/android/forum/pages/results/?query=custom view https://www.b4x.com/android/forum/threads/18626/#content Click to expand... hello, thank's for your response I have difficulty understanding could you do me this example with the following code? Dim panel_wait As Panel Dim wait As WhorlView (library) panel_wait.Initialize("") panel_wait.Color = Colors.Transparent Activity.AddView(panel_wait,0,0,480,800) ' Attente Cercle wait.Initialize("") wait.SweepAngle = 200 wait.StrokeWidth = 5 wait.LayerColors = Array As Int(Colors.Blue,Colors.Red,Colors.Yellow,Colors.Green) wait.AddToParent(panel_wait,130,275,250,250) wait.start Best regards