Adil Bhatty
Adil Bhatty

Reputation: 17340

Remove Custom Progress Dialog borders

I have created a custom progress dialog drawables.

 <style name="MyTheme" parent="@android:style/Theme.Dialog">
        <item name="android:alertDialogStyle">@style/CustomAlertDialogStyle</item>
        <item name="android:textColorPrimary">#ABCDEF</item>
        <item name="android:textColor"> @color/heading</item>
        <item name="android:background">#00000000</item>
         <item name="android:windowFrame">@null</item>

    </style>

    <style name="CustomAlertDialogStyle">
         <item name="android:background">#00000000</item>
      <item name="android:windowFrame">@null</item>
        <item name="android:bottomBright">@color/grey</item>
        <item name="android:bottomDark">@color/grey</item>
        <item name="android:bottomMedium">@color/grey</item>
        <item name="android:centerBright">@color/grey</item>
        <item name="android:centerDark">@color/grey</item>
        <item name="android:centerMedium">@color/grey</item>
        <item name="android:fullBright">@color/grey</item>
        <item name="android:fullDark">@color/grey</item>
        <item name="android:topBright">@color/grey</item>
        <item name="android:topDark">@color/grey</item>
    </style>

Everything is working fine, its showing the things as it should. But dialog is showing borders. I want to remove those borders [screen shot attached].

enter image description here

Upvotes: 0

Views: 1623

Answers (2)

waqaslam
waqaslam

Reputation: 68167

You need to add the following to your CustomAlertDialogStyle too:

<item name="android:windowBackground">@android:color/transparent</item>

Upvotes: 2

mrsus
mrsus

Reputation: 5486

use dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);

Upvotes: 4

Related Questions