Search code examples
androidandroid-layoutandroid-5.0-lollipopandroid-progressbar

Certain ProgressBar styles not shown on Nexus 5 Android 5.0.1


I have the following layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">

    <ProgressBar
        style="@android:style/Widget.Material.ProgressBar.Large"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

</LinearLayout>

I have a Nexus 5 running Android 5.0.1 that doesn't display the ProgressBar, obviously because of the style. When I set the style for example to

 style="@android:style/Widget.ProgressBar.Large"

or

 style="@android:style/Widget.Holo.ProgressBar.Large"

it is shown. I have an identical Nexus 5 also running Android 5.0.1 which displays all the ProgressBars fine. Enabling the 'draw layout borders' option in the developers options, it shows that the ProgressBar is included in the layout, it is simply not shown.

This seems very strange, any idea on what could be going on here?

enter image description here


Solution

  • I was having the same issue but was because the developer phone have animations scales to 0 (all 3).

    Enable all the animations on the device and maybe you will be able to see the progress bar, so for normal people that will have animations enabled the progress bar will appear fine.