Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Brightness Screen Filter

Does anyone have an idea how to implement an Brightness Screen Filter like the one here:

http://www.appbrain.com/app/screen-filter/com.haxor

I need a starting point and I can't figure out how to do it.

like image 768
Alex Avatar asked Nov 26 '10 14:11

Alex


People also ask

Is there a way to lower brightness even more?

There are many apps out there designed to turn your Android's screen brightness down even further. A couple of options are the Lower Brightness Screen Filter app and the Screen Filter app. Both of these have the option of lowering your screen brightness from zero to 100%.

Is there an app to make my screen brighter?

Velis Auto Brightness Velis is a replacement for Android's default auto-brightness feature without all of the other bells and whistles that come with other brightness management apps. The learning curve for Velis is slightly steep, but that's because it gives you maximum control over what you can do.


1 Answers

Just make a transparent full screen activity that lets touches pass through. To make touches pass through use the following Window flags before setting the contentView:

@Override
public void onCreate(Bundle savedInstanceState)
{
  super.onCreate(savedInstanceState);
  Window window = getWindow();

  // Let touches go through to apps/activities underneath.
  window.addFlags(FLAG_NOT_TOUCHABLE);

  // Now set up content view
  setContentView(R.layout.main);
}

For your main.xml layout file just use a full screen LinearLayout with a transparent background:

<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/background"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="#33000000">
</LinearLayout>

Then to adjust the "brightness" just change the value of the background colour from your code somewhere:

findViewById(R.id.background).setBackgroundColor(0x66000000);
like image 86
pheelicks Avatar answered Oct 16 '22 20:10

pheelicks