Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8796899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:43:42+00:00 2026-06-13T23:43:42+00:00

I am trying to customize a status bar so it will look like this

  • 0

I am trying to customize a status bar so it will look like this image:enter image description here

However, after a good couple of hours all I have is a status bar with the background I need only (Image 2): enter image description here

The current code I have is:
xml layout:

<ProgressBar
                android:id="@+id/pBarOverallStatus"
                style="?android:attr/progressBarStyleHorizontal"
                android:layout_width="0dip"
                android:layout_height="fill_parent"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="10dip"
                android:layout_weight="94"
                android:indeterminateOnly="false"
                android:max="100"
                android:progressDrawable="@drawable/progress_bar_states" >
            </ProgressBar>

The progress_bar_states.xml:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <!-- <item android:id="@android:id/progress">
        <bitmap
            android:gravity="center"
            android:src="@drawable/progressbar_progressing" />

        <corners android:radius="10dp" />
    </item>
     -->

</layer-list>

Removing the comment, where proressbar_progressing looks like
enter image description here
then I am having something a bit ugly as there are no corners. enter image description here

I am adding the background from code, something like:

overallStatus = (ProgressBar) findViewById(R.id.pBarOverallStatus);
Resources res = getResources();
overallStatus.setBackgroundDrawable(res.getDrawable(R.drawable.progressbar_background));
overallStatus.setProgress(50);

I tried to add corners to the image but no luck.
Does anybody have any idea what I am doing wrong here? Or what am I missing?
Also, do you have any idea how could I add the left and right rings? The resource:
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:43:43+00:00Added an answer on June 13, 2026 at 11:43 pm

    The solution (feels weird answering your own):
    First, one problem was that progress drawable had a different size than background (stupid me!). Also, for progress drawable a clip xml was needed. Something like progressbar_progress_clip.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <clip
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:drawable="@drawable/progressbar_progressing"
        android:clipOrientation="horizontal"
        android:gravity="left"/>
    

    Then, add the progress bar and two images in a relative layout, so that the images can be drawn after the status bar. Something like this:

    <RelativeLayout
                    android:id="@+id/relativeLayout1"
                    android:layout_width="0dip"
                    android:layout_height="fill_parent"
                    android:layout_marginLeft="10dip"
                    android:layout_marginRight="10dip"
                    android:layout_weight="94" >
    
                    <ProgressBar
                        android:id="@+id/pBarOverallStatus"
                        style="?android:attr/progressBarStyleHorizontal"
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:layout_marginBottom="2dp"
                        android:layout_marginTop="2dp"
                        android:indeterminateOnly="false"
                        android:max="100"
                        android:progressDrawable="@drawable/progressbar_progress_clip" >
                    </ProgressBar>
    
                    <ImageView
                        android:id="@+id/ringLeft"
                        android:layout_width="wrap_content"
                        android:layout_height="fill_parent"
                        android:layout_alignParentLeft="true"
                        android:layout_centerVertical="true"
                        android:layout_marginLeft="7dp"
                        android:contentDescription="@string/status_bar_ring"
                        android:src="@drawable/status_bar_ring" />
    
                    <ImageView
                        android:id="@+id/ringRight"
                        android:layout_width="wrap_content"
                        android:layout_height="fill_parent"
                        android:layout_alignParentRight="true"
                        android:layout_centerVertical="true"
                        android:layout_marginRight="7dp"
                        android:contentDescription="@string/status_bar_ring"
                        android:src="@drawable/status_bar_ring" />
                </RelativeLayout>
    

    Thanks, guys!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to customize this page indicator with half succes, but after many hours
Trying to customize Symfony2 form to produce html code looking like the following example:
Im trying tu customize horizontal progress bar in my application. I want it to
I'm trying to customize the look of a seekbar by overriding the onDraw() method
I am trying to customize a UITableView. So far, it looks good. But when
I am trying to customize an Ext.form.Slider in Sencha Touch 1.1. This is my
I am trying to customize the app bar command buttons and wondering if we
I've been trying to customize a portion of PHP script for this. I want
I am trying to customize this script so that instead of a user's recent
I'm trying to customize the navigation bar in a RubyMotion app but can't seem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.