public CompassRenderer( Context context, OrientationManager orientationManager, Landmarks landmarks) { _orientationManager = orientationManager; _landmarks = landmarks; try { _renderingCallbackWrapper = new RenderingCallbackWrapper(this); _onChangedListener = new OnChangedListener(this); var inflater = LayoutInflater.From(context); _layout = (FrameLayout)inflater.Inflate(Resource.Layout.compass, null); _layout.SetWillNotDraw(false); _compassView = (CompassView)_layout.FindViewById(Resource.Id.compass); _tipsContainer = (RelativeLayout)_layout.FindViewById(Resource.Id.tips_container); _tipsView = (TextView) _layout.FindViewById(Resource.Id.tips_view); _compassView.OrientationManager = _orientationManager; } catch (Exception e) { Log.Debug("Exception", e.Message); } }
public void OnOrientationChanged(OrientationManager orientationManager) { _compassView.Heading = _orientationManager.Heading; var oldTooSteep = _tooSteep; _tooSteep = Math.Abs(_orientationManager.Pitch) > TOO_STEEP_PITCH_DEGREES; if (_tooSteep != oldTooSteep) { updateTipsView(); } }
public override void OnCreate() { base.OnCreate(); _speech = new TextToSpeech(this, this); _orientationManager = new OrientationManager( this.getSensorManager(), this.getLocationManager()); _landmarks = new Landmarks(this); }
public void OnAccuracyChanged(OrientationManager orientationManager) { _callback.OnAccuracyChanged(orientationManager); }
public void OnLocationChanged(OrientationManager orientationManager) { _callback.OnLocationChanged(orientationManager); }
public OnChangedListener(OrientationManager.IOnChangedListener callback) { _callback = callback; }
public override void OnDestroy() { _speech.Shutdown(); _speech = null; _orientationManager = null; _landmarks = null; base.OnDestroy(); }
public override void OnCreate() { base.OnCreate(); _speech = new TextToSpeech(this, this); _orientationManager = new OrientationManager( this.getSensorManager(), this.getLocationManager()); _landmarks = new Landmarks(AndroidResourceReader.read(this, Resource.Raw.landmarks)); }
public void OnLocationChanged(OrientationManager orientationManager) { var location = _orientationManager.Location; var places = _landmarks.getNearbyLandmarks(location.Latitude, location.Longitude); _compassView.NearbyPlaces = places; }
public void OnAccuracyChanged(OrientationManager orientationManager) { _interference = _orientationManager.HasInterference; updateTipsView(); }