Add to check disply size for rotation 53/220653/1
authorWonsik Jung <sidein@samsung.com>
Fri, 20 Dec 2019 07:04:18 +0000 (16:04 +0900)
committerWonsik Jung <sidein@samsung.com>
Fri, 20 Dec 2019 07:08:08 +0000 (16:08 +0900)
Add to check disply size for rotation
If the screen's width is greater than the height, AddAvailable is called with LANDSCAPE.
Otherwise for the other case, AddAvailable is called with PORTRAIT.

Change-Id: Id99ca9a2b840411194613d82f0f7870e2c81b79c

shared/dali-table-view.cpp

index 3760172fed4155bbfe2c8bc6bd51ab8f16fafb0e..aba375abd674e0fa0f0d75b2e707f4cf8a6f84d3 100644 (file)
@@ -287,10 +287,21 @@ void DaliTableView::Initialize( Application& application )
   ApplyCubeEffectToPages();
 
   Dali::Window winHandle = application.GetWindow();
-  winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT );
-  winHandle.RemoveAvailableOrientation( Dali::Window::LANDSCAPE );
-  winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT_INVERSE );
-  winHandle.RemoveAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE );
+
+  if( stageSize.width <= stageSize.height )
+  {
+    winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT );
+    winHandle.RemoveAvailableOrientation( Dali::Window::LANDSCAPE );
+    winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT_INVERSE );
+    winHandle.RemoveAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE );
+  }
+  else
+  {
+    winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE );
+    winHandle.RemoveAvailableOrientation( Dali::Window::PORTRAIT );
+    winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE );
+    winHandle.RemoveAvailableOrientation( Dali::Window::PORTRAIT_INVERSE );
+  }
 
   // Set initial orientation
   unsigned int degrees = 0;