示例#1
0
        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);
            }
        }
示例#2
0
        public CompassRenderer(IMvxService service) : base(service)
        {
            try
            {
                _onChangedListener = new OnChangedListener(this);

                var inflater = LayoutInflater.From((Service)service);
                _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);
            }
            catch (Exception e)
            {
                Log.Debug("Exception", e.Message);
                Log.Debug("Exception", e.InnerException.Message);
            }
        }