Set fullscreen mode and adding AppBar 82/295282/1 accepted/tizen/unified/20230712.040712
authorYurii Zinchuk/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics <y.zinchuk@samsung.com>
Tue, 4 Jul 2023 10:49:10 +0000 (12:49 +0200)
committerYurii Zinchuk/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics <y.zinchuk@samsung.com>
Tue, 4 Jul 2023 11:06:50 +0000 (13:06 +0200)
Change-Id: If6c4bda3098d8212a02f118399091dad951d5695
Signed-off-by: Yurii Zinchuk/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics <y.zinchuk@samsung.com>
SettingWallpaper/SettingWallpaper/Core/ViewManager.cs
SettingWallpaper/SettingWallpaper/MenuProvider.cs
SettingWallpaper/SettingWallpaper/ViewModels/WallpaperViewModel.cs
SettingWallpaper/SettingWallpaper/Views/MainPage.cs
SettingWallpaper/SettingWallpaper/Views/WallpaperView.cs
packaging/org.tizen.cssetting-wallpaper-1.0.0.rpk

index 59c4bddbd8df1dd11df21138a705fab5bd66772c..d3522840766ca55c32282e755265a4968787b15e 100644 (file)
@@ -42,8 +42,6 @@ namespace SettingWallpaper.Core
         private AlbumDetailViewModel albumDetailViewModel;
         private WallpaperViewModel wallpaperViewModel;
 
-        private Button saveButton;
-
         private Window customWindow;
         private IBorderInterface appCustomBorder;
 
@@ -86,22 +84,6 @@ namespace SettingWallpaper.Core
             return wallpaperView;
         }
 
-        public Button GetSaveButton()
-        {
-            if (saveButton == null)
-            {
-                saveButton = new Button()
-                {
-                    Text = "Save",
-                    IsEnabled = true,
-                };
-                saveButton.BindingContext = wallpaperViewModel;
-                saveButton.SetBinding(Control.CommandProperty, "SetWallpaperCommand");
-            }
-            saveButton.Hide();
-            return saveButton;
-        }
-
         private void OnFolderClicked()
         {
             CreateCustomWindow();
@@ -273,11 +255,11 @@ namespace SettingWallpaper.Core
         {
             if (url != SystemSettings.WallpaperHomeScreen)
             {
-                saveButton.Show();
+                wallpaperView?.SaveButton.Show();
             }
             else
             {
-                saveButton.Hide();
+                wallpaperView?.SaveButton.Hide();
             }
             wallpaperView.ResourceUrl = url;
         }
@@ -424,12 +406,6 @@ namespace SettingWallpaper.Core
                 }
                 appCustomBorder?.Dispose();
                 appCustomBorder = null;
-                if (saveButton != null)
-                {
-                    saveButton.BindingContext = null;
-                    saveButton.Dispose();
-                    saveButton = null;
-                }
                 ThemeManager.ThemeChanged -= OnThemeChanged;
                 if(wallpaperViewModel != null)
                 {
index 5a7c9f0f5f51599747a1dd9a9c1091e030f1727a..b39f8d4c761a2981958ffd611e0a2886d01e80be 100644 (file)
@@ -26,7 +26,7 @@ namespace SettingWallpaper
         {
             return new SettingMenu[]
             {
-                new SettingMenu(path: Wallpaper, defaultOrder: 30, type: typeof(SettingWallpaper.MainPage)),
+                new SettingMenu(path: Wallpaper, defaultOrder: 30, type: typeof(SettingWallpaper.MainPage)) { IsFullScreenMode = true },
             };
         }
     }
index 2f103071c6daea0f64ae9e359e879ca480d29ee7..5d76d74307c40d777206486cb710747f7a37caaa 100644 (file)
@@ -25,6 +25,7 @@ using Tizen.NUI.Binding;
 using Tizen.System;
 using SettingWallpaper.Common;
 using SettingWallpaper.Models;
+using SettingCore;
 
 namespace SettingWallpaper.ViewModels
 {
@@ -187,7 +188,7 @@ namespace SettingWallpaper.ViewModels
             {
                 SystemSettings.WallpaperHomeScreen = CurrentWallpaper;
             }
-            NUIApplication.Current.Exit();
+            GadgetNavigation.NavigateBack();
         }
 
         private void OnPreviousClicked()
index c83b372da46627aac7d47f76ce1e8477a7017092..abfd67e904bc74de45743b226aef6a79582a1885 100644 (file)
@@ -40,12 +40,6 @@ namespace SettingWallpaper
            Resources.ResourcePath = GetResourcePath("");
         }
 
-        public override IEnumerable<View> ProvideMoreActions()
-        {
-            var saveButton = viewManager?.GetSaveButton();
-            return new View[] { saveButton };
-        }
-
         protected override View OnCreate()
         {
             Tizen.Log.Info(Resources.LogTag, "OnCreate");
index 5d2e004b1c3516e08320c3451146b602a25f09e2..bb79a3d29bba46d2ff5dc12808dc53de0d74b4ee 100644 (file)
@@ -22,6 +22,7 @@ using Tizen.NUI.Binding;
 using Tizen.NUI.Components;
 using Tizen.System;
 using SettingWallpaper.Common;
+using SettingCore;
 
 namespace SettingWallpaper.Views
 {
@@ -30,8 +31,11 @@ namespace SettingWallpaper.Views
         private View bottomView;
         private View wallpaperListView;
 
+        private AppBar appBar;
+
         private TextLabel centerText;
 
+        public Button SaveButton { get; private set; }
         private Button albumFolder;
         private Button previousButton;
         private Button nextButton;
@@ -71,6 +75,7 @@ namespace SettingWallpaper.Views
             wallpaperList = new List<object>();
             AddTextLabel();
             AddBottomView();
+            AddAppBar();
             ThemeChangeSensitive = true;
         }
 
@@ -248,16 +253,54 @@ namespace SettingWallpaper.Views
             previewMode = !previewMode;
         }
 
+        private void AddAppBar()
+        {
+            var appBarStyle = ThemeManager.GetStyle("Tizen.NUI.Components.AppBar") as AppBarStyle;
+            appBarStyle.ActionButton.BackgroundColor = ThemeManager.PlatformThemeId == Resources.LightPlatformThemeId ? new Color("#FF6200") : new Color("#FF8A00");         
+            appBarStyle.ActionButton.Text.TextColor = ThemeManager.PlatformThemeId == Resources.LightPlatformThemeId ? new Color("#FDFDFD") : new Color("#16131A");
+            appBarStyle.ActionButton.CornerRadius = 12f.SpToPx();
+            appBarStyle.ActionButton.SizeHeight = 48f.SpToPx();
+            appBarStyle.ActionButton.Margin = new Extents(0, 64, 16, 0).SpToPx();
+            appBarStyle.ActionButton.Icon = null;
+            appBarStyle.TitleTextLabel.PixelSize = 24f.SpToPx();
+
+            var backButton = new SettingCore.Views.BackButton();
+            backButton.Margin = new Extents(16, 0, 0, 0).SpToPx();
+            backButton.Clicked += (s, e) => GadgetNavigation.NavigateBack();
+
+            SaveButton = new Button()
+            {
+                Text = "Save",
+                IsEnabled = true,
+            };
+            SaveButton.SetBinding(Control.CommandProperty, "SetWallpaperCommand");
+            SaveButton.Hide();
+
+            appBar = new AppBar(appBarStyle)
+            {
+                Size = new Size(-1, 64).SpToPx(),
+                Padding = new Extents(0, 0, 0, 0).SpToPx(),
+                NavigationContent = backButton,
+                BackgroundColor = Color.Transparent,
+                ThemeChangeSensitive = true,
+                Actions = new List<View> { SaveButton },
+            };
+
+            Add(appBar);
+        }
+
         private void HideItems()
         {
             centerText.Hide();
             bottomView.Hide();
+            appBar.Hide();
         }
 
         private void ShowItems()
         {
             centerText.Show();
             bottomView.Show();
+            appBar.Show();
         }
 
         private IEnumerable wallpaperList;
@@ -292,6 +335,13 @@ namespace SettingWallpaper.Views
                 albumFolder?.Dispose();
                 albumFolder = null;
 
+                if (SaveButton != null)
+                {
+                    SaveButton.BindingContext = null;
+                    SaveButton.Dispose();
+                    SaveButton = null;
+                }
+
                 if (wallpaperListView != null)
                 {
                     while (wallpaperListView.ChildCount != 0)
index 54a0df86d91b5edc96d493c0a416c97a5282c9a1..bdcd3c55ccf97c439b05899d5132868ea639623f 100644 (file)
Binary files a/packaging/org.tizen.cssetting-wallpaper-1.0.0.rpk and b/packaging/org.tizen.cssetting-wallpaper-1.0.0.rpk differ