0

Please note

This is not a question for the Activity/Theme or Manifest, its a include layout issue.

The Issue

In all my layouts I have included progress_bar.xml layout which has the following content

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#80ffffff"
    android:layout_centerInParent="true"
    android:layout_gravity="center"
    android:orientation="vertical">

    <!--<ImageView-->
        <!--android:layout_width="match_parent"-->
        <!--android:layout_height="match_parent"-->
        <!--android:adjustViewBounds="true"-->
        <!--android:background="#80ffffff"-->
        <!--android:src="@drawable/splashscreen"-->
        <!--android:visibility="visible" />-->



        <ProgressBar
            android:id="@+id/defaultBigProgressBar"
            style="?android:attr/progressBarStyleLarge"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_marginBottom="8dp"
            android:indeterminate="false" />

        <ProgressBar
            android:id="@+id/defaultSmallProgressBar"
            style="?android:attr/progressBarStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_marginBottom="8dp"
            android:indeterminate="false"
            android:visibility="gone" />

</FrameLayout>

When I include it in some of my other layouts at the end of the xml files like this

  <include
        android:id="@+id/progressBar"
        layout="@layout/progress_bar"
        android:background="#80ffffff"
        android:visibility="gone" />

The progress_bar takes up the entire screen and completely overlays on the other view without any transparency at all.

I have tried this and other recommendations from other SO questions, non work.

These dont work

  • android:background="@android:color/transparent"
  • convertView.setBackgroundColor(Color.TRANSPARENT);
Siddharth
  • 9,349
  • 16
  • 86
  • 148

0 Answers0