Exemplo n.º 1
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    base.OnCreateView( inflater, container, savedInstanceState );

                    // get the root control from our .axml
                    var layout = inflater.Inflate(Resource.Layout.Notes, container, false) as RelativeLayout;

                    // get the refresh button from the layout
                    RefreshButton = layout.FindViewById<Button>( Resource.Id.refreshButton );

                    // create our overridden lockable scroll view
                    ScrollView = new LockableScrollView( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    ScrollView.ScrollBarStyle = ScrollbarStyles.InsideInset;
                    ScrollView.OverScrollMode = OverScrollMode.Always;
                    ScrollView.VerticalScrollbarPosition = ScrollbarPosition.Default;
                    ScrollView.LayoutParameters = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
                    ScrollView.Notes = this;
                    ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.CenterHorizontal);
                    ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.Below, Resource.Id.refreshButton);

                    // add it to our main layout.
                    layout.AddView( ScrollView );

                    Indicator = layout.FindViewById<ProgressBar>( Resource.Id.progressBar );
                    Indicator.Visibility = ViewStates.Gone;
                    Indicator.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( 0 ) );
                    Indicator.BringToFront();

                    // create the layout that will contain the notes
                    ScrollViewLayout = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    ScrollView.AddView( ScrollViewLayout );
                    ScrollViewLayout.SetOnTouchListener( this );

                    RefreshButton.Click += (object sender, EventArgs e ) =>
                    {
                        DeleteNote( );

                        PrepareCreateNotes(  );
                    };

                    // if the refresh button isn't enabled, hide it
                    if ( App.Shared.Network.RockGeneralData.Instance.Data.DeveloperModeEnabled == false )
                    {
                        RefreshButton.Visibility = ViewStates.Gone;
                    }

                    // get our power management control
                    PowerManager pm = PowerManager.FromContext( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    WakeLock = pm.NewWakeLock(WakeLockFlags.Full, "Notes");

                    ResultView = new UIResultView( layout, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), OnResultViewDone );

                    ResultView.Hide( );

                    // setup the tutorial overlay
                    TutorialBacker = new View( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    TutorialBacker.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent );
                    TutorialBacker.Alpha = 0;
                    TutorialBacker.SetBackgroundColor( Android.Graphics.Color.Black );
                    layout.AddView( TutorialBacker );

                    AnimatingTutorial = false;
                    TutorialOverlay = new ImageView( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    TutorialOverlay.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent );
                    ((RelativeLayout.LayoutParams)TutorialOverlay.LayoutParameters ).AddRule( LayoutRules.CenterInParent );
                    TutorialOverlay.Alpha = 0;
                    TutorialOverlay.SetBackgroundColor( Android.Graphics.Color.Transparent );
                    layout.AddView( TutorialOverlay );

                    NavBarRevealTracker = new NavBarReveal( );

                    return layout;
                }
Exemplo n.º 2
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    base.OnCreateView(inflater, container, savedInstanceState);

                    // get the root control from our .axml
                    var layout = inflater.Inflate(Resource.Layout.Notes, container, false) as RelativeLayout;

                    // get the refresh button from the layout
                    RefreshButton = layout.FindViewById <Button>(Resource.Id.refreshButton);

                    // create our overridden lockable scroll view
                    ScrollView = new LockableScrollView(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    ScrollView.ScrollBarStyle            = ScrollbarStyles.InsideInset;
                    ScrollView.OverScrollMode            = OverScrollMode.Always;
                    ScrollView.VerticalScrollbarPosition = ScrollbarPosition.Default;
                    ScrollView.LayoutParameters          = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
                    ScrollView.OnTouchIntercept          = OnInterceptTouchEvent;
                    ScrollView.OnChangedScroll           = OnScrollChanged;
                    ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.CenterHorizontal);
                    ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.Below, Resource.Id.refreshButton);

                    // add it to our main layout.
                    layout.AddView(ScrollView);

                    Indicator            = layout.FindViewById <ProgressBar>(Resource.Id.progressBar);
                    Indicator.Visibility = ViewStates.Gone;
                    Indicator.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(0));
                    Indicator.BringToFront();

                    // create the layout that will contain the notes
                    ScrollViewLayout = new RelativeLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    ScrollView.AddView(ScrollViewLayout);
                    ScrollViewLayout.SetOnTouchListener(this);

                    RefreshButton.Click += (object sender, EventArgs e) =>
                    {
                        DeleteNote( );

                        PrepareCreateNotes(  );
                    };

                    // if the refresh button isn't enabled, hide it
                    if (MobileApp.Shared.Network.RockLaunchData.Instance.Data.DeveloperModeEnabled == false)
                    {
                        RefreshButton.Visibility = ViewStates.Gone;
                    }

                    // get our power management control
                    PowerManager pm = PowerManager.FromContext(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                    WakeLock = pm.NewWakeLock(WakeLockFlags.Full, "Notes");

                    ResultView = new UIResultView(layout, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels), OnResultViewDone);

                    ResultView.Hide( );

                    // setup the tutorial overlay
                    TutorialBacker = new View(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    TutorialBacker.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                    TutorialBacker.Alpha            = 0;
                    TutorialBacker.SetBackgroundColor(Android.Graphics.Color.Black);
                    layout.AddView(TutorialBacker);

                    AnimatingTutorial = false;
                    TutorialOverlay   = new ImageView(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    TutorialOverlay.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
                    ((RelativeLayout.LayoutParams)TutorialOverlay.LayoutParameters).AddRule(LayoutRules.CenterInParent);
                    TutorialOverlay.Alpha = 0;
                    TutorialOverlay.SetBackgroundColor(Android.Graphics.Color.Transparent);
                    layout.AddView(TutorialOverlay);

                    NavBarRevealTracker = new NavBarReveal( );

                    return(layout);
                }