Edit:
Question 1) is solved. But I still wasn't able to change to color
of the ProgressBar
. I tried to use my own theme
(see code below).
I want my ProgressBar
to look like the image below. I have already created a ProgressBar
above my ListView
.I’m using a ListView
, ProgressBar
, and two TextViews
in a RelativeLayout
.
My Question:
1.) How can I align the
TextViews
above theProgressBar
in the way shown below?
2.) How can I set the Color of theProgressBar
itself and the Background Color of theProgressBar
?
MainActivity.xml
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/progressBarText"
android:progress="0"
android:max="100"
android:paddingTop="0dp"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:theme="@style/progressBarTheme"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"/>
styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="DialogTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">@android:color/holo_green_dark</item>
</style>
<style name="progressBarTheme" parent="@style/Theme.AppCompat">
<item name="colorAccent">@color/myRedColor</item>
</style>
</resources>