diff --git a/workload/src/Samsung.Tizen.Templates/tizen/Main.cs b/workload/src/Samsung.Tizen.Templates/tizen/Main.cs
index 8a7e38a73..64996ec3f 100644
--- a/workload/src/Samsung.Tizen.Templates/tizen/Main.cs
+++ b/workload/src/Samsung.Tizen.Templates/tizen/Main.cs
@@ -1,45 +1,33 @@
-using System;
-
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
+using Tizen.UI;
+using Tizen.UI.Components;
+using Tizen.UI.Components.Material;
namespace TizenApp1
{
- class Program : NUIApplication
+ class Program : MaterialApplication
{
protected override void OnCreate()
{
base.OnCreate();
- Initialize();
- }
-
- void Initialize()
- {
- Window.Default.KeyEvent += OnKeyEvent;
-
- TextLabel text = new TextLabel("Hello Tizen") {
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center,
- TextColor = Color.Blue,
- PointSize = 12.0f,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- WidthResizePolicy = ResizePolicyType.FillToParent
- };
- Window.Default.GetDefaultLayer().Add(text);
-
- Animation animation = new Animation(2000);
- animation.AnimateTo(text, "Orientation", new Rotation(new Radian(new Degree(180.0f)), PositionAxis.X), 0, 500);
- animation.AnimateTo(text, "Orientation", new Rotation(new Radian(new Degree(0.0f)), PositionAxis.X), 500, 1000);
- animation.Looping = true;
- animation.Play();
- }
-
- public void OnKeyEvent(object sender, Window.KeyEventArgs e)
- {
- if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape"))
+ FocusManager.Instance.EnableDefaultFocusAlgorithm(true);
+ Window.Default.AddAvailableOrientation(WindowOrientation.Portrait);
+ Window.Default.AddAvailableOrientation(WindowOrientation.Landscape);
+ Window.Default.AddAvailableOrientation(WindowOrientation.PortraitInverse);
+ Window.Default.AddAvailableOrientation(WindowOrientation.LandscapeInverse);
+ Window.Default.KeyEvent += (s, e) =>
{
- Exit();
- }
+ if (e.KeyEvent.State == KeyState.Up && (e.KeyEvent.KeyPressedName == "BackSpace" || e.KeyEvent.KeyPressedName == "XF86Back"))
+ {
+ if (!RootNavigateBack())
+ {
+ Window.Default.Dispose();
+ Exit();
+ }
+ }
+ };
+ var navigator = new Navigator();
+ Window.Default.DefaultLayer.Add(navigator);
+ navigator.PushAsync(new MainView());
}
static void Main(string[] args)
diff --git a/workload/src/Samsung.Tizen.Templates/tizen/MainView.cs b/workload/src/Samsung.Tizen.Templates/tizen/MainView.cs
new file mode 100644
index 000000000..62d2c04f2
--- /dev/null
+++ b/workload/src/Samsung.Tizen.Templates/tizen/MainView.cs
@@ -0,0 +1,40 @@
+using Tizen.UI;
+using Tizen.UI.Components.Material;
+using Tizen.UI.Layouts;
+
+namespace TizenApp1
+{
+ public class MainView : Scaffold
+ {
+ public MainView() : base()
+ {
+ int count = 0;
+
+ AppBar = new AppBar
+ {
+ BackgroundColor = MaterialColor.PrimaryContainer,
+ Title = "TizenApp1",
+ };
+
+ Content = new VStack
+ {
+ Children =
+ {
+ new Label
+ {
+ Text = $"Current Count: {count}",
+ FontSize = 40f,
+ }
+ .Self(out var label)
+ .Expand()
+ .Center(),
+ }
+ };
+
+ FloatingActionButton = new IconButton(MaterialIcon.Add, IconButtonVariables.FAB)
+ {
+ ClickedCommand = (_, _) => label.Text = $"Current Count: {++count}"
+ };
+ }
+ }
+}
diff --git a/workload/src/Samsung.Tizen.Templates/tizen/TizenApp1.csproj b/workload/src/Samsung.Tizen.Templates/tizen/TizenApp1.csproj
index 0948225ed..cac1aadf1 100644
--- a/workload/src/Samsung.Tizen.Templates/tizen/TizenApp1.csproj
+++ b/workload/src/Samsung.Tizen.Templates/tizen/TizenApp1.csproj
@@ -4,4 +4,8 @@
TizenApp1
Exe
+
+
+
+