Exemple #1
0
        public static void Preload()
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();
            var window = new PreloadedWindow();

            TSystemInfo.TryGetValue("http://tizen.org/feature/screen.width", out int width);
            TSystemInfo.TryGetValue("http://tizen.org/feature/screen.height", out int height);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();

            SimpleWebviewApp app = new Test.SimpleWebviewApp();

            app.Run(args);
        }
Exemple #3
0
        public static void Main(string[] args)
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();

            var app = new App();

            app.Run(args);
        }
        static void Main(string[] args)
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();

            CoreUIApplication app;

            app = new MaterialWatchGallery();
            app.Run(args);
        }
        protected override void OnCreate()
        {
            //Log.Info(ReactConstants.Tag, "## ReactProgram ##  Enter Constructor ReactProgram()");
            try
            {
                _reactInstanceManager = CreateReactInstanceManager();
            }
            catch (Exception ex)
            {
                Log.Info(ReactConstants.Tag, "## ReactProgram ## CreateReactInstanceManager Ex:" + ex.ToString());
            }
            //Log.Info(ReactConstants.Tag, "## ReactProgram ##  Exit Constructor ReactProgram()");

            MainSynchronizationContext.Initialize(SynchronizationContext.Current, Exit);

            Elementary.Initialize();
            Elementary.ThemeOverlay();

            //Log.Info(ReactConstants.Tag, "## ReactProgram ##  Enter OnCreate()");

            ResourceDir = DirectoryInfo.Resource;

            // 1. Create root window
            ReactWindow rctWin = new ReactWindow("ElmSharp Window");

            RctWindow = rctWin;
            RctWindow.Show();
            RctWindow.BackButtonPressed += (object sender, EventArgs e) =>
            {
                Log.Debug(ReactConstants.Tag, "## Back button being Pressed ##");
                _reactInstanceManager.OnBackPressed();
            };

            RctWindow.RedButtonPressed += (object sender, EventArgs e) =>
            {
                Log.Debug(ReactConstants.Tag, "## Red button being Pressed ##");
                _reactInstanceManager.DevSupportManager.ShowDevOptionsDialog();
            };

            // 2. Create root view
            RootView = CreateRootView();
            //RootView.Show();


            // 3. Entry of 'JS' world
            RootView.StartReactApplication(_reactInstanceManager, MainComponentName);

            // 4. Set root view
            //RctWindow.Navigator.Push(RootView, "Instagram");
            RctWindow.SetMainPage(RootView);

            base.OnCreate();

            //Log.Info(ReactConstants.Tag, "## ReactProgram ##  Exit OnCreate()");
        }
Exemple #6
0
        public TizenHost(Func <WinUI.Application> appBuilder, string[]?args = null)
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();

            _current = this;

            _appBuilder = appBuilder;

            Windows.UI.Core.CoreDispatcher.DispatchOverride        = (d) => EcoreMainloop.PostAndWakeUp(d);
            Windows.UI.Core.CoreDispatcher.HasThreadAccessOverride = () => EcoreMainloop.IsMainThread;

            _tizenApplication = new TizenApplication(this);
            _tizenApplication.Run(args);
        }
Exemple #7
0
        public TizenHost(Func <WinUI.Application> appBuilder)
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();

            _current = this;

            _appBuilder = appBuilder;

            Windows.UI.Core.CoreDispatcher.DispatchOverride        = (d) => EcoreMainloop.PostAndWakeUp(d);
            Windows.UI.Core.CoreDispatcher.HasThreadAccessOverride = () => EcoreMainloop.IsMainThread;

            _tizenApplication = new TizenApplication(this);
            _tizenApplication.Run(Environment.GetCommandLineArgs());
        }
Exemple #8
0
        static void Main(string[] args)
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();

            CoreUIApplication app;

            if (Elementary.GetProfile() == "wearable")
            {
                app = new MaterialWatchGallery();
            }
            else
            {
                app = new MaterialGallery();
            }

            app.Run(args);
        }
