Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Android sensor code. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

slightfoot
Copy link

This still requires similar changes on iOS.

@diegoveloper
Copy link
Contributor

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

@diegoveloper
Copy link
Contributor

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

@slightfoot
Copy link
Author

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.

@RyanRamchandar
Copy link

@slightfoot Any plans to resume work on this?

1 similar comment
@lovemory
Copy link

@slightfoot Any plans to resume work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants