X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fscroll-view%2Fscroll-view-example.cpp;h=d45f1c9cc66da2ae5c08d8639d2b5aa380b9890a;hb=adf210149fc391c9176d667e43e8d8b5a429cb57;hp=ed8e699887f29f3dbe7511ec0ec9533ffc9c99f1;hpb=46e6a0e92784c860b2b5425e34941c6574dd8062;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/scroll-view/scroll-view-example.cpp b/examples/scroll-view/scroll-view-example.cpp index ed8e699..d45f1c9 100644 --- a/examples/scroll-view/scroll-view-example.cpp +++ b/examples/scroll-view/scroll-view-example.cpp @@ -450,16 +450,23 @@ private: * @param[in] width the width of the image in texels * @param[in] height the height of the image in texels. */ - ImageView CreateImage( const std::string& filename, unsigned int width = IMAGE_THUMBNAIL_WIDTH, unsigned int height = IMAGE_THUMBNAIL_HEIGHT ) + ImageView CreateImage( const std::string& filename, int width = IMAGE_THUMBNAIL_WIDTH, int height = IMAGE_THUMBNAIL_HEIGHT ) { - Image img = ResourceImage::New(filename, ImageDimensions( width, height ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR ); + ImageView actor = ImageView::New(); + Property::Map map; + map[Visual::Property::TYPE] = Visual::IMAGE; + map[ImageVisual::Property::URL] = filename; + map[ImageVisual::Property::DESIRED_WIDTH] = width; + map[ImageVisual::Property::DESIRED_HEIGHT] = height; + map[ImageVisual::Property::FITTING_MODE] = FittingMode::SCALE_TO_FILL; + map[ImageVisual::Property::SAMPLING_MODE] = SamplingMode::BOX_THEN_LINEAR; + actor.SetProperty( ImageView::Property::IMAGE, map ); - ImageView actor = ImageView::New(img); actor.SetName( filename ); actor.SetParentOrigin(ParentOrigin::CENTER); actor.SetAnchorPoint(AnchorPoint::CENTER); - actor.TouchedSignal().Connect( this, &ExampleController::OnTouchImage ); + actor.TouchSignal().Connect( this, &ExampleController::OnTouchImage ); return actor; } @@ -487,14 +494,13 @@ private: * Upon Touching an image (Release), make it spin * (provided we're not scrolling). * @param[in] actor The actor touched - * @param[in] event The TouchEvent. + * @param[in] event The touch information. */ - bool OnTouchImage( Actor actor, const TouchEvent& event ) + bool OnTouchImage( Actor actor, const TouchData& event ) { - if( (event.points.size() > 0) && (!mScrolling) ) + if( (event.GetPointCount() > 0) && (!mScrolling) ) { - TouchPoint point = event.points[0]; - if(point.state == TouchPoint::Up) + if( event.GetState( 0 ) == PointState::UP ) { // Spin the Image a few times. Animation animation = Animation::New(SPIN_DURATION); @@ -579,7 +585,7 @@ private: Toolkit::PushButton mEffectChangeButton; ///< Effect Change Button }; -int main(int argc, char **argv) +int DALI_EXPORT_API main(int argc, char **argv) { Application app = Application::New(&argc, &argv, DEMO_THEME_PATH); ExampleController test(app);