2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 // Need to override adaptor classes for toolkit test harness, so include
22 // test harness headers before dali headers.
23 #include <dali-toolkit-test-suite-utils.h>
26 #include <dali-toolkit/dali-toolkit.h>
29 using namespace Toolkit;
33 const unsigned int TOTAL_ITEM_NUMBER = 200;
34 const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg";
37 // Implementation of ItemFactory for providing actors to ItemView
38 class TestItemFactory : public ItemFactory
44 * @param application class, stored as reference
53 virtual ~TestItemFactory()
57 public: // From ItemFactory
60 * Query the number of items available from the factory.
61 * The maximum available item has an ID of GetNumberOfItems() - 1.
63 virtual unsigned int GetNumberOfItems()
65 return TOTAL_ITEM_NUMBER;
69 * Create an Actor to represent a visible item.
71 * @return the created actor.
73 virtual Actor NewItem(unsigned int itemId)
75 // Create a renderable actor for this item
76 return ImageView::New( TEST_IMAGE_FILE_NAME );
82 typedef IntrusivePtr<TestItemLayout> TestItemLayoutPtr;
84 // Implementation of ItemLayout
85 class TestItemLayout : public ItemLayout
99 virtual ~TestItemLayout()
104 * Create a new grid layout.
106 static TestItemLayoutPtr New()
108 return TestItemLayoutPtr(new TestItemLayout());
111 public: // From ItemLayout
114 * Query the minimum valid layout position; this is a negative value.
116 * When scrolling, the first item will move within the range 0 to GetMinimumLayoutPosition().
117 * @param[in] numberOfItems The current number of items in the layout.
118 * @param[in] layoutSize The size of the layout area.
119 * @return The minimum layout position.
121 virtual float GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const
127 * Query the closest anchor position for the given layout position.
129 * This anchor position is the position where all the items in the layout are aligned to
130 * their rounded layout positions in integer.
131 * @param[in] layoutPosition The layout position.
132 * @return The closest anchor position for the given layout position.
134 virtual float GetClosestAnchorPosition(float layoutPosition) const
140 * Query the layout position for the first item in the layout to move to when the layout
141 * needs to scroll to a particular item.
143 * @param[in] itemId The ID of an item in the layout.
144 * @return The layout position for the first item in the layout to move to.
146 virtual float GetItemScrollToPosition(unsigned int itemId) const
152 * Query the items within a given layout-area.
154 * @param[in] firstItemPosition The layout-position of the first item in the layout.
155 * @param[in] layoutSize The size of the layout area.
156 * @return The ID of the first & last visible item.
158 virtual ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const
160 return ItemRange(0, 10);
164 * Query the number of items that should be reserved, for scrolling purposes.
166 * @param[in] layoutSize The size of the layout area.
167 * @return The number of extra items.
169 virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const
175 * Retrieve the default size of an item in the layout.
177 * @param[in] itemId The ID of an item in the layout.
178 * @param[in] layoutSize The layout size
179 * @param[out] itemSize The target size of an item.
181 virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const
186 * @brief Query the scroll direction of the layout.
187 * @return The scroll direction in degrees.
189 virtual Degree GetScrollDirection() const
191 return Degree( 0.0f );
195 * @brief Query the scroll speed factor of the layout while dragging.
196 * @return The scroll speed factor of the layout.
198 virtual float GetScrollSpeedFactor() const
204 * @brief Query the maximum swipe speed in pixels per second.
205 * @return speed The maximum swipe speed.
207 virtual float GetMaximumSwipeSpeed() const
213 * @brief Get the duration of the flick animation in second.
214 * @return The duration of the flick animation.
216 virtual float GetItemFlickAnimationDuration() const
222 * @brief Applies constraints defined by the layout to an actor.
224 * @param[in] actor The actor to constrain.
225 * @param[in] itemId The ID of the item represented by the actor.
226 * @param[in] layoutSize the current size of the item view instance.
227 * @param[in] itemViewActor The item view instance which requests the application of constraints.
229 virtual void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor )
234 * @brief Gets the position of a given item
236 * @param[in] itemID id of the item we want to get its position
237 * @param[in] currentLayoutPosition the current layout position of the item view instance
238 * @param[in] layoutSize the current size of the item view instance
239 * @return The item position (x,y,z)
241 virtual Vector3 GetItemPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize) const
243 return Vector3::ZERO;
249 int UtcDaliItemLayoutSetAndGetOrientation(void)
251 ToolkitTestApplication application;
253 // Create the ItemView actor
254 TestItemFactory factory;
255 ItemView view = ItemView::New(factory);
257 // Create a grid layout and add it to ItemView
258 ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
259 view.AddLayout(*gridLayout);
261 // Set the orientation of the layout to be horizontal from left to right
262 ItemLayoutPtr layout = view.GetLayout(0);
264 DALI_TEST_CHECK(gridLayout == layout);
266 layout->SetOrientation(ControlOrientation::Left);
268 // Check the orientation of the layout is horizontal from left to right
269 DALI_TEST_CHECK(layout->GetOrientation() == ControlOrientation::Left);
271 Vector3 itemSize(100.0f, 100.0f, 100.0f);
272 layout->SetItemSize(itemSize);
275 layout->GetItemSize(0u, Vector3(application.GetScene().GetSize()), itemSize1);
277 DALI_TEST_CHECK(itemSize == itemSize1);
279 float position = layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3(application.GetScene().GetSize()));
281 DALI_TEST_EQUALS(position, 0.0f, TEST_LOCATION);
283 int focusItem = layout->GetNextFocusItemID(0, TOTAL_ITEM_NUMBER, Control::KeyboardFocus::LEFT, true);
285 DALI_TEST_CHECK(focusItem != 0);
287 float flickSpeedFactor = layout->GetFlickSpeedFactor();
289 DALI_TEST_CHECK(flickSpeedFactor != 0.0f);
291 // White box test here: -( itemId / NoOfItemsPerRow(default 4) ) * NoOfItemsPerRow
292 DALI_TEST_EQUALS( -1.0f, gridLayout->GetItemScrollToPosition( 1 ), TEST_LOCATION );
294 ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
295 view.AddLayout(*depthLayout);
297 layout = view.GetLayout(1);
298 DALI_TEST_CHECK(depthLayout == layout);
300 ItemLayoutPtr listLayout = DefaultItemLayout::New( DefaultItemLayout::LIST );
301 view.AddLayout(*listLayout);
303 layout = view.GetLayout(2);
304 DALI_TEST_CHECK(listLayout == layout);
306 ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
307 view.AddLayout(*spiralLayout);
309 layout = view.GetLayout(3);
310 DALI_TEST_CHECK(spiralLayout == layout);
314 int UtcDaliItemLayoutGetExtension(void)
316 ToolkitTestApplication application;
318 ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
319 DALI_TEST_CHECK( gridLayout );
320 DALI_TEST_CHECK( !gridLayout->GetExtension() );
325 int UtcDaliItemLayoutGetClosestOnScreenLayoutPosition(void)
327 ToolkitTestApplication application;
329 TestItemLayoutPtr layout = TestItemLayout::New();
330 DALI_TEST_CHECK( layout );
331 DALI_TEST_EQUALS(layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3::ZERO), 0.0f, TEST_LOCATION );
332 DALI_TEST_EQUALS(layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3(-800.0f, -1200.0f, 0.0f)), 0.0f, TEST_LOCATION );
337 int UtcDaliItemLayoutGetNextFocusItemID(void)
339 ToolkitTestApplication application;
341 TestItemLayoutPtr layout = TestItemLayout::New();
342 DALI_TEST_CHECK( layout );
343 DALI_TEST_EQUALS(layout->GetNextFocusItemID(0, 100, Control::KeyboardFocus::LEFT, true), 99, TEST_LOCATION );
344 DALI_TEST_EQUALS(layout->GetNextFocusItemID(110, 100, Control::KeyboardFocus::RIGHT, true), 0, TEST_LOCATION );
349 int UtcDaliItemLayoutSetAndGetLayoutProperties(void)
351 ToolkitTestApplication application;
353 // Create the ItemView actor
354 TestItemFactory factory;
355 ItemView view = ItemView::New(factory);
357 // Create a grid layout and add it to ItemView
358 ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
360 // Set the property of the grid layout
361 Property::Map gridLayoutProperty;
362 gridLayoutProperty.Insert( DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::GRID) );
363 gridLayoutProperty.Insert( DefaultItemLayoutProperty::ITEM_SIZE, Dali::Property::Value(Vector3(200, 200,50)) );
364 gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_ROW_SPACING, Dali::Property::Value(50.0f) );
365 gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_COLUMN_NUMBER, Dali::Property::Value(4) );
366 gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_COLUMN_SPACING, Dali::Property::Value(50.0f) );
367 gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_TOP_MARGIN, Dali::Property::Value(95.0f) );
368 gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_BOTTOM_MARGIN, Dali::Property::Value(20.0f) );
369 gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_SIDE_MARGIN, Dali::Property::Value(20.0f) );
370 gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.03f) );
371 gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.015f) );
372 gridLayoutProperty.Insert( DefaultItemLayoutProperty::GRID_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(100.0f) );
373 gridLayoutProperty.Insert( DefaultItemLayoutProperty::ORIENTATION, Dali::Property::Value((int)ControlOrientation::Up) );
374 gridLayout->SetLayoutProperties(gridLayoutProperty);
376 view.AddLayout(*gridLayout);
377 ItemLayoutPtr layout = view.GetLayout(0);
378 DALI_TEST_CHECK(gridLayout == layout);
379 Property::Map firstLayout = gridLayout->GetLayoutProperties();
381 //Check all the properties of grid layout
382 DALI_TEST_EQUALS( gridLayoutProperty.Count(), firstLayout.Count(), TEST_LOCATION );
384 for( unsigned int mapIdx = 0, mapCount = firstLayout.Count(); mapIdx < mapCount; ++mapIdx )
386 KeyValuePair propertyPair( firstLayout.GetKeyValue( mapIdx ) );
387 if(propertyPair.first == DefaultItemLayoutProperty::TYPE)
389 int layoutType = propertyPair.second.Get<int>();
390 DALI_TEST_EQUALS( layoutType, (int)DefaultItemLayout::GRID, TEST_LOCATION );
392 else if(propertyPair.first == DefaultItemLayoutProperty::ITEM_SIZE)
394 Vector3 size = propertyPair.second.Get<Vector3>();
395 DALI_TEST_EQUALS( size, Vector3(200, 200,50), TEST_LOCATION );
397 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_ROW_SPACING)
399 float rowSpacing = propertyPair.second.Get<float>();
400 DALI_TEST_EQUALS( rowSpacing, 50.0f, TEST_LOCATION );
402 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_COLUMN_NUMBER)
404 int number = propertyPair.second.Get<int>();
405 DALI_TEST_EQUALS(number, 4, TEST_LOCATION );
407 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_COLUMN_SPACING)
409 float columnSpacing = propertyPair.second.Get<float>();
410 DALI_TEST_EQUALS(columnSpacing, 50.0f, TEST_LOCATION );
412 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_TOP_MARGIN)
414 float topMargin = propertyPair.second.Get<float>();
415 DALI_TEST_EQUALS(topMargin, 95.0f, TEST_LOCATION );
417 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_BOTTOM_MARGIN)
419 float bottomMargin = propertyPair.second.Get<float>();
420 DALI_TEST_EQUALS(bottomMargin, 20.0f, TEST_LOCATION );
422 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_SIDE_MARGIN)
424 float sideMargin = propertyPair.second.Get<float>();
425 DALI_TEST_EQUALS(sideMargin, 20.0f, TEST_LOCATION );
427 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_SCROLL_SPEED_FACTOR)
429 float scrollSpeedFactor = propertyPair.second.Get<float>();
430 DALI_TEST_EQUALS(scrollSpeedFactor, 0.03f, TEST_LOCATION );
432 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_ITEM_FLICK_ANIMATION_DURATION)
434 float animationDuration = propertyPair.second.Get<float>();
435 DALI_TEST_EQUALS(animationDuration, 0.015f, TEST_LOCATION );
437 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_MAXIMUM_SWIPE_SPEED)
439 float swipSpeed = propertyPair.second.Get<float>();
440 DALI_TEST_EQUALS(swipSpeed, 100.0f, TEST_LOCATION );
443 ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
445 // Set the property of the depth layout
446 Property::Map depthLayoutProperty;
447 depthLayoutProperty.Insert( DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::DEPTH) );
448 depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_COLUMN_NUMBER, Dali::Property::Value(3) );
449 depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_ROW_NUMBER, Dali::Property::Value(26.0f) );
450 depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_ROW_SPACING, Dali::Property::Value(55.0f) );
451 depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_TILT_ANGLE, Dali::Property::Value(Math::PI*0.15f) );
452 depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_ITEM_TILT_ANGLE, Dali::Property::Value(-Math::PI*0.025f ) );
453 depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.02f) );
454 depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.03f) );
455 depthLayoutProperty.Insert( DefaultItemLayoutProperty::DEPTH_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(50.0f) );
456 depthLayoutProperty.Insert( DefaultItemLayoutProperty::ORIENTATION, Dali::Property::Value((int)ControlOrientation::Up) );
457 depthLayout->SetLayoutProperties(depthLayoutProperty);
459 view.AddLayout(*depthLayout);
460 layout = view.GetLayout(1);
461 DALI_TEST_CHECK(depthLayout == layout);
463 Property::Map secondLayout = depthLayout->GetLayoutProperties();
465 //Check all the properties of grid layout
466 DALI_TEST_EQUALS( depthLayoutProperty.Count(), secondLayout.Count(), TEST_LOCATION );
467 for( unsigned int mapIdx = 0, mapCount = secondLayout.Count(); mapIdx < mapCount; ++mapIdx )
469 KeyValuePair propertyPair( secondLayout.GetKeyValue( mapIdx ) );
470 if(propertyPair.first == DefaultItemLayoutProperty::TYPE)
472 int layoutType = propertyPair.second.Get<int>();
473 DALI_TEST_EQUALS( layoutType, (int)DefaultItemLayout::DEPTH, TEST_LOCATION );
475 else if(propertyPair.first == DefaultItemLayoutProperty::ORIENTATION)
477 int orientation = propertyPair.second.Get<int>();
478 DALI_TEST_EQUALS(orientation, (int)ControlOrientation::Up, TEST_LOCATION );
480 else if(propertyPair.first == DefaultItemLayoutProperty::ITEM_SIZE)
482 Vector3 size = propertyPair.second.Get<Vector3>();
483 DALI_TEST_EQUALS( size, Vector3(200, 200,50), TEST_LOCATION );
486 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_COLUMN_NUMBER)
488 int columnNumber = propertyPair.second.Get<int>();
489 DALI_TEST_EQUALS( columnNumber, 3, TEST_LOCATION );
491 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ROW_NUMBER)
493 float rowNumber = propertyPair.second.Get<float>();
494 DALI_TEST_EQUALS(rowNumber, 26.0f, TEST_LOCATION );
496 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ROW_SPACING)
498 float rowSpacing = propertyPair.second.Get<float>();
499 DALI_TEST_EQUALS(rowSpacing, 55.0f, TEST_LOCATION );
501 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_TILT_ANGLE)
503 float tiltAngle = propertyPair.second.Get<float>();
504 DALI_TEST_EQUALS(tiltAngle, Math::PI*0.15f, TEST_LOCATION );
506 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ITEM_TILT_ANGLE)
508 float itemTiltAngle = propertyPair.second.Get<float>();
509 DALI_TEST_EQUALS(itemTiltAngle, -Math::PI*0.025f, TEST_LOCATION );
511 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_SCROLL_SPEED_FACTOR)
513 float scrollSpeedFactor = propertyPair.second.Get<float>();
514 DALI_TEST_EQUALS(scrollSpeedFactor, 0.02f, TEST_LOCATION );
517 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ITEM_FLICK_ANIMATION_DURATION)
519 float animationDuration = propertyPair.second.Get<float>();
520 DALI_TEST_EQUALS(animationDuration, 0.03f, TEST_LOCATION );
522 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_MAXIMUM_SWIPE_SPEED)
524 float swipSpeed = propertyPair.second.Get<float>();
525 DALI_TEST_EQUALS(swipSpeed, 50.0f, TEST_LOCATION );
528 ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
530 // Set the property of the spiral layout
531 Property::Map spiralLayoutPrperty;
532 spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::SPIRAL) );
533 spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_ITEM_SPACING, Dali::Property::Value((Math::PI*2.0f)/9.5f) );
534 spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_TOP_ITEM_ALIGNMENT, Dali::Property::Value(-0.125f) );
535 spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_REVOLUTION_DISTANCE, Dali::Property::Value(190.0f) );
536 spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.01f) );
537 spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.1f) );
538 spiralLayoutPrperty.Insert( DefaultItemLayoutProperty::SPIRAL_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(30.0f) );
539 spiralLayout->SetLayoutProperties(spiralLayoutPrperty);
541 view.AddLayout(*spiralLayout);
542 layout = view.GetLayout(2);
543 DALI_TEST_CHECK(spiralLayout == layout);
545 Property::Map thridLayout = spiralLayout->GetLayoutProperties();
547 //Check all the properties of grid layout
548 DALI_TEST_EQUALS( spiralLayoutPrperty.Count(), thridLayout.Count(), TEST_LOCATION );
550 for( unsigned int mapIdx = 0, mapCount = thridLayout.Count(); mapIdx < mapCount; ++mapIdx )
552 KeyValuePair propertyPair( thridLayout.GetKeyValue( mapIdx ) );
553 if(propertyPair.first == DefaultItemLayoutProperty::TYPE)
555 int layoutType = propertyPair.second.Get<int>();
556 DALI_TEST_EQUALS( layoutType, (int)DefaultItemLayout::SPIRAL, TEST_LOCATION );
558 else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_ITEM_SPACING)
560 float columnNumber = propertyPair.second.Get<float>();
561 DALI_TEST_EQUALS( columnNumber, (Math::PI*2.0f)/9.5f, TEST_LOCATION );
563 else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_TOP_ITEM_ALIGNMENT)
565 float rowNumber = propertyPair.second.Get<float>();
566 DALI_TEST_EQUALS(rowNumber, -0.125f, TEST_LOCATION );
568 else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_REVOLUTION_DISTANCE)
570 float rowSpacing = propertyPair.second.Get<float>();
571 DALI_TEST_EQUALS(rowSpacing, 190.0f, TEST_LOCATION );
573 else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_SCROLL_SPEED_FACTOR)
575 float scrollSpeedFactor = propertyPair.second.Get<float>();
576 DALI_TEST_EQUALS(scrollSpeedFactor, 0.01f, TEST_LOCATION );
579 else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_ITEM_FLICK_ANIMATION_DURATION)
581 float animationDuration = propertyPair.second.Get<float>();
582 DALI_TEST_EQUALS(animationDuration, 0.1f, TEST_LOCATION );
584 else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_MAXIMUM_SWIPE_SPEED)
586 float swipSpeed = propertyPair.second.Get<float>();
587 DALI_TEST_EQUALS(swipSpeed, 30.0f, TEST_LOCATION );
590 Dali::Integration::Scene scene = application.GetScene();
591 Vector3 sceneSize(scene.GetSize());
592 view.ActivateLayout(0, sceneSize, 0.5f);
593 view.ActivateLayout(1, sceneSize, 0.5f);
594 view.ActivateLayout(2, sceneSize, 0.5f);
599 int UtcDaliItemRangeIntersection(void)
601 ToolkitTestApplication application;
603 unsigned int uBeginItemFirst = 100u, uEndItemFirst = 300u;
604 unsigned int uBeginItemSecond = 290u, uEndItemSecond = 400;
605 unsigned int uInterBeginCheck=290u , uInterEndCheck=301u;
606 bool bIsInThisRange = false, bOutOfThisRange = false;
608 Toolkit::ItemRange objItemRangeFirst(uBeginItemFirst, uEndItemFirst);
609 Toolkit::ItemRange objItemRangeSecond(uBeginItemSecond, uEndItemSecond);
610 ItemRange itmInterSect = objItemRangeFirst.Intersection(objItemRangeSecond);
612 bIsInThisRange = itmInterSect.Within(uInterBeginCheck);
613 DALI_TEST_EQUALS(bIsInThisRange, true, TEST_LOCATION );
615 bOutOfThisRange = itmInterSect.Within(uInterEndCheck);
616 DALI_TEST_EQUALS(bOutOfThisRange, false, TEST_LOCATION );