FORUMS
Remove All Ads from XDA
Win Honor 9 Lite

[MOD][Xposed][4.0.3+] Screen Filter (v1.5.2)

109 posts
Thanks Meter: 392
 
By tony78960, Senior Member on 2nd October 2014, 05:56 PM
Post Reply Email Thread
Screen Filter


This mod puts a transparent view on top of the window manager in order to darken the whole screen.

Once activated, the mod adds a toolbox below the header of your expanded status bar where you can easily switch ON or OFF the filter and set its transparency using the seek bar (only if the filter is active).
A settings activity is also available to control the filter and other settings (such as tuning or hiding the toolbox).

Screen Filter is mostly designed to lower you screen's luminosity and allow you to use your device in the dark without killing your eyes, but you can also use it as a screen privacy guard!
Also, on AMOLED screens, reducing the luminosity improves your battery's lifetime!


Features
  • Darken the whole screen, including: soft keys (nav bar), toasts, cpu info (*)
  • While activated, the filter does not trigger Android's security against overlays (like preventing you from installing new apps) (*)
  • Filter's transparency and color are customizable
  • Add a toolbox in the extended statusbar (you can disable it in the settings activity)
  • Tasker/Locale integration
  • Transparency range can be changed (but the minimum cannot go under 15 in order to avoid completely black screen)
  • Works for both phone and tablet layouts
(*) contrary to most "user level" screen filters on the market

Screenshots

Filter demo
The number you can see in the toggle button while the filter is enabled is the current value of the alpha layer (max range: 15 to 255).

Settings activity & tasker plugin integration
Screen Filter has a settings activity and is recognized as a plugin in Tasker.


Requirements
  • You need the Xposed framework installed (and working, of course).
  • Screen Filter works with ICS (4.0.3), JB, KK and Lollipop
  • Should work well on any AOSP based ROM
  • May work on some stock ROM, please report your result (good or bad) if you give a try!

Don't forget to read the troubleshooting section in the next post!


XDA:DevDB Information
Screen Filter, Xposed for all devices (see above for details)

Contributors
tony78960
Xposed Package Name: com.tonymanou.screenfilter

Version Information
Status: Stable
Current Stable Version: 1.5.2
Stable Release Date: 2015-02-22

Created 2014-10-02
Last Updated 2015-02-22
Attached Thumbnails
Click image for larger version

Name:	activity_toolbox.jpg
Views:	110494
Size:	77.3 KB
ID:	3044689  
Attached Images
File Type: jpg phone_4_4.jpg - [Click for QR Code] (23.1 KB, 233370 views)
File Type: jpg activity_and_tasker.jpg - [Click for QR Code] (30.9 KB, 21021 views)
The Following 79 Users Say Thank You to tony78960 For This Useful Post: [ View ] Gift tony78960 Ad-Free
 
 
2nd October 2014, 05:56 PM |#2  
tony78960's Avatar
OP Senior Member
Thanks Meter: 392
 
Donate to Me
More
Automation

It is possible to control Screen Filter via intents, here is how the magic works:

There are three different intent actions:
  • com.tonymanou.screenfilter.action.DISABLE
  • com.tonymanou.screenfilter.action.ENABLE
  • com.tonymanou.screenfilter.action.TOGGLE
With each of these actions, you can choose which filter you want to control by setting one or both of the following extras:
  • FILTER_DIM
    Valid values for 'selected' are: "1" (int), "true" (boolean) or no value (null string).
    Valid values for 'unselected' are: "0" (int), "false" (boolean) or just don't use this extra.
  • FILTER_COLOR
    Valid values for 'selected' are: "1" (int), "true" (boolean) or no value (null string).
    Valid values for 'unselected' are: "0" (int), "false" (boolean) or just don't use this extra.
In the case of ENABLE and TOGGLE actions, you can change the value of the filters with the following extras:
  • TRANSPARENCY
    Valid values are 8 bit unsigned integers within the transparency interval you set, between 5 and 255.
    Works only if FILTER_DIM is selected and if the darkening filter is getting enabled.
  • COLOR
    Valid values are 32 bit signed integers in base 10 representing the ARGB color (hexadecimal string not supported yet).
    Works only if FILTER_COLOR is selected and if the color filter is getting enabled.
Note: if both FILTER_DIM and FILTER_COLOR are unselected or if they are not given, only the darkening filter is affected by the action and TRANSPARENCY is skipped.

For instance, using the command-line:
  • adb shell am broadcast -a com.tonymanou.screenfilter.action.TOGGLE
    Toggles the darkening filter.
  • adb shell am broadcast -a com.tonymanou.screenfilter.action.ENABLE --ez FILTER_DIM true --ei TRANSPARENCY 125
    Enables the darkening filter at the transparency 125.
  • adb shell am broadcast -a com.tonymanou.screenfilter.action.ENABLE --ei FILTER_COLOR 1 --ei COLOR 792333838
    Enables the color filter at the color #2F3A0E0E (792333838 = 0x2F3A0E0E).
  • But...
    adb shell am broadcast -a com.tonymanou.screenfilter.action.DISABLE --ei FILTER_COLOR 0
    Will disable the darkening filter /!\

Screen Filter is also provides shortcuts and is recognized as a plugin in Locale/Tasker.
Here is how the "linked filters" option works:

Not linked:
  • darkening enabled, color enabled
    --> darkening is disabled, color is disabled
  • darkening enabled, color disabled
    --> darkening is disabled, color is enabled & color updated
  • darkening disabled, color enabled
    --> darkening is enabled & transparency updated, color is disabled
  • darkening disabled, color disabled
    --> darkening is enabled & transparency updated, color is enabled & color updated
Linked:
  • darkening enabled, color enabled
    --> darkening is disabled, color is disabled
  • darkening enabled, color disabled
    --> darkening is disabled
  • darkening disabled, color enabled
    --> darkening is enabled & transparency updated, color is updated
  • darkening disabled, color disabled
    --> darkening is enabled & transparency updated, color is enabled & color updated


Testing

  • AOSP based
    Successfully tested on:
    • Android emulator 4.0.3
    • Genymotion 4.1.1 / 4.3 / 4.4.2
    • CM 11 (KK 4.4.4)
    Reported working on:
    • CM 10.2 (JB 4.3.1) on GT-i8190 [post]
    • CM 9 (ICS 4.0.4) on LG Optimus L3 [post]
  • Stock
    Reported working on:
    • Omni Rom on Galaxy R [post] and Galaxy S3 (GT-I9300) [post]
    • Samy Deluxe Pick Your King 4.4.2 on Galaxy S4 (GTI9505) [post]
    • Stock 4.3 MK2 baseband on Galaxy S4 (SCH-R970 USCC) [post]
    • Stock 4.4 rooted on Galaxy Note 2 [post]
    • Crash ROM (17.1) on Galaxy Note 3 (N9005) [post]
    • Stock TouchWiz 4.4.2 on Galaxy Note 3 (SM-N9005) [post] and on Note Pro 12.2 (SM-P905) [post]
    • CloudyG3 (KitKat) on LG G2 [post]
    • Stock rooted ROM on T-Mobile LG G3 [post]
    • Stock 4.4.2 (version 183.46.15) on RAZR HD [post]
    • Stock 4.4.2 on Moto G (XT1032) [post]
    • Carbon Rom 4.4.4 on Galaxy S4 mini [post]
    • KitKat Google Edition on Galaxy S4 [post]
    • Stock 4.4.4 on Nexus 5 [post]
    • Stock Sony 4.4.4 on Xperia Z (C6603) [post]
    • Stock 4.2.1 on Cubot One [post]
    • . . .

If you get problems after installation, check in the following section if the bug is already known. If not, then read the Troubleshooting section.


