Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

GH-143 Change compass to event based. #144

Merged
merged 5 commits into from
Apr 2, 2018

Conversation

jamesmontemagno
Copy link
Collaborator

Description of Change

Makes API for compass event based.

Bugs Fixed

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Updated documentation (see walkthrough)

@jamesmontemagno jamesmontemagno added the awaiting-review This PR needs to have a set of eyes on it label Mar 30, 2018
@jamesmontemagno jamesmontemagno added DO-NOT-MERGE Don't merge it.... don't do it! and removed awaiting-review This PR needs to have a set of eyes on it labels Mar 30, 2018
@jamesmontemagno jamesmontemagno added awaiting-review This PR needs to have a set of eyes on it and removed DO-NOT-MERGE Don't merge it.... don't do it! labels Apr 2, 2018
internal static void PlatformStart(SensorSpeed sensorSpeed, Action<CompassData> handler)
static SensorListener listener;
static Sensor magnetometer;
static Sensor accelerometer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we dispose/null these out when they are no longer needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so they are shared system wide and if you dispose them out then they will effect other listeners from my testing :(

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well actually.... maybe if we only allow one at a time.... let me see here. Will need to see if you can do both compass and others at the same time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it could get ugly, but could we track/count the # of listeners we have and dispose if 0?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we use a weak reference? This way we leave it up the Androids?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#resolved

@jamesmontemagno jamesmontemagno merged commit b1870aa into master Apr 2, 2018
@jamesmontemagno jamesmontemagno deleted the feature/compass-events branch April 2, 2018 18:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting-review This PR needs to have a set of eyes on it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants