- Toolkit::PushButton editButton = Toolkit::PushButton::New();
- editButton.SetUnselectedImage( EDIT_IMAGE );
- editButton.SetSelectedImage( EDIT_IMAGE_SELECTED );
- editButton.ClickedSignal().Connect( this, &ExampleApp::OnToolSelectLayout);
- editButton.SetLeaveRequired( true );
- mToolBar.AddControl( editButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
-
- EnterSelection();
-
- mTimer = Timer::New( 500 ); // ms
- mTimer.TickSignal().Connect( this, &ExampleApp::OnTimer);
+ Toolkit::PushButton backButton = Toolkit::PushButton::New();
+ backButton.SetProperty(Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, EDIT_IMAGE);
+ backButton.SetProperty(Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, EDIT_IMAGE_SELECTED);
+ backButton.ClickedSignal().Connect(this, &ExampleApp::OnBackButtonPressed);
+ backButton.SetProperty(Actor::Property::LEAVE_REQUIRED, true);
+ mToolBar.AddControl(backButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HORIZONTAL_LEFT, DemoHelper::DEFAULT_MODE_SWITCH_PADDING);
+
+ mNavigationView = Toolkit::NavigationView::New();
+ mNavigationView.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+ mNavigationView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+
+ window.Add(mNavigationView);
+
+ // Set up the background gradient.
+ Property::Array stopOffsets;
+ stopOffsets.PushBack(0.0f);
+ stopOffsets.PushBack(1.0f);
+ Property::Array stopColors;
+ stopColors.PushBack(Color::WHITE);
+ stopColors.PushBack(Vector4(0.45f, 0.70f, 0.80f, 1.0f)); // Medium bright, pastel blue
+ const float percentageWindowHeight = window.GetSize().GetHeight() * 0.6f;
+
+ mNavigationView.SetProperty(Toolkit::Control::Property::BACKGROUND, Dali::Property::Map().Add(Toolkit::Visual::Property::TYPE, Dali::Toolkit::Visual::GRADIENT).Add(Toolkit::GradientVisual::Property::STOP_OFFSET, stopOffsets).Add(Toolkit::GradientVisual::Property::STOP_COLOR, stopColors).Add(Toolkit::GradientVisual::Property::START_POSITION, Vector2(0.0f, -percentageWindowHeight)).Add(Toolkit::GradientVisual::Property::END_POSITION, Vector2(0.0f, percentageWindowHeight)).Add(Toolkit::GradientVisual::Property::UNITS, Toolkit::GradientVisual::Units::USER_SPACE));
+
+ SetUpItemView();
+ mNavigationView.Push(mItemView);
+
+ mTimer = Timer::New(500); // ms
+ mTimer.TickSignal().Connect(this, &ExampleApp::OnTimer);