Known bugs
  • Screen-off animation (like electron beam / CRT effect) is not affected by the filter
  • As you can see in the first post, screenshots are affected by the filter
  • Quick settings disappear when the toolbox is visible on Stock Sense 6 (HTC One m7 and m8)
  • Stock ROM where SystemUI addon is not loaded:
    • Stock 4.4.2 on Elephone P10c
    • Stock 4.4.2 on i9500
    • Stock 4.4.2 on Micromax A106
    • Neat rom 4.1.2 on SGS2

Troubleshooting

In case you set the filter too dark and you can't see anything on your screen, just reboot your device.

After installation or update of the module, you must reboot your device to get the latest changes fully loaded.

If it does not work even after reboot:
  • first, check if Xposed is working and if the module is activated in the Xposed Installer,
  • then, post in the thread indicating your ROM and attaching:
    • your last Xposed error log (the /data/data/de.robv.android.xposed.installer/log/error.log file)
    • and your SystemUI.apk (should be located in /system/app or /system/priv-app)
    Thanks!

To-do list
  • Toolbox customization:
    • Hide the toolbox from notification panel or quick settings independently
    • Choose location (top/bottom)
    • Change the height
    • Double tap on the icon to open settings activity
    • Full toolbox customization:
      • Change items location
      • Ability to make the button transparent or replace it by a grey(off)/white(on) image
      • Ability to add shortcuts to some values
  • Filter improvements:
    • Let the user create different settings (color + transparency)
    • Filter pattern [post] [post]
    • Darkening filter using an image [post]
    • Filter blending using multiply instead of addition (?)
    • Allow unfiltered screenshots (?)
  • Other ways to toggle the filter:
    • Notification with ^ and v buttons
    • Overlay control [post]
  • Automation:
    • Auto enable at device startup
    • Auto enable depending on application context
    • Auto enable depending on the time and/or battery level
  • Other:
    • Make the project open-source
    • Llama integration (locale changer)
    • Make use of the luminosity sensor
The Following 17 Users Say Thank You to tony78960 For This Useful Post: [ View ] Gift tony78960 Ad-Free
2nd October 2014, 05:56 PM |#3  
tony78960's Avatar
OP Senior Member
Thanks Meter: 392
 
Donate to Me
More
Download

You can download Screen Filter from the Xposed repository.


Translations

Strings are available on GitHub, translators are welcome to contribute!
Don't forget to read the "Translations" section in the README.


Changelog

v1.5.2 - Feb 22, 2015
-- Lollipop support with SELinux set to permissive (no toolbox)
-- Fixed transparency value display in the toolbox
-- Better exception handling in module initialization
-- Updated Simplified Chinese and Slovak translations

