Darker Brightness

Share and discuss your flows and ideas with other users.

Moderator: Martin

Post Reply
User avatar
Yam
Posts: 54
Joined: 23 Nov 2019 09:07

Darker Brightness

Post by Yam » 20 Feb 2020 07:20

Heyo!

The main purpose of this flow is about getting screen resolutions for widgets.
I have tried to make this flow work on all device resolutions, I apologize if it does not work for you. (Im Running S9+)


Download here:
http://automagic4android.com/flow.php?i ... bd8d90c44b

When the brightness is under 50% it will apply a transparent filter which gets darker as you adjust brightness levels lower

Hope it helps with the eyestrain!
Every life altering decision you have made, has lead to you reading this.

Pepy
Posts: 76
Joined: 31 Oct 2018 10:53
Location: Canada

Re: Darker Brightness

Post by Pepy » 20 Feb 2020 21:10

Thanks for sharing the flow!

Using your overlay, I'll try to find a way to dim the screen even further once the brightness goes below minimum like all those screen filter apps do.

I unfortunately didn't have that system variable, so I found an alternative (and perhaps more reliable) way to get the screen resolution:

Code: Select all

windowService = getJavaStaticField( "android.content.Context", "WINDOW_SERVICE" );
displayMetrics = callJavaConstructor( "android.util.DisplayMetrics", "DisplayMetrics()" );

windowManager = callJavaMethod( getContext(), "android.content.Context", "getSystemService (java.lang.String)", windowService );
display = callJavaMethod( windowManager, "android.view.WindowManager", "getDefaultDisplay()" );
callJavaMethod( display, "android.view.Display", "getRealMetrics( android.util.DisplayMetrics )", displayMetrics );

width = getJavaField( displayMetrics, "android.util.DisplayMetrics", "widthPixels" );
height = getJavaField( displayMetrics, "android.util.DisplayMetrics", "heightPixels" );
Martin said he'll be adding an option to display over navigation and status bar in next update. For now, if it's in immersive mode, it will still be covered.
Last edited by Pepy on 09 Mar 2020 20:28, edited 2 times in total.
Hope my post was helpful :D
Device: OnePlus 5T running crDroid, rooted with Magisk 8-)

User avatar
Yam
Posts: 54
Joined: 23 Nov 2019 09:07

Re: Darker Brightness

Post by Yam » 20 Feb 2020 23:14

Fantastic stuff ~ yeah that's kinda a bummer, i was reading a post about Martin possibly implimenting something back in 2017, but that's alright :)

Thanks for the feedback!
Every life altering decision you have made, has lead to you reading this.

Post Reply