Exemple #9
0
        static void Main(string[] args)
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();

            Console.WriteLine("ELM_PROFILE : {0}", Elementary.GetProfile());
            Console.WriteLine("ELM_SCALE : {0}", Elementary.GetScale());

            TestRunner testRunner = new TestRunner();

            testRunner.Run(args);

            // if running with appfw is failed, below line will be executed.
            if (!s_terminated)
            {
                testRunner.RunStandalone(args);
            }
        }
Exemple #10
0
        /// <summary>
        /// Creates a WpfHost element to host a Uno-Skia into a WPF application.
        /// </summary>
        /// <remarks>
        /// If args are omitted, those from Environment.GetCommandLineArgs() will be used.
        /// </remarks>
        public TizenHost(Func <WinUI.Application> appBuilder, string[] args = null)
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();

            _current = this;

            _appBuilder = appBuilder;
            _args       = args;


            _args ??= Environment
            .GetCommandLineArgs()
            .Skip(1)
            .ToArray();

            Windows.UI.Core.CoreDispatcher.DispatchOverride
                = (d) => EcoreMainloop.PostAndWakeUp(d);

            _tizenApplication = new TizenApplication(this);
            _tizenApplication.Run(_args);
        }
Exemple #11
0
        protected override void OnPreCreate()
        {
            base.OnPreCreate();

            Elementary.Initialize();
            Elementary.ThemeOverlay();

            var mauiApp = CreateMauiApp();

            var rootContext = new MauiContext(mauiApp.Services);

            var platformWindow = CoreAppExtensions.GetDefaultWindow();

            platformWindow.Initialize();
            rootContext.AddWeakSpecific(platformWindow);

            _applicationContext = rootContext.MakeApplicationScope(this);

            Services = _applicationContext.Services;

            Current.Services?.InvokeLifecycleEvents <TizenLifecycle.OnPreCreate>(del => del(this));
        }
        static void SetupInit(CoreApplication application, InitializationOptions options = null)
        {
            Context = application;

            if (!IsInitialized)
            {
                Internals.Log.Listeners.Add(new XamarinLogListener());
                if (System.Threading.SynchronizationContext.Current == null)
                {
                    TizenSynchronizationContext.Initialize();
                }

                Elementary.Initialize();
                Elementary.ThemeOverlay();
                Utility.AppendGlobalFontPath(@"/usr/share/fonts");
            }

            Device.PlatformServices = new TizenPlatformServices();
            if (Device.info != null)
            {
                ((TizenDeviceInfo)Device.info).Dispose();
                Device.info = null;
            }

            Device.Info = new Forms.TizenDeviceInfo();
            Device.SetFlags(s_flags);

            string profile = ((TizenDeviceInfo)Device.Info).Profile;

            if (profile == "mobile")
            {
                Device.SetIdiom(TargetIdiom.Phone);
            }
            else if (profile == "tv")
            {
                Device.SetIdiom(TargetIdiom.TV);
            }
            else if (profile == "desktop")
            {
                Device.SetIdiom(TargetIdiom.Desktop);
            }
            else if (profile == "wearable")
            {
                Device.SetIdiom(TargetIdiom.Watch);
            }
            else
            {
                Device.SetIdiom(TargetIdiom.Unsupported);
            }

            if (!Forms.IsInitialized)
            {
                if (options != null)
                {
                    s_platformType       = options.PlatformType;
                    s_useMessagingCenter = options.UseMessagingCenter;

                    if (options.Assemblies != null && options.Assemblies.Length > 0)
                    {
                        TizenPlatformServices.AppDomain.CurrentDomain.AddAssemblies(options.Assemblies);
                    }

                    // renderers
                    if (options.Handlers != null)
                    {
                        Registrar.RegisterRenderers(options.Handlers);
                    }
                    else
                    {
                        // Add Xamarin.Forms.Core assembly by default to apply the styles.
                        TizenPlatformServices.AppDomain.CurrentDomain.AddAssembly(Assembly.GetAssembly(typeof(Xamarin.Forms.View)));

                        // static registrar
                        if (options.StaticRegistarStrategy != StaticRegistrarStrategy.None)
                        {
                            s_staticRegistrarStrategy = options.StaticRegistarStrategy;
                            StaticRegistrar.RegisterHandlers(options.CustomHandlers);

                            if (options.StaticRegistarStrategy == StaticRegistrarStrategy.All)
                            {
                                Registrar.RegisterAll(new Type[]
                                {
                                    typeof(ExportRendererAttribute),
                                    typeof(ExportImageSourceHandlerAttribute),
                                    typeof(ExportCellAttribute),
                                    typeof(ExportHandlerAttribute),
                                    typeof(ExportFontAttribute)
                                });
                            }
                        }
                        else
                        {
                            Registrar.RegisterAll(new Type[]
                            {
                                typeof(ExportRendererAttribute),
                                typeof(ExportImageSourceHandlerAttribute),
                                typeof(ExportCellAttribute),
                                typeof(ExportHandlerAttribute),
                                typeof(ExportFontAttribute)
                            });
                        }
                    }

                    // effects
                    var effectScopes = options.EffectScopes;
                    if (effectScopes != null)
                    {
                        for (var i = 0; i < effectScopes.Length; i++)
                        {
                            var effectScope = effectScopes[0];
                            Registrar.RegisterEffects(effectScope.Name, effectScope.Effects);
                        }
                    }

                    // css
                    Registrar.RegisterStylesheets(options.Flags);
                }
                else
                {
                    // In .NETCore, AppDomain feature is not supported.
                    // The list of assemblies returned by AppDomain.GetAssemblies() method should be registered manually.
                    // The assembly of the executing application and referenced assemblies of it are added into the list here.
                    TizenPlatformServices.AppDomain.CurrentDomain.RegisterAssemblyRecursively(application.GetType().GetTypeInfo().Assembly);

                    Registrar.RegisterAll(new Type[]
                    {
                        typeof(ExportRendererAttribute),
                        typeof(ExportImageSourceHandlerAttribute),
                        typeof(ExportCellAttribute),
                        typeof(ExportHandlerAttribute),
                        typeof(ExportFontAttribute)
                    });
                }
            }

            Color.SetAccent(GetAccentColor(profile));
            ExpressionSearch.Default = new TizenExpressionSearch();

            if (application is WatchApplication)
            {
                s_platformType = PlatformType.Lightweight;
            }

            IsInitialized = true;
        }
