Fix builder.example to work with updated ItemView code. 63/32363/1
authorKingsley Stephens <k.stephens@partner.samsung.com>
Wed, 17 Dec 2014 11:50:28 +0000 (11:50 +0000)
committerKingsley Stephens <k.stephens@partner.samsung.com>
Wed, 17 Dec 2014 11:50:28 +0000 (11:50 +0000)
Change-Id: Id2a566a93648690cd1a308302e0047149c8f2c31

examples/builder/examples.cpp

index 1f98958..0e26bdf 100644 (file)
@@ -280,6 +280,9 @@ public:
   {
     Stage stage = Stage::GetCurrent();
 
+    mTapDetector = TapGestureDetector::New();
+    mTapDetector.DetectedSignal().Connect( this, &ExampleApp::OnTap );
+
     if( mItemView )
     {
       stage.Remove( mItemView );
@@ -361,15 +364,6 @@ public:
       }
     }
 
-    mTapDetector = TapGestureDetector::New();
-
-    for( unsigned int i = 0u; i < mItemView.GetChildCount(); ++i )
-    {
-      mTapDetector.Attach( mItemView.GetChildAt(i) );
-    }
-
-    mTapDetector.DetectedSignal().Connect( this, &ExampleApp::OnTap );
-
     // Display item view on the stage
     stage.Add( mItemView );
 
@@ -413,6 +407,10 @@ public:
     t.SetText( fontString.str() );
 
     t.SetTextAlignment( Alignment::HorizontalLeft );
+
+    // Hook up tap detector
+    mTapDetector.Attach( t );
+
     return t;
   }