Change FittingMode on Item view demos. 84/166784/3
authorFrancisco Santos <f1.santos@samsung.com>
Fri, 12 Jan 2018 02:15:13 +0000 (02:15 +0000)
committerFrancisco Santos <f1.santos@samsung.com>
Fri, 12 Jan 2018 15:15:24 +0000 (15:15 +0000)
Change-Id: I4d05c72240d2dd69c373ee2feb5b97254cb8f77f

examples/clipping/clipping-item-factory.cpp
examples/item-view/item-view-example.cpp

index 1233831e0cf9a48753ca46098ebdfe17d0c83367..f6cf3771a9be6816a308062ea782f0486009f4c4 100644 (file)
@@ -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 <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/public-api/visuals/border-visual-properties.h>
 #include <dali-toolkit/public-api/visuals/visual-properties.h>
+#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 
 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();
index d7e7b9bec4ea1db2ae25b0ab6653711a8a7300f9..61dce2da3a1388e76e48f3ea9a918819909ea130 100644 (file)
@@ -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 <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 
 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 );