I need help in doing a custom progress bar.
I would like to change the stock android progress bar like this one:
http://i56.tinypic.com/dlgbae.jpg
To something like this or any other shape:
http://i52.tinypic.com/2r750dh.jpg
Can someone point me to the right direction, please?
Thanks
You need to load different Drawable for the progress bar
Simple way to do this is just using
android:progressDrawable="#drawable/myprogbar_new_drawable"
Either put PNG in res/drawable folder in your project or create your own xml with specify colors/gradients/shapes etc.
Related
I have found several answers on here as to how to change the background color and add a custom icon to the title bar in android studio but am having difficulties finding an answer for how to use a custom image as the background instead of just a color in the title bar. Any help would be much appreciated. Thanks.
sadly you cannot add images as the background on both the header and textView/webView that's why you don't see any apps on android with image backgrounds. you could try using html instead of xml, like:
replace colors.xml, styles.xml, ect with colors.html, styles.html, ect
but i doubt that will work. hopefully they will add this feature later in the android sdk.
I find the default Android progress bar very thick when large, is there anyway to make the bar thinner in the circular indetermindate.
I dont want to use a custom drawable if possible. It always slows things down and gives a two two gradient I dont like
I don't think it's possible without using custom drawables. As an alternative, you can use a third-party library, such as CircularProgressView, to create a customizable Material progress indicator.
I know it is possible to change the style of the SeekBar in android apps, but is it possible to change the shape of the progress line of a SeekBar?
I would like it to be like that:
Any ideas on how to achieve this? :)
Similar to this question here How to make custom seek bar in android?
You're not going to be able to do that with the default slider. You're going to have create a custom view. Here's some resources to get you started.
http://www.mokasocial.com/2011/02/create-a-custom-styled-ui-slider-seekbar-in-android/
http://developer.android.com/training/custom-views/create-view.html
Edited to add this other resource the may help you get the curves you want
Give a semi-circular shape to seekbar
Now I have this task where I should create a rating bar just like youtube in my app , and so my idea was to have a textview where I set its background to a color but then remove the color according to an equation I will make so it displays only a percentage of it... any idea how can I do this or where to look ?
The simplest way to do this would be to create a selector.xml. You would assign android:background="#drawable/selector". Your selector would decide which background color to show based on what percentage you have assigned.
This link explains how to use selectors with buttons. It should help to get you on the right track...http://developer.android.com/guide/topics/resources/color-list-resource.html
EDIT: You can still accomplish a custom progress bar by xml. It is very similar to the selector. Just think of it as many more selectors based on progress instead of state. Here is a nice example...Custom Drawable for ProgressBar/ProgressDialog
You can also look into xml animations. They are similar.
I've seen in the progress bar api, there is a property for 'backgroundImage'. Is there a way in titanium to create a custom progress bar? If I have two images? Or has anyone heard of a module which could let me do such a thing?