示例#1
0
        public override void ViewDidLoad( )
        {
            base.ViewDidLoad( );

            OrientationState = -1;

            UIScrollView                   = new CustomScrollView( );
            UIScrollView.Interceptor       = this;
            UIScrollView.Frame             = View.Frame;
            UIScrollView.BackgroundColor   = Rock.Mobile.UI.Util.GetUIColor(0x1C1C1CFF);
            UIScrollView.Delegate          = new NavBarRevealHelperDelegate(Task.NavToolbar);
            UIScrollView.Layer.AnchorPoint = new CGPoint(0, 0);

            UITapGestureRecognizer tapGesture = new UITapGestureRecognizer( );

            tapGesture.NumberOfTapsRequired = 2;
            tapGesture.AddTarget(this, new ObjCRuntime.Selector("DoubleTapSelector:"));
            UIScrollView.AddGestureRecognizer(tapGesture);

            View.BackgroundColor = UIScrollView.BackgroundColor;
            View.AddSubview(UIScrollView);

            // add a busy indicator
            Indicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.White);
            UIScrollView.AddSubview(Indicator);

            // add a refresh button for debugging
            RefreshButton = UIButton.FromType(UIButtonType.System);
            RefreshButton.SetTitle("Refresh", UIControlState.Normal);
            RefreshButton.SizeToFit( );

            // if they tap the refresh button, refresh the list
            RefreshButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                DeleteNote( );

                PrepareCreateNotes(0, true);
            };

            ResultView = new UIResultView(UIScrollView, View.Frame.ToRectF( ), OnResultViewDone);

            ResultView.Hide( );

            // setup the tutorial overlay
            TutorialBacker = new UIView( );
            TutorialBacker.Layer.AnchorPoint = CGPoint.Empty;
            TutorialBacker.Alpha             = 0.00f;
            TutorialBacker.BackgroundColor   = UIColor.Black;
            TutorialBacker.Hidden            = true;
            View.AddSubview(TutorialBacker);

            AnimatingTutorial = false;
            TutorialOverlay   = new UIImageView( );
            TutorialOverlay.Layer.AnchorPoint = CGPoint.Empty;
            TutorialOverlay.Frame             = View.Frame;
            TutorialOverlay.Alpha             = 0.00f;
            View.AddSubview(TutorialOverlay);

            KeyboardAdjustManager = new Rock.Mobile.PlatformSpecific.iOS.UI.KeyboardAdjustManager(View);
        }
        public override void ViewDidLoad( )
        {
            base.ViewDidLoad( );

            OrientationState = -1;

            UIScrollView = new CustomScrollView();
            UIScrollView.Interceptor = this;
            UIScrollView.Frame = View.Frame;
            UIScrollView.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor( 0x1C1C1CFF );
            UIScrollView.Delegate = new NavBarRevealHelperDelegate( Task.NavToolbar );
            UIScrollView.Layer.AnchorPoint = new CGPoint( 0, 0 );

            UITapGestureRecognizer tapGesture = new UITapGestureRecognizer();
            tapGesture.NumberOfTapsRequired = 2;
            tapGesture.AddTarget( this, new ObjCRuntime.Selector( "DoubleTapSelector:" ) );
            UIScrollView.AddGestureRecognizer( tapGesture );

            View.BackgroundColor = UIScrollView.BackgroundColor;
            View.AddSubview( UIScrollView );

            // add a busy indicator
            Indicator = new UIActivityIndicatorView( UIActivityIndicatorViewStyle.White );
            UIScrollView.AddSubview( Indicator );

            // add a refresh button for debugging
            RefreshButton = UIButton.FromType( UIButtonType.System );
            RefreshButton.SetTitle( "Refresh", UIControlState.Normal );
            RefreshButton.SizeToFit( );

            // if they tap the refresh button, refresh the list
            RefreshButton.TouchUpInside += (object sender, EventArgs e ) =>
            {
                DeleteNote( );

                PrepareCreateNotes( 0, true );
            };
            
            ResultView = new UIResultView( UIScrollView, View.Frame.ToRectF( ), OnResultViewDone );

            ResultView.Hide( );

            // setup the tutorial overlay
            TutorialBacker = new UIView( );
            TutorialBacker.Layer.AnchorPoint = CGPoint.Empty;
            TutorialBacker.Alpha = 0.00f;
            TutorialBacker.BackgroundColor = UIColor.Black;
            TutorialBacker.Hidden = true;
            View.AddSubview( TutorialBacker );

            AnimatingTutorial = false;
            TutorialOverlay = new UIImageView( );
            TutorialOverlay.Layer.AnchorPoint = CGPoint.Empty;
            TutorialOverlay.Frame = View.Frame;
            TutorialOverlay.Alpha = 0.00f;
            View.AddSubview( TutorialOverlay );

            KeyboardAdjustManager = new Rock.Mobile.PlatformSpecific.iOS.UI.KeyboardAdjustManager( View );
        }