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

Starting time #4

Closed
FunnyDevs opened this issue Oct 12, 2015 · 4 comments
Closed

Starting time #4

FunnyDevs opened this issue Oct 12, 2015 · 4 comments

Comments

@FunnyDevs
Copy link

Is possibile to choose when to start the sensor listening (and so the panning)???

@justasm
Copy link
Owner

justasm commented Oct 12, 2015

Not out of the box for the moment.

You could subclass WindowView as follows:

public class ManualWindowView extends WindowView {
    // .. standard constructors

    public void startTracking(){
        sensor.startTracking(getSensorSamplingPeriod());
    }

    public void stopTracking(){
        sensor.stopTracking();
    }
}

and then control it as such, although it is clearly not ideal as it would still be active by default.

@justasm
Copy link
Owner

justasm commented Oct 12, 2015

Adding more options for controlling this is not difficult and I could do so in a future version. Pull requests are of course also welcome!

I can see offering the following options:

  • tilt tracking starts / stops automatically (keep current behavior as default);
  • tilt tracking is off by default, and you call e.g. WindowView#startTiltTracking() to start (or stop) at your leisure;
  • tilt tracking is off by default, and you call e.g. WindowView#startTiltTracking(TiltSensor) to start (or stop) at your leisure, supplying a TiltSensor that you manage manually; this would allow you to optimize if using many WindowViews by using only one TiltSensor.

Do you agree that these options would cover the majority of use cases, or am I missing something?

@FunnyDevs
Copy link
Author

Yes, i think these option cover a lot of use case! The second options are useful when user has to add some animations to the windowsview and prefers to start tilting after animation ends.
The second instead, as you said, to use multiple windowview

@justasm
Copy link
Owner

justasm commented Jun 18, 2016

The aforementioned options are now available in the 0.2.0 release.

Refer to TiltSensorMode or the documentation for wwv_tilt_sensor_mode in the README for details.

@justasm justasm closed this as completed Jun 18, 2016
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

No branches or pull requests

2 participants