--- /dev/null
+* text=auto
+*.cs eol=lf
+*.csproj eol=lf
+*.sln eol=lf
+*.xml eol=lf
+*.svg eol=lf
+*.xaml eol=lf
\ No newline at end of file
-Settings/.vs/
-Settings/SettingView/bin/
-Settings/SettingView/obj/
-Settings/SettingView/SettingView.csproj.user
-Settings/SettingWallpaper/bin/
-Settings/SettingWallpaper/obj/
-Settings/SettingWallpaper/SettingWallpaper.csproj.user
+.vs/
+.vscode/*
+**/[Bb]in/
+**/[Oo]bj/
+**/[Dd]ebug/
+**/[Bb]uild/
+**/.gn
+**/res/allowed/*.dll
+tags
+msbuild.log
\ No newline at end of file
--- /dev/null
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31005.135
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SettingWallpaper", "SettingWallpaper\SettingWallpaper.csproj", "{50df7308-af53-4191-a29d-7d86b8f3b5a3}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1db5148b-e609-425d-9846-1bf0b0885d7b}"
+ ProjectSection(SolutionItems) = preProject
+ tizen_workspace.yaml = tizen_workspace.yaml
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {50df7308-af53-4191-a29d-7d86b8f3b5a3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {50df7308-af53-4191-a29d-7d86b8f3b5a3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {50df7308-af53-4191-a29d-7d86b8f3b5a3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {50df7308-af53-4191-a29d-7d86b8f3b5a3}.Release|Any CPU.Build.0 = Release|Any CPU
+
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.System;
+
+namespace SettingWallpaper.Common
+{
+ public static class DeviceInfo
+ {
+ private static int width;
+ private static int height;
+ private const string WidthKey = "tizen.org/feature/screen.width";
+ private const string HeightKey = "tizen.org/feature/screen.height";
+
+ static DeviceInfo()
+ {
+ bool isWidthAvailable = Information.TryGetValue(WidthKey, out width);
+ bool isHeightAvailable = Information.TryGetValue(HeightKey, out height);
+ if (isHeightAvailable == false || isWidthAvailable == false)
+ {
+ width = 1280;
+ height = 1080;
+ Tizen.Log.Debug(Resources.LogTag, "Width and height are not available , setting default size as 1280 x 720");
+ }
+ IsPortrait = width < height;
+ }
+
+ public static bool IsPortrait { get; private set; }
+
+ public static int DisplayWidth => width;
+
+ public static int DisplayHeight => height;
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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 SettingCore;
+
+namespace SettingWallpaper.Common
+{
+ class Resources
+ {
+ public static readonly string LogTag = "SettingWallpaper";
+
+ public const string LightPlatformThemeId = "org.tizen.default-light-theme";
+ public const string DarkPlatformThemeId = "org.tizen.default-dark-theme";
+
+ public static readonly PropertyMap FontStyleNormalLight = new PropertyMap().
+ Add("width", new PropertyValue("normal")).
+ Add("weight", new PropertyValue("light"));
+
+ public static readonly PropertyMap FontStyleAllNormal = new PropertyMap().
+ Add("width", new PropertyValue("normal")).
+ Add("weight", new PropertyValue("normal")).
+ Add("slant", new PropertyValue("normal"));
+
+ static private string mResourcePath = "";
+
+ static public void SetPath(string path)
+ {
+ mResourcePath = path;
+ }
+
+ public static string GetThemePath()
+ {
+ return mResourcePath + "/themes/";
+ }
+ public static string GetImagePath()
+ {
+ Tizen.Log.Info(Resources.LogTag, "GetImagePath: " + mResourcePath + "/images/");
+ return mResourcePath + "/images/";
+ }
+
+ public static string GetLightImagePath()
+ {
+ return mResourcePath + "/light/";
+ }
+
+ public static string GetDarkImagePath()
+ {
+ return mResourcePath + "/dark/";
+ }
+
+ public static string GetCurrentThemePath()
+ {
+ return (ThemeManager.PlatformThemeId == LightPlatformThemeId) ? GetLightImagePath() : GetDarkImagePath();
+ }
+ }
+}
--- /dev/null
+<!--
+***********************************************************************************************
+<Build.Directory.targets>
+WARNING: DO NOT MODIFY this file. Incorrect changes to this file will make it
+ impossible to load or build your projects from the IDE.
+
+***********************************************************************************************
+-->
+
+<Project>
+ <Target Name="BuildDotnet" AfterTargets="TizenPackage" >
+ <Message Text="Tizen Build starts here ------------" Importance="high"/>
+ <Message Text="$(MSBuildProjectDirectory)" Importance="high"/>
+ <PropertyGroup>
+ <WorkspaceFolder>$([System.IO.Path]::GetDirectoryName($(MSBuildProjectDirectory)))</WorkspaceFolder>
+ </PropertyGroup>
+ <Message Text="Workspace: '$(WorkspaceFolder)'" Importance="high" />
+
+ <Exec Command="C:\tizen-studio\tools\tizen-core\tz.exe pack -S $(ProjectDir) $(WorkspaceFolder)"> </Exec>
+ </Target>
+</Project>
--- /dev/null
+using SettingCore;
+
+namespace SettingWallpaper
+{
+ public class MenuProvider : SettingMenuProvider
+ {
+ public static string Wallpaper = "Wallpaper";
+
+ public override SettingMenu[] Provide()
+ {
+ return new SettingMenu[]
+ {
+ new SettingMenu(path: Wallpaper, defaultOrder: 30, type: typeof(SettingWallpaper.MainPage)),
+ };
+ }
+ }
+}
--- /dev/null
+<Project Sdk="Tizen.NET.Sdk/1.1.9">
+
+ <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="10.0.0.17712" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <Reference Include="SettingCore">
+ <HintPath>..\..\..\..\..\..\settings-56543f0.tar\settings-56543f0\settings-56543f0\SettingCore\bin\Debug\netcoreapp3.1\SettingCore.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+
+</Project>
--- /dev/null
+using SettingCore;
+using System.Collections.Generic;
+using Tizen;
+using Tizen.Applications;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using SettingWallpaper.Common;
+
+namespace SettingWallpaper
+{
+ public class MainPage : SettingCore.MainMenuGadget
+ {
+
+ public override Color ProvideIconColor() => new Color(ThemeManager.PlatformThemeId == "org.tizen.default-light-theme" ? "#0075FF" : "#1A85FF");
+
+ public override string ProvideIconPath() => GetResourcePath("wallpaper-icon.svg");
+
+ public override string ProvideTitle() => "Wallpaper";
+
+ public MainPage() : base(NUIGadgetType.Normal)
+ {
+ Resources.SetPath(GetResourcePath(""));
+ }
+
+ protected override View OnCreate()
+ {
+
+ Log.Info(Resources.LogTag, "OnCreate");
+ base.OnCreate();
+
+ Window.Instance.SetTransparency(true);
+ Window.Instance.BackgroundColor = Color.Transparent;
+
+ View mainView = new View()
+ {
+ Layout = new LinearLayout()
+ {
+ LinearOrientation = LinearLayout.Orientation.Vertical,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ },
+ WidthSpecification = LayoutParamPolicies.MatchParent,
+ HeightSpecification = LayoutParamPolicies.MatchParent,
+ };
+
+ View contentPage = ViewManager.Instance.Initialize();
+
+ mainView.Add(contentPage);
+ return mainView;
+ }
+
+ public override IEnumerable<View> ProvideMoreActions()
+ {
+ var saveButton = new Button()
+ {
+ Text = "Save",
+ IsEnabled = true,
+ };
+ saveButton.Clicked += OnSaveButtonClick;
+
+ return new View[] { saveButton };
+ }
+
+ private void OnSaveButtonClick(object sender, ClickedEventArgs e)
+ {
+ ViewManager.Instance.SetCurrentWallpaper();
+ NavigateBack();
+ }
+ protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
+ {
+ Log.Info(Resources.LogTag, "OnAppControlReceived");
+ base.OnAppControlReceived(e);
+ }
+
+ protected override void OnPause()
+ {
+ Log.Info(Resources.LogTag, "OnPause");
+ base.OnPause();
+ MainView.Hide();
+ }
+
+ protected override void OnResume()
+ {
+ Log.Info(Resources.LogTag, "OnResume");
+ base.OnResume();
+ MainView.Show();
+ }
+
+ protected override void OnDestroy()
+ {
+ Log.Info(Resources.LogTag, "OnDestroy");
+ base.OnDestroy();
+ }
+
+ protected override void OnDeviceOrientationChanged(DeviceOrientationEventArgs e)
+ {
+ Log.Info(Resources.LogTag, "OnDeviceOrientationChanged");
+ base.OnDeviceOrientationChanged(e);
+ }
+
+ protected override void OnLocaleChanged(LocaleChangedEventArgs e)
+ {
+ Log.Info(Resources.LogTag, "OnLocaleChanged");
+ base.OnLocaleChanged(e);
+ }
+
+ protected override void OnLowBattery(LowBatteryEventArgs e)
+ {
+ Log.Info(Resources.LogTag, "OnLowBattery");
+ base.OnLowBattery(e);
+ }
+
+ protected override void OnLowMemory(LowMemoryEventArgs e)
+ {
+ Log.Info(Resources.LogTag, "OnLowMemory");
+ base.OnLowMemory(e);
+ }
+
+ protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e)
+ {
+ Log.Info(Resources.LogTag, "OnRegionFormatChanged");
+ base.OnRegionFormatChanged(e);
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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 System.IO;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using Tizen.NUI.Xaml;
+using SettingWallpaper.Common;
+using SettingWallpaper.Views;
+
+namespace SettingWallpaper
+{
+ class ViewManager
+ {
+ public static event EventHandler<EventArgs> ApplicationClosed;
+
+ private static ViewManager instance = null;
+
+ private AppBar appBar;
+ private WallpaperView wallpaperView;
+ private ContentPage contentPage;
+
+ private ViewManager()
+ {
+ }
+
+ public static ViewManager Instance
+ {
+ get
+ {
+ if (instance == null)
+ {
+ instance = new ViewManager();
+ }
+ return instance;
+ }
+ }
+
+ public View Initialize()
+ {
+ Tizen.Log.Info(Resources.LogTag, "Initializing ViewManager");
+
+ // UpdateTheme(ThemeManager.PlatformThemeId);
+ //CreateAppBar();
+ wallpaperView = new WallpaperView();
+ wallpaperView.TouchEvent += (object source, View.TouchEventArgs e) =>
+ {
+ if (e.Touch.GetState(0) == PointStateType.Down)
+ {
+ wallpaperView.TogglePreview();
+ // ToggleAppBar();
+ }
+ return true;
+ };
+ wallpaperView.WallpaperChanged += (object source, EventArgs e) =>
+ {
+ contentPage.BackgroundImage = wallpaperView.CurrentWallpaper;
+ };
+ CreateContentPage();
+ ThemeManager.ThemeChanged += OnThemeChanged;
+ Tizen.Log.Info(Resources.LogTag, "Initialization Done");
+
+ return contentPage;
+ }
+
+ public void CleanUp()
+ {
+ Tizen.Log.Error(Resources.LogTag, "Cleaning Resources");
+ ThemeManager.ThemeChanged -= OnThemeChanged;
+ //appBar?.Dispose();
+ wallpaperView?.Dispose();
+ contentPage?.Dispose();
+ }
+
+ public void UpdateViews()
+ {
+ wallpaperView.UpdateView();
+ }
+
+ public ContentPage GetContentPage()
+ {
+ return contentPage;
+ }
+
+ public void SetCurrentWallpaper()
+ {
+ wallpaperView.SetCurrentWallpaper();
+ }
+
+ //private void CreateAppBar()
+ //{
+ // appBar = new AppBar()
+ // {
+ // AutoNavigationContent = false,
+ // BackgroundColor = Color.Transparent,
+ // Layout = new RelativeLayout()
+ // {
+ // Padding = new Extents(0, 16, 0, 0).SpToPx(),
+ // },
+ // };
+
+ // StringSelector iconUrlSelector = new StringSelector()
+ // {
+ // Normal = Resources.GetLightImagePath() + "back.png",
+ // Pressed = Resources.GetLightImagePath() + "back_pressed.png",
+ // };
+ // Button navigationContent = new Button()
+ // {
+ // Size2D = new Size2D(48, 48).SpToPx(),
+ // IconURLSelector = iconUrlSelector,
+ // BackgroundColor = Color.Transparent,
+ // };
+ // navigationContent.Icon.Size2D = new Size2D(48, 48).SpToPx();
+ // navigationContent.Clicked += (object source, ClickedEventArgs e) =>
+ // {
+ // CloseSettingWallpaper();
+ // };
+ // appBar.NavigationContent = navigationContent;
+ // RelativeLayout.SetVerticalAlignment(appBar.NavigationContent, RelativeLayout.Alignment.Center);
+
+ // TextLabel titleContent = new TextLabel("Wallpaper"/*res.resx.LanguageResources.Title*/)
+ // {
+ // StyleName = "PageLabel",
+ // PixelSize = 24.SpToPx(),
+ // FontFamily = "BreezeSans",
+ // VerticalAlignment = VerticalAlignment.Center,
+ // FontStyle = Resources.FontStyleAllNormal,
+ // Margin = new Extents(16, 0, 0, 0).SpToPx(),
+ // };
+ // appBar.TitleContent = titleContent;
+ // RelativeLayout.SetLeftTarget(appBar.TitleContent, appBar.NavigationContent);
+ // RelativeLayout.SetLeftRelativeOffset(appBar.TitleContent, 1.0f);
+ // RelativeLayout.SetVerticalAlignment(appBar.TitleContent, RelativeLayout.Alignment.Center);
+ // RelativeLayout.SetFillHorizontal(appBar.TitleContent, true);
+
+ // Button actionContent = new Button()
+ // {
+ // Text = "Save", /*res.resx.LanguageResources.Save,*/
+ // Size2D = new Size2D(110, 48).SpToPx(),
+ // PointSize = 12.SpToPx(),
+ // ThemeChangeSensitive = true,
+ // };
+ // actionContent.Clicked += (object sender, ClickedEventArgs e) =>
+ // {
+ // SetCurrentWallpaper();
+ // CloseSettingWallpaper();
+ // };
+ // appBar.ActionContent = actionContent;
+ // RelativeLayout.SetHorizontalAlignment(appBar.ActionContent, RelativeLayout.Alignment.End);
+ // RelativeLayout.SetVerticalAlignment(appBar.ActionContent, RelativeLayout.Alignment.Center);
+ //}
+
+ //private void ToggleAppBar()
+ //{
+ // if (appBar.Visibility == false)
+ // {
+ // appBar.Show();
+ // }
+ // else
+ // {
+ // appBar.Hide();
+ // }
+ //}
+
+ private void CloseSettingWallpaper()
+ {
+ // CleanUp();
+ // ApplicationClosed.Invoke(this, new EventArgs());
+ }
+
+ private void CreateContentPage()
+ {
+ contentPage = new ContentPage()
+ {
+ // AppBar = appBar,
+ Content = wallpaperView,
+ BackgroundImage = wallpaperView.CurrentWallpaper,
+ ThemeChangeSensitive = true,
+ };
+ }
+
+ private void OnThemeChanged(object sender, ThemeChangedEventArgs e)
+ {
+ if (e.IsPlatformThemeChanged)
+ {
+ Tizen.Log.Info(Resources.LogTag, "Theme Changed: " + e.ThemeId);
+ UpdateTheme(e.PlatformThemeId);
+ }
+ }
+
+ private void SetTheme(string path)
+ {
+ try
+ {
+ Theme theme = new Theme(path);
+ ThemeManager.ApplyTheme(theme);
+ }
+ catch (ArgumentNullException e)
+ {
+ Tizen.Log.Error(Resources.LogTag, "ArgumentNullException: " + e.ParamName);
+ }
+ catch (IOException e)
+ {
+ Tizen.Log.Error(Resources.LogTag, "IOException: " + e.Message);
+ }
+ catch (XamlParseException e)
+ {
+ Tizen.Log.Error(Resources.LogTag, "XamlParseException: " + e.Message);
+ if (e.XmlInfo != null)
+ {
+ Tizen.Log.Error(Resources.LogTag, "XamlParseException, LineNo." + e.XmlInfo.LineNumber + " Pos: " + e.XmlInfo.LinePosition + " HasInfo: " + e.XmlInfo.HasLineInfo().ToString());
+ }
+ }
+ }
+ private void UpdateTheme(string platformThemeId)
+ {
+ if (platformThemeId == null)
+ {
+ Tizen.Log.Error(Resources.LogTag, "Platform theme id is null");
+ return;
+ }
+ if (platformThemeId.Equals(Resources.LightPlatformThemeId))
+ {
+ SetTheme(Resources.GetThemePath() + "light.xaml");
+ }
+ else if (platformThemeId.Equals(Resources.DarkPlatformThemeId))
+ {
+ SetTheme(Resources.GetThemePath() + "dark.xaml");
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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 System.Collections.Generic;
+using System.IO;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components;
+using Tizen.System;
+using SettingWallpaper.Common;
+
+namespace SettingWallpaper.Views
+{
+ class WallpaperView : View
+ {
+ public event EventHandler<EventArgs> WallpaperChanged;
+
+ private TextLabel centerText;
+ private View bottomView;
+ private View wallpaperListView;
+ private Button previousButton;
+ private Button nextButton;
+ private Button albumFolder;
+ private List<Button> wallpaperIcons;
+ private int startingIndex;
+ private int maxWallpapers;
+ private int totalWallpapers;
+ private bool previewMode;
+ private const string WallpaperPath = "/opt/usr/data/settings/Wallpapers/";
+
+ public WallpaperView()
+ {
+ WidthSpecification = LayoutParamPolicies.MatchParent;
+ HeightSpecification = LayoutParamPolicies.MatchParent;
+ CurrentWallpaper = SystemSettings.WallpaperHomeScreen;
+ Layout = new RelativeLayout();
+ AddTextLabel();
+ AddBottomView();
+ Tizen.Log.Info(Resources.LogTag, "WallpaperView Created");
+ }
+
+ public string CurrentWallpaper { get; set; }
+
+ public void SetCurrentWallpaper()
+ {
+ Tizen.Log.Info(Resources.LogTag, "SaveButton Clicked.");
+ try
+ {
+ SystemSettings.WallpaperHomeScreen = CurrentWallpaper;
+ }
+ catch (ArgumentException ex)
+ {
+ Tizen.Log.Error(Resources.LogTag, "ArgumentException: " + ex.Message);
+ }
+ catch (NotSupportedException ex)
+ {
+ Tizen.Log.Error(Resources.LogTag, "NotSupportedException: " + ex.Message);
+ }
+ catch (InvalidOperationException ex)
+ {
+ Tizen.Log.Error(Resources.LogTag, "InvalidOperationException: " + ex.Message);
+ }
+ catch (UnauthorizedAccessException ex)
+ {
+ Tizen.Log.Error(Resources.LogTag, "UnauthorizedAccessException Exception: " + ex.Message);
+ }
+ catch
+ {
+ Tizen.Log.Error(Resources.LogTag, "Catch Unknown Exception: ");
+ }
+ }
+
+ public void TogglePreview()
+ {
+ if (previewMode == false)
+ {
+ HideItems();
+ }
+ else
+ {
+ ShowItems();
+ }
+ previewMode = !previewMode;
+ }
+
+ public void UpdateView()
+ {
+ bottomView.WidthSpecification = (int)(Window.Instance.Size.Width * 0.55f);
+ float wallpaperListViewWidth = bottomView.SizeWidth - (2 * previousButton.SizeWidth) - albumFolder.SizeWidth - 64.SpToPx();
+ maxWallpapers = (int)wallpaperListViewWidth / 130.SpToPx();
+ wallpaperListView.SizeWidth = wallpaperListViewWidth;
+ UpdateWallpapers();
+ }
+
+ private void HideItems()
+ {
+ centerText.Hide();
+ bottomView.Hide();
+ }
+
+ private void ShowItems()
+ {
+ centerText.Show();
+ bottomView.Show();
+ }
+
+ private void AddTextLabel()
+ {
+ centerText = new TextLabel()
+ {
+ HeightSpecification = 32.SpToPx(),
+ HorizontalAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center,
+ Text = "Preview", /*res.resx.LanguageResources.Preview,*/
+ TextColor = Color.White,
+ PixelSize = 24.SpToPx(),
+ FontFamily = "BreezeSans",
+ };
+ previewMode = false;
+ Add(centerText);
+ RelativeLayout.SetVerticalAlignment(centerText, RelativeLayout.Alignment.Center);
+ RelativeLayout.SetHorizontalAlignment(centerText, RelativeLayout.Alignment.Center);
+ }
+
+ private void AddBottomView()
+ {
+ bottomView = new View()
+ {
+ WidthSpecification = (int)(Window.Instance.Size.Width * 0.55f),
+ HeightSpecification = 144.SpToPx(),
+ Margin = new Extents(0, 0, 0, 80).SpToPx(),
+ CornerRadius = new Vector4(12, 12, 12, 12),
+ BackgroundColor = Color.White,
+ Layout = new LinearLayout()
+ {
+ CellPadding = new Size2D(16, 0).SpToPx(),
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ VerticalAlignment = VerticalAlignment.Center,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ }
+ };
+ bottomView.TouchEvent += (object source, TouchEventArgs e) =>
+ {
+ return true;
+ };
+ Add(bottomView);
+ RelativeLayout.SetHorizontalAlignment(bottomView, RelativeLayout.Alignment.Center);
+ RelativeLayout.SetVerticalAlignment(bottomView, RelativeLayout.Alignment.End);
+
+ AddPreviousButton();
+ AddAlbumsFolder();
+ startingIndex = 0;
+ AddWallpaperListView();
+ AddNextButton();
+ UpdateWallpapers();
+ }
+
+ private void AddPreviousButton()
+ {
+ StringSelector iconUrlSelector = new StringSelector()
+ {
+ Normal = Resources.GetLightImagePath() + "previous.png",
+ Pressed = Resources.GetLightImagePath() + "previous_pressed.png",
+ Disabled = Resources.GetLightImagePath() + "previous_disabled.png",
+ };
+ previousButton = new Button()
+ {
+ Size2D = new Size2D(48, 48).SpToPx(),
+ IconURLSelector = iconUrlSelector,
+ BackgroundColor = Color.Transparent,
+ IsEnabled = false,
+ };
+ previousButton.Clicked += OnPreviousButtonClicked;
+ bottomView.Add(previousButton);
+ }
+
+ private void OnPreviousButtonClicked(object sender, ClickedEventArgs e)
+ {
+ if (previousButton.IsEnabled == true)
+ {
+ startingIndex--;
+ UpdateWallpapers();
+ }
+ }
+
+ private void AddAlbumsFolder()
+ {
+ albumFolder = new Button()
+ {
+ Size2D = new Size2D(114, 114).SpToPx(),
+ BackgroundImage = Resources.GetLightImagePath() + "background.png",
+ IconURL = Resources.GetLightImagePath() + "folder.png",
+ };
+
+ albumFolder.Icon.Size2D = new Size2D(114, 114).SpToPx();
+ albumFolder.Clicked += OnAlbumFolderClicked;
+ bottomView.Add(albumFolder);
+ }
+
+ private void OnAlbumFolderClicked(object sender, ClickedEventArgs e)
+ {
+ //throw new NotImplementedException();
+ }
+
+ private void AddWallpaperListView()
+ {
+ float wallpaperListViewWidth = bottomView.SizeWidth - (2 * previousButton.SizeWidth) - albumFolder.SizeWidth - 64.SpToPx();
+ maxWallpapers = (int)wallpaperListViewWidth / 130.SpToPx();
+ Tizen.Log.Info(Resources.LogTag, "maxWallapers: " + maxWallpapers);
+ wallpaperListView = new View()
+ {
+ SizeWidth = wallpaperListViewWidth,
+ SizeHeight = 114.SpToPx(),
+ Layout = new LinearLayout()
+ {
+ CellPadding = new Size2D(16, 0).SpToPx(),
+ LinearOrientation = LinearLayout.Orientation.Horizontal,
+ VerticalAlignment = VerticalAlignment.Center,
+ HorizontalAlignment = HorizontalAlignment.Begin,
+ }
+ };
+ AddWallpaperButtons();
+ bottomView.Add(wallpaperListView);
+ }
+
+ private void AddWallpaperButtons()
+ {
+ wallpaperIcons = new List<Button>();
+ totalWallpapers = 0;
+ DirectoryInfo wallPaperDirectory = new DirectoryInfo(WallpaperPath);
+ foreach (FileInfo fi in wallPaperDirectory.GetFiles())
+ {
+ Tizen.Log.Info(Resources.LogTag, "Image: " + fi.Name);
+ Button wallpaper = new Button()
+ {
+ ThemeChangeSensitive = true,
+ WidthSpecification = 114.SpToPx(),
+ HeightSpecification = 114.SpToPx(),
+ CornerRadius = new Vector4(12, 12, 12, 12),
+ BackgroundColor = Color.Transparent,
+ BackgroundImage = WallpaperPath + fi.Name
+ };
+ wallpaper.Clicked += (object sender, ClickedEventArgs e) =>
+ {
+ CurrentWallpaper = wallpaper.BackgroundImage;
+ WallpaperChanged.Invoke(this, new EventArgs());
+ };
+ totalWallpapers++;
+ wallpaper.Hide();
+ wallpaperIcons.Add(wallpaper);
+ }
+ }
+
+ private void UpdateWallpapers()
+ {
+ while (wallpaperListView.ChildCount != 0)
+ {
+ Button wallpaper = (Button)wallpaperListView.GetChildAt(0);
+ wallpaper.Hide();
+ wallpaperListView.Remove(wallpaper);
+ }
+ Tizen.Log.Info(Resources.LogTag, "wallpapers count " + wallpaperIcons.Count);
+ for (int i = 0; i < maxWallpapers; i++)
+ {
+ if (i + startingIndex >= totalWallpapers)
+ {
+ break;
+ }
+ Button wallpaper = wallpaperIcons[i + startingIndex];
+ wallpaperListView.Add(wallpaper);
+ wallpaper.Show();
+ }
+ Tizen.Log.Info(Resources.LogTag, "new wallpapers Added ");
+ previousButton.IsEnabled = startingIndex != 0;
+ nextButton.IsEnabled = startingIndex + maxWallpapers < totalWallpapers;
+ }
+
+ private void AddNextButton()
+ {
+ StringSelector iconUrlSelector = new StringSelector()
+ {
+ Normal = Resources.GetLightImagePath() + "next.png",
+ Pressed = Resources.GetLightImagePath() + "next_pressed.png",
+ Disabled = Resources.GetLightImagePath() + "next_disabled.png",
+ };
+ nextButton = new Button()
+ {
+ Size2D = new Size2D(48, 48).SpToPx(),
+ BackgroundColor = Color.Transparent,
+ IconURLSelector = iconUrlSelector,
+ };
+ if (startingIndex + maxWallpapers >= totalWallpapers)
+ {
+ nextButton.IsEnabled = false;
+ }
+ nextButton.Clicked += OnNextButtonClicked;
+ bottomView.Add(nextButton);
+ }
+
+ private void OnNextButtonClicked(object sender, ClickedEventArgs e)
+ {
+ if (nextButton.IsEnabled == true)
+ {
+ startingIndex++;
+ UpdateWallpapers();
+ }
+ }
+
+ protected override void Dispose(DisposeTypes type)
+ {
+ if (Disposed)
+ {
+ return;
+ }
+ if (type == DisposeTypes.Explicit)
+ {
+
+ }
+ Tizen.Log.Info(Resources.LogTag, "WallpaperView Dispose");
+ base.Dispose(type);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M28 0H4C1.79086 0 0 1.79086 0 4V28C0 30.2091 1.79086 32 4 32H28C30.2091 32 32 30.2091 32 28V4C32 1.79086 30.2091 0 28 0Z" fill="#0075FF"/>
+<path d="M22.536 10.6779H22.028V10.5629C22.0272 10.1495 21.8626 9.75329 21.5702 9.46106C21.2777 9.16883 20.8814 9.00443 20.468 9.00391H9.56C9.1466 9.00443 8.75027 9.16883 8.45786 9.46106C8.16544 9.75329 8.00079 10.1495 8 10.5629V11.9499C8.00079 12.3633 8.16544 12.7595 8.45786 13.0518C8.75027 13.344 9.1466 13.5084 9.56 13.5089H20.468C20.8814 13.5084 21.2777 13.344 21.5702 13.0518C21.8626 12.7595 22.0272 12.3633 22.028 11.9499V11.8339H22.536C22.6238 11.8401 22.7055 11.8806 22.7635 11.9467C22.8216 12.0128 22.8512 12.0991 22.846 12.1869V13.6999C22.8481 13.7731 22.8274 13.8452 22.7867 13.9061C22.7461 13.967 22.6875 14.0138 22.619 14.0399L16.253 16.0809C15.9515 16.1809 15.6894 16.374 15.5047 16.6324C15.32 16.8908 15.222 17.2012 15.225 17.5189V18.1279C15.1701 18.1381 15.1204 18.1668 15.084 18.2092C15.0476 18.2516 15.0268 18.3051 15.025 18.3609V18.5539C14.9298 18.6061 14.8503 18.6828 14.7946 18.7759C14.7389 18.8691 14.709 18.9754 14.708 19.0839V21.9069C14.7285 22.1838 14.853 22.4428 15.0565 22.6317C15.2599 22.8207 15.5273 22.9257 15.805 22.9257C16.0827 22.9257 16.3501 22.8207 16.5536 22.6317C16.757 22.4428 16.8815 22.1838 16.902 21.9069V19.0989C16.9016 18.977 16.8662 18.8577 16.7999 18.7554C16.7335 18.6531 16.6392 18.572 16.528 18.5219V18.3629C16.526 18.3177 16.5111 18.2739 16.4851 18.2369C16.459 18.1999 16.4229 18.1711 16.381 18.1539V17.5209C16.3787 17.4478 16.3992 17.3757 16.4397 17.3148C16.4802 17.2539 16.5387 17.2071 16.607 17.1809L22.973 15.1409C23.2749 15.0411 23.5373 14.8479 23.7222 14.5892C23.9072 14.3306 24.0052 14.0199 24.002 13.7019V12.1889C24.0051 11.9934 23.9695 11.7992 23.8975 11.6175C23.8254 11.4357 23.7183 11.2699 23.5822 11.1296C23.446 10.9893 23.2835 10.8772 23.104 10.7997C22.9245 10.7221 22.7315 10.6808 22.536 10.6779ZM20.874 11.9479C20.8738 12.0555 20.8309 12.1586 20.7548 12.2347C20.6787 12.3108 20.5756 12.3536 20.468 12.3539H9.56C9.4524 12.3536 9.34931 12.3108 9.27322 12.2347C9.19714 12.1586 9.15429 12.0555 9.15402 11.9479V10.5629C9.15455 10.4554 9.19747 10.3524 9.2735 10.2764C9.34952 10.2004 9.45248 10.1574 9.56 10.1569H20.468C20.5755 10.1574 20.6785 10.2004 20.7545 10.2764C20.8305 10.3524 20.8735 10.4554 20.874 10.5629V11.9479Z" fill="#FAFAFA"/>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="7.0"
+ package="org.tizen.cssetting-wallpaper" version="1.0.0"
+ res-type="org.tizen.appfw.gadget.setting-wallpaper" res-version="1.5.0">
+ <allowed-package id="org.tizen.*">
+ <required-privileges>
+ <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+ </required-privileges>
+ </allowed-package>/>
+ <metadata key="http://tizen.org/metadata/ui-gadget/dll" value="SettingWallpaper.dll" />
+</manifest>
--- /dev/null
+# csproj file path
+csproj_file: SettingWallpaper.csproj
+
+# files monitored for dirty/modified status
+files:
+ - SettingWallpaper.csproj
+ - tizen-manifest.xml
+
+# Enable to pack as rpk
+pack_as_rpk: true
+
+# List of resource files to be packed in rpk
+resources:
+ - res/
+
\ No newline at end of file
--- /dev/null
+# Enable auto build file generation
+auto_gen_build_files: true
+# Workspace type, [native/web/dotnet]
+type: hybrid
+# Package ID for the Tizen package
+package_id:
+# version for the Tizen package
+version:
+# Default profile
+profile: mobile
+# Tizen API version
+api_version: 7.0
+# Path of profiles.xml, containing the signing profiles
+ # If value is empty, the profiles.xml in the data_path specified in tizen-studio/tools/tizen-core/config.yaml will be used
+profiles_xml_path:
+# Signing profile to be used for Tizen package signing
+ # If value is empty, active signing profile will be used
+signing_profile: ''
+# Build type [debug/ release/ test]
+build_type: debug
+# Rootstrap for compiling native app
+rootstrap: public
+# Default compiler for native app compilation
+compiler: llvm
+# Default path for dotnet-cli
+dotnet_cli_path:
+# Default path for msbuild
+msbuild_path:
+# Default tool for dotnet build [dotnet-cli/ msbuild]
+dotnet_build_tool: dotnet-cli
+# Default nuget version for Tizen.Net
+tizen_net_version:
+# Default nuget version for Xamarin.Forms
+tizen_net_sdk_verison: 1.1.9
+# Default nuget version for MSBuild.Tasks
+xamarin_forms_version: 5.0.0.2515
+# Default nuget version for Tizen.Wearable.CircleUI
+msbuild_tasks_version:
+# Default nuget version for Tizen.Wearable.CircleUI
+tizen_wearable_circleui_version: 1.5.0
+# Default nuget version for Tizen.OpenTK
+tizen_opentk_version: 3.0.2
+# Default nuget version for Tizen.NUI.Xaml
+tizen_nuixaml_version: 1.0.34
+# Default nuget version for Tizen.HotReload
+tizen_hotreload_version: 1.0.1
+# Working folder for dotnet & web workspace, paths to csproj or sln or config.xml, if empty all projects will be build
+working_folder:
+# Default path for Google Chrome
+chrome_path:
+# Default options to be passed to Chrome when running web simulator
+chrome_simulator_options:
+- --allow-file-access-from-files
+- --disable-web-security
+- --proxy-auto-detect
+# Default path for Web Simulator data
+chrome_simulator_data_path: C:\tizen-studio\tools\websimulator\sdk-profile-data
+# Default path for Samsung Tizen TV Simulator
+tv_simulator_path: C:\tizen-studio\tools\sec-tv-simulator\simulator.exe
+# Default options to be passed to Chrome when running web inspector
+chrome_inspector_options:
+- --no-first-run
+- --activate-on-launch
+- --no-default-browser-check
+- --allow-file-access-from-files
+- --disable-web-security
+- --disable-translate
+- --proxy-auto-detect
+- --proxy-bypass-list=127.0.0.1
+- --enable-blink-features=ShadowDOMV0
+- --enable-blink-features=CustomElementsV0
+# Default path for Web Inspector data
+chrome_inspector_data_path: C:\tizen-studio-data\chrome-user-data
+# default arch for build, [x86/ x86_64/ arm/ aarch64]
+arch: x86
+# Enable size optimization of wgt for web workspace
+opt: false
+# Source files matching these pattern will always be excluded from build
+src_file_patterns:
+- _exclude*
+# Source files matching these patterns will only be included while building in test mode
+test_file_patterns:
+- _test*
+# List of projects in the workspace and their dependencies
+projects:
+ SettingWallpaper: []
+# Skip generating files needed for VS
+skip_vs_files: false
+++ /dev/null
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.Applications;
-using Tizen.NUI;
-using Tizen.NUI.Components;
-
-namespace SettingView
-{
- public class Program : NUIApplication
- {
- private WidgetView widgetView;
- public Program() : base(ThemeOptions.PlatformThemeEnabled)
- {
- }
-
- protected override void OnCreate()
- {
- base.OnCreate();
- Window window = Window.Instance;
- window.KeyEvent += OnKeyEvent;
-
- Bundle bundle = new Bundle();
- bundle.AddItem("COUNT", "1");
- string encodedBundle = bundle.Encode();
-
- widgetView = WidgetViewManager.Instance.AddWidget("wallpaper@org.tizen.cssetting-wallpaper", encodedBundle, window.Size.Width, window.Size.Height, 0.0f);
- widgetView.Position = new Position(0, 0);
- widgetView.WidgetContentUpdated += OnWidgetContentUpdated;
- window.GetDefaultLayer().Add(widgetView);
- }
-
- private void OnWidgetContentUpdated(object sender, WidgetView.WidgetViewEventArgs e)
- {
- string encodedBundle = e.WidgetView.ContentInfo;
- Bundle bundle = Bundle.Decode(encodedBundle);
- if(bundle.TryGetItem("WIDGET_ACTION", out string widgetAction))
- {
- if(widgetAction.Equals("POP"))
- {
- GetDefaultWindow().GetDefaultNavigator().Pop();
- Exit();
- }
- }
- }
-
- public void OnKeyEvent(object sender, Window.KeyEventArgs e)
- {
- if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape"))
- {
- Exit();
- }
- }
- static void Main(string[] args)
- {
- var app = new Program();
- app.Run(args);
- }
- }
-}
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- <TargetFramework>tizen10.0</TargetFramework>
- <LangVersion>8.0</LangVersion>
- <TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
- </PropertyGroup>
-
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugType>portable</DebugType>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>None</DebugType>
- </PropertyGroup>
-
- <ItemGroup>
- <EmbeddedResource Include="*.xaml">
- <Generator>MSBuild:Compile</Generator>
- </EmbeddedResource>
- </ItemGroup>
-
- <ItemGroup>
- <PackageReference Include="Tizen.NET" Version="10.0.0.17432" />
- <PackageReference Include="Tizen.NET.Sdk" Version="1.1.8" />
- </ItemGroup>
-
- <ItemGroup>
- <Folder Include="res\theme\" />
- </ItemGroup>
-
-</Project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="7" package="org.tizen.SettingView" version="1.0.0">
- <profile name="common" />
- <ui-application appid="org.tizen.SettingView" exec="SettingView.dll" type="dotnet" multiple="false" taskmanage="true" nodisplay="false" launch_mode="single">
- <icon>SettingView.png</icon>
- <label>SettingView</label>
- <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
- </ui-application>
- <privileges>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- <privilege>http://tizen.org/privilege/datasharing</privilege>
- <privilege>http://tizen.org/privilege/widget.viewer</privilege>
- </privileges>
-</manifest>
+++ /dev/null
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.32228.343
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SettingView", "SettingView\SettingView.csproj", "{899E27F2-5344-47F1-9547-8868E5B997BD}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SettingWallpaper", "SettingWallpaper\SettingWallpaper.csproj", "{8F70E0B5-87EA-4FD1-B714-6E41F123F5FD}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {899E27F2-5344-47F1-9547-8868E5B997BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {899E27F2-5344-47F1-9547-8868E5B997BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {899E27F2-5344-47F1-9547-8868E5B997BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {899E27F2-5344-47F1-9547-8868E5B997BD}.Release|Any CPU.Build.0 = Release|Any CPU
- {8F70E0B5-87EA-4FD1-B714-6E41F123F5FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8F70E0B5-87EA-4FD1-B714-6E41F123F5FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8F70E0B5-87EA-4FD1-B714-6E41F123F5FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8F70E0B5-87EA-4FD1-B714-6E41F123F5FD}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {008F24DB-DAFE-4CF0-B19D-62C667BEB247}
- EndGlobalSection
-EndGlobal
+++ /dev/null
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.System;
-
-namespace SettingWallpaper.Common
-{
- public static class DeviceInfo
- {
- private static int width;
- private static int height;
- private const string WidthKey = "tizen.org/feature/screen.width";
- private const string HeightKey = "tizen.org/feature/screen.height";
-
- static DeviceInfo()
- {
- bool isWidthAvailable = Information.TryGetValue(WidthKey, out width);
- bool isHeightAvailable = Information.TryGetValue(HeightKey, out height);
- if (isHeightAvailable == false || isWidthAvailable == false)
- {
- width = 1280;
- height = 1080;
- Tizen.Log.Debug(Resources.LogTag, "Width and height are not available , setting default size as 1280 x 720");
- }
- IsPortrait = width < height;
- }
-
- public static bool IsPortrait { get; private set; }
-
- public static int DisplayWidth => width;
-
- public static int DisplayHeight => height;
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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;
-
-namespace SettingWallpaper.Common
-{
- class Resources
- {
- public const string LogTag = "SettingWallpaper";
- public const string LightPlatformThemeId = "org.tizen.default-light-theme";
- public const string DarkPlatformThemeId = "org.tizen.default-dark-theme";
-
- public static readonly PropertyMap FontStyleNormalLight = new PropertyMap().
- Add("width", new PropertyValue("normal")).
- Add("weight", new PropertyValue("light"));
-
- public static readonly PropertyMap FontStyleAllNormal = new PropertyMap().
- Add("width", new PropertyValue("normal")).
- Add("weight", new PropertyValue("normal")).
- Add("slant", new PropertyValue("normal"));
-
- public static string GetThemePath()
- {
- return Tizen.Applications.Application.Current.DirectoryInfo.Resource + "themes/";
- }
- public static string GetImagePath()
- {
- return Tizen.Applications.Application.Current.DirectoryInfo.Resource + "images/";
- }
-
- public static string GetLightImagePath()
- {
- return GetImagePath() + "light/";
- }
-
- public static string GetDarkImagePath()
- {
- return GetImagePath() + "dark/";
- }
-
- public static string GetCurrentThemePath()
- {
- return (ThemeManager.PlatformThemeId == LightPlatformThemeId) ? GetLightImagePath() : GetDarkImagePath();
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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 System.Collections.Generic;
-using Tizen.NUI;
-
-namespace SettingWallpaper
-{
- public class Program : NUIWidgetApplication
- {
- public Program(Dictionary<Type, string> widgetSet) : base(widgetSet)
- {
-
- }
-
- protected override void OnCreate()
- {
- base.OnCreate();
- }
-
- static void Main(string[] args)
- {
- Dictionary<Type, string> widgetSet = new Dictionary<Type, string>();
- widgetSet.Add(typeof(SettingWidgetWallpaper), "wallpaper@org.tizen.cssetting-wallpaper");
- var app = new Program(widgetSet);
- app.Run(args);
- }
- }
-}
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <PropertyGroup>
- <OutputType>Exe</OutputType>
- <TargetFramework>tizen10.0</TargetFramework>
- <LangVersion>8.0</LangVersion>
- <TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
- </PropertyGroup>
-
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugType>portable</DebugType>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>None</DebugType>
- </PropertyGroup>
-
- <ItemGroup>
- <EmbeddedResource Include="*.xaml">
- <Generator>MSBuild:Compile</Generator>
- </EmbeddedResource>
- </ItemGroup>
-
- <ItemGroup>
- <None Remove="res\themes\dark.xaml" />
- <None Remove="res\themes\light.xaml" />
- </ItemGroup>
-
- <ItemGroup>
- <EmbeddedResource Include="res\themes\dark.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </EmbeddedResource>
- <EmbeddedResource Include="res\themes\light.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </EmbeddedResource>
- </ItemGroup>
-
- <ItemGroup>
- <PackageReference Include="Tizen.NET" Version="10.0.0.17432" />
- <PackageReference Include="Tizen.NET.Sdk" Version="1.1.8" />
- </ItemGroup>
-
- <ItemGroup>
- <Folder Include="res\images\light\" />
- <Folder Include="res\images\dark\" />
- </ItemGroup>
-
- <ItemGroup>
- <Compile Update="res\resx\LanguageResources.Designer.cs">
- <DesignTime>True</DesignTime>
- <AutoGen>True</AutoGen>
- <DependentUpon>LanguageResources.resx</DependentUpon>
- </Compile>
- </ItemGroup>
-
- <ItemGroup>
- <EmbeddedResource Update="res\resx\LanguageResources.resx">
- <Generator>PublicResXFileCodeGenerator</Generator>
- <LastGenOutput>LanguageResources.Designer.cs</LastGenOutput>
- </EmbeddedResource>
- </ItemGroup>
-
-</Project>
+++ /dev/null
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.Applications;
-using Tizen.NUI;
-using Tizen.NUI.Components;
-using SettingWallpaper.Common;
-
-namespace SettingWallpaper
-{
- class SettingWidgetWallpaper : Widget
- {
- private static Navigator navigator;
- private static Window window;
- protected override void OnCreate(string contentInfo, Window win)
- {
- Bundle bundle = Bundle.Decode(contentInfo);
- window = win;
- navigator = window.GetDefaultNavigator();
- window.SetTransparency(true);
- window.BackgroundColor = Color.Transparent;
-
- ViewManager.Instance.Initialize(window);
- ViewManager.ApplicationClosed += (object sender, System.EventArgs e) =>
- {
- Bundle nextBundle = new Bundle();
- nextBundle.AddItem("WIDGET_ACTION", "POP");
- string encodedBundle = nextBundle.Encode();
- SetContentInfo(encodedBundle);
- };
- navigator.Push(ViewManager.Instance.GetContentPage());
- window.Resized += OnWindowResized;
- }
-
- private void OnWindowResized(object sender, Window.ResizedEventArgs e)
- {
- Tizen.Log.Info(Resources.LogTag, " Window Resized");
- ViewManager.Instance.UpdateViews();
- }
-
- protected override void OnPause()
- {
- base.OnPause();
- }
-
- protected override void OnResume()
- {
- base.OnResume();
- }
-
- protected override void OnResize(Window window)
- {
- base.OnResize(window);
- }
-
- protected override void OnUpdate(string contentInfo, int force)
- {
- base.OnUpdate(contentInfo, force);
- }
-
- protected override void OnTerminate(string contentInfo, TerminationType type)
- {
- base.OnTerminate(contentInfo, type);
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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 System.IO;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Tizen.NUI.Xaml;
-using SettingWallpaper.Common;
-using SettingWallpaper.Views;
-
-namespace SettingWallpaper
-{
- class ViewManager
- {
- public static event EventHandler<EventArgs> ApplicationClosed;
-
- private static ViewManager instance = null;
- private static Window window;
-
- private AppBar appBar;
- private WallpaperView wallpaperView;
- private ContentPage contentPage;
-
- private ViewManager()
- {
- }
-
- public static ViewManager Instance
- {
- get
- {
- if (instance == null)
- {
- instance = new ViewManager();
- }
- return instance;
- }
- }
-
- public void Initialize(Window win)
- {
- Tizen.Log.Info(Resources.LogTag, "Initializing ViewManager");
- window = win;
- UpdateTheme(ThemeManager.PlatformThemeId);
- CreateAppBar();
- wallpaperView = new WallpaperView(window);
- wallpaperView.TouchEvent += (object source, View.TouchEventArgs e) =>
- {
- if (e.Touch.GetState(0) == PointStateType.Down)
- {
- wallpaperView.TogglePreview();
- ToggleAppBar();
- }
- return true;
- };
- wallpaperView.WallpaperChanged += (object source, EventArgs e) =>
- {
- contentPage.BackgroundImage = wallpaperView.CurrentWallpaper;
- };
- CreateContentPage();
- ThemeManager.ThemeChanged += OnThemeChanged;
- Tizen.Log.Info(Resources.LogTag, "Initialization Done");
- }
-
- public void CleanUp()
- {
- Tizen.Log.Error(Resources.LogTag, "Cleaning Resources");
- ThemeManager.ThemeChanged -= OnThemeChanged;
- appBar?.Dispose();
- wallpaperView?.Dispose();
- contentPage?.Dispose();
- }
-
- public void UpdateViews()
- {
- wallpaperView.UpdateView();
- }
-
- public ContentPage GetContentPage()
- {
- return contentPage;
- }
-
- public void SetCurrentWallpaper()
- {
- wallpaperView.SetCurrentWallpaper();
- }
-
- private void CreateAppBar()
- {
- appBar = new AppBar()
- {
- AutoNavigationContent = false,
- BackgroundColor = Color.Transparent,
- Layout = new RelativeLayout()
- {
- Padding = new Extents(0, 16, 0, 0).SpToPx(),
- },
- };
-
- StringSelector iconUrlSelector = new StringSelector()
- {
- Normal = Resources.GetLightImagePath() + "back.png",
- Pressed = Resources.GetLightImagePath() + "back_pressed.png",
- };
- Button navigationContent = new Button()
- {
- Size2D = new Size2D(48, 48).SpToPx(),
- IconURLSelector = iconUrlSelector,
- BackgroundColor = Color.Transparent,
- };
- navigationContent.Icon.Size2D = new Size2D(48, 48).SpToPx();
- navigationContent.Clicked += (object source, ClickedEventArgs e) =>
- {
- CloseSettingWallpaper();
- };
- appBar.NavigationContent = navigationContent;
- RelativeLayout.SetVerticalAlignment(appBar.NavigationContent, RelativeLayout.Alignment.Center);
-
- TextLabel titleContent = new TextLabel(res.resx.LanguageResources.Title)
- {
- StyleName = "PageLabel",
- PixelSize = 24.SpToPx(),
- FontFamily = "BreezeSans",
- VerticalAlignment = VerticalAlignment.Center,
- FontStyle = Resources.FontStyleAllNormal,
- Margin = new Extents(16, 0, 0, 0).SpToPx(),
- };
- appBar.TitleContent = titleContent;
- RelativeLayout.SetLeftTarget(appBar.TitleContent, appBar.NavigationContent);
- RelativeLayout.SetLeftRelativeOffset(appBar.TitleContent, 1.0f);
- RelativeLayout.SetVerticalAlignment(appBar.TitleContent, RelativeLayout.Alignment.Center);
- RelativeLayout.SetFillHorizontal(appBar.TitleContent, true);
-
- Button actionContent = new Button()
- {
- Text = res.resx.LanguageResources.Save,
- Size2D = new Size2D(110, 48).SpToPx(),
- PointSize = 12.SpToPx(),
- ThemeChangeSensitive = true,
- };
- actionContent.Clicked += (object sender, ClickedEventArgs e) =>
- {
- SetCurrentWallpaper();
- CloseSettingWallpaper();
- };
- appBar.ActionContent = actionContent;
- RelativeLayout.SetHorizontalAlignment(appBar.ActionContent, RelativeLayout.Alignment.End);
- RelativeLayout.SetVerticalAlignment(appBar.ActionContent, RelativeLayout.Alignment.Center);
- }
-
- private void ToggleAppBar()
- {
- if (appBar.Visibility == false)
- {
- appBar.Show();
- }
- else
- {
- appBar.Hide();
- }
- }
-
- private void CloseSettingWallpaper()
- {
- CleanUp();
- ApplicationClosed.Invoke(this, new EventArgs());
- }
-
- private void CreateContentPage()
- {
- contentPage = new ContentPage()
- {
- AppBar = appBar,
- Content = wallpaperView,
- BackgroundImage = wallpaperView.CurrentWallpaper,
- ThemeChangeSensitive = true,
- };
- }
-
- private void OnThemeChanged(object sender, ThemeChangedEventArgs e)
- {
- if (e.IsPlatformThemeChanged)
- {
- Tizen.Log.Info(Resources.LogTag, "Theme Changed: " + e.ThemeId);
- UpdateTheme(e.PlatformThemeId);
- }
- }
-
- private void SetTheme(string path)
- {
- try
- {
- Theme theme = new Theme(path);
- ThemeManager.ApplyTheme(theme);
- }
- catch (ArgumentNullException e)
- {
- Tizen.Log.Error(Resources.LogTag, "ArgumentNullException: " + e.ParamName);
- }
- catch (IOException e)
- {
- Tizen.Log.Error(Resources.LogTag, "IOException: " + e.Message);
- }
- catch (XamlParseException e)
- {
- Tizen.Log.Error(Resources.LogTag, "XamlParseException: " + e.Message);
- if (e.XmlInfo != null)
- {
- Tizen.Log.Error(Resources.LogTag, "XamlParseException, LineNo." + e.XmlInfo.LineNumber + " Pos: " + e.XmlInfo.LinePosition + " HasInfo: " + e.XmlInfo.HasLineInfo().ToString());
- }
- }
- }
- private void UpdateTheme(string platformThemeId)
- {
- if (platformThemeId == null)
- {
- Tizen.Log.Error(Resources.LogTag, "Platform theme id is null");
- return;
- }
- if (platformThemeId.Equals(Resources.LightPlatformThemeId))
- {
- SetTheme(Resources.GetThemePath() + "light.xaml");
- }
- else if (platformThemeId.Equals(Resources.DarkPlatformThemeId))
- {
- SetTheme(Resources.GetThemePath() + "dark.xaml");
- }
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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 System.Collections.Generic;
-using System.IO;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.Components;
-using Tizen.System;
-using SettingWallpaper.Common;
-
-namespace SettingWallpaper.Views
-{
- class WallpaperView : View
- {
- public event EventHandler<EventArgs> WallpaperChanged;
-
- private TextLabel centerText;
- private View bottomView;
- private View wallpaperListView;
- private Button previousButton;
- private Button nextButton;
- private Button albumFolder;
- private List<Button> wallpaperIcons;
- private int startingIndex;
- private int maxWallpapers;
- private int totalWallpapers;
- private bool previewMode;
- private const string WallpaperPath = "/opt/usr/data/settings/Wallpapers/";
- private static Window window;
-
- public WallpaperView(Window win)
- {
- window = win;
- WidthSpecification = LayoutParamPolicies.MatchParent;
- HeightSpecification = LayoutParamPolicies.MatchParent;
- CurrentWallpaper = SystemSettings.WallpaperHomeScreen;
- Layout = new RelativeLayout();
- AddTextLabel();
- AddBottomView();
- Tizen.Log.Info(Resources.LogTag, "WallpaperView Created");
- }
-
- public string CurrentWallpaper { get; set; }
-
- public void SetCurrentWallpaper()
- {
- Tizen.Log.Info(Resources.LogTag, "SaveButton Clicked.");
- try
- {
- SystemSettings.WallpaperHomeScreen = CurrentWallpaper;
- }
- catch (ArgumentException ex)
- {
- Tizen.Log.Error(Resources.LogTag, "ArgumentException: " + ex.Message);
- }
- catch (NotSupportedException ex)
- {
- Tizen.Log.Error(Resources.LogTag, "NotSupportedException: " + ex.Message);
- }
- catch (InvalidOperationException ex)
- {
- Tizen.Log.Error(Resources.LogTag, "InvalidOperationException: " + ex.Message);
- }
- catch (UnauthorizedAccessException ex)
- {
- Tizen.Log.Error(Resources.LogTag, "UnauthorizedAccessException Exception: " + ex.Message);
- }
- catch
- {
- Tizen.Log.Error(Resources.LogTag, "Catch Unknown Exception: ");
- }
- }
-
- public void TogglePreview()
- {
- if (previewMode == false)
- {
- HideItems();
- }
- else
- {
- ShowItems();
- }
- previewMode = !previewMode;
- }
-
- public void UpdateView()
- {
- bottomView.WidthSpecification = (int)(window.Size.Width * 0.55f);
- float wallpaperListViewWidth = bottomView.SizeWidth - (2 * previousButton.SizeWidth) - albumFolder.SizeWidth - 64.SpToPx();
- maxWallpapers = (int)wallpaperListViewWidth / 130.SpToPx();
- wallpaperListView.SizeWidth = wallpaperListViewWidth;
- UpdateWallpapers();
- }
-
- private void HideItems()
- {
- centerText.Hide();
- bottomView.Hide();
- }
-
- private void ShowItems()
- {
- centerText.Show();
- bottomView.Show();
- }
-
- private void AddTextLabel()
- {
- centerText = new TextLabel()
- {
- HeightSpecification = 32.SpToPx(),
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center,
- Text = res.resx.LanguageResources.Preview,
- TextColor = Color.White,
- PixelSize = 24.SpToPx(),
- FontFamily = "BreezeSans",
- };
- previewMode = false;
- Add(centerText);
- RelativeLayout.SetVerticalAlignment(centerText, RelativeLayout.Alignment.Center);
- RelativeLayout.SetHorizontalAlignment(centerText, RelativeLayout.Alignment.Center);
- }
-
- private void AddBottomView()
- {
- bottomView = new View()
- {
- WidthSpecification = (int)(window.Size.Width * 0.55f),
- HeightSpecification = 144.SpToPx(),
- Margin = new Extents(0, 0, 0, 80).SpToPx(),
- CornerRadius = new Vector4(12, 12, 12, 12),
- BackgroundColor = Color.White,
- Layout = new LinearLayout()
- {
- CellPadding = new Size2D(16, 0).SpToPx(),
- LinearOrientation = LinearLayout.Orientation.Horizontal,
- VerticalAlignment = VerticalAlignment.Center,
- HorizontalAlignment = HorizontalAlignment.Center,
- }
- };
- bottomView.TouchEvent += (object source, TouchEventArgs e) =>
- {
- return true;
- };
- Add(bottomView);
- RelativeLayout.SetHorizontalAlignment(bottomView, RelativeLayout.Alignment.Center);
- RelativeLayout.SetVerticalAlignment(bottomView, RelativeLayout.Alignment.End);
-
- AddPreviousButton();
- AddAlbumsFolder();
- startingIndex = 0;
- AddWallpaperListView();
- AddNextButton();
- UpdateWallpapers();
- }
-
- private void AddPreviousButton()
- {
- StringSelector iconUrlSelector = new StringSelector()
- {
- Normal = Resources.GetLightImagePath() + "previous.png",
- Pressed = Resources.GetLightImagePath() + "previous_pressed.png",
- Disabled = Resources.GetLightImagePath() + "previous_disabled.png",
- };
- previousButton = new Button()
- {
- Size2D = new Size2D(48, 48).SpToPx(),
- IconURLSelector = iconUrlSelector,
- BackgroundColor = Color.Transparent,
- IsEnabled = false,
- };
- previousButton.Clicked += OnPreviousButtonClicked;
- bottomView.Add(previousButton);
- }
-
- private void OnPreviousButtonClicked(object sender, ClickedEventArgs e)
- {
- if (previousButton.IsEnabled == true)
- {
- startingIndex--;
- UpdateWallpapers();
- }
- }
-
- private void AddAlbumsFolder()
- {
- albumFolder = new Button()
- {
- Size2D = new Size2D(114, 114).SpToPx(),
- BackgroundImage = Resources.GetLightImagePath() + "background.png",
- IconURL = Resources.GetLightImagePath() + "folder.png",
- };
- albumFolder.Icon.Size2D = new Size2D(114, 114).SpToPx();
- albumFolder.Clicked += OnAlbumFolderClicked;
- bottomView.Add(albumFolder);
- }
-
- private void OnAlbumFolderClicked(object sender, ClickedEventArgs e)
- {
- //throw new NotImplementedException();
- }
-
- private void AddWallpaperListView()
- {
- float wallpaperListViewWidth = bottomView.SizeWidth - (2 * previousButton.SizeWidth) - albumFolder.SizeWidth - 64.SpToPx();
- maxWallpapers = (int)wallpaperListViewWidth / 130.SpToPx();
- Tizen.Log.Info(Resources.LogTag, "maxWallapers: " + maxWallpapers);
- wallpaperListView = new View()
- {
- SizeWidth = wallpaperListViewWidth,
- SizeHeight = 114.SpToPx(),
- Layout = new LinearLayout()
- {
- CellPadding = new Size2D(16, 0).SpToPx(),
- LinearOrientation = LinearLayout.Orientation.Horizontal,
- VerticalAlignment = VerticalAlignment.Center,
- HorizontalAlignment = HorizontalAlignment.Begin,
- }
- };
- AddWallpaperButtons();
- bottomView.Add(wallpaperListView);
- }
-
- private void AddWallpaperButtons()
- {
- wallpaperIcons = new List<Button>();
- totalWallpapers = 0;
- DirectoryInfo wallPaperDirectory = new DirectoryInfo(WallpaperPath);
- foreach (FileInfo fi in wallPaperDirectory.GetFiles())
- {
- Tizen.Log.Info(Resources.LogTag, "Image: " + fi.Name);
- Button wallpaper = new Button()
- {
- ThemeChangeSensitive = true,
- WidthSpecification = 114.SpToPx(),
- HeightSpecification = 114.SpToPx(),
- CornerRadius = new Vector4(12, 12, 12, 12),
- BackgroundColor = Color.Transparent,
- BackgroundImage = WallpaperPath + fi.Name
- };
- wallpaper.Clicked += (object sender, ClickedEventArgs e) =>
- {
- CurrentWallpaper = wallpaper.BackgroundImage;
- WallpaperChanged.Invoke(this, new EventArgs());
- };
- totalWallpapers++;
- wallpaper.Hide();
- wallpaperIcons.Add(wallpaper);
- }
- }
-
- private void UpdateWallpapers()
- {
- while (wallpaperListView.ChildCount != 0)
- {
- Button wallpaper = (Button)wallpaperListView.GetChildAt(0);
- wallpaper.Hide();
- wallpaperListView.Remove(wallpaper);
- }
- Tizen.Log.Info(Resources.LogTag, "wallpapers count " + wallpaperIcons.Count);
- for (int i = 0; i < maxWallpapers; i++)
- {
- if (i + startingIndex >= totalWallpapers)
- {
- break;
- }
- Button wallpaper = wallpaperIcons[i + startingIndex];
- wallpaperListView.Add(wallpaper);
- wallpaper.Show();
- }
- Tizen.Log.Info(Resources.LogTag, "new wallpapers Added ");
- previousButton.IsEnabled = startingIndex != 0;
- nextButton.IsEnabled = startingIndex + maxWallpapers < totalWallpapers;
- }
-
- private void AddNextButton()
- {
- StringSelector iconUrlSelector = new StringSelector()
- {
- Normal = Resources.GetLightImagePath() + "next.png",
- Pressed = Resources.GetLightImagePath() + "next_pressed.png",
- Disabled = Resources.GetLightImagePath() + "next_disabled.png",
- };
- nextButton = new Button()
- {
- Size2D = new Size2D(48, 48).SpToPx(),
- BackgroundColor = Color.Transparent,
- IconURLSelector = iconUrlSelector,
- };
- if (startingIndex + maxWallpapers >= totalWallpapers)
- {
- nextButton.IsEnabled = false;
- }
- nextButton.Clicked += OnNextButtonClicked;
- bottomView.Add(nextButton);
- }
-
- private void OnNextButtonClicked(object sender, ClickedEventArgs e)
- {
- if (nextButton.IsEnabled == true)
- {
- startingIndex++;
- UpdateWallpapers();
- }
- }
-
- protected override void Dispose(DisposeTypes type)
- {
- if (Disposed)
- {
- return;
- }
- if (type == DisposeTypes.Explicit)
- {
-
- }
- Tizen.Log.Info(Resources.LogTag, "WallpaperView Dispose");
- base.Dispose(type);
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace SettingWallpaper.res.resx {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- public class LanguageResources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal LanguageResources() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- public static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SettingWallpaper.res.resx.LanguageResources", typeof(LanguageResources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- public static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Tap to preview.
- /// </summary>
- public static string Preview {
- get {
- return ResourceManager.GetString("Preview", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Save.
- /// </summary>
- public static string Save {
- get {
- return ResourceManager.GetString("Save", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Wallpapers.
- /// </summary>
- public static string Title {
- get {
- return ResourceManager.GetString("Title", resourceCulture);
- }
- }
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="Preview" xml:space="preserve">
- <value>탭하여 미리보기</value>
- </data>
- <data name="Save" xml:space="preserve">
- <value>저장</value>
- </data>
- <data name="Title" xml:space="preserve">
- <value>월페이퍼</value>
- </data>
-</root>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="Preview" xml:space="preserve">
- <value>Tap to preview</value>
- </data>
- <data name="Save" xml:space="preserve">
- <value>Save</value>
- </data>
- <data name="Title" xml:space="preserve">
- <value>Wallpapers</value>
- </data>
-</root>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Theme
-xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
-xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
-xmlns:c="clr-namespace:Tizen.NUI.Components;assembly=Tizen.NUI.Components"
-Id="DarkTheme">
-
- <ViewStyle x:Key="Background" ThemeChangeSensitive="true" BackgroundColor="#16131A" />
-
- <c:DefaultTitleItemStyle x:Key="Header" ThemeChangeSensitive="true" >
- <c:DefaultTitleItemStyle.Label>
- <TextLabelStyle PixelSize ="24sp" TextColor ="#FDFDFD" />
- </c:DefaultTitleItemStyle.Label>
- </c:DefaultTitleItemStyle>
-
- <TextLabelStyle x:Key="PageLabel" ThemeChangeSensitive="true" TextColor="#FAFAFA" FontFamily="BreezeSans"/>
-
- <TextLabelStyle x:Key="AlbumLabel" ThemeChangeSensitive="true" TextColor="#FAFAFA" FontFamily="BreezeSans"/>
-
- <c:ButtonStyle x:Key="ReturnButton" Size="48sp, 48sp" ThemeChangeSensitive="true" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
- <c:ButtonStyle.Icon>
- <ImageViewStyle Size="48sp, 48sp">
- <ImageViewStyle.ResourceUrl>
- <Selector x:TypeArguments="x:String" Normal="*Resource*/images/dark/return.png" Pressed="*Resource*/images/dark/return.png" />
- </ImageViewStyle.ResourceUrl>
- </ImageViewStyle>
- </c:ButtonStyle.Icon>
- </c:ButtonStyle>
-
- <c:ButtonStyle x:Key="BackButton" Size="48sp, 48sp" ThemeChangeSensitive="true" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
- <c:ButtonStyle.Icon>
- <ImageViewStyle Size="48sp, 48sp">
- <ImageViewStyle.ResourceUrl>
- <Selector x:TypeArguments="x:String" Normal="*Resource*/images/dark/back.png" Pressed="*Resource*/images/dark/back.png" />
- </ImageViewStyle.ResourceUrl>
- </ImageViewStyle>
- </c:ButtonStyle.Icon>
- </c:ButtonStyle>
-
- <c:ButtonStyle x:Key="FolderIcon" Size="48sp, 48sp" ThemeChangeSensitive="true" IsSelectable="false" IsEnabled="true" BackgroundImage="*Resource*/images/dark/background.png">
- <c:ButtonStyle.Icon>
- <ImageViewStyle Size="78sp, 65sp">
- <ImageViewStyle.ResourceUrl>
- <Selector x:TypeArguments="x:String" Normal="*Resource*/images/dark/folder.png" Pressed="*Resource*/images/dark/folder.png" />
- </ImageViewStyle.ResourceUrl>
- </ImageViewStyle>
- </c:ButtonStyle.Icon>
- </c:ButtonStyle>
-
- <c:ButtonStyle x:Key="ForwardButton" Size="48sp, 48sp" ThemeChangeSensitive="true" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
- <c:ButtonStyle.Icon>
- <ImageViewStyle Size="48sp, 48sp">
- <ImageViewStyle.ResourceUrl>
- <Selector x:TypeArguments="x:String" Normal="*Resource*/images/dark/forward.png" Pressed="*Resource*/images/dark/forward.png" />
- </ImageViewStyle.ResourceUrl>
- </ImageViewStyle>
- </c:ButtonStyle.Icon>
- </c:ButtonStyle>
-
-</Theme>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Theme
-xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
-xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
-xmlns:c="clr-namespace:Tizen.NUI.Components;assembly=Tizen.NUI.Components"
-Id="LightTheme">
-
- <ViewStyle x:Key="Background" ThemeChangeSensitive="true" BackgroundColor="#FAFAFA" />
-
- <c:DefaultTitleItemStyle x:Key="Header" ThemeChangeSensitive="true">
- <c:DefaultTitleItemStyle.Label>
- <TextLabelStyle PixelSize ="24sp" TextColor ="#090E21" />
- </c:DefaultTitleItemStyle.Label>
- </c:DefaultTitleItemStyle>
-
- <TextLabelStyle x:Key="PageLabel" ThemeChangeSensitive="true" TextColor="#090E21" FontFamily="BreezeSans"/>
-
- <TextLabelStyle x:Key="AlbumLabel" ThemeChangeSensitive="true" TextColor="#090E21" FontFamily="BreezeSans"/>
-
- <c:ButtonStyle x:Key="ReturnButton" Size="48sp, 48sp" ThemeChangeSensitive="true" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
- <c:ButtonStyle.Icon>
- <ImageViewStyle Size="48sp, 48sp">
- <ImageViewStyle.ResourceUrl>
- <Selector x:TypeArguments="x:String" Normal="*Resource*/images/light/return.png" Pressed="*Resource*/images/light/return.png" />
- </ImageViewStyle.ResourceUrl>
- </ImageViewStyle>
- </c:ButtonStyle.Icon>
- </c:ButtonStyle>
-
- <c:ButtonStyle x:Key="BackButton" Size="48sp, 48sp" ThemeChangeSensitive="true" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
- <c:ButtonStyle.Icon>
- <ImageViewStyle Size="48sp, 48sp">
- <ImageViewStyle.ResourceUrl>
- <Selector x:TypeArguments="x:String" Normal="*Resource*/images/light/back.png" Pressed="*Resource*/images/light/back.png" />
- </ImageViewStyle.ResourceUrl>
- </ImageViewStyle>
- </c:ButtonStyle.Icon>
- </c:ButtonStyle>
-
- <c:ButtonStyle x:Key="FolderIcon" Size="48sp, 48sp" ThemeChangeSensitive="true" IsSelectable="false" IsEnabled="true" BackgroundImage="*Resource*/images/light/background.png">
- <c:ButtonStyle.Icon>
- <ImageViewStyle Size="78sp, 65sp">
- <ImageViewStyle.ResourceUrl>
- <Selector x:TypeArguments="x:String" Normal="*Resource*/images/light/folder.png" Pressed="*Resource*/images/light/folder.png" />
- </ImageViewStyle.ResourceUrl>
- </ImageViewStyle>
- </c:ButtonStyle.Icon>
- </c:ButtonStyle>
-
- <c:ButtonStyle x:Key="ForwardButton" Size="48sp, 48sp" ThemeChangeSensitive="true" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
- <c:ButtonStyle.Icon>
- <ImageViewStyle Size="48sp, 48sp">
- <ImageViewStyle.ResourceUrl>
- <Selector x:TypeArguments="x:String" Normal="*Resource*/images/light/forward.png" Pressed="*Resource*/images/light/forward.png" />
- </ImageViewStyle.ResourceUrl>
- </ImageViewStyle>
- </c:ButtonStyle.Icon>
- </c:ButtonStyle>
-
-</Theme>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="7" package="org.tizen.cssetting-wallpaper" version="1.0.0">
- <profile name="common" />
- <widget-application appid="org.tizen.cssetting-wallpaper" exec="SettingWallpaper.dll" type="dotnet" multiple="false" taskmanage="true" nodisplay="false" launch_mode="single">
- <icon>SettingWallpaper.png</icon>
- <label>SettingWallpaper</label>
- <metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
- <widget-class classid="wallpaper" update-period="0">
- <support-size preview="SettingWallpaper.png">4x4</support-size>
- </widget-class>
- </widget-application>
- <privileges>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
- <privilege>http://tizen.org/privilege/systemsettings.admin</privilege>
- <privilege>http://tizen.org/privilege/datasharing</privilege>
- <privilege>http://tizen.org/privilege/widget.viewer</privilege>
- </privileges>
-</manifest>
-Name: org.tizen.cssetting-wallpaper
-Summary: org.tizen.cssetting-wallpaper
-Version: 1.0.0
-Release: 1
-Group: N/A
-License: Apache-2.0
+Name: org.tizen.setting-wallpaper
+summary: NUI wallpaper setting application
+Version: 1.0.0
+Release: 1
+Provides: org.tizen.setting-wallpaper = %{version}-%{release}
+Group: Applications/Security
+License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
-ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
-
-BuildRequires: pkgconfig(libtzplatform-config)
-Requires(post): /usr/bin/tpk-backend
-
-%define internal_name org.tizen.cssetting-wallpaper
-%define preload_tpk_path %{TZ_SYS_RO_APP}/.preload-tpk
+Requires(post): /usr/bin/pkgcmd
+Requires(post): /usr/sbin/cyad
%description
-This application is used for setting wallpaper for the system.
+NUI application for managing wallpaper functionalities
+
+%define rpk_pkgid org.tizen.cssetting-wallpaper
+%define preload_rpk_path /usr/apps/.preload-rpk
%prep
%setup -q
%install
rm -rf %{buildroot}
-mkdir -p %{buildroot}/%{preload_tpk_path}
-install packaging/%{internal_name}-%{version}.tpk %{buildroot}/%{preload_tpk_path}/
+mkdir -p %{buildroot}/%{preload_rpk_path}
+install packaging/%{rpk_pkgid}-%{version}.rpk %{buildroot}/%{preload_rpk_path}/
%post
+# Uncomment following lines to test rpk installation
+#pkgcmd -it rpk -p %{preload_rpk_path}/%{rpk_pkgid}-%{version}.rpk
+
+cyad -s -k MANIFESTS_GLOBAL -c User::Pkg::%{rpk_pkgid} -u 5001 -p http://tizen.org/privilege/notexist -t ALLOW
+
+# Uncomment following lines to test preload rpk installation on image creation
+#pkg_initdb --ro
+#install_preload_pkg
%files
%defattr(-,root,root,-)
-%{preload_tpk_path}/*
-%license LICENSE
\ No newline at end of file
+%{preload_rpk_path}/*