v1.5.1 - Feb 18, 2015 (removed)
-- Probable Lollipop support (not tested)
-- Replaced third-party color picker by custom implementation
-- Added ability to edit values in color picker
-- Merged temperature picker and color picker
-- Fixed crash when using shortcuts or Locale/Tasker plugin if the filter service is not found
-- Added debug option: dump view hierarchy of the notification area
-- Updated French, Russian, Simplified Chinese & Slovak translations
v1.5 - Jan 26, 2015
-- Draft customizable toolbox
---- Ability to tint the toolbox
---- More to come...
-- Long-press on the color button to choose a color temperature (in Kelvin)
-- Added warning message about hardware button backlight
-- Changed notification icon
-- Another potential fix for the hole left in system UI in some cases when the toolbox is hidden
-- Fixed value editing in Locale/Tasker plugin (value was not restored)
-- Updated French, Japanese, Russian, Slovak & Spanish translations
v1.4.2 - Jan 11, 2015
-- Color filter's opacity is now independent from its color
-- Implemented shortcuts to toggle filters
---- can be used "like a widget" on the desktop
---- thanks to GravityBox, can be used as a quick setting tile
-- Added translator's name in About
-- Fixed Screen Filter plugin not showing in Locale
-- Potential fix for the hole left in system UI in some cases when the toolbox is hidden
-- Updated French, Russian & Slovak translations
-- Fixed Spanish translation
v1.4.1 - Dec 23, 2014
-- Updated Locale/Tasker plugin in order to support color filter control
-- Added simple intents to control filters
-- Fixed FC in activity
-- Fixed bugs occurring at screen rotation
-- Prevent full flat colored filter (capped max opacity, fully transparent at first launch)
-- Lowered the minimum transparent limit to 5, use it wisely!
-- Updated French, Simplified Chinese & Slovak translations
v1.4 - Dec 02, 2014
-- Refreshed UI: filter settings are separated from global settings
-- Color filter is now independent from darkening filter
-- Added ability to hide toolbox when the filter is disabled
-- Added help dialog
-- Changed the behavior of "change default" buttons, !!! read the help dialog !!!
-- Many other internal changes, bug-fixes and improvements
-- Added Russian translation
-- Updated French, Japanese, Spanish translations
v1.3.3 beta - Nov 18, 2014
-- Added ability to choose the color of the filter
---- Choose a dark color, otherwise it will brighten the screen!
-- Improved the readability of transparency range values in the range dialog
-- Updated Dutch, French, Simplified Chinese, Slovak & Spanish translations
v1.3.2 - Oct 31, 2014
-- Added ability to disable hardware button backlight when the filter is active
-- Added debug button to dump display list in logcat
-- Fixed transparency setting that was sometimes reset when sliding the seekbar
v1.3.1 - Oct 28, 2014
-- Added "toggle" action in Tasker/Locale plugin
-- Added more internal checks to avoid wrong transparency
-- Seekbar is now movable even if the filter is disabled
-- Long-press on the icon of the toolbox opens the settings activity
-- Long-press on the toggle button in the toolbox enables the filter and sets it to the default level
-- Long-press on the "Change" button in settings activity reset the transparency to default value (but does not enable the filter)
-- Updated Dutch, Slovak and Traditional Chinese translations
v1.3 - Oct 25, 2014
-- Added Locale/Tasker support
-- Added ability to change min and max transparency
-- Refactored toolbox injection system
-- Added more error checks and fixed minor bugs
-- Debug log enabled by default
-- Updated French, Japanese, Slovak and Spanish translations
-- Added Simplified & Traditional Chinese translations
v1.2 - Oct 12, 2014
-- Added ability to change default transparency
-- Added ability to enable debug log (disabled by default)
-- Updated Japanese translation
-- Added Chinese translation
-- Code cleaning and small bugfixes
v1.1.6 beta - Oct 11, 2014
-- Heavy code restructuring to allow the filter to work even if the toolbox cannot be injected into SystemUI
-- Added Dutch, Japanese and Slovak translations
v1.1.5 beta - Oct 09, 2014
-- Fixed wrong cast exception introduced in 1.1.4
v1.1.4 beta - Oct 09, 2014 (removed)
-- Added Spanish and Turkish translations
-- Experimental support for Gemini status bar
v1.1.3 beta - Oct 09, 2014
-- Fixed AOSP support that was broken in 1.1.2
v1.1.2 beta - Oct 09, 2014 (removed)
-- Output more debug log
-- Potential fix for stock Sony ROMs
-- Added support for JB tablet layout (statusbar at the bottom of the screen)
v1.1.1 beta - Oct 07, 2014
-- Reduced service setup constraint (SystemUI is reloaded many times on some ROM like Spirit ROM)
v1.1 - Oct 05, 2014
-- Added settings activity to control the filter
-- Ability to show/hide toolbox
-- Ability to make toolbox's background transparent
-- Added French translation
v1.0.1 - Oct 02, 2014
-- Better ICS support
v1.0 - Oct 02, 2014 (not released)
-- Headless Xposed module that puts filter's settings under the expanded statusbar's header

The Following 8 Users Say Thank You to tony78960 For This Useful Post: [ View ] Gift tony78960 Ad-Free
2nd October 2014, 06:12 PM |#4  
PunchUp's Avatar
Senior Member
Thanks Meter: 2,899
 
