Commit be88883a75560ea10d54849025be429dd44456f6

Authored by Victor Cebollada
2 parents af9cf192 280e1b5a

[dali_1.2.4] Merge branch 'devel/master'

Change-Id: Idfe0ebf0e9c5de4f4d42ba1ae22fa0df21167dd4
build/tizen/CMakeLists.txt
@@ -56,7 +56,7 @@ SET(DEMO_EXAMPLE_BIN \\"${BINDIR}/\\") @@ -56,7 +56,7 @@ SET(DEMO_EXAMPLE_BIN \\"${BINDIR}/\\")
56 SET(DEMO_LOCALE_DIR \\"${LOCALE_DIR}\\") 56 SET(DEMO_LOCALE_DIR \\"${LOCALE_DIR}\\")
57 SET(DEMO_LANG \\"${LANG}\\") 57 SET(DEMO_LANG \\"${LANG}\\")
58 58
59 -SET(DEMO_STYLE_IMAGE_DIR ${STYLE_DIR}images) 59 +SET(DEMO_STYLE_IMAGE_DIR ${STYLE_DIR}/images)
60 60
61 FILE(GLOB LOCAL_IMAGES_PNG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.png") 61 FILE(GLOB LOCAL_IMAGES_PNG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.png")
62 FILE(GLOB LOCAL_IMAGES_JPG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.jpg") 62 FILE(GLOB LOCAL_IMAGES_JPG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.jpg")
demo/dali-table-view.cpp
1 /* 1 /*
2 - * Copyright (c) 2015 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -44,6 +44,7 @@ const std::string TILE_BACKGROUND_ALPHA(DEMO_IMAGE_DIR "item-background-alpha.9. @@ -44,6 +44,7 @@ const std::string TILE_BACKGROUND_ALPHA(DEMO_IMAGE_DIR "item-background-alpha.9.
44 44
45 const char * const DEFAULT_TOOLBAR_TEXT( "TOUCH TO LAUNCH EXAMPLE" ); 45 const char * const DEFAULT_TOOLBAR_TEXT( "TOUCH TO LAUNCH EXAMPLE" );
46 46
  47 +const Vector4 TILE_COLOR( 0.5f, 0.6f, 0.8f, 0.23f ); ///< Color (including alpha) of tile contents.
47 const float BUTTON_PRESS_ANIMATION_TIME = 0.25f; ///< Time to perform button scale effect. 48 const float BUTTON_PRESS_ANIMATION_TIME = 0.25f; ///< Time to perform button scale effect.
48 const float ROTATE_ANIMATION_TIME = 0.5f; ///< Time to perform rotate effect. 49 const float ROTATE_ANIMATION_TIME = 0.5f; ///< Time to perform rotate effect.
49 const int MAX_PAGES = 256; ///< Maximum pages (arbitrary safety limit) 50 const int MAX_PAGES = 256; ///< Maximum pages (arbitrary safety limit)
@@ -54,34 +55,6 @@ const float LOGO_MARGIN_RATIO = 0.1f / 0.3f; @@ -54,34 +55,6 @@ const float LOGO_MARGIN_RATIO = 0.1f / 0.3f;
54 const float BOTTOM_PADDING_RATIO = 0.4f / 0.9f; 55 const float BOTTOM_PADDING_RATIO = 0.4f / 0.9f;
55 const Vector3 SCROLLVIEW_RELATIVE_SIZE(0.9f, 1.0f, 0.8f ); ///< ScrollView's relative size to its parent 56 const Vector3 SCROLLVIEW_RELATIVE_SIZE(0.9f, 1.0f, 0.8f ); ///< ScrollView's relative size to its parent
56 const Vector3 TABLE_RELATIVE_SIZE(0.95f, 0.9f, 0.8f ); ///< TableView's relative size to the entire stage. The Y value means sum of the logo and table relative heights. 57 const Vector3 TABLE_RELATIVE_SIZE(0.95f, 0.9f, 0.8f ); ///< TableView's relative size to the entire stage. The Y value means sum of the logo and table relative heights.
57 -const float STENCIL_RELATIVE_SIZE = 1.0f;  
58 -  
59 -const float EFFECT_SNAP_DURATION = 0.66f; ///< Scroll Snap Duration for Effects  
60 -const float EFFECT_FLICK_DURATION = 0.5f; ///< Scroll Flick Duration for Effects  
61 -const Vector3 ANGLE_CUBE_PAGE_ROTATE(Math::PI * 0.5f, Math::PI * 0.5f, 0.0f);  
62 -  
63 -const Vector4 BUBBLE_COLOR[] =  
64 -{  
65 - Vector4( 0.3255f, 0.3412f, 0.6353f, 0.38f ),  
66 - Vector4( 0.3647f, 0.7569f, 0.8157f, 0.38f ),  
67 - Vector4( 0.3804f, 0.7412f, 0.6510f, 0.38f ),  
68 - Vector4( 1.f, 1.f, 1.f, 0.2f )  
69 -};  
70 -const int NUMBER_OF_BUBBLE_COLOR( sizeof(BUBBLE_COLOR) / sizeof(BUBBLE_COLOR[0]) );  
71 -  
72 -const int NUM_BACKGROUND_IMAGES = 18;  
73 -const float BACKGROUND_SWIPE_SCALE = 0.025f;  
74 -const float BACKGROUND_SPREAD_SCALE = 1.5f;  
75 -const float SCALE_MOD = 1000.0f * Math::PI * 2.0f;  
76 -const float SCALE_SPEED = 10.0f;  
77 -const float SCALE_SPEED_SIN = 0.1f;  
78 -  
79 -const unsigned int BACKGROUND_ANIMATION_DURATION = 15000; // 15 secs  
80 -  
81 -const Vector4 BACKGROUND_COLOR( 0.3569f, 0.5451f, 0.7294f, 1.0f );  
82 -  
83 -const float BUBBLE_MIN_Z = -1.0;  
84 -const float BUBBLE_MAX_Z = 0.0f;  
85 58
86 /** 59 /**
87 * Creates the background image 60 * Creates the background image
@@ -90,7 +63,7 @@ Control CreateBackground( std::string stylename ) @@ -90,7 +63,7 @@ Control CreateBackground( std::string stylename )
90 { 63 {
91 Control background = Control::New(); 64 Control background = Control::New();
92 Stage::GetCurrent().Add( background ); 65 Stage::GetCurrent().Add( background );
93 - background.SetProperty( Control::Property::STYLE_NAME,stylename); 66 + background.SetStyleName( stylename);
94 background.SetName( "BACKGROUND" ); 67 background.SetName( "BACKGROUND" );
95 background.SetAnchorPoint( AnchorPoint::CENTER ); 68 background.SetAnchorPoint( AnchorPoint::CENTER );
96 background.SetParentOrigin( ParentOrigin::CENTER ); 69 background.SetParentOrigin( ParentOrigin::CENTER );
@@ -99,38 +72,6 @@ Control CreateBackground( std::string stylename ) @@ -99,38 +72,6 @@ Control CreateBackground( std::string stylename )
99 return background; 72 return background;
100 } 73 }
101 74
102 -/**  
103 - * Constraint to return a position for a bubble based on the scroll value and vertical wrapping  
104 - */  
105 -struct AnimateBubbleConstraint  
106 -{  
107 -public:  
108 - AnimateBubbleConstraint( const Vector3& initialPos, float scale )  
109 - : mInitialX( initialPos.x ),  
110 - mScale( scale )  
111 - {  
112 - }  
113 -  
114 - void operator()( Vector3& position, const PropertyInputContainer& inputs )  
115 - {  
116 - const Vector3& parentSize = inputs[1]->GetVector3();  
117 - const Vector3& childSize = inputs[2]->GetVector3();  
118 -  
119 - // Wrap bubbles vertically.  
120 - float range = parentSize.y + childSize.y;  
121 - // This performs a float mod (we don't use fmod as we want the arithmetic modulus as opposed to the remainder).  
122 - position.y -= range * ( floor( position.y / range ) + 0.5f );  
123 -  
124 - // Bubbles X position moves parallax to horizontal  
125 - // panning by a scale factor unique to each bubble.  
126 - position.x = mInitialX + ( inputs[0]->GetVector2().x * mScale );  
127 - }  
128 -  
129 -private:  
130 - float mInitialX;  
131 - float mScale;  
132 -};  
133 -  
134 bool CompareByTitle( const Example& lhs, const Example& rhs ) 75 bool CompareByTitle( const Example& lhs, const Example& rhs )
135 { 76 {
136 return lhs.title < rhs.title; 77 return lhs.title < rhs.title;
@@ -150,16 +91,13 @@ DaliTableView::DaliTableView( Application&amp; application ) @@ -150,16 +91,13 @@ DaliTableView::DaliTableView( Application&amp; application )
150 mScrollRulerX(), 91 mScrollRulerX(),
151 mScrollRulerY(), 92 mScrollRulerY(),
152 mPressedActor(), 93 mPressedActor(),
153 - mAnimationTimer(),  
154 mLogoTapDetector(), 94 mLogoTapDetector(),
155 mVersionPopup(), 95 mVersionPopup(),
156 mPages(), 96 mPages(),
157 - mBackgroundAnimations(),  
158 mExampleList(), 97 mExampleList(),
159 mTotalPages(), 98 mTotalPages(),
160 mScrolling( false ), 99 mScrolling( false ),
161 - mSortAlphabetically( false ),  
162 - mBackgroundAnimsPlaying( false ) 100 + mSortAlphabetically( false )
163 { 101 {
164 application.InitSignal().Connect( this, &DaliTableView::Initialize ); 102 application.InitSignal().Connect( this, &DaliTableView::Initialize );
165 } 103 }
@@ -185,7 +123,7 @@ void DaliTableView::Initialize( Application&amp; application ) @@ -185,7 +123,7 @@ void DaliTableView::Initialize( Application&amp; application )
185 const Vector2 stageSize = Stage::GetCurrent().GetSize(); 123 const Vector2 stageSize = Stage::GetCurrent().GetSize();
186 124
187 // Background 125 // Background
188 - Control background = CreateBackground( "launcherbackground" ); 126 + Control background = CreateBackground( "LauncherBackground" );
189 Stage::GetCurrent().Add( background ); 127 Stage::GetCurrent().Add( background );
190 128
191 // Add root actor 129 // Add root actor
@@ -251,25 +189,6 @@ void DaliTableView::Initialize( Application&amp; application ) @@ -251,25 +189,6 @@ void DaliTableView::Initialize( Application&amp; application )
251 mScrollViewLayer.SetParentOrigin( ParentOrigin::CENTER ); 189 mScrollViewLayer.SetParentOrigin( ParentOrigin::CENTER );
252 mScrollViewLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 190 mScrollViewLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
253 191
254 - // Create solid background colour.  
255 - Control backgroundColourActor = Control::New();  
256 - backgroundColourActor.SetBackgroundColor( BACKGROUND_COLOR );  
257 - backgroundColourActor.SetAnchorPoint( AnchorPoint::CENTER );  
258 - backgroundColourActor.SetParentOrigin( ParentOrigin::CENTER );  
259 - backgroundColourActor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );  
260 - backgroundColourActor.SetSizeModeFactor( Vector3( 1.0f, 1.5f, 1.0f ) );  
261 -  
262 - mScrollViewLayer.Add( backgroundColourActor );  
263 -  
264 - // Populate background and bubbles - needs to be scrollViewLayer so scroll ends show  
265 - Actor bubbleContainer = Actor::New();  
266 - bubbleContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );  
267 - bubbleContainer.SetAnchorPoint( AnchorPoint::CENTER );  
268 - bubbleContainer.SetParentOrigin( ParentOrigin::CENTER );  
269 - backgroundColourActor.Add( bubbleContainer );  
270 -  
271 - SetupBackground( bubbleContainer );  
272 -  
273 Alignment buttonsAlignment = Alignment::New(); 192 Alignment buttonsAlignment = Alignment::New();
274 buttonsAlignment.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); 193 buttonsAlignment.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
275 buttonsAlignment.Add( mScrollViewLayer ); 194 buttonsAlignment.Add( mScrollViewLayer );
@@ -301,12 +220,6 @@ void DaliTableView::Initialize( Application&amp; application ) @@ -301,12 +220,6 @@ void DaliTableView::Initialize( Application&amp; application )
301 220
302 winHandle.ShowIndicator( Dali::Window::INVISIBLE ); 221 winHandle.ShowIndicator( Dali::Window::INVISIBLE );
303 222
304 - // Background animation  
305 - mAnimationTimer = Timer::New( BACKGROUND_ANIMATION_DURATION );  
306 - mAnimationTimer.TickSignal().Connect( this, &DaliTableView::PauseBackgroundAnimation );  
307 - mAnimationTimer.Start();  
308 - mBackgroundAnimsPlaying = true;  
309 -  
310 KeyboardFocusManager::Get().PreFocusChangeSignal().Connect( this, &DaliTableView::OnKeyboardPreFocusChange ); 223 KeyboardFocusManager::Get().PreFocusChangeSignal().Connect( this, &DaliTableView::OnKeyboardPreFocusChange );
311 KeyboardFocusManager::Get().FocusedActorEnterKeySignal().Connect( this, &DaliTableView::OnFocusedActorActivated ); 224 KeyboardFocusManager::Get().FocusedActorEnterKeySignal().Connect( this, &DaliTableView::OnFocusedActorActivated );
312 AccessibilityManager::Get().FocusedActorActivatedSignal().Connect( this, &DaliTableView::OnFocusedActorActivated ); 225 AccessibilityManager::Get().FocusedActorActivatedSignal().Connect( this, &DaliTableView::OnFocusedActorActivated );
@@ -325,7 +238,6 @@ void DaliTableView::ApplyCubeEffectToPages() @@ -325,7 +238,6 @@ void DaliTableView::ApplyCubeEffectToPages()
325 238
326 void DaliTableView::OnButtonsPageRelayout( const Dali::Actor& actor ) 239 void DaliTableView::OnButtonsPageRelayout( const Dali::Actor& actor )
327 { 240 {
328 -  
329 } 241 }
330 242
331 void DaliTableView::Populate() 243 void DaliTableView::Populate()
@@ -364,7 +276,7 @@ void DaliTableView::Populate() @@ -364,7 +276,7 @@ void DaliTableView::Populate()
364 { 276 {
365 const Example& example = ( *iter ); 277 const Example& example = ( *iter );
366 278
367 - Actor tile = CreateTile( example.name, example.title, Vector3( tileParentMultiplier, tileParentMultiplier, 1.0f ), true ); 279 + Actor tile = CreateTile( example.name, example.title, Vector3( tileParentMultiplier, tileParentMultiplier, 1.0f ), TILE_COLOR );
368 AccessibilityManager accessibilityManager = AccessibilityManager::Get(); 280 AccessibilityManager accessibilityManager = AccessibilityManager::Get();
369 accessibilityManager.SetFocusOrder( tile, ++exampleCount ); 281 accessibilityManager.SetFocusOrder( tile, ++exampleCount );
370 accessibilityManager.SetAccessibilityAttribute( tile, Dali::Toolkit::AccessibilityManager::ACCESSIBILITY_LABEL, 282 accessibilityManager.SetAccessibilityAttribute( tile, Dali::Toolkit::AccessibilityManager::ACCESSIBILITY_LABEL,
@@ -436,7 +348,7 @@ void DaliTableView::Rotate( unsigned int degrees ) @@ -436,7 +348,7 @@ void DaliTableView::Rotate( unsigned int degrees )
436 mRotateAnimation.Play(); 348 mRotateAnimation.Play();
437 } 349 }
438 350
439 -Actor DaliTableView::CreateTile( const std::string& name, const std::string& title, const Dali::Vector3& sizeMultiplier, bool addBackground ) 351 +Actor DaliTableView::CreateTile( const std::string& name, const std::string& title, const Dali::Vector3& sizeMultiplier, const Dali::Vector4& color )
440 { 352 {
441 Actor content = Actor::New(); 353 Actor content = Actor::New();
442 content.SetName( name ); 354 content.SetName( name );
@@ -445,26 +357,28 @@ Actor DaliTableView::CreateTile( const std::string&amp; name, const std::string&amp; tit @@ -445,26 +357,28 @@ Actor DaliTableView::CreateTile( const std::string&amp; name, const std::string&amp; tit
445 content.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); 357 content.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
446 content.SetSizeModeFactor( sizeMultiplier ); 358 content.SetSizeModeFactor( sizeMultiplier );
447 359
448 - // create background image  
449 - if( addBackground )  
450 - {  
451 - ImageView image = ImageView::New( TILE_BACKGROUND );  
452 - image.SetAnchorPoint( AnchorPoint::CENTER );  
453 - image.SetParentOrigin( ParentOrigin::CENTER );  
454 - // make the image 100% of tile  
455 - image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );  
456 -  
457 - content.Add( image );  
458 -  
459 - // Add stencil  
460 - Toolkit::ImageView stencil = NewStencilImage();  
461 - stencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );  
462 - image.Add( stencil );  
463 - } 360 + // Create background image.
  361 + ImageView image = ImageView::New( TILE_BACKGROUND );
  362 + image.SetAnchorPoint( AnchorPoint::CENTER );
  363 + image.SetParentOrigin( ParentOrigin::CENTER );
  364 + // Make the image 100% of tile.
  365 + image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
  366 + content.Add( image );
  367 +
  368 + // Create the tile background.
  369 + Actor tileBackground = ImageView::New( TILE_BACKGROUND_ALPHA );
  370 + tileBackground.SetParentOrigin( ParentOrigin::CENTER );
  371 + tileBackground.SetAnchorPoint( AnchorPoint::CENTER );
  372 + tileBackground.SetProperty( Actor::Property::COLOR, color );
  373 + Property::Map shaderEffect = CreateAlphaDiscardEffect();
  374 + tileBackground.SetProperty( Toolkit::ImageView::Property::IMAGE, shaderEffect );
  375 + tileBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
  376 + image.Add( tileBackground );
464 377
  378 + // Create the tile label.
465 TextLabel label = TextLabel::New(); 379 TextLabel label = TextLabel::New();
466 label.SetAnchorPoint( AnchorPoint::TOP_LEFT ); 380 label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
467 - label.SetProperty( Control::Property::STYLE_NAME, "launcherlabel" ); 381 + label.SetStyleName( "LauncherLabel" );
468 label.SetProperty( TextLabel::Property::MULTI_LINE, true ); 382 label.SetProperty( TextLabel::Property::MULTI_LINE, true );
469 label.SetProperty( TextLabel::Property::TEXT, title ); 383 label.SetProperty( TextLabel::Property::TEXT, title );
470 label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); 384 label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
@@ -482,19 +396,6 @@ Actor DaliTableView::CreateTile( const std::string&amp; name, const std::string&amp; tit @@ -482,19 +396,6 @@ Actor DaliTableView::CreateTile( const std::string&amp; name, const std::string&amp; tit
482 return content; 396 return content;
483 } 397 }
484 398
485 -Toolkit::ImageView DaliTableView::NewStencilImage()  
486 -{  
487 - Toolkit::ImageView stencil = ImageView::New( TILE_BACKGROUND_ALPHA );  
488 - stencil.SetParentOrigin( ParentOrigin::CENTER );  
489 - stencil.SetAnchorPoint( AnchorPoint::CENTER );  
490 - stencil.SetDrawMode( DrawMode::STENCIL );  
491 -  
492 - Property::Map shaderEffect = CreateAlphaDiscardEffect();  
493 - stencil.SetProperty( Toolkit::ImageView::Property::IMAGE, shaderEffect );  
494 -  
495 - return stencil;  
496 -}  
497 -  
498 bool DaliTableView::OnTilePressed( Actor actor, const TouchData& event ) 399 bool DaliTableView::OnTilePressed( Actor actor, const TouchData& event )
499 { 400 {
500 return DoTilePress( actor, event.GetState( 0 ) ); 401 return DoTilePress( actor, event.GetState( 0 ) );
@@ -571,8 +472,6 @@ void DaliTableView::OnPressedAnimationFinished( Dali::Animation&amp; source ) @@ -571,8 +472,6 @@ void DaliTableView::OnPressedAnimationFinished( Dali::Animation&amp; source )
571 void DaliTableView::OnScrollStart( const Dali::Vector2& position ) 472 void DaliTableView::OnScrollStart( const Dali::Vector2& position )
572 { 473 {
573 mScrolling = true; 474 mScrolling = true;
574 -  
575 - PlayAnimation();  
576 } 475 }
577 476
578 void DaliTableView::OnScrollComplete( const Dali::Vector2& position ) 477 void DaliTableView::OnScrollComplete( const Dali::Vector2& position )
@@ -656,138 +555,6 @@ void DaliTableView::OnKeyEvent( const KeyEvent&amp; event ) @@ -656,138 +555,6 @@ void DaliTableView::OnKeyEvent( const KeyEvent&amp; event )
656 } 555 }
657 } 556 }
658 557
659 -void DaliTableView::SetupBackground( Actor bubbleContainer )  
660 -{  
661 - // Create distance field shape.  
662 - BufferImage distanceField;  
663 - Size imageSize( 512, 512 );  
664 - CreateShapeImage( CIRCLE, imageSize, distanceField );  
665 -  
666 - // Add bubbles to the bubbleContainer.  
667 - // Note: The bubbleContainer is parented externally to this function.  
668 - AddBackgroundActors( bubbleContainer, NUM_BACKGROUND_IMAGES, distanceField );  
669 -}  
670 -  
671 -void DaliTableView::InitialiseBackgroundActors( Actor actor )  
672 -{  
673 - // Delete current animations  
674 - mBackgroundAnimations.clear();  
675 -  
676 - // Create new animations  
677 - const Vector3 size = actor.GetTargetSize();  
678 -  
679 - for( unsigned int i = 0, childCount = actor.GetChildCount(); i < childCount; ++i )  
680 - {  
681 - Actor child = actor.GetChildAt( i );  
682 -  
683 - // Calculate a random position  
684 - Vector3 childPos( Random::Range( -size.x * 0.5f * BACKGROUND_SPREAD_SCALE, size.x * 0.5f * BACKGROUND_SPREAD_SCALE ),  
685 - Random::Range( -size.y, size.y ),  
686 - Random::Range( BUBBLE_MIN_Z, BUBBLE_MAX_Z ) );  
687 -  
688 - child.SetPosition( childPos );  
689 -  
690 - // Define bubble horizontal parallax and vertical wrapping  
691 - Constraint animConstraint = Constraint::New < Vector3 > ( child, Actor::Property::POSITION, AnimateBubbleConstraint( childPos, Random::Range( -0.85f, 0.25f ) ) );  
692 - animConstraint.AddSource( Source( mScrollView, ScrollView::Property::SCROLL_POSITION ) );  
693 - animConstraint.AddSource( Dali::ParentSource( Dali::Actor::Property::SIZE ) );  
694 - animConstraint.AddSource( Dali::LocalSource( Dali::Actor::Property::SIZE ) );  
695 - animConstraint.SetRemoveAction( Constraint::Discard );  
696 - animConstraint.Apply();  
697 -  
698 - // Kickoff animation  
699 - Animation animation = Animation::New( Random::Range( 30.0f, 160.0f ) );  
700 - animation.AnimateBy( Property( child, Actor::Property::POSITION ), Vector3( 0.0f, -2000.0f, 0.0f ), AlphaFunction::LINEAR );  
701 - animation.SetLooping( true );  
702 - animation.Play();  
703 - mBackgroundAnimations.push_back( animation );  
704 - }  
705 -}  
706 -  
707 -void DaliTableView::AddBackgroundActors( Actor layer, int count, BufferImage distanceField )  
708 -{  
709 - for( int i = 0; i < count; ++i )  
710 - {  
711 - float randSize = Random::Range( 10.0f, 400.0f );  
712 - ImageView dfActor = ImageView::New( distanceField );  
713 - dfActor.SetSize( Vector2( randSize, randSize ) );  
714 - dfActor.SetParentOrigin( ParentOrigin::CENTER );  
715 -  
716 - Dali::Property::Map effect = Toolkit::CreateDistanceFieldEffect();  
717 - dfActor.SetProperty( Toolkit::ImageView::Property::IMAGE, effect );  
718 - dfActor.SetColor( BUBBLE_COLOR[ i%NUMBER_OF_BUBBLE_COLOR ] );  
719 -  
720 - layer.Add( dfActor );  
721 - }  
722 -  
723 - // Positioning will occur when the layer is relaid out  
724 - layer.OnRelayoutSignal().Connect( this, &DaliTableView::InitialiseBackgroundActors );  
725 -}  
726 -  
727 -void DaliTableView::CreateShapeImage( ShapeType shapeType, const Size& size, BufferImage& distanceFieldOut )  
728 -{  
729 - // this bitmap will hold the alpha map for the distance field shader  
730 - distanceFieldOut = BufferImage::New( size.width, size.height, Pixel::A8 );  
731 -  
732 - // Generate bit pattern  
733 - std::vector< unsigned char > imageDataA8;  
734 - imageDataA8.reserve( size.width * size.height ); // A8  
735 -  
736 - switch( shapeType )  
737 - {  
738 - case CIRCLE:  
739 - GenerateCircle( size, imageDataA8 );  
740 - break;  
741 - case SQUARE:  
742 - GenerateSquare( size, imageDataA8 );  
743 - break;  
744 - default:  
745 - break;  
746 - }  
747 -  
748 - PixelBuffer* buffer = distanceFieldOut.GetBuffer();  
749 - if( buffer )  
750 - {  
751 - GenerateDistanceFieldMap( &imageDataA8[ 0 ], size, buffer, size, 8.0f, size );  
752 - distanceFieldOut.Update();  
753 - }  
754 -}  
755 -  
756 -void DaliTableView::GenerateSquare( const Size& size, std::vector< unsigned char >& distanceFieldOut )  
757 -{  
758 - for( int h = 0; h < size.height; ++h )  
759 - {  
760 - for( int w = 0; w < size.width; ++w )  
761 - {  
762 - distanceFieldOut.push_back( 0xFF );  
763 - }  
764 - }  
765 -}  
766 -  
767 -void DaliTableView::GenerateCircle( const Size& size, std::vector< unsigned char >& distanceFieldOut )  
768 -{  
769 - const float radius = size.width * 0.5f * size.width * 0.5f;  
770 - Vector2 center( size.width / 2, size.height / 2 );  
771 -  
772 - for( int h = 0; h < size.height; ++h )  
773 - {  
774 - for( int w = 0; w < size.width; ++w )  
775 - {  
776 - Vector2 pos( w, h );  
777 - Vector2 dist = pos - center;  
778 -  
779 - if( dist.x * dist.x + dist.y * dist.y > radius )  
780 - {  
781 - distanceFieldOut.push_back( 0x00 );  
782 - }  
783 - else  
784 - {  
785 - distanceFieldOut.push_back( 0xFF );  
786 - }  
787 - }  
788 - }  
789 -}  
790 -  
791 ImageView DaliTableView::CreateLogo( std::string imagePath ) 558 ImageView DaliTableView::CreateLogo( std::string imagePath )
792 { 559 {
793 ImageView logo = ImageView::New( imagePath ); 560 ImageView logo = ImageView::New( imagePath );
@@ -798,45 +565,6 @@ ImageView DaliTableView::CreateLogo( std::string imagePath ) @@ -798,45 +565,6 @@ ImageView DaliTableView::CreateLogo( std::string imagePath )
798 return logo; 565 return logo;
799 } 566 }
800 567
801 -bool DaliTableView::PauseBackgroundAnimation()  
802 -{  
803 - PauseAnimation();  
804 -  
805 - return false;  
806 -}  
807 -  
808 -void DaliTableView::PauseAnimation()  
809 -{  
810 - if( mBackgroundAnimsPlaying )  
811 - {  
812 - for( AnimationListIter animIter = mBackgroundAnimations.begin(); animIter != mBackgroundAnimations.end(); ++animIter )  
813 - {  
814 - Animation anim = *animIter;  
815 -  
816 - anim.Stop();  
817 - }  
818 -  
819 - mBackgroundAnimsPlaying = false;  
820 - }  
821 -}  
822 -  
823 -void DaliTableView::PlayAnimation()  
824 -{  
825 - if ( !mBackgroundAnimsPlaying )  
826 - {  
827 - for( AnimationListIter animIter = mBackgroundAnimations.begin(); animIter != mBackgroundAnimations.end(); ++animIter )  
828 - {  
829 - Animation anim = *animIter;  
830 -  
831 - anim.Play();  
832 - }  
833 -  
834 - mBackgroundAnimsPlaying = true;  
835 - }  
836 -  
837 - mAnimationTimer.SetInterval( BACKGROUND_ANIMATION_DURATION );  
838 -}  
839 -  
840 Dali::Actor DaliTableView::OnKeyboardPreFocusChange( Dali::Actor current, Dali::Actor proposed, Dali::Toolkit::Control::KeyboardFocus::Direction direction ) 568 Dali::Actor DaliTableView::OnKeyboardPreFocusChange( Dali::Actor current, Dali::Actor proposed, Dali::Toolkit::Control::KeyboardFocus::Direction direction )
841 { 569 {
842 Actor nextFocusActor = proposed; 570 Actor nextFocusActor = proposed;
@@ -930,11 +658,13 @@ void DaliTableView::OnLogoTapped( Dali::Actor actor, const Dali::TapGesture&amp; tap @@ -930,11 +658,13 @@ void DaliTableView::OnLogoTapped( Dali::Actor actor, const Dali::TapGesture&amp; tap
930 Toolkit::TextLabel titleActor = Toolkit::TextLabel::New( "Version information" ); 658 Toolkit::TextLabel titleActor = Toolkit::TextLabel::New( "Version information" );
931 titleActor.SetName( "titleActor" ); 659 titleActor.SetName( "titleActor" );
932 titleActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); 660 titleActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
  661 + titleActor.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
933 662
934 Toolkit::TextLabel contentActor = Toolkit::TextLabel::New( stream.str() ); 663 Toolkit::TextLabel contentActor = Toolkit::TextLabel::New( stream.str() );
935 contentActor.SetName( "contentActor" ); 664 contentActor.SetName( "contentActor" );
936 contentActor.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true ); 665 contentActor.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
937 contentActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); 666 contentActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
  667 + contentActor.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
938 contentActor.SetPadding( Padding( 0.0f, 0.0f, 20.0f, 0.0f ) ); 668 contentActor.SetPadding( Padding( 0.0f, 0.0f, 20.0f, 0.0f ) );
939 669
940 mVersionPopup.SetTitle( titleActor ); 670 mVersionPopup.SetTitle( titleActor );
demo/dali-table-view.h
1 -#ifndef __DALI_DEMO_H__  
2 -#define __DALI_DEMO_H__ 1 +#ifndef DALI_DEMO_H
  2 +#define DALI_DEMO_H
3 3
4 /* 4 /*
5 - * Copyright (c) 2015 Samsung Electronics Co., Ltd. 5 + * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6 * 6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License. 8 * you may not use this file except in compliance with the License.
@@ -98,15 +98,6 @@ public: @@ -98,15 +98,6 @@ public:
98 private: // Application callbacks & implementation 98 private: // Application callbacks & implementation
99 99
100 /** 100 /**
101 - * Shape enum for create function  
102 - */  
103 - enum ShapeType  
104 - {  
105 - CIRCLE,  
106 - SQUARE  
107 - };  
108 -  
109 - /**  
110 * Initialize application. 101 * Initialize application.
111 * 102 *
112 * @param[in] app Application instance 103 * @param[in] app Application instance
@@ -140,18 +131,11 @@ private: // Application callbacks &amp; implementation @@ -140,18 +131,11 @@ private: // Application callbacks &amp; implementation
140 * @param[in] name The unique name for this Tile 131 * @param[in] name The unique name for this Tile
141 * @param[in] title The text caption that appears on the Tile 132 * @param[in] title The text caption that appears on the Tile
142 * @param[in] parentSize Tile's parent size. 133 * @param[in] parentSize Tile's parent size.
143 - * @param[in] addBackground Whether to add a background graphic to the tile or not 134 + * @param[in] color The color (including alpha) of the tiles contents.
144 * 135 *
145 * @return The Actor for the created tile. 136 * @return The Actor for the created tile.
146 */ 137 */
147 - Dali::Actor CreateTile( const std::string& name, const std::string& title, const Dali::Vector3& sizeMultiplier, bool addBackground );  
148 -  
149 - /**  
150 - * Create a stencil image  
151 - *  
152 - * @return The stencil image  
153 - */  
154 - Dali::Toolkit::ImageView NewStencilImage(); 138 + Dali::Actor CreateTile( const std::string& name, const std::string& title, const Dali::Vector3& sizeMultiplier, const Dali::Vector4& color );
155 139
156 // Signal handlers 140 // Signal handlers
157 141
@@ -257,49 +241,6 @@ private: // Application callbacks &amp; implementation @@ -257,49 +241,6 @@ private: // Application callbacks &amp; implementation
257 void OnKeyEvent( const Dali::KeyEvent& event ); 241 void OnKeyEvent( const Dali::KeyEvent& event );
258 242
259 /** 243 /**
260 - * Create a depth field background  
261 - *  
262 - * @param[in] bubbleLayer Add the graphics to this layer  
263 - */  
264 - void SetupBackground( Dali::Actor bubbleLayer );  
265 -  
266 - /**  
267 - * Create background actors for the given layer  
268 - *  
269 - * @param[in] layer The layer to add the actors to  
270 - * @param[in] count The number of actors to generate  
271 - * @param[in] distanceField The distance field bitmap to use  
272 - */  
273 - void AddBackgroundActors( Dali::Actor layer, int count, Dali::BufferImage distanceField );  
274 -  
275 - /**  
276 - * Create a bitmap with the specified shape and also output a distance field  
277 - *  
278 - * @param[in] shapeType The shape to generate  
279 - * @param[in] size The size of the bitmap to create  
280 - * @param[out] distanceFieldOut The return depth field alpha map  
281 - */  
282 - void CreateShapeImage( ShapeType shapeType, const Dali::Size& size, Dali::BufferImage& distanceFieldOut );  
283 -  
284 - /**  
285 - * Generate a square bit pattern and depth field  
286 - *  
287 - * @param[in] size The size of the bitmap to create  
288 - * @param[out] imageOut The return bitmap  
289 - * @param[out] distanceFieldOut The return depth field alpha map  
290 - */  
291 - void GenerateSquare( const Dali::Size& size, std::vector<unsigned char>& distanceFieldOut );  
292 -  
293 - /**  
294 - * Generate a circle bit pattern and depth field  
295 - *  
296 - * @param[in] size The size of the bitmap to create  
297 - * @param[out] imageOut The return bitmap  
298 - * @param[out] distanceFieldOut The return depth field alpha map  
299 - */  
300 - void GenerateCircle( const Dali::Size& size, std::vector<unsigned char>& distanceFieldOut );  
301 -  
302 - /**  
303 * Creates the logo. 244 * Creates the logo.
304 * 245 *
305 * @param[in] imagePath The path to the image file to load 246 * @param[in] imagePath The path to the image file to load
@@ -309,23 +250,6 @@ private: // Application callbacks &amp; implementation @@ -309,23 +250,6 @@ private: // Application callbacks &amp; implementation
309 Dali::Toolkit::ImageView CreateLogo( std::string imagePath ); 250 Dali::Toolkit::ImageView CreateLogo( std::string imagePath );
310 251
311 /** 252 /**
312 - * Timer handler for ending background animation  
313 - *  
314 - * @return Return value for timer handler  
315 - */  
316 - bool PauseBackgroundAnimation();  
317 -  
318 - /**  
319 - * Pause all animations  
320 - */  
321 - void PauseAnimation();  
322 -  
323 - /**  
324 - * Resume all animations  
325 - */  
326 - void PlayAnimation();  
327 -  
328 - /**  
329 * Callback when the keyboard focus is going to be changed. 253 * Callback when the keyboard focus is going to be changed.
330 * 254 *
331 * @param[in] current The current focused actor 255 * @param[in] current The current focused actor
@@ -362,13 +286,6 @@ private: // Application callbacks &amp; implementation @@ -362,13 +286,6 @@ private: // Application callbacks &amp; implementation
362 */ 286 */
363 void OnButtonsPageRelayout( const Dali::Actor& actor ); 287 void OnButtonsPageRelayout( const Dali::Actor& actor );
364 288
365 - /**  
366 - * @brief Callback called to set up background actors  
367 - *  
368 - * @param[in] actor The actor raising the callback  
369 - */  
370 - void InitialiseBackgroundActors( Dali::Actor actor );  
371 -  
372 private: 289 private:
373 290
374 Dali::Application& mApplication; ///< Application instance. 291 Dali::Application& mApplication; ///< Application instance.
@@ -382,20 +299,17 @@ private: @@ -382,20 +299,17 @@ private:
382 Dali::Toolkit::RulerPtr mScrollRulerX; ///< ScrollView X (horizontal) ruler 299 Dali::Toolkit::RulerPtr mScrollRulerX; ///< ScrollView X (horizontal) ruler
383 Dali::Toolkit::RulerPtr mScrollRulerY; ///< ScrollView Y (vertical) ruler 300 Dali::Toolkit::RulerPtr mScrollRulerY; ///< ScrollView Y (vertical) ruler
384 Dali::Actor mPressedActor; ///< The currently pressed actor. 301 Dali::Actor mPressedActor; ///< The currently pressed actor.
385 - Dali::Timer mAnimationTimer; ///< Timer used to turn off animation after a specific time period  
386 Dali::TapGestureDetector mLogoTapDetector; ///< To detect taps on the logo 302 Dali::TapGestureDetector mLogoTapDetector; ///< To detect taps on the logo
387 Dali::Toolkit::Popup mVersionPopup; ///< Displays DALi library version information 303 Dali::Toolkit::Popup mVersionPopup; ///< Displays DALi library version information
388 304
389 std::vector< Dali::Actor > mPages; ///< List of pages. 305 std::vector< Dali::Actor > mPages; ///< List of pages.
390 - AnimationList mBackgroundAnimations; ///< List of background bubble animations  
391 ExampleList mExampleList; ///< List of examples. 306 ExampleList mExampleList; ///< List of examples.
392 307
393 int mTotalPages; ///< Total pages within scrollview. 308 int mTotalPages; ///< Total pages within scrollview.
394 309
395 bool mScrolling:1; ///< Flag indicating whether view is currently being scrolled 310 bool mScrolling:1; ///< Flag indicating whether view is currently being scrolled
396 bool mSortAlphabetically:1; ///< Sort examples alphabetically. 311 bool mSortAlphabetically:1; ///< Sort examples alphabetically.
397 - bool mBackgroundAnimsPlaying:1; ///< Are background animations playing  
398 312
399 }; 313 };
400 314
401 -#endif // __DALI_DEMO_H__ 315 +#endif // DALI_DEMO_H
examples/builder/examples.cpp
@@ -387,7 +387,7 @@ public: @@ -387,7 +387,7 @@ public:
387 Actor MenuItem(const std::string& text) 387 Actor MenuItem(const std::string& text)
388 { 388 {
389 TextLabel label = TextLabel::New( ShortName( text ) ); 389 TextLabel label = TextLabel::New( ShortName( text ) );
390 - label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "builderlabel" ); 390 + label.SetStyleName( "BuilderLabel" );
391 label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); 391 label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
392 392
393 // Hook up tap detector 393 // Hook up tap detector
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
@@ -45,9 +45,8 @@ const char* const SAMPLING_BUTTON_ID = &quot;SAMPLING_BUTTON&quot;; @@ -45,9 +45,8 @@ const char* const SAMPLING_BUTTON_ID = &quot;SAMPLING_BUTTON&quot;;
45 const char* const FITTING_BUTTON_TEXT = "Fitting"; 45 const char* const FITTING_BUTTON_TEXT = "Fitting";
46 const char* const SAMPLING_BUTTON_TEXT = "Sampling"; 46 const char* const SAMPLING_BUTTON_TEXT = "Sampling";
47 47
48 -const char* const STYLE_LABEL_TEXT = "grouplabel";  
49 -const char* const STYLE_BUTTON_TEXT = "buttonlabel";  
50 - 48 +const char* const STYLE_LABEL_TEXT = "ImageScalingGroupLabel";
  49 +const char* const STYLE_BUTTON_TEXT = "ImageScalingButton";
