summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>2023-01-13 12:20:51 +0530
committerShivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>2023-01-13 16:46:06 +0530
commitc7d3b50ce75806726c16d6a18c8e8855e0937501 (patch)
treeaf7d23ac0897f340aa80b856bf218b27ef8bbc45
parenta7a06366057b6d5f68acf07039aa92761f8a05bf (diff)
downloadtray-c7d3b50ce75806726c16d6a18c8e8855e0937501.tar.gz
tray-c7d3b50ce75806726c16d6a18c8e8855e0937501.tar.bz2
tray-c7d3b50ce75806726c16d6a18c8e8855e0937501.zip
Adding OrientationChanged event in Tray/Apps
Change-Id: I2698b0df8ce12b7a6abc49b29b1962791fa518fa Signed-off-by: Shivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
-rwxr-xr-xApps/Apps.cs21
-rwxr-xr-xApps/Apps.csproj4
-rwxr-xr-xTrayApplication/TrayApplication.cs25
-rwxr-xr-xTrayApplication/TrayApplication.csproj11
-rwxr-xr-xpackaging/org.tizen.Apps-1.0.0.tpkbin74936 -> 75032 bytes
-rwxr-xr-xpackaging/org.tizen.TrayApplication-1.0.0.tpkbin228660 -> 227725 bytes
6 files changed, 27 insertions, 34 deletions
diff --git a/Apps/Apps.cs b/Apps/Apps.cs
index 6cf1da3..508452e 100755
--- a/Apps/Apps.cs
+++ b/Apps/Apps.cs
@@ -27,7 +27,6 @@ namespace Apps
private const int TrayApplicationHeight = 361;
private ViewManager viewManager;
private Window window;
- private Window.WindowOrientation orientation;
public Program() : base(new Size2D(960, 540), new Position2D(480, 170), ThemeOptions.PlatformThemeEnabled, new CustomBorder())
{
@@ -49,16 +48,25 @@ namespace Apps
};
window.SetAvailableOrientations(list);
- orientation = window.GetCurrentOrientation();
UpdateWindowSize();
UpdateWindowPosition();
window.BackgroundColor = Color.Transparent;
window.KeyEvent += OnKeyEvent;
window.Resized += OnWindowResized;
+ window.OrientationChanged += OnWindowOrientationChanged;
viewManager = new ViewManager(window);
Tizen.Log.Info(Resources.LogTag, "Show Window");
}
+ private void OnWindowOrientationChanged(object sender, WindowOrientationChangedEventArgs e)
+ {
+ Tizen.Log.Debug(Resources.LogTag, "orientation changed" + e.WindowOrientation);
+ DeviceInfo.UpdateDeviceInfo();
+ UpdateWindowSize();
+ UpdateWindowPosition();
+ viewManager.UpdateAppView();
+ }
+
protected override void OnTerminate()
{
Tizen.Log.Info(Resources.LogTag, "On App Terminate");
@@ -116,16 +124,7 @@ namespace Apps
private void OnWindowResized(object sender, Window.ResizedEventArgs e)
{
- Window.WindowOrientation newOrientation = window.GetCurrentOrientation();
Tizen.Log.Debug(Resources.LogTag, "Resized Event");
- if (orientation != newOrientation)
- {
- Tizen.Log.Debug(Resources.LogTag, "orientation changed");
- DeviceInfo.UpdateDeviceInfo();
- orientation = newOrientation;
- UpdateWindowSize();
- UpdateWindowPosition();
- }
viewManager.UpdateAppView();
}
diff --git a/Apps/Apps.csproj b/Apps/Apps.csproj
index 2f87b52..12c2d0d 100755
--- a/Apps/Apps.csproj
+++ b/Apps/Apps.csproj
@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFramework>tizen10.0</TargetFramework>
+ <TargetFramework>tizen11.0</TargetFramework>
<TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
<AssemblyName>Apps</AssemblyName>
</PropertyGroup>
@@ -15,7 +15,7 @@
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="Tizen.NET" Version="10.0.0.17504" />
+ <PackageReference Include="Tizen.NET" Version="11.0.0.17643" />
<PackageReference Include="Tizen.NET.Sdk" Version="1.1.9" />
</ItemGroup>
diff --git a/TrayApplication/TrayApplication.cs b/TrayApplication/TrayApplication.cs
index bfbdfa1..cb5adc8 100755
--- a/TrayApplication/TrayApplication.cs
+++ b/TrayApplication/TrayApplication.cs
@@ -42,7 +42,6 @@ namespace TrayApplication
private MainView mainView;
private TizenShell tizenShell;
private SoftkeyService softkeyService;
- private Window.WindowOrientation windowOrientation;
private float touchStartPosition;
private bool touchStarted = false;
@@ -62,8 +61,6 @@ namespace TrayApplication
Window.WindowOrientation.PortraitInverse
};
window.SetAvailableOrientations(list);
- windowOrientation = window.GetCurrentOrientation();
- Tizen.Log.Info(Resources.LogTag, "Orientation: " + windowOrientation);
UpdateWindowDimensions();
window.BackgroundColor = Color.Transparent;
@@ -75,7 +72,7 @@ namespace TrayApplication
window.KeyEvent += OnKeyEvent;
window.TouchEvent += OnTouch;
- window.Resized += OnWindowResized;
+ window.OrientationChanged += OnWindowOrientationChanged;
AppScoreDataBase.InitializeDataBase();
mainView = new MainView();
@@ -87,6 +84,13 @@ namespace TrayApplication
Tizen.Log.Info(Resources.LogTag, "Tray Application Created");
}
+ private void OnWindowOrientationChanged(object sender, WindowOrientationChangedEventArgs e)
+ {
+ DeviceInfo.UpdateDeviceInfo();
+ UpdateWindowDimensions();
+ mainView.UpdateView();
+ }
+
protected override void OnTerminate()
{
Tizen.Log.Info(Resources.LogTag, "Program OnTerminate");
@@ -110,19 +114,6 @@ namespace TrayApplication
mainView?.HideView();
}
- private void OnWindowResized(object sender, Window.ResizedEventArgs e)
- {
- Tizen.Log.Info(Resources.LogTag, "Tray Resized");
- Window.WindowOrientation currentWindowOrientation = window.GetCurrentOrientation();
- if (windowOrientation != currentWindowOrientation)
- {
- DeviceInfo.UpdateDeviceInfo();
- windowOrientation = currentWindowOrientation;
- UpdateWindowDimensions();
- mainView.UpdateView();
- }
- }
-
private void MainViewRemovedFromWindow(object sender, EventArgs e)
{
Tizen.Log.Info(Resources.LogTag, "Main View Removed");
diff --git a/TrayApplication/TrayApplication.csproj b/TrayApplication/TrayApplication.csproj
index 009d32a..2bca34b 100755
--- a/TrayApplication/TrayApplication.csproj
+++ b/TrayApplication/TrayApplication.csproj
@@ -1,8 +1,8 @@
-<Project Sdk="Tizen.NET.Sdk/1.1.8">
+<Project Sdk="Tizen.NET.Sdk/1.1.9">
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFramework>tizen10.0</TargetFramework>
+ <TargetFramework>tizen11.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<TargetFrameworkIdentifier>Tizen</TargetFrameworkIdentifier>
</PropertyGroup>
@@ -19,12 +19,15 @@
</ItemGroup>
<ItemGroup>
- <PackageReference Include="Microsoft.Data.Sqlite.Core" Version="6.0.9">
+ <PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.2">
<TreatAsUsed>true</TreatAsUsed>
</PackageReference>
- <PackageReference Include="SQLitePCLRaw.bundle_sqlite3" Version="2.1.2">
+ <PackageReference Include="SQLitePCLRaw.bundle_sqlite3" Version="2.1.4">
<TreatAsUsed>true</TreatAsUsed>
</PackageReference>
+ <PackageReference Include="Tizen.NET" Version="11.0.0.17643">
+ <TreatAsUsed>true</TreatAsUsed>
+ </PackageReference>
</ItemGroup>
<ItemGroup>
diff --git a/packaging/org.tizen.Apps-1.0.0.tpk b/packaging/org.tizen.Apps-1.0.0.tpk
index 11f9a1a..d3480a5 100755
--- a/packaging/org.tizen.Apps-1.0.0.tpk
+++ b/packaging/org.tizen.Apps-1.0.0.tpk
Binary files differ
diff --git a/packaging/org.tizen.TrayApplication-1.0.0.tpk b/packaging/org.tizen.TrayApplication-1.0.0.tpk
index b3b68c9..02152a7 100755
--- a/packaging/org.tizen.TrayApplication-1.0.0.tpk
+++ b/packaging/org.tizen.TrayApplication-1.0.0.tpk
Binary files differ