ProgressDialog Background Activity Fade Out Animation

I am creating a custom ProgressDialog and would like the background activity to accelerate and become more bleak than the default. The only problem is I don’t know where to look for the animation that handles the attenuation for the ProgressDialog. I have worked my way upstream from ProgressDialog -> AlertDialog -> Dialog, but can't see anything in java that looks useful. I assume that there is an animation .xml file that controls it, so I'm looking for this file and how the calling program uses it.

Just to be a little clearer, the animation I'm talking about is when the ProgressDialog appears, the previous active action disappears before dark. I want to get control over this animation.

+4
source share
1 answer

The only thing I can change to change the background is the android: backgroundDimEnabled and android: backgroundDimAmount settings (to fully enable / disable background dimming and to control the amount of background dimming, respectively)

To change these values, create (or edit) the res / values ​​/ styles.xml file with the following

<?xml version="1.0" encoding="utf-8"?> <resources> <style name="Theme.ControlledDim" parent="android:Theme"> <item name="android:backgroundDimAmount">0.2</item> </style> </resources> 

And apply this theme in the activity manifest by setting the theme to

@ style / Theme.ControlledDim

This may not provide as much control as you want, but hopefully a step in the right direction.

(The default value for android: backgroundDimAmount is 0.6)

+2
source

Source: https://habr.com/ru/post/1345266/


All Articles