示例#1
0
        //It's just for testing so don't yell at me
        private IEnumerator PresentTest()
        {
            yield return(new WaitForSeconds(1));

            TestViewController testViewController = BeatSaberUI.CreateViewController <TestViewController>();

            Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().First().InvokeMethod("PresentViewController", new object[] { testViewController, null, false });
        }
示例#2
0
        //It's just for testing so don't yell at me
        private IEnumerator PresentTest()
        {
            yield return(new WaitForSeconds(1));

            TestViewController testViewController = BeatSaberUI.CreateViewController <TestViewController>();
            //FloatingScreen.FloatingScreen floatingScreen = FloatingScreen.FloatingScreen.CreateFloatingScreen(new Vector2(400, 200), true, Vector3.zero, Quaternion.identity);
            //floatingScreen.SetRootViewController(testViewController, ViewController.AnimationType.None);
            //Resources.FindObjectsOfTypeAll<MainFlowCoordinator>().First().InvokeMethod<object, FlowCoordinator>("PresentViewController", new object[] { testViewController, null, ViewController.AnimationDirection.Horizontal, false });
        }
示例#3
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            viewController            = new TestViewController();
            window.RootViewController = viewController;
            window.MakeKeyAndVisible();

            suspendHelper.FinishedLaunching(app, options);
            return(true);
        }
示例#4
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method

            var rootViewController = new TestViewController();

            Window = new UIWindow(UIScreen.MainScreen.Bounds)
            {
                RootViewController = rootViewController
            };

            Window?.MakeKeyAndVisible();

            return(true);
        }
        public void FromVisualFormat()
        {
            if (!TestRuntime.CheckSystemAndSDKVersion(7, 0))
            {
                Assert.Ignore("Ignoring FromVisualFormat tests: Requires iOS7+");
            }

            using (var testViewController = new TestViewController()) {
                var constraints = NSLayoutConstraint.FromVisualFormat("V:|[topLayoutGuide]-[firstLabel]-[secondLabel]",
                                                                      NSLayoutFormatOptions.DirectionLeadingToTrailing,
                                                                      "topLayoutGuide", testViewController.TopLayoutGuide,
                                                                      "firstLabel", testViewController.FirstLabel,
                                                                      "secondLabel", testViewController.SecondLabel
                                                                      );

                const int expectedNumberOfConstraints = 3;

                Assert.That(constraints != null,
                            "'NSLayoutConstraint.FromVisualFormat' method returned no constraints");

                Assert.That(constraints.Length, Is.EqualTo(expectedNumberOfConstraints),
                            string.Format("Expected number of constraints is {0}. Actual number is {1}", expectedNumberOfConstraints, constraints.Length));

                Assert.That(constraints [0].FirstItem.Handle == testViewController.TopLayoutGuide.Handle,
                            "First item of constraints[0] is not testViewController.TopLayoutGuide");
                Assert.That(constraints [0].SecondItem == testViewController.View,
                            "Second item of constraints[0] is not testViewController.View");
                Assert.That(constraints [0].Relation == NSLayoutRelation.Equal,
                            string.Format("Relation between views of constraints[0] must be `NSLayoutRelation.Equal`. Actual realtion is {0}", constraints [0].Relation));

                Assert.That(constraints [1].FirstItem == testViewController.FirstLabel,
                            "First item of constraints[1] is not testViewController.FirstLabel");
                Assert.That(constraints [1].SecondItem.Handle == testViewController.TopLayoutGuide.Handle,
                            "Second item of constraints[1] is not testViewController.TopLayoutGuide");
                Assert.That(constraints [1].Relation == NSLayoutRelation.Equal,
                            string.Format("Relation between views of constraints[1] must be `NSLayoutRelation.Equal`. Actual realtion is {0}", constraints [1].Relation));

                Assert.That(constraints [2].FirstItem == testViewController.SecondLabel,
                            "First item of constraints[2] is not testViewController.SecondLabel");
                Assert.That(constraints [2].SecondItem == testViewController.FirstLabel,
                            "Second item of constraints[2] is not testViewController.FirstLabel");
                Assert.That(constraints [2].Relation == NSLayoutRelation.Equal,
                            string.Format("Relation between views of constraints[2] must be `NSLayoutRelation.Equal`. Actual realtion is {0}", constraints [2].Relation));
            }
        }
示例#6
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // NB: GrossHackAlertTiem™:
            //
            // Monotouch appears to not load assemblies when you request them
            // via Type.GetType, unlike every other platform (even
            // Xamarin.Android). So, we've got to manually do what RxUI and
            // Akavache would normally do for us
            var r = RxApp.MutableResolver;

            (new ReactiveUI.Cocoa.Registrations()).Register((f, t) => r.Register(f, t));
            (new ReactiveUI.Mobile.Registrations()).Register((f, t) => r.Register(f, t));
            (new Akavache.Registrations()).Register(r.Register);
            (new Akavache.Mobile.Registrations()).Register(r.Register);
            (new Akavache.Sqlite3.Registrations()).Register(r.Register);

            window = new UIWindow(UIScreen.MainScreen.Bounds);

            viewController            = new TestViewController();
            window.RootViewController = viewController;
            window.MakeKeyAndVisible();

            return(true);
        }