This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Android.Content.Res; | |
using System.Resources; | |
using System.IO; | |
using Android.Content; | |
using Android.App; | |
namespace AndroidSandbox | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ensures the shake is strong enough on at least two axes before declaring it a shake. | |
// "Strong enough" means "greater than a client-supplied threshold" in G's. | |
static BOOL L0AccelerationIsShaking(UIAcceleration* last, UIAcceleration* current, double threshold) { | |
double | |
deltaX = fabs(last.x - current.x), | |
deltaY = fabs(last.y - current.y), | |
deltaZ = fabs(last.z - current.z); | |
return | |
(deltaX > threshold && deltaY > threshold) || |
NewerOlder