Exemple #13
0
        static void SetupInit(CoreApplication application)
        {
            Context = application;

            if (!IsInitialized)
            {
                Internals.Log.Listeners.Add(new XamarinLogListener());
                if (System.Threading.SynchronizationContext.Current == null)
                {
                    TizenSynchronizationContext.Initialize();
                }
                Elementary.Initialize();
                Elementary.ThemeOverlay();
            }

            // In .NETCore, AppDomain feature is not supported.
            // The list of assemblies returned by AppDomain.GetAssemblies() method should be registered manually.
            // The assembly of the executing application and referenced assemblies of it are added into the list here.
            // TODO: AppDomain is comming back in NETStandard2.0. This logic should be changed at that time.
            TizenPlatformServices.AppDomain.CurrentDomain.RegisterAssemblyRecursively(application.GetType().GetTypeInfo().Assembly);

            Device.PlatformServices = new TizenPlatformServices();;
            if (Device.info != null)
            {
                ((TizenDeviceInfo)Device.info).Dispose();
                Device.info = null;
            }

            Device.Info = new Forms.TizenDeviceInfo();
            Device.SetFlags(s_flags);

            if (!Forms.IsInitialized)
            {
                Registrar.RegisterAll(new Type[]
                {
                    typeof(ExportRendererAttribute),
                    typeof(ExportImageSourceHandlerAttribute),
                    typeof(ExportCellAttribute),
                    typeof(ExportHandlerAttribute)
                });
            }

            // TODO: We should consider various tizen profiles such as TV, Wearable and so on.
            string profile = ((TizenDeviceInfo)Device.Info).Profile;

            if (profile == "mobile")
            {
                Device.SetIdiom(TargetIdiom.Phone);
            }
            else if (profile == "tv")
            {
                Device.SetIdiom(TargetIdiom.TV);
            }
            else if (profile == "desktop")
            {
                Device.SetIdiom(TargetIdiom.Desktop);
            }
            else
            {
                Device.SetIdiom(TargetIdiom.Unsupported);
            }
            Color.SetAccent(GetAccentColor(profile));
            ExpressionSearch.Default = new TizenExpressionSearch();
            IsInitialized            = true;
        }
