public ConnectTask( string storyboardName ) : base( storyboardName ) { MainPageVC = Storyboard.InstantiateViewController( "ConnectMainPageViewController" ) as TaskUIViewController; MainPageVC.Task = this; ActiveViewController = MainPageVC; }
public override void WillShowViewController(TaskUIViewController viewController) { base.WillShowViewController( viewController ); // turn off the share & create buttons NavToolbar.SetShareButtonEnabled( false, null ); NavToolbar.SetCreateButtonEnabled( false, null ); // if it's the main page, nide the nav toolbar if ( viewController == MainPageVC ) { NavToolbar.Reveal( false ); } // if it's the group finder, force the nav toolbar to always show else if ( viewController as GroupFinderViewController != null ) { NavToolbar.Reveal( true ); } // otherwise, as long as it IS NOT the webView, do the standard 3 seconds else if ( viewController as TaskWebViewController == null ) { //NavToolbar.RevealForTime( 3.0f ); NavToolbar.Reveal( true ); } }
public override void WillShowViewController(TaskUIViewController viewController) { base.WillShowViewController( viewController ); // if it's the main page, disable the back button on the toolbar if ( viewController == MainPage ) { NavToolbar.SetShareButtonEnabled( false, null ); NavToolbar.SetCreateButtonEnabled( true, null ); NavToolbar.Reveal( true ); } else { NavToolbar.SetShareButtonEnabled( false, null ); NavToolbar.SetCreateButtonEnabled( false, null ); // if we're showing the post controller, don't reveal the nav bar, // as nothing should be allowed while posting. if ( viewController as Prayer_PostUIViewController == null ) { //NavToolbar.RevealForTime( 3.0f ); NavToolbar.Reveal( true ); } } }
public GiveTask(string storyboardName) : base(storyboardName) { MainPageVC = Storyboard.InstantiateViewController("MainPageViewController") as TaskUIViewController; MainPageVC.Task = this; ActiveViewController = MainPageVC; }
public override void TouchesEnded(TaskUIViewController taskUIViewController, NSSet touches, UIEvent evt) { base.TouchesEnded(taskUIViewController, touches, evt); // if they touched a dead area, reveal the nav toolbar again. //NavToolbar.RevealForTime( 3.0f ); }
public void RowClicked(int rowIndex) { if (rowIndex > -1) { ConnectLink linkEntry = null; // is this a getEngaged row? if (rowIndex < GetEngagedEntries.Count) { linkEntry = GetEngagedEntries[rowIndex]; } // did they pick something valid? if (linkEntry != null) { // GroupFinder is unique in that it doesn't use a webView. if (linkEntry.Title == ConnectStrings.Main_Connect_GroupFinder) { TaskUIViewController viewController = Storyboard.InstantiateViewController("GroupFinderViewController") as TaskUIViewController; Task.PerformSegue(this, viewController); } else { TaskWebViewController.HandleUrl(false, true, linkEntry.Url, Task, this, false, false, false); } } } }
/// <summary> /// Called when the task is going away so another task can be interacted with. /// Allows it to undo any work done in MakeActive. /// Ex: Notes might RE-enable the phone's sleep. /// This is NOT called when the application goes into the background. /// </summary> public virtual void MakeInActive( ) { // always clear our parent view controller when going inactive ActiveViewController = null; ParentViewController = null; NavToolbar = null; }
public override void WillShowViewController(TaskUIViewController viewController) { base.WillShowViewController(viewController); // if it's the main page, disable the back button on the toolbar if (viewController == MainPage) { NavToolbar.SetShareButtonEnabled(false, null); NavToolbar.SetCreateButtonEnabled(true, null); NavToolbar.Reveal(true); } else { NavToolbar.SetShareButtonEnabled(false, null); NavToolbar.SetCreateButtonEnabled(false, null); // if we're showing the post controller, don't reveal the nav bar, // as nothing should be allowed while posting. if (viewController as Prayer_PostUIViewController == null) { //NavToolbar.RevealForTime( 3.0f ); NavToolbar.Reveal(true); } } }
public override void WillShowViewController(TaskUIViewController viewController) { base.WillShowViewController(viewController); // turn off the share & create buttons NavToolbar.SetShareButtonEnabled(false, null); NavToolbar.SetCreateButtonEnabled(false, null); // if it's the main page, nide the nav toolbar if (viewController == MainPageVC) { NavToolbar.Reveal(false); } // if it's the group finder, force the nav toolbar to always show else if (viewController as GroupFinderViewController != null) { NavToolbar.Reveal(true); } // otherwise, as long as it IS NOT the webView, do the standard 3 seconds else if (viewController as TaskWebViewController == null) { //NavToolbar.RevealForTime( 3.0f ); NavToolbar.Reveal(true); } }
public override void WillShowViewController(TaskUIViewController viewController) { base.WillShowViewController( viewController ); // turn off the share & create buttons NavToolbar.SetShareButtonEnabled( false, null ); NavToolbar.SetCreateButtonEnabled( false, null ); NavToolbar.Reveal( false ); }
public override void WillShowViewController(TaskUIViewController viewController) { base.WillShowViewController(viewController); // if we're coming from WebView or Notes and going to something else, // force the device back to portrait // if the notes are active, make sure the share button gets turned on if ((viewController as NotesViewController) != null) { // Let the view controller manage this being enabled, because // it's conditional on being in landscape or not. NavToolbar.SetCreateButtonEnabled(false, null); NavToolbar.SetShareButtonEnabled(true, delegate { (viewController as NotesViewController).ShareNotes( ); }); // go ahead and show the bar, because we're at the top of the page. NavToolbar.Reveal(true); } else if ((viewController as NotesWatchUIViewController) != null) { // Let the view controller manage this being enabled, because // it's conditional on being in landscape or not. NavToolbar.SetCreateButtonEnabled(false, null); NavToolbar.SetShareButtonEnabled(true, delegate { (viewController as NotesWatchUIViewController).ShareVideo( ); }); } else if ((viewController as NotesDetailsUIViewController) != null) { NavToolbar.SetCreateButtonEnabled(false, null); NavToolbar.SetShareButtonEnabled(false, null); //NavToolbar.RevealForTime( 3.0f ); NavToolbar.Reveal(true); } else if ((viewController as NotesMainUIViewController) != null) { NavToolbar.SetCreateButtonEnabled(false, null); NavToolbar.SetShareButtonEnabled(false, null); NavToolbar.Reveal(false); } else if ((viewController as TaskWebViewController) != null) { NavToolbar.SetCreateButtonEnabled(false, null); NavToolbar.SetShareButtonEnabled(false, null); } else if ((viewController as BiblePassageViewController) != null) { NavToolbar.SetCreateButtonEnabled(false, null); NavToolbar.SetShareButtonEnabled(false, null); } }
public override void WillShowViewController(TaskUIViewController viewController) { base.WillShowViewController(viewController); // turn off the back, share & create buttons NavToolbar.SetBackButtonEnabled(false); NavToolbar.SetShareButtonEnabled(false, null); NavToolbar.SetCreateButtonEnabled(false, null); NavToolbar.Reveal(true); }
public override void TouchesEnded(TaskUIViewController taskUIViewController, NSSet touches, UIEvent evt) { base.TouchesEnded(taskUIViewController, touches, evt); // if they're not on the main page or the webView if (ActiveViewController != MainPageVC && (ActiveViewController as TaskWebViewController) == null) { // let a dead space tap reveal the toolbar //NavToolbar.RevealForTime( 3.0f ); } }
public override void TouchesEnded(TaskUIViewController taskUIViewController, NSSet touches, UIEvent evt) { base.TouchesEnded(taskUIViewController, touches, evt); // if they're not on the main page or the webView if ( ActiveViewController != MainPageVC && ( ActiveViewController as TaskWebViewController ) == null ) { // let a dead space tap reveal the toolbar //NavToolbar.RevealForTime( 3.0f ); } }
/// <summary> /// Called when a new view controller is shown by the parent navigation controller. /// This is useful so the task can evaluate what viewcontroller was just shown /// and update itself or the toolbar accordingly. /// It is ALWAYS called, whether a view controller is being pushed, or revealed because the stack is being popped. /// </summary> /// <param name="viewController">View controller.</param> public virtual void WillShowViewController(TaskUIViewController viewController) { ActiveViewController = viewController; // ensure this controller has the parent task viewController.Task = this; // and that it knows what its dimensions can be. viewController.View.Bounds = ContainerBounds; viewController.LayoutChanged( ); }
/// <summary> /// The root function to call when changing view controllers within a task. If changing in code, /// directly call this from the view controller. If using a storyboard, hook the segue to TaskTransition /// in ContainerViewController.cs, which will cause this function to be called. /// </summary> /// <param name="sourceViewController">Source view controller.</param> /// <param name="destinationViewController">Destination view controller.</param> public void PerformSegue(UIViewController sourceViewController, UIViewController destinationViewController, bool animated = true) { // take this opportunity to give the presenting view controller a pointer to the active task // so it can receive callbacks. TaskUIViewController viewController = destinationViewController as TaskUIViewController; if (viewController == null) { throw new InvalidCastException("View Controllers used by Activities must be of type TaskUIViewController"); } ParentViewController.PushViewController(destinationViewController, animated); }
public override void WillShowViewController(TaskUIViewController viewController) { base.WillShowViewController( viewController ); // if we're coming from WebView or Notes and going to something else, // force the device back to portrait // if the notes are active, make sure the share button gets turned on if ( ( viewController as NotesViewController ) != null ) { // Let the view controller manage this being enabled, because // it's conditional on being in landscape or not. NavToolbar.SetCreateButtonEnabled( false, null ); NavToolbar.SetShareButtonEnabled( true, delegate { ( viewController as NotesViewController ).ShareNotes( ); } ); // go ahead and show the bar, because we're at the top of the page. NavToolbar.Reveal( true ); } else if ( ( viewController as NotesWatchUIViewController ) != null ) { // Let the view controller manage this being enabled, because // it's conditional on being in landscape or not. NavToolbar.SetCreateButtonEnabled( false, null ); NavToolbar.SetShareButtonEnabled( true, delegate { ( viewController as NotesWatchUIViewController ).ShareVideo( ); } ); } else if ( ( viewController as NotesDetailsUIViewController ) != null ) { NavToolbar.SetCreateButtonEnabled( false, null ); NavToolbar.SetShareButtonEnabled( false, null ); //NavToolbar.RevealForTime( 3.0f ); NavToolbar.Reveal( true ); } else if ( ( viewController as NotesMainUIViewController ) != null ) { NavToolbar.SetCreateButtonEnabled( false, null ); NavToolbar.SetShareButtonEnabled( false, null ); NavToolbar.Reveal( false ); } else if ( ( viewController as TaskWebViewController ) != null ) { NavToolbar.SetCreateButtonEnabled( false, null ); NavToolbar.SetShareButtonEnabled( false, null ); } }
public override void MakeActive( TaskUINavigationController parentViewController, NavToolbar navToolbar, CGRect containerBounds ) { base.MakeActive( parentViewController, navToolbar, containerBounds ); MainPageVC = new TaskUIViewController(); MainPageVC.Task = this; MainPageVC.View.Bounds = containerBounds; // set our current page as root parentViewController.PushViewController(MainPageVC, false); // and immediately handle the URL TaskWebViewController.HandleUrl( false, true, AboutConfig.Url, this, MainPageVC, false, false ); }
public override void MakeActive(TaskUINavigationController parentViewController, NavToolbar navToolbar, CGRect containerBounds) { base.MakeActive(parentViewController, navToolbar, containerBounds); MainPageVC = new TaskUIViewController(); MainPageVC.Task = this; MainPageVC.View.Bounds = containerBounds; // set our current page as root parentViewController.PushViewController(MainPageVC, false); // and immediately handle the URL string fullUrl = Rock.Mobile.Util.Strings.Parsers.AddParamToURL(AboutConfig.Url, string.Format(PrivateGeneralConfig.RockCampusContext, MobileApp.Shared.Network.RockMobileUser.Instance.GetRelevantCampus( ))); TaskWebViewController.HandleUrl(false, true, fullUrl, this, MainPageVC, false, true, false, false); }
public override void WillShowViewController(TaskUIViewController viewController) { base.WillShowViewController(viewController); // turn off the share & create buttons NavToolbar.SetShareButtonEnabled(false, null); NavToolbar.SetCreateButtonEnabled(false, null); // if it's the main page, disable the back button on the toolbar if (viewController == MainPageVC) { NavToolbar.Reveal(false); } else if (viewController as TaskWebViewController == null) { NavToolbar.Reveal(true); } }
public override void TouchesEnded(TaskUIViewController taskUIViewController, NSSet touches, UIEvent evt) { base.TouchesEnded(taskUIViewController, touches, evt); // immediately hide the toolbar on the main page if (ActiveViewController == MainViewController) { NavToolbar.Reveal(false); } // allow it as long as it's the watch window in portrait mode or landscape wide mode. else if ((ActiveViewController as NotesWatchUIViewController) != null) { if (SpringboardViewController.IsLandscapeWide( ) || SpringboardViewController.IsDevicePortrait( )) { //NavToolbar.RevealForTime( 3.0f ); } } }
public override void PerformAction(string command, string[] arguments) { base.PerformAction(command, arguments); switch (command) { // is this a goto command? case PrivateGeneralConfig.App_URL_Commands_Goto: { // make sure the argument is for us if (arguments[0] == Command_Keyword( ) && arguments.Length > 1) { // check for groupfinder, because we support that one. if (PrivateGeneralConfig.App_URL_Page_GroupFinder == arguments[1]) { // since we're switching to the read notes VC, pop to the main page root and // remove it, because we dont' want back history (where would they go back to?) ParentViewController.ClearViewControllerStack( ); // create and launch the group finder. It's fine to create it here because we always dynamically create this controller. TaskUIViewController viewController = Storyboard.InstantiateViewController("GroupFinderViewController") as TaskUIViewController; ParentViewController.PushViewController(viewController, false); } else { List <ConnectLink> engagedEntries = ConnectLink.BuildGetEngagedList( ); ConnectLink connectLink = engagedEntries.Where(e => e.Command_Keyword == arguments[1]).SingleOrDefault( ); if (connectLink != null) { // clear out the stack and push the main connect page onto the stack ParentViewController.ClearViewControllerStack( ); ParentViewController.PushViewController(MainPageVC, false); // now go to the requested URL (and do not animate it--that could allow a race condition if this action is called rapidly TaskWebViewController.HandleUrl(false, true, connectLink.Url, this, MainPageVC, false, false, false, false); } } } break; } } }
public override void WillShowViewController(TaskUIViewController viewController) { base.WillShowViewController( viewController ); // turn off the share & create buttons NavToolbar.SetShareButtonEnabled( false, null ); NavToolbar.SetCreateButtonEnabled( false, null ); // if it's the main page, disable the back button on the toolbar if ( viewController == MainPageVC ) { NavToolbar.Reveal( false ); } else if ( viewController as TaskWebViewController == null ) { //NavToolbar.RevealForTime( 3.0f ); NavToolbar.Reveal( true ); } }
/// <summary> /// Called when a new view controller is shown by the parent navigation controller. /// This is useful so the task can evaluate what viewcontroller was just shown /// and update itself or the toolbar accordingly. /// It is ALWAYS called, whether a view controller is being pushed, or revealed because the stack is being popped. /// </summary> /// <param name="viewController">View controller.</param> public virtual void WillShowViewController( TaskUIViewController viewController ) { ActiveViewController = viewController; // ensure this controller has the parent task viewController.Task = this; // and that it knows what its dimensions can be. viewController.View.Bounds = ContainerBounds; viewController.LayoutChanged( ); }
/// <summary> /// Called by the active view controller when touches ended. Allows the task to perform any /// necessary actions, like revealing the nav bar. /// </summary> /// <param name="TaskUIViewController">Task user interface view controller.</param> /// <param name="touches">Touches.</param> /// <param name="evt">Evt.</param> public virtual void TouchesEnded( TaskUIViewController taskUIViewController, NSSet touches, UIEvent evt ) { }
public override void TouchesEnded(TaskUIViewController taskUIViewController, NSSet touches, UIEvent evt) { base.TouchesEnded(taskUIViewController, touches, evt); }
/// <summary> /// Called by the active view controller when touches ended. Allows the task to perform any /// necessary actions, like revealing the nav bar. /// </summary> /// <param name="TaskUIViewController">Task user interface view controller.</param> /// <param name="touches">Touches.</param> /// <param name="evt">Evt.</param> public virtual void TouchesEnded(TaskUIViewController taskUIViewController, NSSet touches, UIEvent evt) { }
public override void TouchesEnded(TaskUIViewController taskUIViewController, NSSet touches, UIEvent evt) { base.TouchesEnded(taskUIViewController, touches, evt); // immediately hide the toolbar on the main page if ( ActiveViewController == MainViewController ) { NavToolbar.Reveal( false ); } // allow it as long as it's the watch window in portrait mode or landscape wide mode. else if ( ( ActiveViewController as NotesWatchUIViewController ) != null ) { if ( SpringboardViewController.IsLandscapeWide( ) || SpringboardViewController.IsDevicePortrait( ) ) { //NavToolbar.RevealForTime( 3.0f ); } } }