LucasHeer Active Member Licensed User Longtime User Jan 19, 2020 #1 Is it possible to change the color of the Swift Button control during runtime? [B4X] XUI Views - Cross platform views and dialogs XUI Views is a b4x library (https://www.b4x.com/android/forum/threads/100383/#content). The same b4xlib library is compatible with B4A, B4i and B4J It is a collection of custom views and dialogs. Everything is written in B4X. The source code is included inside the b4xlib file, which is a zip... www.b4x.com The custom properties I want to change are: Primary Color Secondary Color How would I go about doing this? And will the view need to be invalidated? Thank you!
Is it possible to change the color of the Swift Button control during runtime? [B4X] XUI Views - Cross platform views and dialogs XUI Views is a b4x library (https://www.b4x.com/android/forum/threads/100383/#content). The same b4xlib library is compatible with B4A, B4i and B4J It is a collection of custom views and dialogs. Everything is written in B4X. The source code is included inside the b4xlib file, which is a zip... www.b4x.com The custom properties I want to change are: Primary Color Secondary Color How would I go about doing this? And will the view need to be invalidated? Thank you!
LucasHeer Active Member Licensed User Longtime User Jan 19, 2020 #2 Sorry! I didn't realize that the SwiftButton has a function: SetColors(Primary as int, Secondary as int) I've been focusing on B4XLoadingIndicator, which does not have such function. Does anyone know how to change the color on B4XLoadingIndicator? Upvote 0
Sorry! I didn't realize that the SwiftButton has a function: SetColors(Primary as int, Secondary as int) I've been focusing on B4XLoadingIndicator, which does not have such function. Does anyone know how to change the color on B4XLoadingIndicator?
LucasHeer Active Member Licensed User Longtime User Jan 19, 2020 #3 Figured it out! Just grabbed a copy of the original class, and edited the clr variable to be public: B4X: Copy Public clr As Int myLoadingIndicator.clr = Starter.primarycolor Upvote 0
Figured it out! Just grabbed a copy of the original class, and edited the clr variable to be public: B4X: Copy Public clr As Int myLoadingIndicator.clr = Starter.primarycolor
Erel B4X founder Staff member Licensed User Longtime User Jan 19, 2020 #4 lucasheer said: Just grabbed a copy of the original class, and edited the clr variable to be public: Click to expand... This is a mistake unless there is no other option. lucasheer said: Is it possible to change the color of the Swift Button control during runtime? Click to expand... Yes. Call SwiftButton1.SetColors. Make sure to use the latest version of XUI Views. Upvote 0
lucasheer said: Just grabbed a copy of the original class, and edited the clr variable to be public: Click to expand... This is a mistake unless there is no other option. lucasheer said: Is it possible to change the color of the Swift Button control during runtime? Click to expand... Yes. Call SwiftButton1.SetColors. Make sure to use the latest version of XUI Views.
LucasHeer Active Member Licensed User Longtime User Jan 19, 2020 #5 Erel said: This is a mistake unless there is no other option. Yes. Call SwiftButton1.SetColors. Make sure to use the latest version of XUI Views. Click to expand... I needed to change the color of B4XLoadingIndictor. There's no method in the original class to change the color Upvote 0
Erel said: This is a mistake unless there is no other option. Yes. Call SwiftButton1.SetColors. Make sure to use the latest version of XUI Views. Click to expand... I needed to change the color of B4XLoadingIndictor. There's no method in the original class to change the color
Erel B4X founder Staff member Licensed User Longtime User Jan 19, 2020 #6 Sorry, I only read the first post (which is where the question should be)... Upvote 0
LucasHeer Active Member Licensed User Longtime User Jan 19, 2020 #7 Erel said: Sorry, I only read the first post (which is where the question should be)... Click to expand... I deleted my custom B4XLoadingIndicator class, and am calling DesignerCreatedView on the default B4XLoadingIndicator. B4X: Copy Dim mp As Map mp.Initialize mp.Put("Color", Starter.primaryColor) mp.Put("IndicatorStyle", "Three Circles 2") mp.Put("Duration", 1000) myLoadingIndicator.DesignerCreateView(myLoadingIndicator.mBase, Null, mp) Worked Perfectly ? ? ? Thank you. Upvote 0
Erel said: Sorry, I only read the first post (which is where the question should be)... Click to expand... I deleted my custom B4XLoadingIndicator class, and am calling DesignerCreatedView on the default B4XLoadingIndicator. B4X: Copy Dim mp As Map mp.Initialize mp.Put("Color", Starter.primaryColor) mp.Put("IndicatorStyle", "Three Circles 2") mp.Put("Duration", 1000) myLoadingIndicator.DesignerCreateView(myLoadingIndicator.mBase, Null, mp) Worked Perfectly ? ? ? Thank you.