aeyrium-sensor icon indicating copy to clipboard operation
aeyrium-sensor copied to clipboard

Update the Android sensor code.

Open slightfoot opened this issue 7 years ago • 5 comments

This still requires similar changes on iOS.

slightfoot avatar Oct 05 '18 16:10 slightfoot

We'll wait until we complete the iOS changes. Thanks @slightfoot

diegoveloper avatar Oct 05 '18 21:10 diegoveloper

I was testing the PR, looks like there is an issue related with the lowPassFilter, this is a basic example to reproduce the issue :

class _RotationLayoutState extends State<RotationLayout> {
  StreamSubscription<dynamic> _streamSubscriptions;
  double rotation = 0.0;

  @override
  void dispose() {
    _streamSubscriptions?.cancel();
    super.dispose();
  }

  @override
  void initState() {
    _streamSubscriptions =
        AeyriumSensor.sensorEvents.listen((SensorEvent event) {
      setState(() {
        rotation = -event.roll;
      });
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Transform.rotate(
      angle: rotation,
      child: Center(
        child: Container(
          width: 250.0,
          height: 200.0,
          color: Colors.red,
        ),
      ),
    );
  }

When the device is rotated there are some glitches which doesn't happen without using the lowPassFilter.

@slightfoot

diegoveloper avatar Nov 14 '18 20:11 diegoveloper

Ah good to find out the cause of the glitches. Me and @scotts2017 will look into it further and update the PR when we can.

slightfoot avatar Nov 16 '18 12:11 slightfoot

@slightfoot Any plans to resume work on this?

RyanRamchandar avatar Aug 16 '20 07:08 RyanRamchandar

@slightfoot Any plans to resume work on this?

lovemory avatar Mar 28 '21 07:03 lovemory