Jul 20, 2018 Replies: 5 This is a sample of progress bar I use in my project. It only use B4A Core library and native view. Yes, what you need is only 2 panels to create the progress bar. The reason I create this view is because I don't like the square corner of default progress bar and I want to customize the colour. 1. Create a panel "pnlBar" with height = 10 and corner radius = 5. Set the colour to Gray (#808080) 2. Create another panel "pnlValue" with same height and corner radius as pnlBar (you can copy and paste from pnlBar). The width doesn't matter, it can be value smaller than pnlBar. Make sure the Left value is same as pnlBar. Set the colour to any colour you like. Example: SpringGreen (#00FF7F) 3. Then set the width of the progress bar value in code. Code: Copy pnlValue.Width = (Value / 100) * pnlBar.Width That's it! A demo source code is attached. Attachments 000.png 15.4 KB · Views: 2,069 060.png 16.7 KB · Views: 2,173 100.png 21 KB · Views: 2,094 Simple Progress Bar.zip Simple Progress Bar.zip 9.2 KB · Views: 1,486 Click to expand...
This is a sample of progress bar I use in my project. It only use B4A Core library and native view. Yes, what you need is only 2 panels to create the progress bar. The reason I create this view is because I don't like the square corner of default progress bar and I want to customize the colour. 1. Create a panel "pnlBar" with height = 10 and corner radius = 5. Set the colour to Gray (#808080) 2. Create another panel "pnlValue" with same height and corner radius as pnlBar (you can copy and paste from pnlBar). The width doesn't matter, it can be value smaller than pnlBar. Make sure the Left value is same as pnlBar. Set the colour to any colour you like. Example: SpringGreen (#00FF7F) 3. Then set the width of the progress bar value in code. Code: Copy pnlValue.Width = (Value / 100) * pnlBar.Width That's it! A demo source code is attached.
aeric Expert Licensed User Longtime User Jul 20, 2018 #2 My boss just complaint that the progress bar is too thick.
aeric Expert Licensed User Longtime User Jul 20, 2018 #3 Target SDK version 19 vs 26. Notice that second progress bar is native progress bar which has no gray background in version 19 but in version 26 it shows a light gray background.
Target SDK version 19 vs 26. Notice that second progress bar is native progress bar which has no gray background in version 19 but in version 26 it shows a light gray background.
Alexander Stolte Expert Licensed User Longtime User Jul 21, 2018 #4 aeric said: 19 but in version 26 it shows a light gray background Click to expand... jap, this problem i have too
aeric said: 19 but in version 26 it shows a light gray background Click to expand... jap, this problem i have too
aeric Expert Licensed User Longtime User Jul 21, 2018 #5 Alexander Stolte said: jap, this problem i have too Click to expand... Ya, my boss asked why not make it like download progress or a circle ? I told him I purposely custom made it so if the line is not animated then user won't know what it means. Somemore currently my page is still empty. It just look like a normal line and can't show is it the progress is half way or full.
Alexander Stolte said: jap, this problem i have too Click to expand... Ya, my boss asked why not make it like download progress or a circle ? I told him I purposely custom made it so if the line is not animated then user won't know what it means. Somemore currently my page is still empty. It just look like a normal line and can't show is it the progress is half way or full.
aeric Expert Licensed User Longtime User May 3, 2020 #6 I just realized (and surprise) this thread has the most view (152k as today) in Android Code Snippets section. I thought my other thread Register User Example has the top view but I am wrong.
I just realized (and surprise) this thread has the most view (152k as today) in Android Code Snippets section. I thought my other thread Register User Example has the top view but I am wrong.