Skip to content

PietroGranati/brightness

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Brightness Module

Description

Module to control the bright of Android device.

Accessing the Brightness Module

To access this module from JavaScript, you would do the following:

var bright = require("com.apaladini.brightness");

The bright variable is a reference to the Module object.

Functions

getSystemBrightLevel

Return a float value (0-1) of current system bright level

setSystemBrightLevel

Set a float value (0-1) to system bright level

getWindowBrightLevel (Android only)

Return a float value (0-1) of current window bright level

setWindowBrightLevel (Android only)

Set a float value (0-1) to window bright level

Info

On Android, to use "setSystemBrightLevel", your app need permission to write on system settings. To do this, edit your tiapp.xml and insert this:

<android xmlns:android="http://schemas.android.com/apk/res/android">
    <manifest>
        <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
    </manifest>
</android>

Usage

See sample code

Author

Adriano Paladini

About

Control the brightness of your device on Titanium

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 55.4%
  • Java 18.0%
  • JavaScript 17.6%
  • Objective-C 9.0%