I
I
irve2017-07-04 22:38:15
css
irve, 2017-07-04 22:38:15

How to detect power saving mode on MIUI, Android devices?

Hello, I noticed that in Android 6 on MIUI (xiaomi redmi) devices (I think in Android 7 too) power saving mode is not detected.
Now I do it like this:

PowerManager powerManager = (PowerManager) getActivity().getSystemService(Context.POWER_SERVICE);
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && powerManager.isPowerSaveMode())
{
    //power saving mode
}

Maybe I'm doing it wrong?
How can I detect power saving mode on MIUI devices?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Flying, 2018-12-17
@Evanre

The first one is a radial gradient from something like rgba(0,0,0,0.25)to transparenton :afterwith half of the element stuffed under the main one.
The second - :beforeand :afterwith shadows, a small rotate transform left / right and "pushing" under the main element + apparently :afterfrom some additional element to draw the central part of the shadow. True, in the second case it is better that the background under the element is uniform, and the shadows are opaque. otherwise there will be visible artifacts at their intersections.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question