Exemple #14
0
        static void SetupInit(CoreApplication application, InitializationOptions?maybeOptions = null)
        {
            Context = application;

            if (!IsInitialized)
            {
                Internals.Log.Listeners.Add(new XamarinLogListener());
                if (System.Threading.SynchronizationContext.Current == null)
                {
                    TizenSynchronizationContext.Initialize();
                }
                Elementary.Initialize();
                Elementary.ThemeOverlay();
            }

            Device.PlatformServices = new TizenPlatformServices();
            if (Device.info != null)
            {
                ((TizenDeviceInfo)Device.info).Dispose();
                Device.info = null;
            }

            Device.Info = new Forms.TizenDeviceInfo();
            Device.SetFlags(s_flags);

            if (!Forms.IsInitialized)
            {
                if (maybeOptions.HasValue)
                {
                    var options = maybeOptions.Value;
                    _useDeviceIndependentPixel = options.UseDeviceIndependentPixel;

                    if (options.Assemblies != null)
                    {
                        TizenPlatformServices.AppDomain.CurrentDomain.AddAssemblies(options.Assemblies);
                    }

                    // renderers
                    if (options.Handlers != null)
                    {
                        Registrar.RegisterRenderers(options.Handlers);
                    }
                    else
                    {
                        Registrar.RegisterAll(new Type[]
                        {
                            typeof(ExportRendererAttribute),
                            typeof(ExportImageSourceHandlerAttribute),
                            typeof(ExportCellAttribute),
                            typeof(ExportHandlerAttribute)
                        });
                    }

                    // effects
                    var effectScopes = options.EffectScopes;
                    if (effectScopes != null)
                    {
                        for (var i = 0; i < effectScopes.Length; i++)
                        {
                            var effectScope = effectScopes[0];
                            Registrar.RegisterEffects(effectScope.Name, effectScope.Effects);
                        }
                    }

                    // css
                    var flags = options.Flags;
                    var noCss = (flags & InitializationFlags.DisableCss) != 0;
                    if (!noCss)
                    {
                        Registrar.RegisterStylesheets();
                    }
                }
                else
                {
                    // In .NETCore, AppDomain feature is not supported.
                    // The list of assemblies returned by AppDomain.GetAssemblies() method should be registered manually.
                    // The assembly of the executing application and referenced assemblies of it are added into the list here.
                    TizenPlatformServices.AppDomain.CurrentDomain.RegisterAssemblyRecursively(application.GetType().GetTypeInfo().Assembly);
                    Registrar.RegisterAll(new Type[]
                    {
                        typeof(ExportRendererAttribute),
                        typeof(ExportImageSourceHandlerAttribute),
                        typeof(ExportCellAttribute),
                        typeof(ExportHandlerAttribute)
                    });
                }
            }

            string profile = ((TizenDeviceInfo)Device.Info).Profile;

            if (profile == "mobile")
            {
                Device.SetIdiom(TargetIdiom.Phone);
            }
            else if (profile == "tv")
            {
                Device.SetIdiom(TargetIdiom.TV);
            }
            else if (profile == "desktop")
            {
                Device.SetIdiom(TargetIdiom.Desktop);
            }
            else if (profile == "wearable")
            {
                Device.SetIdiom(TargetIdiom.Watch);
            }
            else
            {
                Device.SetIdiom(TargetIdiom.Unsupported);
            }
            Color.SetAccent(GetAccentColor(profile));
            ExpressionSearch.Default = new TizenExpressionSearch();
            IsInitialized            = true;
        }