7 package com.google.appinventor.components.runtime;
16 import android.content.Context;
17 import android.hardware.Sensor;
18 import android.hardware.SensorEvent;
19 import android.hardware.SensorEventListener;
20 import android.hardware.SensorManager;
30 @DesignerComponent(version = YaVersion.LIGHTSENSOR_COMPONENT_VERSION,
31 description =
"A sensor component that can measure the light level.",
32 category = ComponentCategory.SENSORS,
34 iconName =
"images/lightsensor.png")
37 private static final int BUFFER_SIZE = 10;
45 super(container.
$form(), Sensor.TYPE_LIGHT, BUFFER_SIZE);
58 @
SimpleEvent(description =
"Called when a change is detected in the light level.")
69 @
SimpleProperty(description =
"The most recent light level, in lux, if the sensor is available " +
81 @
SimpleProperty(description =
"The average of the 10 most recent light levels measured, in lux.")