using namespace Dali;
+using Dali::Toolkit::TextLabel;
+
// LOCAL STUFF
namespace
{
/**
* @brief Load an image, scaled-down to no more than the stage dimensions.
*
- * Uses image scaling mode ImageAttributes::ScaleToFill to resize the image at
+ * Uses image scaling mode SCALE_TO_FILL to resize the image at
* load time to cover the entire stage with pixels with no borders,
- * and filter mode ImageAttributes::BoxThenLinear to sample the image with
+ * and filter mode BOX_THEN_LINEAR to sample the image with
* maximum quality.
*/
ResourceImage LoadStageFillingImage( const char * const imagePath )
{
Size stageSize = Stage::GetCurrent().GetSize();
- ImageAttributes attributes;
- attributes.SetSize( stageSize.x, stageSize.y );
- attributes.SetFilterMode( ImageAttributes::BoxThenLinear );
- attributes.SetScalingMode( ImageAttributes::ScaleToFill );
- return ResourceImage::New( imagePath, attributes );
+ return ResourceImage::New( imagePath, ImageDimensions( stageSize.x, stageSize.y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
}
} // namespace
Toolkit::View mView;
Toolkit::ToolBar mToolBar;
Layer mContent;
+ Toolkit::TextLabel mTitleActor;
Actor mParent;
Vector2 mViewSize;
ImageActor mNextImage;
unsigned int mIndex;
bool mIsImageLoading;
- Constraint mImageConstraint;
PanGestureDetector mPanGestureDetector;
void CubeTransitionApp::OnInit( Application& application )
{
+ DemoHelper::RequestThemeChange();
+
Stage::GetCurrent().KeyEventSignal().Connect(this, &CubeTransitionApp::OnKeyEvent);
// Creates a default view with a default tool bar, the view is added to the stage.
mEffectChangeButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnEffectButtonClicked );
mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
+ // Add title to the tool bar.
+ mTitleActor = DemoHelper::CreateToolBarLabel( APPLICATION_TITLE_WAVE );
+ mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter );
+
//Add an slideshow icon on the right of the title
mIconSlideshowStart = ResourceImage::New( SLIDE_SHOW_START_ICON );
mIconSlideshowStop = ResourceImage::New( SLIDE_SHOW_STOP_ICON );
mViewTimer.TickSignal().Connect( this, &CubeTransitionApp::OnTimerTick );
// show the first image
- mImageConstraint = Constraint::New<Vector3>( Actor::Property::SCALE, LocalSource( Actor::Property::SIZE ), ParentSource( Actor::Property::SIZE ), ScaleToFitKeepAspectRatioConstraint() );
-
mCurrentImage = ImageActor::New( LoadStageFillingImage( IMAGES[mIndex] ) );
mCurrentImage.SetPositionInheritanceMode( USE_PARENT_POSITION );
- mCurrentImage.ApplyConstraint( mImageConstraint );
- mCurrentImage.SetRelayoutEnabled( false );
+ mCurrentImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mCurrentImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mParent.Add( mCurrentImage );
mCurrentEffect = mCubeWaveEffect;
mNextImage = ImageActor::New( image );
mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION);
- mNextImage.ApplyConstraint( mImageConstraint );
+ mNextImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mNextImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mNextImage.SetRelayoutEnabled( false );
mCurrentEffect.SetTargetImage(mNextImage);
if( image.GetLoadingState() == ResourceLoadingSucceeded )
if(mCurrentEffect == mCubeWaveEffect)
{
mCurrentEffect = mCubeCrossEffect;
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_CROSS) );
mEffectChangeButton.SetBackgroundImage(mImageCross);
}
else if(mCurrentEffect == mCubeCrossEffect)
{
mCurrentEffect = mCubeFoldEffect;
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_FOLD) );
mEffectChangeButton.SetBackgroundImage(mImageFold);
}
else
{
mCurrentEffect = mCubeWaveEffect;
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_WAVE) );
mEffectChangeButton.SetBackgroundImage(mImageWave);
}