Skip to content

Instantly share code, notes, and snippets.

@dylanberry
Last active April 11, 2020 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dylanberry/0fc149d943ab8479fdda684fe9550890 to your computer and use it in GitHub Desktop.
Save dylanberry/0fc149d943ab8479fdda684fe9550890 to your computer and use it in GitHub Desktop.
StreamNotes-2020-04-11

Notes From Dan

// This should result in a Tabbed Page with ViewA & ViewB as tabs and ViewB as the selected Tab...
// ViewC should be a Modal over the TabbedPage
NavigationService.NavigateAsync("TabbedPage?createTab=ViewA&createTab=ViewB&selectedTab=ViewB/ViewC");
// If we're improving things... then this should create a tab with a NavigationPage with the root ViewB and current page as ViewD...
// The select tab should be able to distinguish it by NavigationPage unless more than one tab has a NavigationPage..
// otherwise it should distinguish which tab by either the root or current which ever matches...
NavigationService.NavigateAsync("TabbedPage?createTab=ViewA&createTab=NavigationPage/ViewB/ViewC/ViewD&selectedTab={NavigationPage|ViewB|ViewD}");
// Second note here that was actually invalid and should not be supported... as the first actual `/` should be treated as an entirely new segment
// all query parameters should be URL Encoded...
NavigationService.NavigateAsync("TabbedPage?createTab=ViewA&createTab=NavigationPage%2FViewB%2FViewC%2FViewD&selectedTab={NavigationPage|ViewB|ViewD}");

Notes

  • Current state:

    [MonoDroid] UNHANDLED EXCEPTION:
    [MonoDroid] System.InvalidOperationException: PushAsync is not supported globally on Android, please use a NavigationPage.
    [MonoDroid]   at Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.INavigation.PushAsync (Xamarin.Forms.Page root, System.Boolean animated) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:145 
    [MonoDroid]   at Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.INavigation.PushAsync (Xamarin.Forms.Page root) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:140 
    [MonoDroid]   at Xamarin.Forms.Internals.NavigationProxy.set_Inner (Xamarin.Forms.INavigation value) [0x0009e] in D:\a\1\s\Xamarin.Forms.Core\NavigationProxy.cs:45 
    [MonoDroid]   at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPageInternal (Xamarin.Forms.Page newRoot) [0x00067] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:339 
    [MonoDroid]   at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x000e6] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:291 
    [MonoDroid]   at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.InternalSetPage (Xamarin.Forms.Page page) [0x00039] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:515 
    [MonoDroid]   at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.SetMainPage () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:541 
    [MonoDroid]   at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.LoadApplication (Xamarin.Forms.Application application) [0x00140] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:191 
    [MonoDroid]   at PrismTabNav.Droid.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x0002f] in /Users/dylanberry/Projects/PrismTabNav/PrismTabNav.Android/MainActivity.cs:32 
    [MonoDroid]   at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in <4ccdb3137d974856b786e1aeebbfbab6>:0 
    [MonoDroid]   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.8(intptr,intptr,intptr)
    
  • Navigation logic:

    1. slash indicates a new navigation segment not a continuation of the existing segment - ie. opens a modal page with a new navigation stack
    2. To create a tab that wraps a page in a NavigationPage, simply denote this as a nested hierarchy using the | character. TabbedPage?createTab=NavigationPage|ViewA
  • Navigation Scenarios:

    1. Relative url + Modal (ViewC): TabbedPage?createTab=ViewA&createTab=ViewB&selectedTab=ViewB/ViewC
    2. Absolute url + Modal (ViewC): /TabbedPage?createTab=ViewA&createTab=ViewB&selectedTab=ViewB/ViewC

Action Items

Next Session

  • Write tests (unit and UI) for our scenarios
  • Implement parsing for pipe delimeter within selectedTab navigation parameter/url query param

Stream To Do

  • Private/secrets scene
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment