Providing theme support in the application. 77/296377/4 accepted/tizen/unified/20230727.173107
authortarun.mahay <tarun.mahay@samsung.com>
Wed, 26 Jul 2023 09:11:04 +0000 (14:41 +0530)
committertarun.mahay <tarun.mahay@samsung.com>
Wed, 26 Jul 2023 10:12:41 +0000 (15:42 +0530)
Change-Id: I12d0d24c39ce2f2ad87da1c85e466af2377a24dc
Signed-off-by: tarun.mahay <tarun.mahay@samsung.com>
SettingWallpaper/SettingWallpaper/Common/AppCommon.cs
SettingWallpaper/SettingWallpaper/SettingWallpaper.csproj
SettingWallpaper/SettingWallpaper/Views/CustomTitleItem.cs
SettingWallpaper/SettingWallpaper/Views/WallpaperView.cs
SettingWallpaper/SettingWallpaper/res/allowed/SettingWallpaper/themes/dark.xaml
SettingWallpaper/SettingWallpaper/res/allowed/SettingWallpaper/themes/light.xaml
packaging/org.tizen.cssetting-wallpaper-1.0.0.rpk

index a784a68..ee45f89 100644 (file)
@@ -38,6 +38,8 @@ namespace SettingWallpaper.Common
         public static Shadow itemLightBoxShadow = new Shadow(4.0f, new Color(0, 0, 0, 0.10f), new Vector2(2, 2));
         public static Shadow itemDarkBoxShadow = new Shadow(4.0f, new Color(1.0f, 1.0f, 1.0f, 0.20f), new Vector2(2, 2));
 
+        public static Size2D buttonSize = new Size2D(48, 48).SpToPx();
+        public static Size2D saveButtonSize = new Size2D(234, 48).SpToPx();
         public static int albumIconTextHeight = 24.SpToPx();
 
         public static int imageItemWidth = 130.SpToPx();
@@ -47,6 +49,7 @@ namespace SettingWallpaper.Common
         public static int albumTitleHeight = 32.SpToPx();
         public static Extents backButtonMargin = new Extents(16, 8, 8, 8).SpToPx();
         public static Extents albumTitleMargin = new Extents(0, 16, 16, 16).SpToPx();
+        public static Extents saveButtonMargin = new Extents(0, 64, 8, 0).SpToPx();
 
         public static int centerTextHeight = 32.SpToPx();
         public static int centerTextPixelSize = 24.SpToPx();
index 2d7b24a..97ec518 100644 (file)
@@ -1,29 +1,29 @@
 <Project Sdk="Tizen.NET.Sdk/1.1.9">
 
-  <PropertyGroup>
-    <TargetFramework>netcoreapp3.1</TargetFramework>
-    <TizenCreateTpkOnBuild>false</TizenCreateTpkOnBuild>
-  </PropertyGroup>
+    <PropertyGroup>
+        <TargetFramework>netcoreapp3.1</TargetFramework>
+        <TizenCreateTpkOnBuild>false</TizenCreateTpkOnBuild>
+    </PropertyGroup>
 
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugType>portable</DebugType>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>None</DebugType>
-  </PropertyGroup>
-  <ItemGroup>
-    <PackageReference Include="Tizen.NET" Version="11.0.0.17848" />
-  </ItemGroup>
-  <ItemGroup>
-    <Reference Include="SettingCore">
-      <HintPath>..\..\..\settings\SettingCore\bin\Debug\netcoreapp3.1\SettingCore.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Core\" />
-    <Folder Include="Models\" />
-    <Folder Include="MediaContent\" />
-    <Folder Include="ViewModels\" />
-  </ItemGroup>
+    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+        <DebugType>portable</DebugType>
+    </PropertyGroup>
+    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+        <DebugType>None</DebugType>
+    </PropertyGroup>
+    <ItemGroup>
+        <PackageReference Include="Tizen.NET" Version="11.0.0.17848" />
+    </ItemGroup>
+    <ItemGroup>
+        <Reference Include="SettingCore">
+            <HintPath>..\..\..\settings\SettingCore\bin\Debug\netcoreapp3.1\SettingCore.dll</HintPath>
+        </Reference>
+    </ItemGroup>
+    <ItemGroup>
+        <Folder Include="Core\" />
+        <Folder Include="Models\" />
+        <Folder Include="MediaContent\" />
+        <Folder Include="ViewModels\" />
+    </ItemGroup>
 
 </Project>
index c7ffb7d..12aa661 100644 (file)
@@ -34,12 +34,21 @@ namespace SettingWallpaper.Views
             BackgroundColor = Color.Transparent;
             ThemeChangeSensitive = true;
             Layout = new RelativeLayout();
+
+            ImageView icon = new ImageView
+            {
+                StyleName = "BackIcon",
+            };
             backButton = new Button()
             {
-                StyleName = "BackButton",
+                Size2D = AppCommon.buttonSize,
                 CornerRadius = AppCommon.itemCornerRadius,
                 Margin = AppCommon.backButtonMargin,
+                IsSelectable = false,
+                IsEnabled = true,
+                BackgroundColor = Color.Transparent,
             };
+            backButton.Add(icon);
             backButton.SetBinding(Control.CommandProperty, "BackButtonCommand");
 
             albumTitle = new TextLabel()
index bb79a3d..08ce0b5 100644 (file)
@@ -131,10 +131,16 @@ namespace SettingWallpaper.Views
 
         private void AddPreviousButton()
         {
+            ImageView icon = new ImageView
+            {
+                StyleName = "PreviousIcon",
+            };
             previousButton = new Button()
             {
-                StyleName = "PreviousButton",
+                Size2D = AppCommon.buttonSize,
+                BackgroundColor = Color.Transparent,
             };
+            previousButton.Add(icon);
             previousButton.SetBinding(IsEnabledProperty, "IsPreviousImageAvailable");
             previousButton.SetBinding(Control.CommandProperty, "PreviousButtonCommand");
             bottomView.Add(previousButton);
@@ -142,10 +148,15 @@ namespace SettingWallpaper.Views
 
         private void AddAlbumsFolder()
         {
+            ImageView icon = new ImageView
+            {
+                StyleName = "AlbumIcon",
+            };
             albumFolder = new Button()
             {
                 StyleName = "AlbumFolder",
             };
+            albumFolder.Add(icon);
             albumFolder.SetBinding(Control.CommandProperty, "AlbumFolderCommand");
             bottomView.Add(albumFolder);
         }
@@ -224,10 +235,16 @@ namespace SettingWallpaper.Views
 
         private void AddNextButton()
         {
+            ImageView icon = new ImageView
+            {
+                StyleName = "NextIcon",
+            };
             nextButton = new Button()
             {
-                StyleName = "NextButton",
+                Size2D = AppCommon.buttonSize,
+                BackgroundColor = Color.Transparent,
             };
+            nextButton.Add(icon);
             nextButton.SetBinding(IsEnabledProperty, "IsNextImageAvailable");
             nextButton.SetBinding(Control.CommandProperty, "NextButtonCommand");
             bottomView.Add(nextButton);
@@ -255,37 +272,34 @@ namespace SettingWallpaper.Views
 
         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.Margin = AppCommon.backButtonMargin;
             backButton.Clicked += (s, e) => GadgetNavigation.NavigateBack();
 
+            ImageView icon = new ImageView
+            {
+                StyleName = "SaveIcon",
+            };
             SaveButton = new Button()
             {
-                Text = "Save",
+                Size2D = AppCommon.saveButtonSize,
+                BackgroundColor = Color.Transparent,
                 IsEnabled = true,
+                Margin = AppCommon.saveButtonMargin,
             };
+            SaveButton.Add(icon);
             SaveButton.SetBinding(Control.CommandProperty, "SetWallpaperCommand");
             SaveButton.Hide();
 
-            appBar = new AppBar(appBarStyle)
+            appBar = new AppBar()
             {
-                Size = new Size(-1, 64).SpToPx(),
-                Padding = new Extents(0, 0, 0, 0).SpToPx(),
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+                HeightSpecification = AppCommon.customItemHeight,
                 NavigationContent = backButton,
                 BackgroundColor = Color.Transparent,
                 ThemeChangeSensitive = true,
-                Actions = new List<View> { SaveButton },
             };
-
+            appBar.ActionContent.Add(SaveButton);
             Add(appBar);
         }
 
index 34ee3ae..5a6ad06 100644 (file)
@@ -14,35 +14,29 @@ Id="DarkTheme">
     </c:DefaultTitleItemStyle>
     <TextLabelStyle x:Key="ItemText" TextColor="#FDFDFD" FontFamily="BreezeSans" VerticalAlignment="Center" ThemeChangeSensitive="True"/>
 
-    <c:ButtonStyle x:Key="BackButton" Size="48sp, 48sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent" ThemeChangeSensitive="True">
-        <c:ButtonStyle.Icon>
-            <ImageViewStyle Size="48sp, 48sp">
-                <ImageViewStyle.ResourceUrl>
-                    <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/dark/back.png" Pressed="*Resource*/mount/allowed/SettingWallpaper/images/dark/back_pressed.png" />
-                </ImageViewStyle.ResourceUrl>
-            </ImageViewStyle>
-        </c:ButtonStyle.Icon>
-    </c:ButtonStyle>
-
-    <c:ButtonStyle x:Key="PreviousButton" Size="48sp, 48sp" BackgroundColor="Transparent" ThemeChangeSensitive="True">
-        <c:ButtonStyle.Icon>
-            <ImageViewStyle Size="48sp, 48sp">
-                <ImageViewStyle.ResourceUrl>
-                    <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/dark/previous.png" Pressed="*Resource*/mount/allowed/SettingWallpaper/images/dark/previous_pressed.png" Disabled="*Resource*/mount/allowed/SettingWallpaper/images/dark/previous_disabled.png"/>
-                </ImageViewStyle.ResourceUrl>
-            </ImageViewStyle>
-        </c:ButtonStyle.Icon>
-    </c:ButtonStyle>
-
-    <c:ButtonStyle x:Key="NextButton" Size="48sp, 48sp" BackgroundColor="Transparent" ThemeChangeSensitive="True">
-        <c:ButtonStyle.Icon>
-            <ImageViewStyle Size="48sp, 48sp">
-                <ImageViewStyle.ResourceUrl>
-                    <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/dark/next.png" Pressed="*Resource*/mount/allowed/SettingWallpaper/images/dark/next_pressed.png" Disabled="*Resource*/mount/allowed/SettingWallpaper/images/dark/next_disabled.png"/>
-                </ImageViewStyle.ResourceUrl>
-            </ImageViewStyle>
-        </c:ButtonStyle.Icon>
-    </c:ButtonStyle>
+    <ImageViewStyle x:Key="BackIcon" Size="48sp, 48sp">
+        <ImageViewStyle.ResourceUrl>
+            <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/dark/back.png" Pressed="*Resource*/mount/allowed/SettingWallpaper/images/dark/back_pressed.png" />
+        </ImageViewStyle.ResourceUrl>
+    </ImageViewStyle>
+
+    <ImageViewStyle x:Key="PreviousIcon" Size="48sp, 48sp">
+        <ImageViewStyle.ResourceUrl>
+            <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/dark/previous.png" Pressed="*Resource*/mount/allowed/SettingWallpaper/images/dark/previous_pressed.png" Disabled="*Resource*/mount/allowed/SettingWallpaper/images/dark/previous_disabled.png"/>
+        </ImageViewStyle.ResourceUrl>
+    </ImageViewStyle>
+
+    <ImageViewStyle x:Key="NextIcon" Size="48sp, 48sp">
+        <ImageViewStyle.ResourceUrl>
+            <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/dark/next.png" Pressed="*Resource*/mount/allowed/SettingWallpaper/images/dark/next_pressed.png" Disabled="*Resource*/mount/allowed/SettingWallpaper/images/dark/next_disabled.png"/>
+        </ImageViewStyle.ResourceUrl>
+    </ImageViewStyle>
+
+    <ImageViewStyle x:Key="SaveIcon" Size="234sp, 48sp">
+        <ImageViewStyle.ResourceUrl>
+            <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/dark/save.png" />
+        </ImageViewStyle.ResourceUrl>
+    </ImageViewStyle>
 
     <ImageViewStyle x:Key="AlbumIcon" Size="80sp, 80sp">
         <ImageViewStyle.ResourceUrl>
@@ -50,14 +44,5 @@ Id="DarkTheme">
         </ImageViewStyle.ResourceUrl>
     </ImageViewStyle>
 
-    <c:ButtonStyle x:Key="AlbumFolder" Size="114sp, 114sp" IsSelectable="false" IsEnabled="true" ThemeChangeSensitive="True" BackgroundImage="*Resource*/mount/allowed/SettingWallpaper/images/dark/background.png">
-        <c:ButtonStyle.Icon>
-            <ImageViewStyle Size="80sp, 80sp">
-                <ImageViewStyle.ResourceUrl>
-                    <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/dark/folder.png"/>
-                </ImageViewStyle.ResourceUrl>
-            </ImageViewStyle>
-        </c:ButtonStyle.Icon>
-    </c:ButtonStyle>
-
+    <c:ButtonStyle x:Key="AlbumFolder" Size="114sp, 114sp" IsSelectable="false" IsEnabled="true" ThemeChangeSensitive="True" BackgroundImage="*Resource*/mount/allowed/SettingWallpaper/images/dark/background.png"/>
 </Theme>
\ No newline at end of file
index 487871a..d6b801d 100644 (file)
@@ -15,35 +15,29 @@ Id="LightTheme">
 
     <TextLabelStyle x:Key="ItemText" TextColor="#090E21" FontFamily="BreezeSans"  VerticalAlignment="Center" ThemeChangeSensitive="True"/>
 
-    <c:ButtonStyle x:Key="BackButton" Size="48sp, 48sp" BackgroundColor="Transparent" ThemeChangeSensitive="True">
-        <c:ButtonStyle.Icon>
-            <ImageViewStyle Size="48sp, 48sp">
-                <ImageViewStyle.ResourceUrl>
-                    <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/light/back.png" Pressed="*Resource*/mount/allowed/SettingWallpaper/images/light/back_pressed.png" />
-                </ImageViewStyle.ResourceUrl>
-            </ImageViewStyle>
-        </c:ButtonStyle.Icon>
-    </c:ButtonStyle>
-
-    <c:ButtonStyle x:Key="PreviousButton" Size="48sp, 48sp" BackgroundColor="Transparent" ThemeChangeSensitive="True">
-        <c:ButtonStyle.Icon>
-            <ImageViewStyle Size="48sp, 48sp">
-                <ImageViewStyle.ResourceUrl>
-                    <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/light/previous.png" Pressed="*Resource*/mount/allowed/SettingWallpaper/images/light/previous_pressed.png" Disabled="*Resource*/mount/allowed/SettingWallpaper/images/light/previous_disabled.png"/>
-                </ImageViewStyle.ResourceUrl>
-            </ImageViewStyle>
-        </c:ButtonStyle.Icon>
-    </c:ButtonStyle>
-
-    <c:ButtonStyle x:Key="NextButton" Size="48sp, 48sp" BackgroundColor="Transparent" ThemeChangeSensitive="True">
-        <c:ButtonStyle.Icon>
-            <ImageViewStyle Size="48sp, 48sp">
-                <ImageViewStyle.ResourceUrl>
-                    <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/light/next.png" Pressed="*Resource*/mount/allowed/SettingWallpaper/images/light/next_pressed.png" Disabled="*Resource*/mount/allowed/SettingWallpaper/images/light/next_disabled.png"/>
-                </ImageViewStyle.ResourceUrl>
-            </ImageViewStyle>
-        </c:ButtonStyle.Icon>
-    </c:ButtonStyle>
+    <ImageViewStyle x:Key="BackIcon" Size="48sp, 48sp">
+        <ImageViewStyle.ResourceUrl>
+            <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/light/back.png" Pressed="*Resource*/mount/allowed/SettingWallpaper/images/light/back_pressed.png" />
+        </ImageViewStyle.ResourceUrl>
+    </ImageViewStyle>
+
+    <ImageViewStyle x:Key="PreviousIcon" Size="48sp, 48sp">
+        <ImageViewStyle.ResourceUrl>
+            <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/light/previous.png" Pressed="*Resource*/mount/allowed/SettingWallpaper/images/light/previous_pressed.png" Disabled="*Resource*/mount/allowed/SettingWallpaper/images/light/previous_disabled.png"/>
+        </ImageViewStyle.ResourceUrl>
+    </ImageViewStyle>
+
+    <ImageViewStyle x:Key="NextIcon" Size="48sp, 48sp">
+        <ImageViewStyle.ResourceUrl>
+            <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/light/next.png" Pressed="*Resource*/mount/allowed/SettingWallpaper/images/light/next_pressed.png" Disabled="*Resource*/mount/allowed/SettingWallpaper/images/light/next_disabled.png"/>
+        </ImageViewStyle.ResourceUrl>
+    </ImageViewStyle>
+
+    <ImageViewStyle x:Key="SaveIcon"  Size="234sp, 48sp">
+        <ImageViewStyle.ResourceUrl>
+            <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/light/save.png" />
+        </ImageViewStyle.ResourceUrl>
+    </ImageViewStyle>
 
     <ImageViewStyle x:Key="AlbumIcon" Size="80sp, 80sp">
         <ImageViewStyle.ResourceUrl>
@@ -51,13 +45,5 @@ Id="LightTheme">
         </ImageViewStyle.ResourceUrl>
     </ImageViewStyle>
 
-    <c:ButtonStyle x:Key="AlbumFolder" Size="114sp, 114sp" IsSelectable="false" IsEnabled="true" ThemeChangeSensitive="True" BackgroundImage="*Resource*/mount/allowed/SettingWallpaper/images/light/background.png">
-       <c:ButtonStyle.Icon>
-            <ImageViewStyle Size="80sp, 80sp">
-                <ImageViewStyle.ResourceUrl>
-                    <Selector x:TypeArguments="x:String" Normal="*Resource*/mount/allowed/SettingWallpaper/images/light/folder.png"/>
-                </ImageViewStyle.ResourceUrl>
-            </ImageViewStyle>
-        </c:ButtonStyle.Icon>
-    </c:ButtonStyle>
+    <c:ButtonStyle x:Key="AlbumFolder" Size="114sp, 114sp" IsSelectable="false" IsEnabled="true" ThemeChangeSensitive="True" BackgroundImage="*Resource*/mount/allowed/SettingWallpaper/images/light/background.png"/>
 </Theme>
\ No newline at end of file
index ee84f47..8115963 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