void Initialize() { Forms.Init(this); Instance = this; window = new Window("Phoneword"); window.BackButtonPressed += (s, e) => { if (naviFrame.NavigationStack.Count > 1) { naviFrame.Pop(); } else { Exit(); } }; window.Show(); var conformant = new Conformant(window); conformant.Show(); naviFrame = new Naviframe(window); conformant.SetContent(naviFrame); naviFrame.Show(); var mainPage = new PhonewordPage().CreateEvasObject(window); naviFrame.Push(mainPage); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); square = window.GetInnerSquare(); Naviframe navi = new Naviframe(window) { PreserveContentOnPop = true, DefaultBackButtonEnabled = true }; _navi = navi; navi.Popped += (s, e) => { Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content); }; NaviItem item = navi.Push(CreatePage(window), "0 Page"); item.SetPartContent("title_left_btn", new Button(window) { Text = "LEFT", Style = "naviframe/title_left" }); item.SetPartContent("title_right_btn", new Button(window) { Text = "RIGHT", Style = "naviframe/title_right" }); navi.Show(); conformant.SetContent(navi); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); square = window.GetInnerSquare(); Naviframe navi = new Naviframe(window) { PreserveContentOnPop = true, DefaultBackButtonEnabled = true }; _navi = navi; navi.Popped += (s, e) => { Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content); }; navi.Push(CreatePage(window), "0 Page"); navi.Show(); conformant.SetContent(navi); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Naviframe navi = new Naviframe(window) { PreserveContentOnPop = true, DefaultBackButtonEnabled = true }; navi.Popped += (s, e) => { Console.WriteLine("naviframe was popped : " + e.Content.GetType()); }; Rectangle rect1 = new Rectangle(window) { Color = Color.Red, Geometry = new Rect(0, 0, 200, 200) }; navi.Push(rect1, "First Page"); Rectangle rect2 = new Rectangle(window) { Color = Color.Blue, Geometry = new Rect(0, 0, 200, 200) }; navi.Push(rect2, "Second Page"); navi.Show(); conformant.SetContent(navi); }
internal Platform(FormsApplication context) { Forms.Context.MainWindow.BackButtonPressed += (o, e) => { bool handled = false; if (_navModel.CurrentPage != null) { if (CurrentModalNavigationTask != null && !CurrentModalNavigationTask.IsCompleted) { handled = true; } else { handled = _navModel.CurrentPage.SendBackButtonPressed(); } } if (!handled) { context.Exit(); } }; _naviframe = new Naviframe(Forms.Context.MainWindow) { PreserveContentOnPop = true, DefaultBackButtonEnabled = false, }; _naviframe.SetAlignment(-1, -1); _naviframe.SetWeight(1.0, 1.0); _naviframe.Show(); _naviframe.AnimationFinished += NaviAnimationFinished; Forms.Context.BaseLayout.SetContent(_naviframe); }
public override void Run(Window window) { Log.Debug(TestName, "CircleProgressBar run"); Conformant conformant = new Conformant(window); conformant.Show(); Naviframe naviframe = new Naviframe(window); naviframe.Show(); conformant.SetContent(naviframe); var surface = new CircleSurface(conformant); CircleProgressBar pb1 = new CircleProgressBar(naviframe, surface) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Value = 0, Maximum = 100, Minimum = 0, }; pb1.Show(); naviframe.Push(pb1, null, "empty"); Label lb1 = new Label(window) { Text = string.Format("S {0} %", pb1.Value), }; lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height); lb1.Move(160, window.ScreenSize.Height / 2 - 40); lb1.Show(); EcoreMainloop.AddTimer(0.05, () => { if (pb1.Value == pb1.Maximum / 2) { // Test purpose : set disable pb1.IsEnabled = false; } if (pb1.Value == pb1.Maximum) { EcoreMainloop.RemoveTimer(pb1); } pb1.Value += 1; lb1.Text = string.Format("S {0} %", pb1.Value); return(true); }); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); square = window.GetInnerSquare(); Naviframe navi = new Naviframe(window) { PreserveContentOnPop = true, DefaultBackButtonEnabled = true, Geometry = square }; box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Geometry = new Rect(square.X, square.Y, square.Width, square.Height) }; box.Show(); box2 = new Box(box); box2.Geometry = new Rect(square.X, square.Y + square.Height / 6, square.Width, square.Height / 2); box2.Show(); box.PackEnd(box2); list = new GenList(window) { Homogeneous = true, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Style = "solid/default" }; box.PackEnd(list); navi.Push(box, "Performance"); InitializeListItem(); list.Changed += List_Changed; list.ScrollAnimationStarted += List_ScrollAnimationStarted; list.ScrollAnimationStopped += List_ScrollAnimationStopped; list.Show(); navi.Show(); conformant.SetContent(navi); }
public override void Run(Window window) { Log.Debug(TestName, "CircleSpinnerTest run"); Conformant conformant = new Conformant(window); conformant.Show(); Naviframe naviframe = new Naviframe(window); naviframe.Show(); conformant.SetContent(naviframe); Layout layout = new Layout(naviframe); layout.SetTheme("layout", "circle", "spinner"); var surface = new CircleSurface(conformant); CircleSpinner spn1 = new CircleSpinner(naviframe, surface) { Text = "Spinner Test", LabelFormat = "%d Value", Style = "circle", AngleRatio = 1.0, Minimum = 0, Maximum = 100, Value = 0, Step = 10, Interval = 0.5, AlignmentX = -1, AlignmentY = 1, WeightX = 1, WeightY = 1 }; ((IRotaryActionWidget)spn1).Activate(); spn1.AddSpecialValue(50, "50 match !!!!"); layout.SetContent(spn1); Button btn = new Button(layout) { Text = "OK", Style = "bottom", }; layout.SetPartContent("elm.swallow.btn", btn); layout.SetPartText("elm.text", "Set value"); naviframe.Push(layout, null, "empty"); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Naviframe navi = new Naviframe(window) { PreserveContentOnPop = true, DefaultBackButtonEnabled = true }; box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; box.Show(); box2 = new Box(box); //elm_box_padding_set(box2, ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10)); ºÎºÐ ºüÁü. box2.Show(); box.PackEnd(box2); list = new GenList(window) { Homogeneous = true, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Style = "solid/default" }; box.PackEnd(list); navi.Push(box, "Performance"); InitializeListItem(); list.Changed += List_Changed; list.ScrollAnimationStarted += List_ScrollAnimationStarted; list.ScrollAnimationStopped += List_ScrollAnimationStopped; list.Show(); navi.Show(); conformant.SetContent(navi); }
#pragma warning restore 0067 internal DefaultPlatform(EvasObject parent) { Forms.NativeParent = parent; _pageBusyCount = 0; MessagingCenter.Subscribe <Page, bool>(this, Page.BusySetSignalName, BusySetSignalNameHandler); MessagingCenter.Subscribe <Page, AlertArguments>(this, Page.AlertSignalName, AlertSignalNameHandler); MessagingCenter.Subscribe <Page, ActionSheetArguments>(this, Page.ActionSheetSignalName, ActionSheetSignalNameHandler); _internalNaviframe = new Naviframe(Forms.NativeParent) { PreserveContentOnPop = true, DefaultBackButtonEnabled = false, }; _internalNaviframe.SetAlignment(-1, -1); _internalNaviframe.SetWeight(1.0, 1.0); _internalNaviframe.Show(); _internalNaviframe.AnimationFinished += NaviAnimationFinished; }
public override void Run(Window window) { accessRoleValues = Enum.GetValues(typeof(AccessRole)); Conformant conformant = new Conformant(window); conformant.Show(); navi = new Naviframe(window) { PreserveContentOnPop = true, DefaultBackButtonEnabled = true }; navi.Push(CreatePage(window, "Main page"), "first page"); navi.Show(); conformant.SetContent(navi); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Naviframe naviframe = new Naviframe(window); naviframe.Show(); conformant.SetContent(naviframe); var surface = new CircleSurface(conformant); CircleSlider circleSlider = new CircleSlider(naviframe, surface) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Minimum = 0, Maximum = 20, Value = 5, Step = 0.5, }; ((IRotaryActionWidget)circleSlider).Activate(); circleSlider.Show(); naviframe.Push(circleSlider, null, "empty"); Label label1 = new Label(window) { Text = string.Format("{0:F1}", circleSlider.Value), Color = Color.White, }; label1.Resize(window.ScreenSize.Width, window.ScreenSize.Height); label1.Move(170, window.ScreenSize.Height / 2 - 20); label1.Show(); circleSlider.ValueChanged += (s, e) => { label1.Text = string.Format("{0:F1}", circleSlider.Value); }; }
#pragma warning restore 0067 internal DefaultPlatform(EvasObject parent) { System.Maui.Maui.NativeParent = parent; _internalNaviframe = new Naviframe(System.Maui.Maui.NativeParent) { PreserveContentOnPop = true, DefaultBackButtonEnabled = false, }; _internalNaviframe.SetAlignment(-1, -1); _internalNaviframe.SetWeight(1.0, 1.0); _internalNaviframe.Show(); _internalNaviframe.AnimationFinished += NaviAnimationFinished; if (System.Maui.Maui.UseMessagingCenter) { _popupManager = new PopupManager(this); } }
void Initialize() { var conformant = new Conformant(_mainWindow); conformant.Show(); _navi = new Naviframe(_mainWindow) { PreserveContentOnPop = true, DefaultBackButtonEnabled = true }; _navi.Show(); conformant.SetContent(_navi); var rootPage = CreateMainPage(_mainWindow); _navi.Push(rootPage); _mainWindow.BackButtonPressed += (sender, e) => { bool handled = _currentPage?.SendBackButtonPressed() ?? false; if (!handled) { if (_navi.NavigationStack.Count == 1) { Exit(); } _currentPage = null; _navi.Pop(); } }; _navi.Popped += (sender, e) => { _currentPage = null; }; }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Naviframe navi = new Naviframe(conformant) { PreserveContentOnPop = true, DefaultBackButtonEnabled = true }; navi.Show(); conformant.SetContent(navi); Layout layout = new Layout(conformant) { WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, }; layout.SetTheme("layout", "application", "default"); layout.Show(); Background bg = new Background(layout) { WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, Color = Color.Gray, }; bg.Show(); layout.SetPartContent("elm.swallow.bg", bg); Box box = new Box(conformant) { WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, }; box.Show(); box.SetPadding(5, 5); layout.SetPartContent("elm.swallow.content", box); Label label = new Label(box) { WeightX = 1, WeightY = 0, AlignmentX = 0.5, AlignmentY = 0, }; label.Show(); box.PackEnd(label); AnimationView aniview = new AnimationView(box) { WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, }; aniview.SetAnimation(Path.Combine(TestRunner.ResourceDir, "a_mountain.json")); aniview.Show(); Box box1 = new Box(box) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = 1, IsHorizontal = true, }; box1.Show(); box.PackEnd(box1); Label label1 = new Label(box) { WeightX = 1, WeightY = 0, AlignmentX = 0.0, AlignmentY = 0.5, Text = "Default Size = (" + aniview.DefaultSize.Width + "," + aniview.DefaultSize.Height + ")", }; label1.Show(); box1.PackEnd(label1); Label label2 = new Label(box) { WeightX = 1, WeightY = 0, AlignmentX = 1.0, AlignmentY = 0.5, Text = "FrameCount : " + (aniview.FrameCount).ToString(), }; label2.Show(); box1.PackEnd(label2); Label label3 = new Label(box) { WeightX = 1, WeightY = 0, AlignmentX = 1.0, AlignmentY = 0.5, Text = "Duration : " + (Math.Round(Convert.ToDouble(aniview.DurationTime), 2)).ToString(), }; label3.Show(); box.PackEnd(label3); box.PackEnd(aniview); Box box2 = new Box(box) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = 1, IsHorizontal = true, }; box2.Show(); box.PackEnd(box2); Check check = new Check(box2) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Loop", }; check.Show(); box2.PackEnd(check); check.StateChanged += (s, e) => { aniview.AutoRepeat = !aniview.AutoRepeat; }; Check check2 = new Check(box2) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Speed: 0.25x", }; check2.Show(); box2.PackEnd(check2); check2.StateChanged += (s, e) => { if (check2.IsChecked) { aniview.Speed = 0.25; } else { aniview.Speed = 1.0; } }; Slider slider = new Slider(box) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, IsIndicatorVisible = true, IndicatorFormat = "%1.1f", Minimum = 0, Maximum = 1, }; slider.Show(); box.PackEnd(slider); slider.ValueChanged += (s, e) => { aniview.Progress = slider.Value; }; Box box3 = new Box(box) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = 1, IsHorizontal = true, }; box3.Show(); box.PackEnd(box3); Label label4 = new Label(box) { WeightX = 1, WeightY = 0, AlignmentX = 0.0, AlignmentY = 0.5, Text = (aniview.MinFrame).ToString() + " / " + (aniview.MaxFrame).ToString(), }; label4.Show(); box3.PackEnd(label4); Label label5 = new Label(box) { WeightX = 1, WeightY = 0, AlignmentX = 1.0, AlignmentY = 0.5, Text = (aniview.MinProgress).ToString() + " / " + (aniview.MaxProgress).ToString(), }; label5.Show(); box3.PackEnd(label5); Box box4 = new Box(box) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = 1, IsHorizontal = true, }; box4.Show(); box.PackEnd(box4); Button btn1 = new Button(box4) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Play", }; btn1.Show(); box4.PackEnd(btn1); btn1.Clicked += (s, e) => { aniview.Play(); UpdateAnimationViewStateLabel(aniview, label); }; Button btn2 = new Button(box4) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Reverse", }; btn2.Show(); box4.PackEnd(btn2); btn2.Clicked += (s, e) => { aniview.Play(true); UpdateAnimationViewStateLabel(aniview, label); }; Button btn3 = new Button(box4) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Stop", }; btn3.Show(); box4.PackEnd(btn3); btn3.Clicked += (s, e) => { aniview.Stop(); }; Box box5 = new Box(box) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = 1, IsHorizontal = true, }; box5.Show(); box.PackEnd(box5); Button btn4 = new Button(box5) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Pause", }; btn4.Show(); box5.PackEnd(btn4); btn4.Clicked += (s, e) => { aniview.Pause(); }; Button btn5 = new Button(box5) { WeightX = 1, WeightY = 0, AlignmentX = -1, AlignmentY = -1, Text = "Resume", }; btn5.Show(); box5.PackEnd(btn5); btn5.Clicked += (s, e) => { aniview.Resume(); }; aniview.Started += (s, e) => { UpdateAnimationViewStateLabel(aniview, label); }; aniview.Stopped += (s, e) => { UpdateAnimationViewStateLabel(aniview, label); label4.Text = "0 / " + (aniview.MaxFrame).ToString(); label5.Text = "0 / " + (aniview.MaxProgress).ToString(); slider.Value = 0; }; aniview.Paused += (s, e) => { UpdateAnimationViewStateLabel(aniview, label); }; aniview.Resumed += (s, e) => { UpdateAnimationViewStateLabel(aniview, label); }; aniview.Updated += (s, e) => { slider.Value = aniview.Progress; label4.Text = (aniview.Frame).ToString() + " / " + (aniview.MaxFrame).ToString(); label5.Text = (Math.Round(Convert.ToDouble(aniview.Progress), 2)).ToString() + " / " + (aniview.MaxProgress).ToString(); }; UpdateAnimationViewStateLabel(aniview, label); navi.Push(layout, "AnimationView Test"); }
private void CreateTesterView() { Window window = new Window("GraphicsTester") { AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90 }; window.Show(); window.BackButtonPressed += (s, e) => { EcoreMainloop.Quit(); }; Conformant conformant = new Conformant(window); conformant.Show(); Naviframe navi = new Naviframe(window) { PreserveContentOnPop = true, DefaultBackButtonEnabled = true }; navi.Show(); GenList list = new GenList(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1 }; GenItemClass defaultClass = new GenItemClass("default") { GetTextHandler = (data, part) => { var scenario = data as AbstractScenario; return(scenario == null ? "" : scenario.GetType().Name); } }; foreach (var scenario in ScenarioList.Scenarios) { list.Append(defaultClass, scenario); } SkiaGraphicsView graphicsView = new SkiaGraphicsView(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, BackgroundColor = Color.White }; graphicsView.Show(); list.ItemSelected += (s, e) => { var scenario = ScenarioList.Scenarios[e.Item.Index - 1]; graphicsView.Drawable = scenario; navi.Push(graphicsView, scenario.GetType().Name); }; list.Show(); navi.Push(list, "GraphicsTester.Skia.Tizen"); conformant.SetContent(navi); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Naviframe naviframe = new Naviframe(window); naviframe.Show(); conformant.SetContent(naviframe); var surface = new CircleSurface(conformant); CircleScroller circleScroller = new CircleScroller(naviframe, surface) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible, HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto, HorizontalScrollBarColor = new Color(255, 0, 0, 50), HorizontalScrollBackgroundColor = Color.Orange, HorizontalScrollBarLineWidth = 15, HorizontalScrollBackgroundLineWidth = 15, }; ((IRotaryActionWidget)circleScroller).Activate(); circleScroller.Show(); naviframe.Push(circleScroller, null, "empty"); Box box = new Box(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = true, }; box.Show(); circleScroller.SetContent(box); var rnd = new Random(); for (int i = 0; i < 10; i++) { int r = rnd.Next(255); int g = rnd.Next(255); int b = rnd.Next(255); Color color = Color.FromRgb(r, g, b); Rectangle colorBox = new Rectangle(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Color = color, MinimumWidth = window.ScreenSize.Width, }; colorBox.Show(); box.PackEnd(colorBox); } circleScroller.Scrolled += (s, e) => Log.Debug(TestName, "Horizental Circle Scroll Scrolled"); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Naviframe navi = new Naviframe(window) { PreserveContentOnPop = true, DefaultBackButtonEnabled = true }; Scroller scroller = new Scroller(window) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, ScrollBlock = ScrollBlock.None, }; scroller.Show(); Box container = new Box(window); scroller.SetContent(container); var rect1 = new Rectangle(window) { AlignmentX = -1, WeightX = 1, Color = Color.Blue, MinimumHeight = 500 }; rect1.Show(); var clipper = new Rectangle(window); clipper.Color = new ElmSharp.Color(200, 200, 200, 200); clipper.Geometry = rect1.Geometry; rect1.Moved += (s, e) => { clipper.Geometry = ((Rectangle)s).Geometry; }; rect1.SetClip(clipper); clipper.Show(); container.PackEnd(rect1); Color[] colors = { Color.Red, Color.Olive, Color.Green, Color.Gray, Color.Lime, Color.Maroon }; for (int i = 0; i < 6; i++) { var rect = new Rectangle(window) { AlignmentX = -1, WeightX = 1, Color = colors[i], MinimumHeight = 500 }; rect.Show(); container.PackEnd(rect); } navi.Push(scroller, "Scroll Page"); navi.Show(); conformant.SetContent(navi); }