static void Main(string[] args) { Elementary.Initialize(); Elementary.ThemeOverlay(); var profile = Elementary.GetProfile(); Console.WriteLine("ELM_PROFILE : {0}", profile); Console.WriteLine("ELM_SCALE : {0}", Elementary.GetScale()); Elementary.EvasObjectRealized += (s, e) => { var obj = (EvasObject)s; //Console.WriteLine("EvasObject Realized : ClassName = {0}", obj.ClassName); }; TestRunner testRunner = new TestRunner(); testRunner.Profile = profile; testRunner.Run(args); // if running with appfw is failed, below line will be executed. if (!s_terminated) { testRunner.RunStandalone(args); } }
static void Main(string[] args) { Elementary.Initialize(); Elementary.ThemeOverlay(); var profile = Elementary.GetProfile(); Console.WriteLine("ELM_PROFILE : {0}", profile); Console.WriteLine("ELM_SCALE : {0}", Elementary.GetScale()); /*Elementary.EvasObjectRealized += (s, e) => * { * var obj = (EvasObject)s; * Console.WriteLine("EvasObject Realized : {0}", obj.GetType()); * }; * * Elementary.ItemObjectRealized += (s, e) => * { * var obj = (ItemObject)s; * Console.WriteLine("ItemObject Realized : {0} (Parent : {1})", obj.GetType(), obj.Parent != null? obj.Parent.GetType() : null); * };*/ TestRunner testRunner = new TestRunner(); testRunner.Profile = profile; testRunner.Run(args); // if running with appfw is failed, below line will be executed. if (!s_terminated) { testRunner.RunStandalone(args); } }
public virtual void Run(Window window) { Conformant comformant = CreateComformant(window); var content = CreateContent(window); if (Elementary.GetProfile() != "wearable" && content is Box box) { box.PackStart(CreateThemeButtons(window)); box.Recalculate(); } comformant.SetContent(content); }
internal static Devices.DisplayOrientation GetOrientation(this IWindow?window) { if (window == null) { return(Devices.DeviceDisplay.Current.MainDisplayInfo.Orientation); } bool isTV = Elementary.GetProfile() == "tv"; return(window.Handler?.MauiContext?.GetPlatformWindow()?.Rotation switch { 0 => isTV ? Devices.DisplayOrientation.Landscape : Devices.DisplayOrientation.Portrait, 90 => isTV ? Devices.DisplayOrientation.Portrait : Devices.DisplayOrientation.Landscape, 180 => isTV ? Devices.DisplayOrientation.Landscape : Devices.DisplayOrientation.Portrait, 270 => isTV ? Devices.DisplayOrientation.Portrait : Devices.DisplayOrientation.Landscape, _ => Devices.DisplayOrientation.Unknown });
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); }
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); } }
void Initialize() { ResourceDir = DirectoryInfo.Resource; ThemeLoader.Initialize(ResourceDir); _mainWindow = new Window("MaterialGallery"); _mainWindow.Show(); _mainWindow.BackButtonPressed += (s, e) => { UIExit(); }; var conformant = new Conformant(_mainWindow); conformant.Show(); var box = new Box(_mainWindow) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; box.Show(); var bg = new Background(_mainWindow) { Color = Color.White }; bg.SetContent(box); conformant.SetContent(bg); GenList list = new GenList(_mainWindow) { Homogeneous = true, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; GenItemClass defaultClass = new GenItemClass("default") { GetTextHandler = (data, part) => { BaseGalleryPage page = data as BaseGalleryPage; return(page == null ? "" : page.Name); } }; foreach (var page in GetGalleryPage()) { if (Elementary.GetProfile() == "tv" && page.ExceptProfile == ProfileType.TV) { continue; } list.Append(defaultClass, page); } if (ThemeLoader.Profile == TargetProfile.Wearable) { list.Prepend(defaultClass, null); list.Append(defaultClass, null); } list.ItemSelected += (s, e) => { BaseGalleryPage page = e.Item.Data as BaseGalleryPage; RunGalleryPage(page); }; list.Show(); box.PackEnd(list); }
public override EvasObject CreateContent(EvasObject parent) { if (_conformant == null) { return(null); } Box box = new ColoredBox(parent); box.Show(); var rect = new Rectangle(parent) { WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, }; box.PackEnd(rect); #region FABs MFloatingActionButton fab = new MFloatingActionButton(_conformant); fab.Show(); fab.Resize(180, 176); fab.Move(540, 1070); Image img = new Image(parent); //The source of icon resources is https://materialdesignicons.com/ img.Load(Path.Combine(MaterialGallery.ResourceDir, "alarm.png")); img.Show(); fab.Icon = img; MFloatingActionButton fab2 = new MFloatingActionButton(_conformant); fab2.Show(); fab2.Resize(180, 176); fab2.Move(540, 940); Image img2 = new Image(parent); //The source of icon resources is https://materialdesignicons.com/ img2.Load(Path.Combine(MaterialGallery.ResourceDir, "airplane.png")); img2.Show(); fab2.Icon = img2; MFloatingActionButton fab3 = new MFloatingActionButton(_conformant); fab3.Show(); fab3.Resize(180, 176); fab3.Move(540, 810); Image img3 = new Image(parent); //The source of icon resources is https://materialdesignicons.com/ img3.Load(Path.Combine(MaterialGallery.ResourceDir, "bluetooth.png")); img3.Show(); fab3.Icon = img3; #endregion if (Elementary.GetProfile() == "wearable") { fab.Move(90, 20); fab2.Move(90, 200); fab3.Move(90, 400); fab.Clicked += (s, e) => { parent.Unrealize(); }; } else if (Elementary.GetProfile() == "tv") { fab.Move(1340, 870); fab2.Move(1340, 740); fab3.Move(1340, 610); } return(box); }
public TizenDisplayInformationExtension(object owner, Window window) { _displayInformation = (DisplayInformation)owner; _window = window; _profile = Elementary.GetProfile(); }
public static string GetProfile() { return(Elementary.GetProfile()); }