From: dongsug.song Date: Thu, 4 Nov 2021 05:55:36 +0000 (+0900) Subject: [NUI] Fix NUITizenGallery to run on Ubuntu VS-Code debugging X-Git-Tag: accepted/tizen/unified/20231205.024657~1329 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=991bdc770f59dff7f49bfd99be5884a3872d5e2c;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Fix NUITizenGallery to run on Ubuntu VS-Code debugging --- diff --git a/test/NUITizenGallery/Examples/AbsoluteLayoutTest/AbsoluteLayoutTestPage.xaml b/test/NUITizenGallery/Examples/AbsoluteLayoutTest/AbsoluteLayoutTestPage.xaml index 70bef50..b62d63f 100644 --- a/test/NUITizenGallery/Examples/AbsoluteLayoutTest/AbsoluteLayoutTestPage.xaml +++ b/test/NUITizenGallery/Examples/AbsoluteLayoutTest/AbsoluteLayoutTestPage.xaml @@ -10,7 +10,7 @@ - + - + diff --git a/test/NUITizenGallery/Examples/AlertDialogTest/AlertDialogTestPage.xaml b/test/NUITizenGallery/Examples/AlertDialogTest/AlertDialogTestPage.xaml index 822b196..80e6383 100644 --- a/test/NUITizenGallery/Examples/AlertDialogTest/AlertDialogTestPage.xaml +++ b/test/NUITizenGallery/Examples/AlertDialogTest/AlertDialogTestPage.xaml @@ -10,7 +10,7 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/test/NUITizenGallery/Examples/BrushTest/BrushViewerTestPage.xaml b/test/NUITizenGallery/Examples/BrushTest/BrushViewerTestPage.xaml index 6e6725d..91dcaf4 100644 --- a/test/NUITizenGallery/Examples/BrushTest/BrushViewerTestPage.xaml +++ b/test/NUITizenGallery/Examples/BrushTest/BrushViewerTestPage.xaml @@ -10,7 +10,7 @@ - + - + - + - + - + - + - + - + - + > + HeightSpecification="{Static LayoutParamPolicies.MatchParent}"> diff --git a/test/NUITizenGallery/Examples/CarouselTest/CarouselViewTest1Page.xaml b/test/NUITizenGallery/Examples/CarouselTest/CarouselViewTest1Page.xaml index fb355dd..0eda162 100644 --- a/test/NUITizenGallery/Examples/CarouselTest/CarouselViewTest1Page.xaml +++ b/test/NUITizenGallery/Examples/CarouselTest/CarouselViewTest1Page.xaml @@ -10,7 +10,7 @@ - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/NUITizenGallery/Examples/CollectionViewTest/CollectionViewObservableTestPage.xaml b/test/NUITizenGallery/Examples/CollectionViewTest/CollectionViewObservableTestPage.xaml index 55fb1b8..ac89589 100644 --- a/test/NUITizenGallery/Examples/CollectionViewTest/CollectionViewObservableTestPage.xaml +++ b/test/NUITizenGallery/Examples/CollectionViewTest/CollectionViewObservableTestPage.xaml @@ -10,7 +10,7 @@ - + - + - + - + - + - + - + - + - + - + - + + + + + + diff --git a/test/NUITizenGallery/Examples/ImageButtonTest/ImageButtonTest.xaml.cs b/test/NUITizenGallery/Examples/ImageButtonTest/ImageButtonTestPage.xaml.cs similarity index 85% rename from test/NUITizenGallery/Examples/ImageButtonTest/ImageButtonTest.xaml.cs rename to test/NUITizenGallery/Examples/ImageButtonTest/ImageButtonTestPage.xaml.cs index 96010d0..866c2f2 100644 --- a/test/NUITizenGallery/Examples/ImageButtonTest/ImageButtonTest.xaml.cs +++ b/test/NUITizenGallery/Examples/ImageButtonTest/ImageButtonTestPage.xaml.cs @@ -1,9 +1,10 @@ using Tizen.NUI.BaseComponents; +using Tizen.NUI.Components; namespace NUITizenGallery { - public partial class ImageButtonTestPage : View + public partial class ImageButtonTestPage : ContentPage { string ImageURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "images/"; public ImageButtonTestPage() @@ -18,8 +19,8 @@ namespace NUITizenGallery } if (e.CurrentState == ControlState.Pressed) { text1.Text = "Pressed"; - } + } }; } } -} \ No newline at end of file +} diff --git a/test/NUITizenGallery/Examples/ImageTest1/ImageTest1.cs b/test/NUITizenGallery/Examples/ImageTest/ImageTest1.cs similarity index 86% rename from test/NUITizenGallery/Examples/ImageTest1/ImageTest1.cs rename to test/NUITizenGallery/Examples/ImageTest/ImageTest1.cs index 1b724e3..c03e0b6 100755 --- a/test/NUITizenGallery/Examples/ImageTest1/ImageTest1.cs +++ b/test/NUITizenGallery/Examples/ImageTest/ImageTest1.cs @@ -17,27 +17,25 @@ using System; using Tizen.NUI; +using Tizen.NUI.Components; namespace NUITizenGallery { internal class ImageTest1 : IExample { private Window window; - private ImageTest1Page page; public void Activate() { Console.WriteLine($"@@@ this.GetType().Name={this.GetType().Name}, Activate()"); window = NUIApplication.GetDefaultWindow(); - page = new ImageTest1Page(); - window.Add(page); + window.GetDefaultNavigator().Push(new ImageTest1Page()); } public void Deactivate() { Console.WriteLine($"@@@ this.GetType().Name={this.GetType().Name}, Deactivate()"); - page.Unparent(); - page.Dispose(); + window.GetDefaultNavigator().Pop(); } } } diff --git a/test/NUITizenGallery/Examples/ImageTest/ImageTest1Page.xaml b/test/NUITizenGallery/Examples/ImageTest/ImageTest1Page.xaml new file mode 100755 index 0000000..2385f68 --- /dev/null +++ b/test/NUITizenGallery/Examples/ImageTest/ImageTest1Page.xaml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/NUITizenGallery/Examples/VectorGraphicsTest/VectorGraphicsCanvasViewTest6Page.xaml.cs b/test/NUITizenGallery/Examples/VectorGraphicsTest/VectorGraphicsCanvasViewTest6Page.xaml.cs new file mode 100644 index 0000000..459ef15 --- /dev/null +++ b/test/NUITizenGallery/Examples/VectorGraphicsTest/VectorGraphicsCanvasViewTest6Page.xaml.cs @@ -0,0 +1,100 @@ +using System.Drawing; +using System.Threading; +/* + * Copyright(c) 2021 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Components; +using Tizen.NUI.BaseComponents.VectorGraphics; + +namespace NUITizenGallery +{ + public partial class VectorGraphicsCanvasViewTest6Page : ContentPage + { + + public const int NumberOfPictures = 6; + private readonly string ResourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/"; + public static readonly string[] Files = { "cartman.svg", "duke.svg", "test.tvg", "b.jpg", "Boston.png", "tiger.svg" }; + + + Picture[] mPicture = new Picture[NumberOfPictures]; + DrawableGroup mDrawableGroup; + public int mPictureCount = NumberOfPictures; + + public VectorGraphicsCanvasViewTest6Page() + { + InitializeComponent(); + mDrawableGroup = new DrawableGroup(); + canvasView.AddDrawable(mDrawableGroup); + + for(int i = 0; i < NumberOfPictures; i++) + { + mPicture[i] = new Picture(); + mPicture[i].Load(ResourcePath + Files[i]); + mPicture[i].SetSize(new Size2D(200, 150)); + mPicture[i].Translate(20 + (i % 2) * 220, 20 + (i / 2) * 170); + + mDrawableGroup.AddDrawable(mPicture[i]); + } + + addButton.Clicked += (s, e) => + { + if (mPictureCount < NumberOfPictures) + { + mPicture[mPictureCount] = new Picture(); + mPicture[mPictureCount].Load(ResourcePath + Files[mPictureCount]); + mPicture[mPictureCount].SetSize(new Size2D(200, 120)); + mPicture[mPictureCount].Translate(20 + (mPictureCount % 2) * 220, 20 + (mPictureCount / 2) * 170); + + mDrawableGroup.AddDrawable(mPicture[mPictureCount]); + mPictureCount++; + } + }; + delButton.Clicked += (s, e) => + { + if (mPictureCount > 0) + { + mDrawableGroup.RemoveDrawable(mPicture[mPictureCount - 1]); + mPictureCount--; + } + }; + opacityIncreaseButton.Clicked += (s, e) => + { + if (mDrawableGroup.Opacity + 0.1f > 1.0f) + { + mDrawableGroup.Opacity = 1.0f; + } + else + { + mDrawableGroup.Opacity += 0.1f; + } + }; + opacityDecreaseButton.Clicked += (s, e) => + { + if (mDrawableGroup.Opacity - 0.1f < 0.0f) + { + mDrawableGroup.Opacity = 0.0f; + } + else + { + mDrawableGroup.Opacity -= 0.1f; + } + }; + } + } +} diff --git a/test/NUITizenGallery/Examples/VectorGraphicsTest/VectorGraphicsTVGTest.cs b/test/NUITizenGallery/Examples/VectorGraphicsTest/VectorGraphicsTVGTest.cs new file mode 100644 index 0000000..0d0f020 --- /dev/null +++ b/test/NUITizenGallery/Examples/VectorGraphicsTest/VectorGraphicsTVGTest.cs @@ -0,0 +1,41 @@ +/* + * Copyright(c) 2021 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using Tizen.NUI; +using Tizen.NUI.Components; + +namespace NUITizenGallery +{ + internal class VectorGraphicsTVGTest : IExample + { + private Window window; + public void Activate() + { + Console.WriteLine($"@@@ this.GetType().Name={this.GetType().Name}, Activate()"); + + window = NUIApplication.GetDefaultWindow(); + window.GetDefaultNavigator().Push(new VectorGraphicsTVGTestPage()); + } + + public void Deactivate() + { + Console.WriteLine($"@@@ this.GetType().Name={this.GetType().Name}, Deactivate()"); + window.GetDefaultNavigator().Pop(); + } + } +} diff --git a/test/NUITizenGallery/Examples/VectorGraphicsTest/VectorGraphicsTVGTestPage.xaml b/test/NUITizenGallery/Examples/VectorGraphicsTest/VectorGraphicsTVGTestPage.xaml new file mode 100644 index 0000000..860adaa --- /dev/null +++ b/test/NUITizenGallery/Examples/VectorGraphicsTest/VectorGraphicsTVGTestPage.xaml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/test/NUITizenGallery/Examples/VectorGraphicsTest/VectorGraphicsTVGTestPage.xaml.cs b/test/NUITizenGallery/Examples/VectorGraphicsTest/VectorGraphicsTVGTestPage.xaml.cs new file mode 100644 index 0000000..4421cfc --- /dev/null +++ b/test/NUITizenGallery/Examples/VectorGraphicsTest/VectorGraphicsTVGTestPage.xaml.cs @@ -0,0 +1,38 @@ +using System.Drawing; +using System.Threading; +/* + * Copyright(c) 2021 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Components; +using Tizen.NUI.BaseComponents.VectorGraphics; + +namespace NUITizenGallery +{ + public partial class VectorGraphicsTVGTestPage : ContentPage + { + public static readonly string ImagePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/test.tvg"; + + public VectorGraphicsTVGTestPage() + { + InitializeComponent(); + + imageView.SetImage(ImagePath); + } + } +} diff --git a/test/NUITizenGallery/Examples/WebViewTest1/WebViewTest1.cs b/test/NUITizenGallery/Examples/WebViewTest/WebViewTest1.cs similarity index 64% rename from test/NUITizenGallery/Examples/WebViewTest1/WebViewTest1.cs rename to test/NUITizenGallery/Examples/WebViewTest/WebViewTest1.cs index 6752a1c..35e883e 100644 --- a/test/NUITizenGallery/Examples/WebViewTest1/WebViewTest1.cs +++ b/test/NUITizenGallery/Examples/WebViewTest/WebViewTest1.cs @@ -1,23 +1,20 @@ using System; using Tizen.NUI; +using Tizen.NUI.Components; namespace NUITizenGallery { internal class WebViewTest1 : IExample { private Window window; - private WebViewTest1Page page; public void Activate() { window = NUIApplication.GetDefaultWindow(); - page = new WebViewTest1Page(); - - window.Add(page); + window.GetDefaultNavigator().Push(new WebViewTest1Page()); } public void Deactivate() { - page.Unparent(); - page.Dispose(); + window.GetDefaultNavigator().Pop(); } } } diff --git a/test/NUITizenGallery/Examples/WebViewTest/WebViewTest1Page.xaml b/test/NUITizenGallery/Examples/WebViewTest/WebViewTest1Page.xaml new file mode 100644 index 0000000..56234c1 --- /dev/null +++ b/test/NUITizenGallery/Examples/WebViewTest/WebViewTest1Page.xaml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + +