Skip to main content

Posts

Showing posts with the label progressbar

Progress bar with different color and text

Normally the horizontal progress bar  will display yellow color which most of you may not like. Unlike other views, changing the background for progress bar will not work. It will only change background image, but not the bar which shows the progress. There is one more property in xml, android:progressDrawable . You should change this. But the drawable must be a clip drawable . A clip drawable clips the diagram based on the value set. So let us create a file called clip.xml <?xml version="1.0" encoding="utf-8"?> <clip xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/bg" android:clipOrientation="horizontal" android:gravity="left" > </clip>  android:drawable, in this case bg is the .png or .xml picture to be used for clip drawable. It should be present in your res/drawable folder. Clip orientation horizontal and gravity left ar...

Using progressbar

You might have used ProgressDialog in your android app. This can be used to tell the user that some long processing is going on like file operation or accessing data from net. A progressbar is similar to a progress dialog. It is used to show the progress of a lengthy operation.  Progress bar can be horizontal or indeterminate - which is a wheel like thing which keeps rotating. We can specify which we need horizontal instead of indeterminate with style option          <ProgressBar             android:id="@+id/time"             style="?android:attr/progressBarStyleHorizontal"             android:layout_width="fill_parent"                        android:layout_heigh...