Vertical progress bar in android

I want to make a vertical progress bar in android while performing a particular action. The progress should start from from 1st icon and end in the final icon sh0wing steady progress. I cant seem to find a way to do it.

if any body can help get one foot in the door . I will be highly obliged.


ANSWERS:


It's a bit hard to tell the transition you are trying to attempt between those two images. So you want to start with the B/W image, but does it transition from B/W to Color by cross-fading, or do you slowly want to apply pieces of the color image from the bottom up over the B/W piece?

If the latter is your choice, then your actual image will comprise of two drawables together inside a <layer-list>. One static, and the other representing a ClipDrawable that will reveal a portion of the color image based on its level value. For example, create an XML file:

res/drawable/progress_background.xml

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
  <item>
    <bitmap android:src=""/>
  </item>
  <item>
    <clip
        android:clipOrientation="vertical"
        android:gravity="bottom"
        android:drawable="@drawable/ic_launcher"/>
  </item>
</layer-list>

Then set that Drawable on something like an ImageView to display the progress, and change the value with calls to setLevel(), i.e.

//This is any view subclass that you have chosen to do this
ImageView progress;

progress.setImageResource(R.drawable.progress_background);

//Adjust the progress by adjusting the drawable's level
progress.setImageLevel(500);
// -- OR --
progress.getDrawable().setLevel(500);

Drawable levels are set by default from 0 to 10,000 to represent fully clipped to fully revealed.

HTH


you could use a LevelListDrawable and set the level using setLevel(int)

You can add continous frames of the progressbar in levellistddrawable and keep incrementing the level.


The best way I can think of to do that is to use the original bitmap as a background and then draw parts of the finished image over it from the bottom up. This way you don't need a bunch of different images--just incrementally draw the finished image. I think it can be done with something like this:

// setup
// assuming firstImage is the initial one and secondImage is the final one
int totalHeight = firstImage.getHeight();
Canvas canvas = new Canvas(firstImage);
ImageView imgView = (ImageView)findViewById(R.id.flame_bar_view);
imgView.setImageBitmap(firstBitmap);
Rect src = new Rect (0, totalHeight, 
                     firstImage.getWidth(), totalHeight);

// then on each update
void updateFlameBar(float percentage) {
    int height = (int)(totalHeight * percentage);
    src.top = totalHeight - height;
    canvas.drawBitmap(secondImage, src, src, null);
}


 MORE:


 ? Custom indeterminate progress bar
 ? Progress bar inconvertable types; cannot cast error
 ? Remove progress bar from published document in MATLAB
 ? What is the basic idea behind programming a progress/status bar in MATLAB?
 ? Text progress bar in Matlab
 ? MATLAB update waitbar
 ? xlsread and waitbar MATLAB
 ? How to modify xlsread to get a step-by-step updated flag from loading process
 ? How can I make waitbar in MATLAB modal
 ? Get waitbar value in Matlab