51 50
52 const char* IMAGE_PATHS[] = 51 const char* IMAGE_PATHS[] =
53 { 52 {
@@ -336,7 +335,7 @@ public: @@ -336,7 +335,7 @@ public:
336 fittingModeGroup.SetFitHeight( 1 ); 335 fittingModeGroup.SetFitHeight( 1 );
337 336
338 TextLabel label = TextLabel::New( "Image fitting mode:" ); 337 TextLabel label = TextLabel::New( "Image fitting mode:" );
339 - label.SetProperty( Toolkit::Control::Property::STYLE_NAME, STYLE_LABEL_TEXT ); 338 + label.SetStyleName( STYLE_LABEL_TEXT );
340 fittingModeGroup.Add( label ); 339 fittingModeGroup.Add( label );
341 340
342 Toolkit::PushButton button = CreateButton( FITTING_BUTTON_ID, StringFromScalingMode( mFittingMode ) ); 341 Toolkit::PushButton button = CreateButton( FITTING_BUTTON_ID, StringFromScalingMode( mFittingMode ) );
@@ -357,7 +356,7 @@ public: @@ -357,7 +356,7 @@ public:
357 samplingModeGroup.SetFitHeight( 1 ); 356 samplingModeGroup.SetFitHeight( 1 );
358 357
359 TextLabel label = TextLabel::New( "Image sampling mode:" ); 358 TextLabel label = TextLabel::New( "Image sampling mode:" );
360 - label.SetProperty( Toolkit::Control::Property::STYLE_NAME, STYLE_LABEL_TEXT ); 359 + label.SetStyleName( STYLE_LABEL_TEXT );
361 samplingModeGroup.Add( label ); 360 samplingModeGroup.Add( label );
362 361
363 Toolkit::PushButton button = CreateButton( SAMPLING_BUTTON_ID, StringFromFilterMode( mSamplingMode ) ); 362 Toolkit::PushButton button = CreateButton( SAMPLING_BUTTON_ID, StringFromFilterMode( mSamplingMode ) );
@@ -371,7 +370,7 @@ public: @@ -371,7 +370,7 @@ public:
371 Toolkit::PushButton CreateButton( const char * id, const char * label ) 370 Toolkit::PushButton CreateButton( const char * id, const char * label )
372 { 371 {
373 Toolkit::PushButton button = Toolkit::PushButton::New(); 372 Toolkit::PushButton button = Toolkit::PushButton::New();
374 - button.SetProperty( Toolkit::Control::Property::STYLE_NAME, STYLE_BUTTON_TEXT ); 373 + button.SetStyleName( STYLE_BUTTON_TEXT );
375 button.SetName( id ); 374 button.SetName( id );
376 button.SetLabelText( label ); 375 button.SetLabelText( label );
377 button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); 376 button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
examples/primitive-shapes/primitive-shapes-example.cpp
@@ -318,7 +318,7 @@ public: @@ -318,7 +318,7 @@ public:
318 //Visual map for model 318 //Visual map for model
319 mVisualMap.Clear(); 319 mVisualMap.Clear();
320 mVisualMap[ Visual::Property::TYPE ] = Visual::PRIMITIVE; 320 mVisualMap[ Visual::Property::TYPE ] = Visual::PRIMITIVE;
321 - mVisualMap[ PrimitiveVisual::Property::COLOR ] = mColor; 321 + mVisualMap[ PrimitiveVisual::Property::MIX_COLOR ] = mColor;
322 } 322 }
323 323
324 //Sets the 3D model to a sphere and modifies the sliders appropriately. 324 //Sets the 3D model to a sphere and modifies the sliders appropriately.
examples/styling/styling-application.cpp
@@ -135,7 +135,7 @@ void StylingApplication::Create( Application&amp; application ) @@ -135,7 +135,7 @@ void StylingApplication::Create( Application&amp; application )
135 135
136 mTitle = TextLabel::New( "Styling Example" ); 136 mTitle = TextLabel::New( "Styling Example" );
137 mTitle.SetName( "Title" ); 137 mTitle.SetName( "Title" );
138 - mTitle.SetStyleName("title"); 138 + mTitle.SetStyleName("Title");
139 mTitle.SetAnchorPoint( AnchorPoint::TOP_CENTER ); 139 mTitle.SetAnchorPoint( AnchorPoint::TOP_CENTER );
140 mTitle.SetParentOrigin( ParentOrigin::TOP_CENTER ); 140 mTitle.SetParentOrigin( ParentOrigin::TOP_CENTER );
141 mTitle.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); 141 mTitle.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
@@ -246,7 +246,7 @@ void StylingApplication::Create( Application&amp; application ) @@ -246,7 +246,7 @@ void StylingApplication::Create( Application&amp; application )
246 channelSliderLayout.SetCellAlignment( TableView::CellPosition( i, 0 ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER ); 246 channelSliderLayout.SetCellAlignment( TableView::CellPosition( i, 0 ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
247 247
248 TextLabel label = TextLabel::New( checkboxLabels[i] ); 248 TextLabel label = TextLabel::New( checkboxLabels[i] );
249 - std::ostringstream labelStyleName; labelStyleName << "colorLabel" << i+1; 249 + std::ostringstream labelStyleName; labelStyleName << "ColorLabel" << i+1;
250 label.SetName( labelStyleName.str() ); 250 label.SetName( labelStyleName.str() );
251 label.SetStyleName( labelStyleName.str() ); 251 label.SetStyleName( labelStyleName.str() );
252 label.SetParentOrigin( ParentOrigin::CENTER ); 252 label.SetParentOrigin( ParentOrigin::CENTER );
@@ -258,7 +258,7 @@ void StylingApplication::Create( Application&amp; application ) @@ -258,7 +258,7 @@ void StylingApplication::Create( Application&amp; application )
258 channelSliderLayout.SetCellAlignment( TableView::CellPosition( i, 1 ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER ); 258 channelSliderLayout.SetCellAlignment( TableView::CellPosition( i, 1 ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
259 259
260 mChannelSliders[i] = Slider::New(); 260 mChannelSliders[i] = Slider::New();
261 - std::ostringstream sliderStyleName; sliderStyleName << "colorSlider" << i+1; 261 + std::ostringstream sliderStyleName; sliderStyleName << "ColorSlider" << i+1;
262 mChannelSliders[i].SetName( sliderStyleName.str() ); 262 mChannelSliders[i].SetName( sliderStyleName.str() );
263 mChannelSliders[i].SetStyleName( sliderStyleName.str() ); 263 mChannelSliders[i].SetStyleName( sliderStyleName.str() );
264 mChannelSliders[i].SetParentOrigin( ParentOrigin::CENTER ); 264 mChannelSliders[i].SetParentOrigin( ParentOrigin::CENTER );
@@ -302,7 +302,7 @@ void StylingApplication::Create( Application&amp; application ) @@ -302,7 +302,7 @@ void StylingApplication::Create( Application&amp; application )
302 302
303 TextLabel label = TextLabel::New( "Theme: "); 303 TextLabel label = TextLabel::New( "Theme: ");
304 label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); 304 label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
305 - label.SetStyleName("themelabel"); 305 + label.SetStyleName("ThemeLabel");
306 label.SetAnchorPoint( AnchorPoint::TOP_CENTER ); 306 label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
307 label.SetParentOrigin( ParentOrigin::TOP_CENTER ); 307 label.SetParentOrigin( ParentOrigin::TOP_CENTER );
308 themeButtonLayout.AddChild( label, TableView::CellPosition( 0, 0 ) ); 308 themeButtonLayout.AddChild( label, TableView::CellPosition( 0, 0 ) );
@@ -386,7 +386,7 @@ Popup StylingApplication::CreateResetPopup() @@ -386,7 +386,7 @@ Popup StylingApplication::CreateResetPopup()
386 386
387 TextLabel text = TextLabel::New( "This will reset the channel data to full value. Are you sure?" ); 387 TextLabel text = TextLabel::New( "This will reset the channel data to full value. Are you sure?" );
388 text.SetName( "PopupContentText" ); 388 text.SetName( "PopupContentText" );
389 - text.SetStyleName( "popupBody" ); 389 + text.SetStyleName( "PopupBody" );
390 text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); 390 text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
391 text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT ); 391 text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
392 text.SetProperty( TextLabel::Property::MULTI_LINE, true ); 392 text.SetProperty( TextLabel::Property::MULTI_LINE, true );
@@ -442,7 +442,7 @@ TextLabel StylingApplication::CreateTitle( std::string title ) @@ -442,7 +442,7 @@ TextLabel StylingApplication::CreateTitle( std::string title )
442 { 442 {
443 TextLabel titleActor = TextLabel::New( title ); 443 TextLabel titleActor = TextLabel::New( title );
444 titleActor.SetName( "titleActor" ); 444 titleActor.SetName( "titleActor" );
445 - titleActor.SetStyleName( "popupTitle" ); 445 + titleActor.SetStyleName( "PopupTitle" );
446 titleActor.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); 446 titleActor.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
447 titleActor.SetProperty( TextLabel::Property::MULTI_LINE, false ); 447 titleActor.SetProperty( TextLabel::Property::MULTI_LINE, false );
448 448
examples/text-fonts/text-fonts-example.cpp
@@ -185,7 +185,7 @@ public: @@ -185,7 +185,7 @@ public:
185 CreateTextLabel ( mLabel, LABEL_TEXT, Color::WHITE ); 185 CreateTextLabel ( mLabel, LABEL_TEXT, Color::WHITE );
186 186
187 CreateTextLabel ( mLabel2, LABEL_TEXT, Color::WHITE ); 187 CreateTextLabel ( mLabel2, LABEL_TEXT, Color::WHITE );
188 - mLabel2.SetStyleName("textlabel-Rosemary"); 188 + mLabel2.SetStyleName("TextLabelRosemary");
189 189
190 CreateTextLabel ( mLabel3, LABEL_TEXT, Color::WHITE ); 190 CreateTextLabel ( mLabel3, LABEL_TEXT, Color::WHITE );
191 mLabel3.SetProperty( TextLabel::Property::FONT_FAMILY, "SamsungOneUI" ); 191 mLabel3.SetProperty( TextLabel::Property::FONT_FAMILY, "SamsungOneUI" );
packaging/com.samsung.dali-demo.spec
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 Name: com.samsung.dali-demo 3 Name: com.samsung.dali-demo
4 Summary: The OpenGLES Canvas Core Demo 4 Summary: The OpenGLES Canvas Core Demo
5 -Version: 1.2.3 5 +Version: 1.2.4
6 Release: 1 6 Release: 1
7 Group: System/Libraries 7 Group: System/Libraries
8 License: Apache-2.0 8 License: Apache-2.0
resources/style/demo-theme.json.in
@@ -17,50 +17,52 @@ @@ -17,50 +17,52 @@
17 { 17 {
18 "styles": 18 "styles":
19 { 19 {
20 - "confirmationpopup":{ 20 + "ConfirmationPopup":{
21 "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/00_popup_bg.9.png" 21 "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/00_popup_bg.9.png"
22 }, 22 },
23 23
24 - "textlabel-Rosemary": 24 + "TextLabelRosemary":
25 { 25 {
26 "fontFamily":"Rosemary" 26 "fontFamily":"Rosemary"
27 }, 27 },
28 - "textlabel": 28 + "TextLabel":
29 { 29 {
30 "fontStyle":"Regular", 30 "fontStyle":"Regular",
31 "pointSize":18 31 "pointSize":18
32 }, 32 },
33 - "launcherlabel": 33 + "LauncherLabel":
34 { 34 {
35 "pointSize":18 35 "pointSize":18
36 }, 36 },
37 37
38 - "toolbarlabel": 38 + "ToolbarLabel":
39 { 39 {
40 "pointSize":18 40 "pointSize":18
41 }, 41 },
42 42
43 - "builderlabel": 43 + "BuilderLabel":
44 { 44 {
45 "pointSize":13 45 "pointSize":13
46 }, 46 },
47 47
48 - "scrollview": 48 + "ScrollView":
49 { 49 {
50 "overshootEffectColor":"B018" 50 "overshootEffectColor":"B018"
51 }, 51 },
52 52
53 - "grouplabel": 53 + "ImageScalingGroupLabel":
54 { 54 {
55 "pointSize":9 55 "pointSize":9
56 }, 56 },
57 57
58 - "buttonlabel": 58 + "ImageScalingButton":
59 { 59 {
60 - "pointSize":11 60 + "label":{
  61 + "pointSize":11
  62 + }
61 }, 63 },
62 64
63 - "launcherbackground": 65 + "LauncherBackground":
64 { 66 {
65 "background": 67 "background":
66 { 68 {
resources/style/images/00_popup_bg.9.png 0 โ†’ 100644

1.52 KB

resources/style/mobile/demo-theme.json.in
@@ -18,67 +18,67 @@ @@ -18,67 +18,67 @@
18 { 18 {
19 "styles": 19 "styles":
20 { 20 {
21 - "textlabel-Rosemary": 21 + "TextLabelRosemary":
22 { 22 {
23 "fontFamily":"Rosemary" 23 "fontFamily":"Rosemary"
24 }, 24 },
25 - "textlabel": 25 + "TextLabel":
26 { 26 {
27 "fontStyle":"Regular", 27 "fontStyle":"Regular",
28 "pointSize":18 28 "pointSize":18
29 }, 29 },
30 - "textlabelFontSize0": 30 + "TextLabelFontSize0":
31 { 31 {
32 "pointSize":8 32 "pointSize":8
33 }, 33 },
34 - "textlabelFontSize1": 34 + "TextLabelFontSize1":
35 { 35 {
36 "pointSize":10 36 "pointSize":10
37 }, 37 },
38 - "textlabelFontSize2": 38 + "TextLabelFontSize2":
39 { 39 {
40 "pointSize":15 40 "pointSize":15
41 }, 41 },
42 - "textlabelFontSize3": 42 + "TextLabelFontSize3":
43 { 43 {
44 "pointSize":19 44 "pointSize":19
45 }, 45 },
46 - "textlabelFontSize4": 46 + "TextLabelFontSize4":
47 { 47 {
48 "pointSize":25 48 "pointSize":25
49 }, 49 },
50 50
51 - "launcherlabel": 51 + "Launcherlabel":
52 { 52 {
53 "pointSize":8 53 "pointSize":8
54 }, 54 },
55 55
56 - "toolbarlabel": 56 + "ToolbarLabel":
57 { 57 {
58 "pointSize":10 58 "pointSize":10
59 }, 59 },
60 60
61 - "builderlabel": 61 + "BuilderLabel":
62 { 62 {
63 "pointSize":10 63 "pointSize":10
64 }, 64 },
65 65
66 - "scrollview": 66 + "ScrollView":
67 { 67 {
68 "overshootEffectColor":"B018" 68 "overshootEffectColor":"B018"
69 }, 69 },
70 70
71 - "grouplabel": 71 + "GroupLabel":
72 { 72 {
73 "pointSize":6 73 "pointSize":6
74 }, 74 },
75 75
76 - "buttonlabel": 76 + "ButtonLabel":
77 { 77 {
78 "pointSize":8 78 "pointSize":8
79 }, 79 },
80 80
81 - "launcherbackground": 81 + "LauncherBackground":
82 { 82 {
83 "background": 83 "background":
84 { 84 {
resources/style/style-example-theme-one.json.in
1 { 1 {
2 "styles": 2 "styles":
3 { 3 {
4 - "title":{ 4 + "Title":{
5 "textColor":"#0000ff", 5 "textColor":"#0000ff",
6 "background": 6 "background":
7 { 7 {
@@ -9,58 +9,58 @@ @@ -9,58 +9,58 @@
9 "mixColor": [ 1.0, 1.0, 1.0, 1.0 ] 9 "mixColor": [ 1.0, 1.0, 1.0, 1.0 ]
10 } 10 }
11 }, 11 },
12 - "tableview":{ 12 + "TableView":{
13 "background": 13 "background":
14 { 14 {
15 "visualType":"COLOR", 15 "visualType":"COLOR",
16 "mixColor": [ 1.0, 1.0, 1.0, 0.03 ] 16 "mixColor": [ 1.0, 1.0, 1.0, 0.03 ]
17 } 17 }
18 }, 18 },
19 - "flexcontainer":{ 19 + "FlexContainer":{
20 "background": 20 "background":
21 { 21 {
22 "visualType":"COLOR", 22 "visualType":"COLOR",
23 "mixColor": [ 1.0, 1.0, 1.0, 0.1 ] 23 "mixColor": [ 1.0, 1.0, 1.0, 0.1 ]
24 } 24 }
25 }, 25 },
26 - "radiobutton":{ 26 + "RadioButton":{
27 "label":{ 27 "label":{
28 "textColor": [1,1,1,1] 28 "textColor": [1,1,1,1]
29 } 29 }
30 }, 30 },
31 - "checkboxbutton":{ 31 + "CheckBoxButton":{
32 "label":{ 32 "label":{
33 "textColor": [1,1,1,1] 33 "textColor": [1,1,1,1]
34 } 34 }
35 }, 35 },
36 - "colorLabel1":{ 36 + "ColorLabel1":{
37 "textColor": [1,0,0,1] 37 "textColor": [1,0,0,1]
38 }, 38 },
39 - "colorLabel2":{ 39 + "ColorLabel2":{
40 "textColor": [0,1,0,1] 40 "textColor": [0,1,0,1]
41 }, 41 },
42 - "colorLabel3":{ 42 + "ColorLabel3":{
43 "textColor": [0.3,0.3,1,1] 43 "textColor": [0.3,0.3,1,1]
44 }, 44 },
45 - "themelabel":{ 45 + "ThemeLabel":{
46 "textColor":[0,1,1,1] 46 "textColor":[0,1,1,1]
47 }, 47 },
48 - "popupTitle":{ 48 + "PopupTitle":{
49 "textColor":[1,1,1,1] 49 "textColor":[1,1,1,1]
50 }, 50 },
51 - "popupBody":{ 51 + "PopupBody":{
52 "textColor":[1,1,0,1] 52 "textColor":[1,1,0,1]
53 }, 53 },
54 - "textlabel":{ 54 + "TextLabel":{
55 "textColor":[0,0,0,1] 55 "textColor":[0,0,0,1]
56 }, 56 },
57 - "colorSlider1":{  
58 - "styles":["slider"] 57 + "ColorSlider1":{
  58 + "styles":["Slider"]
59 }, 59 },
60 - "colorSlider2":{ 60 + "ColorSlider2":{
61 "styles":["slider"] 61 "styles":["slider"]
62 }, 62 },
63 - "colorSlider3":{ 63 + "ColorSlider3":{
64 "styles":["slider"] 64 "styles":["slider"]
65 } 65 }
66 } 66 }
resources/style/style-example-theme-three.json.in
1 { 1 {
2 "styles": 2 "styles":
3 { 3 {
4 - "title":{ 4 + "Title":{
5 "textColor":"#0000ff", 5 "textColor":"#0000ff",
6 "background": 6 "background":
7 { 7 {
@@ -9,42 +9,42 @@ @@ -9,42 +9,42 @@
9 "mixColor": [ 1.0, 1.0, 1.0, 1.0 ] 9 "mixColor": [ 1.0, 1.0, 1.0, 1.0 ]
10 } 10 }
11 }, 11 },
12 - "tableview":{ 12 + "TableView":{
13 "background": 13 "background":
14 { 14 {
15 "visualType":"COLOR", 15 "visualType":"COLOR",
16 "mixColor": [ 1.0, 1.0, 1.0, 0.03 ] 16 "mixColor": [ 1.0, 1.0, 1.0, 0.03 ]
17 } 17 }
18 }, 18 },
19 - "radiobutton":{ 19 + "RadioButton":{
20 "label":{ 20 "label":{
21 "textColor": [1,1,1,1] 21 "textColor": [1,1,1,1]
22 } 22 }
23 }, 23 },
24 - "checkboxbutton":{ 24 + "CheckboxButton":{
25 "label":{ 25 "label":{
26 "textColor": [1,1,1,1] 26 "textColor": [1,1,1,1]
27 } 27 }
28 }, 28 },
29 - "colorLabel1":{ 29 + "ColorLabel1":{
30 "textColor": [1,0,0,1] 30 "textColor": [1,0,0,1]
31 }, 31 },
32 - "colorLabel2":{ 32 + "ColorLabel2":{
33 "textColor": [0,1,0,1] 33 "textColor": [0,1,0,1]
34 }, 34 },
35 - "colorLabel3":{ 35 + "ColorLabel3":{
36 "textColor": [0.3,0.3,1,1] 36 "textColor": [0.3,0.3,1,1]
37 }, 37 },
38 - "themelabel":{ 38 + "ThemeLabel":{
39 "textColor":[0,1,1,1] 39 "textColor":[0,1,1,1]
40 }, 40 },
41 - "popupTitle":{ 41 + "PopupTitle":{
42 "textColor":[1,1,1,1] 42 "textColor":[1,1,1,1]
43 }, 43 },
44 - "popupBody":{ 44 + "PopupBody":{
45 "textColor":[1,1,0,1] 45 "textColor":[1,1,0,1]
46 }, 46 },
47 - "textlabel":{ 47 + "TextLabel":{
48 "textColor":[0,0,0,1] 48 "textColor":[0,0,0,1]
49 } 49 }
50 } 50 }
resources/style/style-example-theme-two.json.in
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 }, 5 },
6 "styles": 6 "styles":
7 { 7 {
8 - "title":{ 8 + "Title":{
9 "textColor":"#0000ff", 9 "textColor":"#0000ff",
10 "background": 10 "background":
11 { 11 {
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 "mixColor": [ 1.0, 1.0, 1.0, 1.0 ] 13 "mixColor": [ 1.0, 1.0, 1.0, 1.0 ]
14 } 14 }
15 }, 15 },
16 - "tableview":{ 16 + "TableView":{
17 "background": 17 "background":
18 { 18 {
19 "visualType":"GRADIENT", 19 "visualType":"GRADIENT",
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 }, 24 },
25 25
26 // Change an icon size, see if it gets properly re-sized 26 // Change an icon size, see if it gets properly re-sized
27 - "radiobutton":{ 27 + "RadioButton":{
28 "unselectedStateImage":"{STYLE_DIR}/images/radio-button-unselected.png", 28 "unselectedStateImage":"{STYLE_DIR}/images/radio-button-unselected.png",
29 "selectedStateImage":"{STYLE_DIR}/images/radio-button-selected.png", 29 "selectedStateImage":"{STYLE_DIR}/images/radio-button-selected.png",
30 "disabledStateImage":"{STYLE_DIR}/images/radio-button-unselected-disabled.png", 30 "disabledStateImage":"{STYLE_DIR}/images/radio-button-unselected-disabled.png",
@@ -58,11 +58,11 @@ @@ -58,11 +58,11 @@
58 }, 58 },
59 59
60 // Note, this overrides any non-renamed label styles, e.g. those in a button. 60 // Note, this overrides any non-renamed label styles, e.g. those in a button.
61 - "textlabel":{ 61 + "TextLabel":{
62 //"textColor":[0,0,0,1] 62 //"textColor":[0,0,0,1]
63 }, 63 },
64 64
65 - "thinslider":{ 65 + "ThinSlider":{
66 "styles": ["slider"], 66 "styles": ["slider"],
67 "showPopup":true, 67 "showPopup":true,
68 "showValue":false, 68 "showValue":false,
@@ -75,19 +75,19 @@ @@ -75,19 +75,19 @@
75 }, 75 },
76 "enabled":true 76 "enabled":true
77 }, 77 },
78 - "colorSlider1":{  
79 - "styles":["thinslider"], 78 + "ColorSlider1":{
  79 + "styles":["ThinSlider"],
80 "progressVisual":{ 80 "progressVisual":{
81 "url":"{STYLE_DIR}/images/slider-skin-progress-red.9.png" 81 "url":"{STYLE_DIR}/images/slider-skin-progress-red.9.png"
82 } 82 }
83 }, 83 },
84 - "colorSlider2":{  
85 - "styles":["thinslider"], 84 + "ColorSlider2":{
  85 + "styles":["ThinSlider"],
86 "progressVisual":{ 86 "progressVisual":{
87 "url":"{STYLE_DIR}/images/slider-skin-progress-green.9.png" 87 "url":"{STYLE_DIR}/images/slider-skin-progress-green.9.png"
88 } 88 }
89 }, 89 },
90 - "colorSlider3":{ 90 + "ColorSlider3":{
91 "styles":["thinslider"], 91 "styles":["thinslider"],
92 "progressVisual":{ 92 "progressVisual":{
93 "url":"{STYLE_DIR}/images/slider-skin-progress-blue.9.png" 93 "url":"{STYLE_DIR}/images/slider-skin-progress-blue.9.png"
shared/view.h
@@ -94,7 +94,7 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar&amp; toolBar, @@ -94,7 +94,7 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar&amp; toolBar,
94 { 94 {
95 Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New(); 95 Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New();
96 label.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT ); 96 label.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT );
97 - label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" ); 97 + label.SetStyleName( "ToolbarLabel" );
98 label.SetProperty( Dali::Toolkit::TextLabel::Property::TEXT, title ); 98 label.SetProperty( Dali::Toolkit::TextLabel::Property::TEXT, title );
99 label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); 99 label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
100 label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); 100 label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
@@ -168,7 +168,7 @@ Dali::Layer CreateView( Dali::Application&amp; application, @@ -168,7 +168,7 @@ Dali::Layer CreateView( Dali::Application&amp; application,
168 Dali::Toolkit::TextLabel CreateToolBarLabel( const std::string& text ) 168 Dali::Toolkit::TextLabel CreateToolBarLabel( const std::string& text )
169 { 169 {
170 Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New( text ); 170 Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New( text );
171 - label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" ); 171 + label.SetStyleName( "ToolbarLabel" );
172 label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); 172 label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
173 label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); 173 label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
174 label.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::HEIGHT ); 174 label.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::HEIGHT );