+ Property::Map secondLayout = depthLayout->GetLayoutProperties();
+
+ //Check all the properties of grid layout
+ DALI_TEST_EQUALS(depthLayoutProperty.Count(), secondLayout.Count(), TEST_LOCATION);
+ for(unsigned int mapIdx = 0, mapCount = secondLayout.Count(); mapIdx < mapCount; ++mapIdx)
+ {
+ KeyValuePair propertyPair(secondLayout.GetKeyValue(mapIdx));
+ if(propertyPair.first == DefaultItemLayoutProperty::TYPE)
+ {
+ int layoutType = propertyPair.second.Get<int>();
+ DALI_TEST_EQUALS(layoutType, (int)DefaultItemLayout::DEPTH, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::ORIENTATION)
+ {
+ int orientation = propertyPair.second.Get<int>();
+ DALI_TEST_EQUALS(orientation, (int)ControlOrientation::Up, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::ITEM_SIZE)
+ {
+ Vector3 size = propertyPair.second.Get<Vector3>();
+ DALI_TEST_EQUALS(size, Vector3(200, 200, 50), TEST_LOCATION);
+ }
+
+ else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_COLUMN_NUMBER)
+ {
+ int columnNumber = propertyPair.second.Get<int>();
+ DALI_TEST_EQUALS(columnNumber, 3, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ROW_NUMBER)
+ {
+ float rowNumber = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(rowNumber, 26.0f, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ROW_SPACING)
+ {
+ float rowSpacing = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(rowSpacing, 55.0f, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_TILT_ANGLE)
+ {
+ float tiltAngle = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(tiltAngle, Math::PI * 0.15f, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ITEM_TILT_ANGLE)
+ {
+ float itemTiltAngle = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(itemTiltAngle, -Math::PI * 0.025f, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_SCROLL_SPEED_FACTOR)
+ {
+ float scrollSpeedFactor = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(scrollSpeedFactor, 0.02f, TEST_LOCATION);
+ }
+
+ else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ITEM_FLICK_ANIMATION_DURATION)
+ {
+ float animationDuration = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(animationDuration, 0.03f, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_MAXIMUM_SWIPE_SPEED)
+ {
+ float swipSpeed = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(swipSpeed, 50.0f, TEST_LOCATION);
+ }
+ }
+ ItemLayoutPtr spiralLayout = DefaultItemLayout::New(DefaultItemLayout::SPIRAL);
+
+ // Set the property of the spiral layout
+ Property::Map spiralLayoutPrperty;
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::SPIRAL));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_ITEM_SPACING, Dali::Property::Value((Math::PI * 2.0f) / 9.5f));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_TOP_ITEM_ALIGNMENT, Dali::Property::Value(-0.125f));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_REVOLUTION_DISTANCE, Dali::Property::Value(190.0f));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.01f));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.1f));
+ spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(30.0f));
+ spiralLayout->SetLayoutProperties(spiralLayoutPrperty);
+
+ view.AddLayout(*spiralLayout);
+ layout = view.GetLayout(2);
+ DALI_TEST_CHECK(spiralLayout == layout);
+
+ Property::Map thridLayout = spiralLayout->GetLayoutProperties();
+
+ //Check all the properties of grid layout
+ DALI_TEST_EQUALS(spiralLayoutPrperty.Count(), thridLayout.Count(), TEST_LOCATION);
+
+ for(unsigned int mapIdx = 0, mapCount = thridLayout.Count(); mapIdx < mapCount; ++mapIdx)
+ {
+ KeyValuePair propertyPair(thridLayout.GetKeyValue(mapIdx));
+ if(propertyPair.first == DefaultItemLayoutProperty::TYPE)
+ {
+ int layoutType = propertyPair.second.Get<int>();
+ DALI_TEST_EQUALS(layoutType, (int)DefaultItemLayout::SPIRAL, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_ITEM_SPACING)
+ {
+ float columnNumber = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(columnNumber, (Math::PI * 2.0f) / 9.5f, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_TOP_ITEM_ALIGNMENT)
+ {
+ float rowNumber = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(rowNumber, -0.125f, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_REVOLUTION_DISTANCE)
+ {
+ float rowSpacing = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(rowSpacing, 190.0f, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_SCROLL_SPEED_FACTOR)
+ {
+ float scrollSpeedFactor = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(scrollSpeedFactor, 0.01f, TEST_LOCATION);
+ }
+
+ else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_ITEM_FLICK_ANIMATION_DURATION)
+ {
+ float animationDuration = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(animationDuration, 0.1f, TEST_LOCATION);
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_MAXIMUM_SWIPE_SPEED)
+ {
+ float swipSpeed = propertyPair.second.Get<float>();
+ DALI_TEST_EQUALS(swipSpeed, 30.0f, TEST_LOCATION);
+ }
+ }
+ Dali::Integration::Scene scene = application.GetScene();
+ Vector3 sceneSize(scene.GetSize());
+ view.ActivateLayout(0, sceneSize, 0.5f);
+ view.ActivateLayout(1, sceneSize, 0.5f);
+ view.ActivateLayout(2, sceneSize, 0.5f);
+ END_TEST;
+}
+
+int UtcDaliItemRangeIntersection(void)
+{
+ ToolkitTestApplication application;
+
+ unsigned int uBeginItemFirst = 100u, uEndItemFirst = 300u;
+ unsigned int uBeginItemSecond = 290u, uEndItemSecond = 400;
+ unsigned int uInterBeginCheck = 290u, uInterEndCheck = 301u;
+ bool bIsInThisRange = false, bOutOfThisRange = false;
+
+ Toolkit::ItemRange objItemRangeFirst(uBeginItemFirst, uEndItemFirst);
+ Toolkit::ItemRange objItemRangeSecond(uBeginItemSecond, uEndItemSecond);
+ ItemRange itmInterSect = objItemRangeFirst.Intersection(objItemRangeSecond);
+
+ bIsInThisRange = itmInterSect.Within(uInterBeginCheck);
+ DALI_TEST_EQUALS(bIsInThisRange, true, TEST_LOCATION);
+
+ bOutOfThisRange = itmInterSect.Within(uInterEndCheck);
+ DALI_TEST_EQUALS(bOutOfThisRange, false, TEST_LOCATION);