From: Francisco Santos Date: Fri, 12 Jan 2018 02:15:13 +0000 (+0000) Subject: Change FittingMode on Item view demos. X-Git-Tag: dali_1.3.8~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-demo.git;a=commitdiff_plain;h=c69a61d59c8d844bbe822c13ae14a80b8ddeaede;hp=b39776e9585c8867c1cc8bf17a919a3c174df995 Change FittingMode on Item view demos. Change-Id: I4d05c72240d2dd69c373ee2feb5b97254cb8f77f --- diff --git a/examples/clipping/clipping-item-factory.cpp b/examples/clipping/clipping-item-factory.cpp index 1233831..f6cf377 100644 --- a/examples/clipping/clipping-item-factory.cpp +++ b/examples/clipping/clipping-item-factory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -23,6 +23,8 @@ #include #include #include +#include +#include using namespace Dali; using namespace Dali::Toolkit; @@ -102,7 +104,12 @@ unsigned int ClippingItemFactory::GetNumberOfItems() Actor ClippingItemFactory::NewItem( unsigned int itemId ) { // Create an image view for this item - ImageView actor = ImageView::New( IMAGE_PATHS[ itemId % NUM_IMAGES ] ); + Property::Map propertyMap; + propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE); + propertyMap.Insert(ImageVisual::Property::URL, IMAGE_PATHS[ itemId % NUM_IMAGES ] ); + propertyMap.Insert(DevelVisual::Property::FITTING_MODE, DevelVisual::FILL); + ImageView actor = ImageView::New(); + actor.SetProperty(Toolkit::ImageView::Property::IMAGE, propertyMap); // Add a border image child actor ImageView borderActor = ImageView::New(); diff --git a/examples/item-view/item-view-example.cpp b/examples/item-view/item-view-example.cpp index d7e7b9b..61dce2d 100644 --- a/examples/item-view/item-view-example.cpp +++ b/examples/item-view/item-view-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -21,6 +21,7 @@ #include #include #include +#include using namespace Dali; using namespace Dali::Toolkit; @@ -866,7 +867,12 @@ public: // From ItemFactory virtual Actor NewItem(unsigned int itemId) { // Create an image view for this item - ImageView actor = ImageView::New( IMAGE_PATHS[ itemId % NUM_IMAGES ] ); + Property::Map propertyMap; + propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE); + propertyMap.Insert(ImageVisual::Property::URL, IMAGE_PATHS[ itemId % NUM_IMAGES ] ); + propertyMap.Insert(DevelVisual::Property::FITTING_MODE, DevelVisual::FILL); + ImageView actor = ImageView::New(); + actor.SetProperty( Toolkit::ImageView::Property::IMAGE, propertyMap ); actor.SetZ( 0.0f ); actor.SetPosition( INITIAL_OFFSCREEN_POSITION );