Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to increase the height of the line inside the progress bar Android

Is it possible to increase the height of the line inside the progress bar ? enter image description here

like image 338
Hadi Al Tinawi Avatar asked Mar 10 '23 02:03

Hadi Al Tinawi


2 Answers

I fixed it like this:

I created a custom progress bar xml file inside drawable folder:

progress_bar_states.xml:

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

  <item android:id="@android:id/background">
    <shape>
      <corners android:radius="5dip" />
      <gradient
        android:startColor="@color/colorGray"
        android:centerColor="@color/colorGray"
        android:endColor="@color/colorGray"
      />
    </shape>
  </item>



  <item android:id="@android:id/progress">
    <clip>
      <shape>
        <corners android:radius="5dip" />
        <gradient
          android:startColor="@color/colorBlue"
          android:centerColor="@color/colorBlue"
          android:endColor="@color/colorBlue"
        />     
      </shape>
    </clip>
  </item>



</layer-list>

And in my layout:

              <ProgressBar
                style="?android:attr/progressBarStyleHorizontal"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:indeterminateOnly="false"
                android:id="@+id/progressBar"
                android:gravity="left"
                android:progressDrawable="@drawable/progress_bar_states"
                android:layout_weight="1"
                android:layout_marginBottom="10dp"
                android:layout_marginLeft="15dp" />
like image 134
Hadi Al Tinawi Avatar answered Mar 11 '23 17:03

Hadi Al Tinawi


Try the following code:

mProgressBar.setScaleY(3f);
like image 44
Yogi Bear Avatar answered Mar 11 '23 16:03

Yogi Bear