Page 1 of 1

Darker Brightness

Posted: 20 Feb 2020 07:20
by Yam
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!

Re: Darker Brightness

Posted: 20 Feb 2020 21:10
by Pepy
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.

Re: Darker Brightness

Posted: 20 Feb 2020 23:14
by Yam
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!