/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
virtual Actor NewItem(unsigned int itemId)
{
// Create a renderable actor for this item
- Image image = ResourceImage::New( TEST_IMAGE_FILE_NAME );
- Actor actor = CreateRenderableActor(image);
-
- return actor;
+ return ImageView::New( TEST_IMAGE_FILE_NAME );
}
};
DALI_TEST_CHECK(view.GetActiveLayout() == NULL);
// Activate the depth layout
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(1, stageSize, 0.5f);
// Check the current active layout is the depth layout
DALI_TEST_CHECK(view.GetActiveLayout() == NULL);
// Activate the grid layout
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
// Check the current active layout is the grid layout
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
// Get the item given the item ID
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
// Get the item given the item ID 2 and 3
view.AddLayout(*depthLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.0f);
// Check the current layout position for the 10th items is 9.0f
Vector3 vec(480.0f, 800.0f, 0.0f);
ItemLayoutPtr layout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
- view.SetName("view actor");
+ view.SetProperty( Dali::Actor::Property::NAME,"view actor");
view.AddLayout(*layout);
- view.SetSize(vec);
+ view.SetProperty( Actor::Property::SIZE, vec );
- Stage::GetCurrent().Add(view);
+ application.GetScene().Add(view);
layout->SetOrientation(ControlOrientation::Down);
view.ActivateLayout(0, vec, 0.0f);
tet_result(TET_FAIL);
}
- Stage::GetCurrent().Remove(view);
+ application.GetScene().Remove(view);
END_TEST;
}
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.0f);
// Get the specified item where new item to be inserted before that
view.AddLayout(*depthLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
unsigned int itemCount = view.GetChildCount();
{
Actor child = view.GetChildAt( i );
Actor newActor = Actor::New();
- newActor.SetName("Inserted");
+ newActor.SetProperty( Dali::Actor::Property::NAME,"Inserted");
insertList.push_back( Item( view.GetItemId(child), newActor ) );
}
{
Actor child = view.GetChildAt( i );
- if( child.GetName() == "Inserted" )
+ if( child.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "Inserted" )
{
removeList.push_back( view.GetItemId(child) );
}
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
Actor newActor = Actor::New();
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
ItemContainer replaceList;
{
Actor child = view.GetItem( i );
Actor newActor = Actor::New();
- newActor.SetName("Replaced");
+ newActor.SetProperty( Dali::Actor::Property::NAME,"Replaced");
replaceList.push_back( Item( i, newActor ) );
}
view.ReplaceItems( replaceList, 0.5f );
}
- DALI_TEST_CHECK(view.GetItem(0).GetName() == "Replaced");
- DALI_TEST_CHECK(view.GetItem(8).GetName() == "Replaced");
+ DALI_TEST_CHECK(view.GetItem(0).GetProperty< std::string >( Dali::Actor::Property::NAME ) == "Replaced");
+ DALI_TEST_CHECK(view.GetItem(8).GetProperty< std::string >( Dali::Actor::Property::NAME ) == "Replaced");
END_TEST;
}
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
ItemRange itemRange(0, 0);
view.AddLayout(*spiralLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
Vector3 anchorPoint(10.0f, 10.0f, 0.0f);
view.SetItemsAnchorPoint(anchorPoint);
DALI_TEST_CHECK(view.GetItemsAnchorPoint() == anchorPoint);
- DALI_TEST_CHECK(view.GetItem(0).GetCurrentAnchorPoint() == anchorPoint);
+ DALI_TEST_CHECK(view.GetItem(0).GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ) == anchorPoint);
END_TEST;
}
view.AddLayout(*gridLayout);
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.5f);
Vector3 parentOrigin(10.0f, 10.0f, 0.0f);
view.SetItemsParentOrigin(parentOrigin);
DALI_TEST_CHECK(view.GetItemsParentOrigin() == parentOrigin);
- DALI_TEST_CHECK(view.GetItem(0).GetCurrentParentOrigin() == parentOrigin);
+ DALI_TEST_CHECK(view.GetItem(0).GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ) == parentOrigin);
END_TEST;
}
ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
view.AddLayout(*gridLayout);
- Stage::GetCurrent().Add( view );
+ application.GetScene().Add( view );
// Connect the layout activated signal
view.LayoutActivatedSignal().Connect( &OnLayoutActivated );
application.Render();
// Activate the grid layout so that the items will be created and added to ItemView
- Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+ Vector3 stageSize(application.GetScene().GetSize());
view.ActivateLayout(0, stageSize, 0.1f);
// Wait for 0.1 second
int UtcDaliItemViewOvershootVertical(void)
{
ToolkitTestApplication application;
- Dali::Stage stage = Dali::Stage::GetCurrent();
+ Dali::Integration::Scene stage = application.GetScene();
// Create the ItemView actor
TestItemFactory factory;
int UtcDaliItemViewOvershootHorizontal(void)
{
ToolkitTestApplication application;
- Dali::Stage stage = Dali::Stage::GetCurrent();
+ Dali::Integration::Scene stage = application.GetScene();
// Create the ItemView actor
TestItemFactory factory;
int UtcDaliItemEnableDisableRefresh(void)
{
ToolkitTestApplication application;
- Dali::Stage stage = Dali::Stage::GetCurrent();
+ Dali::Integration::Scene stage = application.GetScene();
// Create the ItemView actor
TestItemFactory factory;