More
Would it be possible to make this open source?
2nd October 2014, 06:41 PM |#5  
Rom's Avatar
Senior Member
Flag Lyon
Thanks Meter: 669
 
Donate to Me
More
Thanks but i don't get to do transparancy setting, help me please..
2nd October 2014, 06:43 PM |#6  
mauam's Avatar
Senior Member
Thanks Meter: 10,762
 
More
Been looking for this for a long time. Working flawless on CM11, keep it up
The Following 2 Users Say Thank You to mauam For This Useful Post: [ View ] Gift mauam Ad-Free
2nd October 2014, 06:44 PM |#7  
tony78960's Avatar
OP Senior Member
Thanks Meter: 392
 
Donate to Me
More
Quote:
Originally Posted by PünchUp

Would it be possible to make this open source?

Yes, very probably!
But first I need to find a suitable license and clean up my source tree a bit...
The Following 3 Users Say Thank You to tony78960 For This Useful Post: [ View ] Gift tony78960 Ad-Free
2nd October 2014, 07:00 PM |#8  
tony78960's Avatar
OP Senior Member
Thanks Meter: 392
 
Donate to Me
More
Quote:
Originally Posted by Rom

Thanks but i don't get to do transparancy setting, help me please..

According to your signature you are using CM 10.1, right? It should work like a charm...
It may not interfere but did you enable PowerWidgets in the expanded statusbar?

Are you using some Xposed modules that act on the statusbar?
Do you have any error log in the Xposed installer's "Log" tab?
Dumb question: did you reboot you device after enabling Screen Filter in the Xposed installer?
The Following User Says Thank You to tony78960 For This Useful Post: [ View ] Gift tony78960 Ad-Free
2nd October 2014, 07:11 PM |#9  
Rom's Avatar
Senior Member
Flag Lyon
Thanks Meter: 669
 
Donate to Me
More
Quote:
Originally Posted by tony78960

According to your signature you are using CM 10.1, right? It should work like a charm...
It may not interfere but did you enable PowerWidgets in the expanded statusbar?

Are you using some Xposed modules that act on the statusbar?
Do you have any error log in the Xposed installer's "Log" tab?
Dumb question: did you reboot you device after enabling Screen Filter in the Xposed installer?

I am on CM 10.2, yes i have other modules that act on statubar like XBlast Tools, Gravitybox, check my log in attachment

Edit: And i have reboot my device I can look it:
Attached Files
File Type: rar error.rar - [Click for QR Code] (5.4 KB, 319 views)
2nd October 2014, 07:29 PM |#10  
tony78960's Avatar
OP Senior Member
Thanks Meter: 392
 
Donate to Me
More
Quote:
Originally Posted by Rom

I am on CM 10.2, yes i have other modules that act on statubar like XBlast Tools, Gravitybox, check my log in attachment

Edit: And i have reboot my device I can look it:

Nice!
Most of the errors in your logs are thrown by AlternateAppPicker, LiveIcons and GravityBox. Maybe you should warn the developers of these modules...

Looking at you screenshot I added the following point in my to-do list: "Ability to change the background of filter's settings"
The Following 2 Users Say Thank You to tony78960 For This Useful Post: [ View ] Gift tony78960 Ad-Free
2nd October 2014, 07:35 PM |#11  
Rom's Avatar
Senior Member
Flag Lyon
Thanks Meter: 669
 
Donate to Me
More
Quote:
Originally Posted by tony78960

Nice!
Most of the errors in your logs are thrown by AlternateAppPicker, LiveIcons and GravityBox. Maybe you should warn the developers of these modules...

Looking at you screenshot I added the following point in my to-do list: "Ability to change the background of filter's settings"

Thank you very much, i will tell authors of these addons

Can you explain me how to change transparancy settings ?

Thanks.
Post Reply Subscribe to Thread

Tags
aosp, brightness, screen filter, xposed

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes