diff options
author | Shivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com> | 2024-02-23 20:11:07 +0530 |
---|---|---|
committer | Shivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com> | 2024-02-27 13:49:33 +0530 |
commit | 4f71e5c1796ada857362eee3bfbc833b2d0be993 (patch) | |
tree | a1027d16e3fb66bc9026548d289c4e0c61591fc8 | |
parent | 47cf7c0cc0afb2a73957969314a88ec4aea0d415 (diff) | |
download | tray-4f71e5c1796ada857362eee3bfbc833b2d0be993.tar.gz tray-4f71e5c1796ada857362eee3bfbc833b2d0be993.tar.bz2 tray-4f71e5c1796ada857362eee3bfbc833b2d0be993.zip |
Updating Add Position on Resize and Min Window Size.
Change-Id: I57e584e76cbd2260a54e055e873e69904464283b
Signed-off-by: Shivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
-rwxr-xr-x | Apps/Apps.cs | 9 | ||||
-rwxr-xr-x | Apps/Apps.csproj | 6 | ||||
-rw-r--r-- | Apps/Common/MultiResourceManager.cs | 26 | ||||
-rwxr-xr-x | Apps/ViewManager.cs | 11 | ||||
-rwxr-xr-x | Apps/Views/AppView.cs | 8 | ||||
-rwxr-xr-x | Apps/Views/CustomBorder.cs | 2 | ||||
-rw-r--r-- | Apps/Views/SelectAppsView.cs | 12 | ||||
-rw-r--r-- | Apps/Views/SelectAppsViewHeader.cs | 2 | ||||
-rwxr-xr-x | packaging/org.tizen.Apps-1.0.0.tpk | bin | 88321 -> 160835 bytes |
9 files changed, 33 insertions, 43 deletions
diff --git a/Apps/Apps.cs b/Apps/Apps.cs index 51ba807..db8efb6 100755 --- a/Apps/Apps.cs +++ b/Apps/Apps.cs @@ -38,7 +38,6 @@ namespace Apps protected override void OnCreate() { - Tizen.Log.Info(Resources.LogTag, "Program OnCreate"); base.OnCreate(); window = Window.Instance; window.SetTransparency(true); @@ -58,7 +57,6 @@ namespace Apps window.OrientationChanged += OnWindowOrientationChanged; window.Hide(); viewManager = new ViewManager(); - Tizen.Log.Info(Resources.LogTag, "Show Window"); } protected override void OnAppControlReceived(AppControlReceivedEventArgs e) @@ -122,18 +120,17 @@ namespace Apps } catch (Exception e) { - Tizen.Log.Debug(Resources.LogTag, "Setting Language failed" + e.Message); + Tizen.Log.Error(Resources.LogTag, "Setting Language failed" + e.Message); } } - MultilingualResourceManager = new MultiResourceManager("Apps.TextResources.Resources", typeof(Resources).Assembly); + MultilingualResourceManager = TextResources.Resources.ResourceManager; Tizen.System.SystemSettings.LocaleLanguageChanged += (s, e) => SetLanguage(); SetLanguage(); } protected override void OnTerminate() { - Tizen.Log.Info(Resources.LogTag, "On App Terminate"); viewManager.CleanUp(); base.OnTerminate(); } @@ -167,10 +164,8 @@ namespace Apps static void Main(string[] args) { - Tizen.Log.Info(Resources.LogTag, "Main statrted"); Program app = new Program(); app.Run(args); - Tizen.Log.Info(Resources.LogTag, "Main ended"); } } } diff --git a/Apps/Apps.csproj b/Apps/Apps.csproj index fc5b3f6..507fc45 100755 --- a/Apps/Apps.csproj +++ b/Apps/Apps.csproj @@ -1,9 +1,8 @@ -<Project Sdk="Microsoft.NET.Sdk"> +<Project Sdk="Tizen.Net.Sdk/1.1.9"> <PropertyGroup> <OutputType>Exe</OutputType> - <TargetFramework>tizen11.0</TargetFramework> - <TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier> + <TargetFramework>netcoreapp3.1</TargetFramework> <AssemblyName>Apps</AssemblyName> </PropertyGroup> @@ -16,7 +15,6 @@ <ItemGroup> <PackageReference Include="Tizen.NET" Version="11.0.0.17918" /> - <PackageReference Include="Tizen.NET.Sdk" Version="1.1.9" /> </ItemGroup> <ItemGroup> diff --git a/Apps/Common/MultiResourceManager.cs b/Apps/Common/MultiResourceManager.cs deleted file mode 100644 index f501260..0000000 --- a/Apps/Common/MultiResourceManager.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Globalization; -using System.Reflection; -using System.Resources; - -namespace Apps.Common -{ - public class MultiResourceManager : ResourceManager - { - public MultiResourceManager(string baseName, Assembly assembly) - : base(baseName, assembly) - { - } - - public override string GetString(string name) - { - return base.GetString(name) - ?? TextResources.Resources.ResourceManager.GetString(name); - } - - public override string GetString(string name, CultureInfo culture) - { - return base.GetString(name, culture) - ?? TextResources.Resources.ResourceManager.GetString(name, culture); - } - } -} diff --git a/Apps/ViewManager.cs b/Apps/ViewManager.cs index 2d9885d..66e08ae 100755 --- a/Apps/ViewManager.cs +++ b/Apps/ViewManager.cs @@ -48,22 +48,27 @@ namespace Apps appView.SetBinding(RecyclerView.ItemsSourceProperty, "AppListSource"); Window.Instance.Add(appView); UpdateViewModel(appListTask); + Window.Instance.Resized += OnWindowResized; PackageManager.InstallProgressChanged += OnInstallProgressChanged; PackageManager.UninstallProgressChanged += OnUninstallProgressChanged; } + public void CleanUp() { PackageManager.InstallProgressChanged -= OnInstallProgressChanged; PackageManager.UninstallProgressChanged -= OnUninstallProgressChanged; appView?.Dispose(); + appView = null; selectAppsView?.Dispose(); + selectAppsView = null; } public void LaunchSelectMode(List<string> invalidApps) { Window.Instance.Remove(appView); appView?.Dispose(); + appView = null; if (invalidApps != null) { Task<IEnumerable<ApplicationInfo>> appListTask = CreateAppList(); @@ -84,6 +89,12 @@ namespace Apps Window.Instance.Add(selectAppsView); } + private void OnWindowResized(object sender, Window.ResizedEventArgs e) + { + appView?.UpdateSize(); + selectAppsView?.UpdateSize(); + } + private Task<IEnumerable<ApplicationInfo>> CreateAppList() { ApplicationInfoFilter appInfoFilter = new ApplicationInfoFilter(); diff --git a/Apps/Views/AppView.cs b/Apps/Views/AppView.cs index d915bb3..9636b5a 100755 --- a/Apps/Views/AppView.cs +++ b/Apps/Views/AppView.cs @@ -46,8 +46,7 @@ namespace Apps.Views Name = "AppView"; ThemeChangeSensitive = true; CornerRadius = AppConstants.AppCornerRadius.SpToPx(); - WidthResizePolicy = ResizePolicyType.FillToParent; - HeightResizePolicy = ResizePolicyType.FillToParent; + UpdateSize(); ItemsLayouter = new GridLayouter(); ScrollingDirection = Direction.Vertical; SelectionMode = ItemSelectionMode.Single; @@ -59,6 +58,11 @@ namespace Apps.Views Tizen.Log.Info(Resources.LogTag, "AppView"); } + public void UpdateSize() + { + Size2D = Window.Instance.Size; + } + private void OnAppViewThemeChanged(object sender, ThemeChangedEventArgs e) { UpdateTheme(); diff --git a/Apps/Views/CustomBorder.cs b/Apps/Views/CustomBorder.cs index c8e5a94..5395e00 100755 --- a/Apps/Views/CustomBorder.cs +++ b/Apps/Views/CustomBorder.cs @@ -35,7 +35,7 @@ namespace Apps.Views public CustomBorder() : base() { - MinSize = new Size2D(320, 280); + MinSize = new Size2D(312, 228); } public override void CreateBorderView(View borderView) diff --git a/Apps/Views/SelectAppsView.cs b/Apps/Views/SelectAppsView.cs index f31357e..8793a35 100644 --- a/Apps/Views/SelectAppsView.cs +++ b/Apps/Views/SelectAppsView.cs @@ -24,8 +24,7 @@ namespace Apps.Views Name = "SelectAppsView"; ThemeChangeSensitive = true; CornerRadius = 24.SpToPx(); - WidthResizePolicy = ResizePolicyType.FillToParent; - HeightResizePolicy = ResizePolicyType.FillToParent; + UpdateSize(); ItemsLayouter = new GridLayouter(); ScrollingDirection = Direction.Vertical; SelectionMode = ItemSelectionMode.Multiple; @@ -45,6 +44,15 @@ namespace Apps.Views ThemeManager.ThemeChanged += OnSelectAppsViewThemeChanged; } + public void UpdateSize() + { + Size2D = Window.Instance.Size; + if (Header != null) + { + Header.SizeWidth = Window.Instance.Size.Width; + } + } + private void OnSelectAppsViewThemeChanged(object sender, ThemeChangedEventArgs e) { UpdateTheme(); diff --git a/Apps/Views/SelectAppsViewHeader.cs b/Apps/Views/SelectAppsViewHeader.cs index 3a2b2a2..ede4bc5 100644 --- a/Apps/Views/SelectAppsViewHeader.cs +++ b/Apps/Views/SelectAppsViewHeader.cs @@ -12,7 +12,7 @@ namespace Apps.Views public SelectAppsViewHeader() : base() { ThemeChangeSensitive = true; - WidthResizePolicy = ResizePolicyType.FillToParent; + WidthSpecification = Window.Instance.Size.Width; HeightSpecification = AppConstants.HeaderHeight.SpToPx(); Padding = AppConstants.HeaderPadding.SpToPx(); Margin = AppConstants.HeaderMargin.SpToPx(); diff --git a/packaging/org.tizen.Apps-1.0.0.tpk b/packaging/org.tizen.Apps-1.0.0.tpk Binary files differindex 51baa82..fdbb6f6 100755 --- a/packaging/org.tizen.Apps-1.0.0.tpk +++ b/packaging/org.tizen.Apps-1.0.0.tpk |