Custom indeterminate progress bar

I successfully have implemented this progress enter image description here

Using animation-list with resources like this: enter image description here enter image description here enter image description here

But problem is, that i can't impement half-heighted progress with this resources.

I have tried half-heighted resources with gravity centered vertically like this: enter image description here enter image description here enter image description here

But the result was enter image description here

Android pushed this progress to bottom. Any ideas how can I center my half-heited progress? Thx in advance.

@Antoine Marques I have tried nine-patch drawables, but i get somethink like this enter image description here

And here is my animation-list:

<item android:duration="200" android:drawable="@drawable/progressbar_indeterminate1_0" />

And resource example: enter image description here


ANSWERS:


The solution to your problem is wrapping your custom progress drawable inside a ScaleDrawable :

<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/my_custom_progress"
    android:scaleGravity="center_vertical|center_horizontal"
    android:scaleHeight="100%"
    android:scaleWidth="100%" />


 MORE:


 ? 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
 ? waitbar matlab before start a standalone script