Exemplo n.º 1
0
 public void OnBackClicked(View view)
 {
     if (!FragmentHelper.BackToPreviousFragment(this))
     {
         Finish();
     }
 }
Exemplo n.º 2
0
        public void OnAddAnchorClicked(View view)
        {
            var placementFragment = new AnchorPlacementFragment();

            placementFragment.OnAnchorPlaced = OnAnchorPlaced;
            FragmentHelper.PushFragment(this, placementFragment);
        }
Exemplo n.º 3
0
 public override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     if (CloudAnchorManager == null)
     {
         FragmentHelper.BackToPreviousFragment(Activity);
     }
 }
Exemplo n.º 4
0
        public void OnStartWatcherClicked(View view)
        {
            WatcherFragment watcherFragment = new WatcherFragment();

            watcherFragment.CloudAnchorManager = cloudAnchorManager;
            watcherFragment.OnAnchorDiscovered = OnAnchorDiscovered;
            FragmentHelper.PushFragment(this, watcherFragment);
        }
Exemplo n.º 5
0
 public void OnAnchorCreationFailed(AnchorVisual placedAnchor, string errorMessage)
 {
     placedAnchor.Destroy();
     FragmentHelper.BackToPreviousFragment(this);
     RunOnUiThread(() =>
     {
         string toastMessage = "Failed to save anchor: " + errorMessage;
         Toast.MakeText(this, toastMessage, ToastLength.Long).Show();
     });
 }
Exemplo n.º 6
0
        public void OnAnchorPlaced(AnchorVisual placedAnchor)
        {
            var creationFragment = new AnchorCreationFragment();

            creationFragment.OnAnchorCreated        = OnAnchorCreated;
            creationFragment.OnAnchorCreationFailed = OnAnchorCreationFailed;
            creationFragment.CloudAnchorManager     = cloudAnchorManager;
            creationFragment.PlacedVisual           = placedAnchor;
            FragmentHelper.BackToPreviousFragment(this);
            FragmentHelper.PushFragment(this, creationFragment);
        }
Exemplo n.º 7
0
        private void StartWatcher()
        {
            if (CloudAnchorManager.LocatingAnchors)
            {
                FragmentHelper.BackToPreviousFragment(Activity);
            }

            watcher = CloudAnchorManager.StartLocating(new AnchorLocateCriteria
            {
                NearDevice = new NearDeviceCriteria
                {
                    DistanceInMeters = 8.0f,
                    MaxResultCount   = 25
                }
            });
        }
Exemplo n.º 8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_coarse_reloc);

            arFragment = (ArFragment)SupportFragmentManager.FindFragmentById(Resource.Id.ar_fragment);
            sceneView  = arFragment.ArSceneView;

            sensorStatusView = FindViewById <SensorStatusView>(Resource.Id.sensor_status);

            Scene scene = sceneView.Scene;

            scene.Update += (_, args) =>
            {
                // Pass frames to Spatial Anchors for processing.
                cloudAnchorManager?.Update(sceneView.ArFrame);
                sensorStatusView.Update();
            };

            FragmentHelper.ReplaceFragment(this, new ActionSelectionFragment());
        }
Exemplo n.º 9
0
 void IOnClickListener.OnClick(View view)
 {
     FragmentHelper.BackToPreviousFragment(Activity);
 }
Exemplo n.º 10
0
 private void OnLocateAnchorsCompleted(
     object sender,
     LocateAnchorsCompletedEvent locateAnchorsCompletedEvent)
 {
     FragmentHelper.BackToPreviousFragment(Activity);
 }
Exemplo n.º 11
0
 public void OnAnchorCreated(AnchorVisual createdAnchor)
 {
     createdAnchor.SetColor(this, Android.Graphics.Color.Green);
     FragmentHelper.BackToPreviousFragment(this);
 }