titanium-sdk icon indicating copy to clipboard operation
titanium-sdk copied to clipboard

feat(android): add headingTime, fix headingFilter

Open m1ga opened this issue 3 years ago • 3 comments

JIRA: https://jira.appcelerator.org/browse/[TICKET] todo

Provide a clear PR title prefixed with [TICKET]

Optional Description:

The current compass heading has a default 250ms waiting interval. Since I didn't want to remove it I'll added a parameter to change it. Changing it to < 100 will result in a smoother update interval.

This PR also fixes headingFilter so it will work on Android now.

Ti.Geolocation.headingTime = 100;
Ti.Geolocation.headingFilter = 2;

Ti.Geolocation.addEventListener('heading', function(e) {
  if (e.error) {
  	return;
  }
  console.log(e.heading.magneticHeading);
});

full example and JIRA ticket will be added soon

m1ga avatar Jun 24 '21 15:06 m1ga

Fails
:no_entry_sign:

:microscope: There are library changes, but no changes to the unit tests. That's OK as long as you're refactoring existing code, but will require an admin to merge this PR. Please see README.md#unit-tests for docs on unit testing.

Warnings
:warning:

Commit 03cdcadd264d9d6a688fb699782ad981e5c4f014 has a message "apidoc" giving 2 errors:

  • subject may not be empty
  • type may not be empty
:warning:

:mag: Can't find junit reports at ./junit.*.xml, skipping generating JUnit Report.

:warning: There is no linked JIRA ticket in the PR body. Please include the URL of the relevant JIRA ticket. If you need to, you may file a ticket on JIRA
Messages
:book:

:rotating_light: This PR has one or more commits with warnings/errors for commit messages not matching our configuration. You may want to squash merge this PR and edit the message to match our conventions, or ask the original developer to modify their history.

:book: :tada: Another contribution from our awesome community member, m1ga! Thanks again for helping us make Titanium SDK better. :thumbsup:

Generated by :no_entry_sign: dangerJS against 03cdcadd264d9d6a688fb699782ad981e5c4f014

build avatar Jun 24 '21 15:06 build

@m1ga , just to let you know, when you target the upcoming Android 12, an exception will be thrown if you set the interval less than 200 milliseconds... unless you add the new HIGH_SAMPLING_RATE_SENSORS permission to the manifest. https://developer.android.com/about/versions/12/behavior-changes-12#motion-sensor-rate-limiting

jquick-axway avatar Jun 24 '21 16:06 jquick-axway

@jquick-axway Thanks for the info! I've added it to the apidoc

m1ga avatar Jun 24 '21 17:06 m1ga