Ejemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var stuff = this.GetBeaconAndRegion();

            _beacon = stuff.Item1;
            _region = stuff.Item2;

            ActionBar.SetDisplayHomeAsUpEnabled(true);
            SetContentView(Resource.Layout.distance_view);
            _dotView = FindViewById(Resource.Id.dot);

            _sonar = FindViewById(Resource.Id.sonar);
            _sonar.ViewTreeObserver.AddOnGlobalLayoutListener(this);

            _findBeacon              = new FindSpecificBeacon(this);
            _findBeacon.BeaconFound += (sender, e) => RunOnUiThread(() =>
            {
                Log.Debug(Tag, "Found the beacon!");
                if (_segmentLength == -1)
                {
                    return;
                }
                _dotView.Animate().TranslationY(ComputeDotPosY(e.FoundBeacon)).Start();
            });
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Tuple<Beacon, Region> stuff = this.GetBeaconAndRegion();
            _beacon = stuff.Item1;
            _region = stuff.Item2;

            ActionBar.SetDisplayHomeAsUpEnabled(true);
            SetContentView(Resource.Layout.distance_view);
            _dotView = FindViewById(Resource.Id.dot);

            _sonar = FindViewById(Resource.Id.sonar);
            _sonar.ViewTreeObserver.AddOnGlobalLayoutListener(this);

            _findBeacon = new FindSpecificBeacon(this);
            _findBeacon.BeaconFound += (sender, e) => RunOnUiThread(() =>{
                                                                        Log.Debug(Tag, "Found the beacon!");
                                                                        if (_segmentLength == -1)
                                                                        {
                                                                            return;
                                                                        }
                                                                        _dotView.Animate().TranslationY(ComputeDotPosY(e.FoundBeacon)).Start();
                                                                    });
        }