Commit 794cce90 authored by Karishma Chadha's avatar Karishma Chadha

Final verison

parent 8fb4fe27
...@@ -171,7 +171,7 @@ public class YaVersion { ...@@ -171,7 +171,7 @@ public class YaVersion {
// For YOUNG_ANDROID_VERSION 55: // For YOUNG_ANDROID_VERSION 55:
// - ACCELEROMETERSENSOR_COMPONENT_VERSION was incremented to 2. // - ACCELEROMETERSENSOR_COMPONENT_VERSION was incremented to 2.
public static final int YOUNG_ANDROID_VERSION = 54; public static final int YOUNG_ANDROID_VERSION = 55;
// ............................... Blocks Language Version Number ............................... // ............................... Blocks Language Version Number ...............................
......
...@@ -109,7 +109,7 @@ public class AccelerometerSensor extends AndroidNonvisibleComponent ...@@ -109,7 +109,7 @@ public class AccelerometerSensor extends AndroidNonvisibleComponent
sensorManager = (SensorManager) container.$context().getSystemService(Context.SENSOR_SERVICE); sensorManager = (SensorManager) container.$context().getSystemService(Context.SENSOR_SERVICE);
accelerometerSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); accelerometerSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
startListening(); startListening();
MinimumInterval(300); MinimumInterval(400);
} }
/** /**
...@@ -134,7 +134,7 @@ public class AccelerometerSensor extends AndroidNonvisibleComponent ...@@ -134,7 +134,7 @@ public class AccelerometerSensor extends AndroidNonvisibleComponent
* @param interval minimum interval in ms * @param interval minimum interval in ms
*/ */
@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_NON_NEGATIVE_INTEGER, @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_NON_NEGATIVE_INTEGER,
defaultValue = "300") defaultValue = "400") //Default value derived by trial of 12 people on 3 different devices
@SimpleProperty @SimpleProperty
public void MinimumInterval(int interval) { public void MinimumInterval(int interval) {
MinimumInterval = interval; MinimumInterval = interval;
......
...@@ -138,6 +138,20 @@ ...@@ -138,6 +138,20 @@
<dd> <dd>
Acceleration in the Z-dimension. Acceleration in the Z-dimension.
</dd> </dd>
<dt>
<code class="c2">
MinimumInterval
</code>
</dt>
<dd>
Minimum time interval between phone shakes.
<br/>
You may want to change the time interval depending on the activity you want to perform when the phone is shaken.
For example, you may want the phone to say "Stop shaking me" each time the user shakes the phone. At shorter time intervals, this
will produce an unwanted echo effect.
In another case, you may want a quick flick of the phone to be considered a single shake and perhaps increment a
counter each time the phone shakes. In cases such as this, a shorter time interval will be more appropriate to properly count the shakes.
</dd>
</dl> </dl>
<h3> <h3>
Events Events
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment