- // Create default View.
- mView = View::New();
- mView.SetRelayoutEnabled( false );
- stage.Add( mView );
-
- Dali::Window winHandle = app.GetWindow();
- winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT );
- winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE );
- winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT_INVERSE );
- winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE );
- // FIXME
- //app.GetOrientation().ChangedSignal().Connect( &mView, &View::OrientationChanged );
- // view will response to orientation change to display portrait or landscape views
- mView.OrientationAnimationStartedSignal().Connect( this, &PageTurnController::OnOrientationAnimationStarted );
-
- mPageTurnPortraitView = PageTurnPortraitView::New( mPortraitPageFactory, stageSize );
- mPageTurnPortraitView.SetRelayoutEnabled( false );
- mPageTurnPortraitView.SetSpineShadowParameter( Vector2(70.f, 30.f) );
+ mButtonLayer = Layer::New();
+ mButtonLayer.SetAnchorPoint( Dali::AnchorPoint::CENTER );
+ mButtonLayer.SetParentOrigin( Dali::ParentOrigin::CENTER );
+ mButtonLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ Toolkit::PushButton button = Toolkit::PushButton::New();
+ button.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
+ button.SetParentOrigin( ParentOrigin::TOP_RIGHT );
+ button.SetUnselectedImage( CHANGE_IMAGE_ICON );
+ button.SetSelectedImage( CHANGE_IMAGE_ICON_SELECTED );
+ button.SetLeaveRequired( true );
+ button.SetScale(1.5f);
+ button.PressedSignal().Connect( this, &PageTurnController::OnButtonClicked );
+ stage.Add( mButtonLayer );
+ mButtonLayer.Add(button);
+
+ Vector2 bookSize( stageSize.x > stageSize.y ? stageSize.y : stageSize.x,
+ stageSize.x > stageSize.y ? stageSize.x : stageSize.y );
+
+ mPageTurnPortraitView = PageTurnPortraitView::New( mPortraitPageFactory, bookSize );
+ mPageTurnPortraitView.SetParentOrigin( ParentOrigin::CENTER );
+ mPageTurnPortraitView.SetAnchorPoint( AnchorPoint::CENTER );
+ mPageTurnPortraitView.SetProperty( PageTurnView::Property::SPINE_SHADOW, Vector2(70.f, 30.f) );