protected override void OnCreate(Bundle savedInstanceState) { // These refer to Android axml files in the Resources>layout directory of this package // they help set the style (deep purple) for the application tabbar and toolbar at the bottom and top TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "Visual_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental"); Xamarin.Essentials.Platform.Init(this, savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); // How to open files from the Assets directory of KaemikaXM.Android: // Android.Content.Res.AssetManager Android.Content.ContentWrapper.Assets(...) // Assets.Open("xxx"); CustomTextEditorDelegate customTextEditor = () => { return(new CustomTextEditView { HorizontalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand, VerticalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand, }); }; Gui.platform = Kaemika.Platform.Android; LoadApplication(new App(customTextEditor)); }
public App(CustomTextEditorDelegate customTextEditorDelegate) { // FolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)); FolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); KGui.Register(new XMGui(customTextEditorDelegate)); DocListPage.docs = Tutorial.Groups(); MainTabbedPage.theMainTabbedPage = new MainTabbedPage(); MainTabbedPage.theMainTabbedPage.CurrentPageChanged += MainTabbedPage.currentPageChangedDelegate; theApp = this; MainPage = MainTabbedPage.theMainTabbedPage; MainTabbedPage.SwitchToTab(MainTabbedPage.theDocListPageNavigation); }
// // 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) { global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "Visual_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental"); global::Xamarin.Forms.Forms.Init(); CustomTextEditorDelegate neutralTextEditor = () => { XMGui.NeutralTextEditView editor = new XMGui.NeutralTextEditView(); Xamarin.Forms.View view = editor.AsView(); view.HorizontalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand; view.VerticalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand; return(editor); //return new GUI_Xamarin.NeutralTextEditView { // HorizontalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand, // VerticalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand, //}; }; CustomTextEditorDelegate customTextEditor = () => { return(new CustomTextEditView { HorizontalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand, VerticalOptions = Xamarin.Forms.LayoutOptions.FillAndExpand, }); }; // How to add a LaunchScreen - SplashScreen // https://docs.microsoft.com/en-us/xamarin/ios/app-fundamentals/images-icons/launch-screens?tabs=windows#migrating-to-launch-screen-storyboards UINavigationBar.Appearance.TintColor = UIColor.White; // affect the color of the bitmaps in the top toolbar Gui.platform = Kaemika.Platform.iOS; LoadApplication(new App(customTextEditor)); // or neutralTextEditor return(base.FinishedLaunching(app, options)); }
public XMGui(CustomTextEditorDelegate customTextEditorDelegate) { customTextEditor = customTextEditorDelegate; }