[Application] Add CurrentDeviceOrientation property on CoreUIApplication (#560)
authorHyunho Kang <hhstark.kang@samsung.com>
Tue, 4 Dec 2018 07:46:08 +0000 (16:46 +0900)
committersemun-lee <35090067+semun-lee@users.noreply.github.com>
Tue, 4 Dec 2018 07:46:08 +0000 (16:46 +0900)
* Add CurrentDeviceOrientation

- app_get_device_orientation

Signed-off-by: hyunho <hhstark.kang@samsung.com>
* Fix summary

Signed-off-by: hyunho <hhstark.kang@samsung.com>
* Modify CurrentDeviceOrientation to static

Signed-off-by: hyunho <hhstark.kang@samsung.com>
src/Tizen.Applications.UI/Interop/Interop.Application.cs
src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs [changed mode: 0755->0644]

index 177bfea0698f791e6aa64aafa6c73a9f44c31c99..3aa879296d85f6abdc7dfd6b96b5fd8acd994fbc 100755 (executable)
@@ -16,6 +16,7 @@
 
 using System;
 using System.Runtime.InteropServices;
+using Tizen.Applications;
 using Tizen.Applications.CoreBackend;
 using Tizen.Internals.Errors;
 
@@ -35,6 +36,10 @@ internal static partial class Interop
 
         internal delegate void AppControlCallback(IntPtr appControl, IntPtr userData);
 
+
+        [DllImport(Libraries.Application, EntryPoint = "app_get_device_orientation")]
+        internal static extern DeviceOrientation AppGetDeviceOrientation();
+
         [DllImport(Libraries.Application, EntryPoint = "ui_app_main")]
         internal static extern ErrorCode Main(int argc, string[] argv, ref UIAppLifecycleCallbacks callback, IntPtr userData);
 
old mode 100755 (executable)
new mode 100644 (file)
index ad16365..5fd06e6
@@ -49,6 +49,18 @@ namespace Tizen.Applications
         {
         }
 
+        /// <summary>
+        /// Gets the current device orientation.
+        /// </summary>
+        /// <since_tizen> 6 </since_tizen>
+        static public DeviceOrientation CurrentDeviceOrientation
+        {
+            get
+            {
+                return Interop.Application.AppGetDeviceOrientation();
+            }
+        }
+
         /// <summary>
         /// Occurs whenever the application is resumed.
         /// </summary>