How I can create this type of textured progress bar & ldquo; line-diag & rdquo; (Ninepatch?)?

advertisements

How I can create this type of textured progress bar "line-diag" (ninepatch?)?

I have read some threads and I think the solution would be using the images of type 9-patch. But I do not understand how to do it right. Can you explain how I can make this progress bar?


I don't think you need a 9-patch here. Just change dynamically the width of your fill bar (I'm guessing that's the bright red one), and set the proper scaleType.-

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/bar_dark" />

    <ImageView
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:scaleType="matrix"
        android:src="@drawable/bar_light" />

</RelativeLayout>


For a ProgressBar component, this post could help.-

Android ProgressBar UI custom layout