コード例 #1
0
 public void OnBackClicked(View view)
 {
     if (!FragmentHelper.BackToPreviousFragment(this))
     {
         Finish();
     }
 }
コード例 #2
0
        public void OnAddAnchorClicked(View view)
        {
            var placementFragment = new AnchorPlacementFragment();

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

            watcherFragment.CloudAnchorManager = cloudAnchorManager;
            watcherFragment.OnAnchorDiscovered = OnAnchorDiscovered;
            FragmentHelper.PushFragment(this, watcherFragment);
        }
コード例 #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();
     });
 }
コード例 #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);
        }
コード例 #7
0
        private void StartWatcher()
        {
            if (CloudAnchorManager.LocatingAnchors)
            {
                FragmentHelper.BackToPreviousFragment(Activity);
            }

            watcher = CloudAnchorManager.StartLocating(new AnchorLocateCriteria
            {
                NearDevice = new NearDeviceCriteria
                {
                    DistanceInMeters = 8.0f,
                    MaxResultCount   = 25
                }
            });
        }
コード例 #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());
        }
コード例 #9
0
 void IOnClickListener.OnClick(View view)
 {
     FragmentHelper.BackToPreviousFragment(Activity);
 }
コード例 #10
0
 private void OnLocateAnchorsCompleted(
     object sender,
     LocateAnchorsCompletedEvent locateAnchorsCompletedEvent)
 {
     FragmentHelper.BackToPreviousFragment(Activity);
 }
コード例 #11
0
 public void OnAnchorCreated(AnchorVisual createdAnchor)
 {
     createdAnchor.SetColor(this, Android.Graphics.Color.Green);
     FragmentHelper.BackToPreviousFragment(this);
 }