2 * Copyright (c) 2022 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>
25 #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";
36 // Implementation of ItemFactory for providing actors to ItemView
37 class TestItemFactory : public ItemFactory
42 * @param application class, stored as reference
51 virtual ~TestItemFactory()
55 public: // From ItemFactory
57 * Query the number of items available from the factory.
58 * The maximum available item has an ID of GetNumberOfItems() - 1.
60 virtual unsigned int GetNumberOfItems()
62 return TOTAL_ITEM_NUMBER;
66 * Create an Actor to represent a visible item.
68 * @return the created actor.
70 virtual Actor NewItem(unsigned int itemId)
72 // Create a renderable actor for this item
73 return ImageView::New(TEST_IMAGE_FILE_NAME);
79 typedef IntrusivePtr<TestItemLayout> TestItemLayoutPtr;
81 // Implementation of ItemLayout
82 class TestItemLayout : public ItemLayout
95 virtual ~TestItemLayout()
100 * Create a new grid layout.
102 static TestItemLayoutPtr New()
104 return TestItemLayoutPtr(new TestItemLayout());
107 public: // From ItemLayout
109 * Query the minimum valid layout position; this is a negative value.
111 * When scrolling, the first item will move within the range 0 to GetMinimumLayoutPosition().
112 * @param[in] numberOfItems The current number of items in the layout.
113 * @param[in] layoutSize The size of the layout area.
114 * @return The minimum layout position.
116 virtual float GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const
122 * Query the closest anchor position for the given layout position.
124 * This anchor position is the position where all the items in the layout are aligned to
125 * their rounded layout positions in integer.
126 * @param[in] layoutPosition The layout position.
127 * @return The closest anchor position for the given layout position.
129 virtual float GetClosestAnchorPosition(float layoutPosition) const
135 * Query the layout position for the first item in the layout to move to when the layout
136 * needs to scroll to a particular item.
138 * @param[in] itemId The ID of an item in the layout.
139 * @return The layout position for the first item in the layout to move to.
141 virtual float GetItemScrollToPosition(unsigned int itemId) const
147 * Query the items within a given layout-area.
149 * @param[in] firstItemPosition The layout-position of the first item in the layout.
150 * @param[in] layoutSize The size of the layout area.
151 * @return The ID of the first & last visible item.
153 virtual ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const
155 return ItemRange(0, 10);
159 * Query the number of items that should be reserved, for scrolling purposes.
161 * @param[in] layoutSize The size of the layout area.
162 * @return The number of extra items.
164 virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const
170 * Retrieve the default size of an item in the layout.
172 * @param[in] itemId The ID of an item in the layout.
173 * @param[in] layoutSize The layout size
174 * @param[out] itemSize The target size of an item.
176 virtual void GetDefaultItemSize(unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize) const
181 * @brief Query the scroll direction of the layout.
182 * @return The scroll direction in degrees.
184 virtual Degree GetScrollDirection() const
190 * @brief Query the scroll speed factor of the layout while dragging.
191 * @return The scroll speed factor of the layout.
193 virtual float GetScrollSpeedFactor() const
199 * @brief Query the maximum swipe speed in pixels per second.
200 * @return speed The maximum swipe speed.
202 virtual float GetMaximumSwipeSpeed() const
208 * @brief Get the duration of the flick animation in second.
209 * @return The duration of the flick animation.
211 virtual float GetItemFlickAnimationDuration() const
217 * @brief Applies constraints defined by the layout to an actor.
219 * @param[in] actor The actor to constrain.
220 * @param[in] itemId The ID of the item represented by the actor.
221 * @param[in] layoutSize the current size of the item view instance.
222 * @param[in] itemViewActor The item view instance which requests the application of constraints.
224 virtual void ApplyConstraints(Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor)
229 * @brief Gets the position of a given item
231 * @param[in] itemID id of the item we want to get its position
232 * @param[in] currentLayoutPosition the current layout position of the item view instance
233 * @param[in] layoutSize the current size of the item view instance
234 * @return The item position (x,y,z)
236 virtual Vector3 GetItemPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize) const
238 return Vector3::ZERO;
244 int UtcDaliItemLayoutSetAndGetOrientation(void)
246 ToolkitTestApplication application;
248 // Create the ItemView actor
249 TestItemFactory factory;
250 ItemView view = ItemView::New(factory);
252 // Create a grid layout and add it to ItemView
253 ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
254 view.AddLayout(*gridLayout);
256 // Set the orientation of the layout to be horizontal from left to right
257 ItemLayoutPtr layout = view.GetLayout(0);
259 DALI_TEST_CHECK(gridLayout == layout);
261 layout->SetOrientation(ControlOrientation::Left);
263 // Check the orientation of the layout is horizontal from left to right
264 DALI_TEST_CHECK(layout->GetOrientation() == ControlOrientation::Left);
266 Vector3 itemSize(100.0f, 100.0f, 100.0f);
267 layout->SetItemSize(itemSize);
270 layout->GetItemSize(0u, Vector3(application.GetScene().GetSize()), itemSize1);
272 DALI_TEST_CHECK(itemSize == itemSize1);
274 float position = layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3(application.GetScene().GetSize()));
276 DALI_TEST_EQUALS(position, 0.0f, TEST_LOCATION);
278 int focusItem = layout->GetNextFocusItemID(0, TOTAL_ITEM_NUMBER, Control::KeyboardFocus::LEFT, true);
280 DALI_TEST_CHECK(focusItem != 0);
282 float flickSpeedFactor = layout->GetFlickSpeedFactor();
284 DALI_TEST_CHECK(flickSpeedFactor != 0.0f);
286 // White box test here: -( itemId / NoOfItemsPerRow(default 4) ) * NoOfItemsPerRow
287 DALI_TEST_EQUALS(-1.0f, gridLayout->GetItemScrollToPosition(1), TEST_LOCATION);
289 ItemLayoutPtr depthLayout = DefaultItemLayout::New(DefaultItemLayout::DEPTH);
290 view.AddLayout(*depthLayout);
292 layout = view.GetLayout(1);
293 DALI_TEST_CHECK(depthLayout == layout);
295 ItemLayoutPtr listLayout = DefaultItemLayout::New(DefaultItemLayout::LIST);
296 view.AddLayout(*listLayout);
298 layout = view.GetLayout(2);
299 DALI_TEST_CHECK(listLayout == layout);
301 ItemLayoutPtr spiralLayout = DefaultItemLayout::New(DefaultItemLayout::SPIRAL);
302 view.AddLayout(*spiralLayout);
304 layout = view.GetLayout(3);
305 DALI_TEST_CHECK(spiralLayout == layout);
309 int UtcDaliItemLayoutGetExtension(void)
311 ToolkitTestApplication application;
313 ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
314 DALI_TEST_CHECK(gridLayout);
315 DALI_TEST_CHECK(!gridLayout->GetExtension());
320 int UtcDaliItemLayoutGetClosestOnScreenLayoutPosition(void)
322 ToolkitTestApplication application;
324 TestItemLayoutPtr layout = TestItemLayout::New();
325 DALI_TEST_CHECK(layout);
326 DALI_TEST_EQUALS(layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3::ZERO), 0.0f, TEST_LOCATION);
327 DALI_TEST_EQUALS(layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3(-800.0f, -1200.0f, 0.0f)), 0.0f, TEST_LOCATION);
332 int UtcDaliItemLayoutGetNextFocusItemID(void)
334 ToolkitTestApplication application;
336 TestItemLayoutPtr layout = TestItemLayout::New();
337 DALI_TEST_CHECK(layout);
338 DALI_TEST_EQUALS(layout->GetNextFocusItemID(0, 100, Control::KeyboardFocus::LEFT, true), 99, TEST_LOCATION);
339 DALI_TEST_EQUALS(layout->GetNextFocusItemID(110, 100, Control::KeyboardFocus::RIGHT, true), 0, TEST_LOCATION);
344 int UtcDaliItemLayoutSetAndGetLayoutProperties(void)
346 ToolkitTestApplication application;
348 // Create the ItemView actor
349 TestItemFactory factory;
350 ItemView view = ItemView::New(factory);
352 // Create a grid layout and add it to ItemView
353 ItemLayoutPtr gridLayout = DefaultItemLayout::New(DefaultItemLayout::GRID);
355 // Set the property of the grid layout
356 Property::Map gridLayoutProperty;
357 gridLayoutProperty.Insert(DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::GRID));
358 gridLayoutProperty.Insert(DefaultItemLayoutProperty::ITEM_SIZE, Dali::Property::Value(Vector3(200, 200, 50)));
359 gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_ROW_SPACING, Dali::Property::Value(50.0f));
360 gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_COLUMN_NUMBER, Dali::Property::Value(4));
361 gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_COLUMN_SPACING, Dali::Property::Value(50.0f));
362 gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_TOP_MARGIN, Dali::Property::Value(95.0f));
363 gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_BOTTOM_MARGIN, Dali::Property::Value(20.0f));
364 gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_SIDE_MARGIN, Dali::Property::Value(20.0f));
365 gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.03f));
366 gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.015f));
367 gridLayoutProperty.Insert(DefaultItemLayoutProperty::GRID_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(100.0f));
368 gridLayoutProperty.Insert(DefaultItemLayoutProperty::ORIENTATION, Dali::Property::Value((int)ControlOrientation::Up));
369 gridLayout->SetLayoutProperties(gridLayoutProperty);
371 view.AddLayout(*gridLayout);
372 ItemLayoutPtr layout = view.GetLayout(0);
373 DALI_TEST_CHECK(gridLayout == layout);
374 Property::Map firstLayout = gridLayout->GetLayoutProperties();
376 //Check all the properties of grid layout
377 DALI_TEST_EQUALS(gridLayoutProperty.Count(), firstLayout.Count(), TEST_LOCATION);
379 for(unsigned int mapIdx = 0, mapCount = firstLayout.Count(); mapIdx < mapCount; ++mapIdx)
381 KeyValuePair propertyPair(firstLayout.GetKeyValue(mapIdx));
382 if(propertyPair.first == DefaultItemLayoutProperty::TYPE)
384 int layoutType = propertyPair.second.Get<int>();
385 DALI_TEST_EQUALS(layoutType, (int)DefaultItemLayout::GRID, TEST_LOCATION);
387 else if(propertyPair.first == DefaultItemLayoutProperty::ITEM_SIZE)
389 Vector3 size = propertyPair.second.Get<Vector3>();
390 DALI_TEST_EQUALS(size, Vector3(200, 200, 50), TEST_LOCATION);
392 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_ROW_SPACING)
394 float rowSpacing = propertyPair.second.Get<float>();
395 DALI_TEST_EQUALS(rowSpacing, 50.0f, TEST_LOCATION);
397 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_COLUMN_NUMBER)
399 int number = propertyPair.second.Get<int>();
400 DALI_TEST_EQUALS(number, 4, TEST_LOCATION);
402 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_COLUMN_SPACING)
404 float columnSpacing = propertyPair.second.Get<float>();
405 DALI_TEST_EQUALS(columnSpacing, 50.0f, TEST_LOCATION);
407 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_TOP_MARGIN)
409 float topMargin = propertyPair.second.Get<float>();
410 DALI_TEST_EQUALS(topMargin, 95.0f, TEST_LOCATION);
412 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_BOTTOM_MARGIN)
414 float bottomMargin = propertyPair.second.Get<float>();
415 DALI_TEST_EQUALS(bottomMargin, 20.0f, TEST_LOCATION);
417 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_SIDE_MARGIN)
419 float sideMargin = propertyPair.second.Get<float>();
420 DALI_TEST_EQUALS(sideMargin, 20.0f, TEST_LOCATION);
422 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_SCROLL_SPEED_FACTOR)
424 float scrollSpeedFactor = propertyPair.second.Get<float>();
425 DALI_TEST_EQUALS(scrollSpeedFactor, 0.03f, TEST_LOCATION);
427 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_ITEM_FLICK_ANIMATION_DURATION)
429 float animationDuration = propertyPair.second.Get<float>();
430 DALI_TEST_EQUALS(animationDuration, 0.015f, TEST_LOCATION);
432 else if(propertyPair.first == DefaultItemLayoutProperty::GRID_MAXIMUM_SWIPE_SPEED)
434 float swipSpeed = propertyPair.second.Get<float>();
435 DALI_TEST_EQUALS(swipSpeed, 100.0f, TEST_LOCATION);
438 ItemLayoutPtr depthLayout = DefaultItemLayout::New(DefaultItemLayout::DEPTH);
440 // Set the property of the depth layout
441 Property::Map depthLayoutProperty;
442 depthLayoutProperty.Insert(DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::DEPTH));
443 depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_COLUMN_NUMBER, Dali::Property::Value(3));
444 depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_ROW_NUMBER, Dali::Property::Value(26.0f));
445 depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_ROW_SPACING, Dali::Property::Value(55.0f));
446 depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_TILT_ANGLE, Dali::Property::Value(Math::PI * 0.15f));
447 depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_ITEM_TILT_ANGLE, Dali::Property::Value(-Math::PI * 0.025f));
448 depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.02f));
449 depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.03f));
450 depthLayoutProperty.Insert(DefaultItemLayoutProperty::DEPTH_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(50.0f));
451 depthLayoutProperty.Insert(DefaultItemLayoutProperty::ORIENTATION, Dali::Property::Value((int)ControlOrientation::Up));
452 depthLayout->SetLayoutProperties(depthLayoutProperty);
454 view.AddLayout(*depthLayout);
455 layout = view.GetLayout(1);
456 DALI_TEST_CHECK(depthLayout == layout);
458 Property::Map secondLayout = depthLayout->GetLayoutProperties();
460 //Check all the properties of grid layout
461 DALI_TEST_EQUALS(depthLayoutProperty.Count(), secondLayout.Count(), TEST_LOCATION);
462 for(unsigned int mapIdx = 0, mapCount = secondLayout.Count(); mapIdx < mapCount; ++mapIdx)
464 KeyValuePair propertyPair(secondLayout.GetKeyValue(mapIdx));
465 if(propertyPair.first == DefaultItemLayoutProperty::TYPE)
467 int layoutType = propertyPair.second.Get<int>();
468 DALI_TEST_EQUALS(layoutType, (int)DefaultItemLayout::DEPTH, TEST_LOCATION);
470 else if(propertyPair.first == DefaultItemLayoutProperty::ORIENTATION)
472 int orientation = propertyPair.second.Get<int>();
473 DALI_TEST_EQUALS(orientation, (int)ControlOrientation::Up, TEST_LOCATION);
475 else if(propertyPair.first == DefaultItemLayoutProperty::ITEM_SIZE)
477 Vector3 size = propertyPair.second.Get<Vector3>();
478 DALI_TEST_EQUALS(size, Vector3(200, 200, 50), TEST_LOCATION);
481 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_COLUMN_NUMBER)
483 int columnNumber = propertyPair.second.Get<int>();
484 DALI_TEST_EQUALS(columnNumber, 3, TEST_LOCATION);
486 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ROW_NUMBER)
488 float rowNumber = propertyPair.second.Get<float>();
489 DALI_TEST_EQUALS(rowNumber, 26.0f, TEST_LOCATION);
491 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ROW_SPACING)
493 float rowSpacing = propertyPair.second.Get<float>();
494 DALI_TEST_EQUALS(rowSpacing, 55.0f, TEST_LOCATION);
496 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_TILT_ANGLE)
498 float tiltAngle = propertyPair.second.Get<float>();
499 DALI_TEST_EQUALS(tiltAngle, Math::PI * 0.15f, TEST_LOCATION);
501 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ITEM_TILT_ANGLE)
503 float itemTiltAngle = propertyPair.second.Get<float>();
504 DALI_TEST_EQUALS(itemTiltAngle, -Math::PI * 0.025f, TEST_LOCATION);
506 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_SCROLL_SPEED_FACTOR)
508 float scrollSpeedFactor = propertyPair.second.Get<float>();
509 DALI_TEST_EQUALS(scrollSpeedFactor, 0.02f, TEST_LOCATION);
512 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_ITEM_FLICK_ANIMATION_DURATION)
514 float animationDuration = propertyPair.second.Get<float>();
515 DALI_TEST_EQUALS(animationDuration, 0.03f, TEST_LOCATION);
517 else if(propertyPair.first == DefaultItemLayoutProperty::DEPTH_MAXIMUM_SWIPE_SPEED)
519 float swipSpeed = propertyPair.second.Get<float>();
520 DALI_TEST_EQUALS(swipSpeed, 50.0f, TEST_LOCATION);
523 ItemLayoutPtr spiralLayout = DefaultItemLayout::New(DefaultItemLayout::SPIRAL);
525 // Set the property of the spiral layout
526 Property::Map spiralLayoutPrperty;
527 spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::TYPE, Dali::Property::Value((int)DefaultItemLayout::SPIRAL));
528 spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_ITEM_SPACING, Dali::Property::Value((Math::PI * 2.0f) / 9.5f));
529 spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_TOP_ITEM_ALIGNMENT, Dali::Property::Value(-0.125f));
530 spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_REVOLUTION_DISTANCE, Dali::Property::Value(190.0f));
531 spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_SCROLL_SPEED_FACTOR, Dali::Property::Value(0.01f));
532 spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_ITEM_FLICK_ANIMATION_DURATION, Dali::Property::Value(0.1f));
533 spiralLayoutPrperty.Insert(DefaultItemLayoutProperty::SPIRAL_MAXIMUM_SWIPE_SPEED, Dali::Property::Value(30.0f));
534 spiralLayout->SetLayoutProperties(spiralLayoutPrperty);
536 view.AddLayout(*spiralLayout);
537 layout = view.GetLayout(2);
538 DALI_TEST_CHECK(spiralLayout == layout);
540 Property::Map thridLayout = spiralLayout->GetLayoutProperties();
542 //Check all the properties of grid layout
543 DALI_TEST_EQUALS(spiralLayoutPrperty.Count(), thridLayout.Count(), TEST_LOCATION);
545 for(unsigned int mapIdx = 0, mapCount = thridLayout.Count(); mapIdx < mapCount; ++mapIdx)
547 KeyValuePair propertyPair(thridLayout.GetKeyValue(mapIdx));
548 if(propertyPair.first == DefaultItemLayoutProperty::TYPE)
550 int layoutType = propertyPair.second.Get<int>();
551 DALI_TEST_EQUALS(layoutType, (int)DefaultItemLayout::SPIRAL, TEST_LOCATION);
553 else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_ITEM_SPACING)
555 float columnNumber = propertyPair.second.Get<float>();
556 DALI_TEST_EQUALS(columnNumber, (Math::PI * 2.0f) / 9.5f, TEST_LOCATION);
558 else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_TOP_ITEM_ALIGNMENT)
560 float rowNumber = propertyPair.second.Get<float>();
561 DALI_TEST_EQUALS(rowNumber, -0.125f, TEST_LOCATION);
563 else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_REVOLUTION_DISTANCE)
565 float rowSpacing = propertyPair.second.Get<float>();
566 DALI_TEST_EQUALS(rowSpacing, 190.0f, TEST_LOCATION);
568 else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_SCROLL_SPEED_FACTOR)
570 float scrollSpeedFactor = propertyPair.second.Get<float>();
571 DALI_TEST_EQUALS(scrollSpeedFactor, 0.01f, TEST_LOCATION);
574 else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_ITEM_FLICK_ANIMATION_DURATION)
576 float animationDuration = propertyPair.second.Get<float>();
577 DALI_TEST_EQUALS(animationDuration, 0.1f, TEST_LOCATION);
579 else if(propertyPair.first == DefaultItemLayoutProperty::SPIRAL_MAXIMUM_SWIPE_SPEED)
581 float swipSpeed = propertyPair.second.Get<float>();
582 DALI_TEST_EQUALS(swipSpeed, 30.0f, TEST_LOCATION);
585 Dali::Integration::Scene scene = application.GetScene();
586 Vector3 sceneSize(scene.GetSize());
587 view.ActivateLayout(0, sceneSize, 0.5f);
588 view.ActivateLayout(1, sceneSize, 0.5f);
589 view.ActivateLayout(2, sceneSize, 0.5f);
593 int UtcDaliItemRangeIntersection(void)
595 ToolkitTestApplication application;
597 unsigned int uBeginItemFirst = 100u, uEndItemFirst = 300u;
598 unsigned int uBeginItemSecond = 290u, uEndItemSecond = 400;
599 unsigned int uInterBeginCheck = 290u, uInterEndCheck = 301u;
600 bool bIsInThisRange = false, bOutOfThisRange = false;
602 Toolkit::ItemRange objItemRangeFirst(uBeginItemFirst, uEndItemFirst);
603 Toolkit::ItemRange objItemRangeSecond(uBeginItemSecond, uEndItemSecond);
604 ItemRange itmInterSect = objItemRangeFirst.Intersection(objItemRangeSecond);
606 bIsInThisRange = itmInterSect.Within(uInterBeginCheck);
607 DALI_TEST_EQUALS(bIsInThisRange, true, TEST_LOCATION);
609 bOutOfThisRange = itmInterSect.Within(uInterEndCheck);
610 DALI_TEST_EQUALS(bOutOfThisRange, false, TEST_LOCATION);