demo.AddExample(Example("image-view-pixel-area.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA));
demo.AddExample(Example("image-view-svg.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG));
demo.AddExample(Example("image-view-url.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL));
- demo.AddExample(Example("layouting.example", DALI_DEMO_STR_TITLE_LAYOUTING));
demo.AddExample(Example("line-mesh.example", DALI_DEMO_STR_TITLE_LINE_MESH));
demo.AddExample(Example("magnifier.example", DALI_DEMO_STR_TITLE_MAGNIFIER));
demo.AddExample(Example("mesh-morph.example", DALI_DEMO_STR_TITLE_MESH_MORPH));
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string>
-#include "absolute-example.h"
-#include "layout-utilities.h"
-#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/layouting/absolute-layout.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-
-namespace
-{
-const char* const TITLE = "Absolute Example";
-
-struct ImageDetails
-{
- const char * name;
- Vector2 position;
- Size size;
-};
-
-ImageDetails IMAGES[] =
-{
- { DEMO_IMAGE_DIR "gallery-small-23.jpg", Vector2( 0.0f, 0.0f ), Size( 100.0f, 100.0f ) },
- { DEMO_IMAGE_DIR "gallery-small-23.jpg", Vector2( 100.0f, 0.0f ), Size( 100.0f, 100.0f ) },
- { DEMO_IMAGE_DIR "gallery-small-23.jpg", Vector2( 0.0f, 100.0f ), Size( 100.0f, 100.0f ) },
- { DEMO_IMAGE_DIR "gallery-small-23.jpg", Vector2( 200.0f, 200.0f ), Size( 100.0f, 100.0f ) },
-};
-unsigned int IMAGE_COUNT=sizeof(IMAGES)/sizeof(IMAGES[0]);
-
-// Helper function to create ImageViews with given filename and size.
-void CreateChildImageView( ImageView& imageView, unsigned imageIndex )
-{
- imageView = ImageView::New();
- Property::Map imagePropertyMap;
- imagePropertyMap[ Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imagePropertyMap[ ImageVisual::Property::URL ] = IMAGES[imageIndex].name;
- imagePropertyMap[ ImageVisual::Property::DESIRED_WIDTH ] = IMAGES[imageIndex].size.width ;
- imagePropertyMap[ ImageVisual::Property::DESIRED_HEIGHT ] = IMAGES[imageIndex].size.height;
- imageView.SetProperty( ImageView::Property::IMAGE , imagePropertyMap );
- imageView.SetName("ImageView");
- imageView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- imageView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- imageView.SetProperty( Dali::Actor::Property::POSITION, Vector3( IMAGES[imageIndex].position ) );
-}
-
-} // namespace
-
-namespace Demo
-{
-
-AbsoluteExample::AbsoluteExample()
-: Example( TITLE ),
- mRootLayoutControl(),
- mAbsoluteLayoutContainer(),
- mLayoutSizeToggleStatus( true ),
- mToggleButton()
-{
-
-}
-
-void AbsoluteExample::Create()
-{
- auto stage = Stage::GetCurrent();
- // This layout will be the size of the stage but allows subsequent layouts to be any size.
- mRootLayoutControl = LayoutUtilities::CreateRootContainer();
- stage.Add( mRootLayoutControl );
-
- // Create an Absolute Layout to show ImageViews at explictly provided positions.
- mAbsoluteLayoutContainer = Control::New();
- mAbsoluteLayoutContainer.SetBackgroundColor( Color::WHITE );
- auto absoluteLayout = AbsoluteLayout::New();
- DevelControl::SetLayout( mAbsoluteLayoutContainer, absoluteLayout );
- mAbsoluteLayoutContainer.SetName("AbsoluteLayout");
-
- mAbsoluteLayoutContainer.SetAnchorPoint( AnchorPoint::CENTER );
- mAbsoluteLayoutContainer.SetParentOrigin( ParentOrigin::CENTER );
-
- // Initially absolute layout to use these specifications, toggle button will alter them.
- mAbsoluteLayoutContainer.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
- mAbsoluteLayoutContainer.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
-
- mRootLayoutControl.Add( mAbsoluteLayoutContainer );
-
- for( unsigned int x = 0; x < NUMBER_OF_IMAGE_VIEWS; x++ )
- {
- CreateChildImageView( mImageViews[x], x%IMAGE_COUNT );
- mAbsoluteLayoutContainer.Add( mImageViews[x] );
- }
-
- // Button toggles the size of the layout
- mToggleButton = PushButton::New();
- mToggleButton.SetProperty( Toolkit::Button::Property::LABEL, "Change layout size" );
- mToggleButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mToggleButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mToggleButton.ClickedSignal().Connect( this, &Demo::AbsoluteExample::ChangeSizeClicked );
- mToggleButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- mToggleButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
-
- stage.Add( mToggleButton );
-
-}
-
-void AbsoluteExample::Remove()
-{
- UnparentAndReset( mAbsoluteLayoutContainer );
- UnparentAndReset( mToggleButton );
- UnparentAndReset( mRootLayoutControl );
-}
-
-bool AbsoluteExample::ChangeSizeClicked( Toolkit::Button button )
-{
- if ( true == mLayoutSizeToggleStatus )
- {
- mAbsoluteLayoutContainer.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, 480 );
- mAbsoluteLayoutContainer.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, 700 );
- mLayoutSizeToggleStatus = false;
- }
- else
- {
- mAbsoluteLayoutContainer.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
- mAbsoluteLayoutContainer.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
- mLayoutSizeToggleStatus = true;
- }
-
- return true;
-}
-
-} // namespace Demo
\ No newline at end of file
+++ /dev/null
-#ifndef DALI_DEMO_ABSOLUTE_EXAMPLE_H
-#define DALI_DEMO_ABSOLUTE_EXAMPLE_H
-
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string>
-#include <dali/dali.h>
-#include <dali-toolkit/dali-toolkit.h>
-#include "example.h"
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace Demo
-{
-
-/**
- * @file absolute-example.hcpp
- * @brief Example of a Linear Layout with padding applied, enables updating of padding values for
- * one of the children.
- */
-class AbsoluteExample final: public ConnectionTracker, public Example
-{
-public:
- static const unsigned int NUMBER_OF_IMAGE_VIEWS = 4;
-
- // Constructor
- AbsoluteExample();
-
- // Creates a Absolute Layout Example and displays it.
- virtual void Create() override;
-
- // Remove and destroy this layout
- virtual void Remove() override;
-
-private:
-
- // Callback when change size button is pressed
- bool ChangeSizeClicked( Toolkit::Button button );
-
-private:
-
- Toolkit::Control mRootLayoutControl;
- Toolkit::Control mAbsoluteLayoutContainer;
- Toolkit::ImageView mImageViews[ NUMBER_OF_IMAGE_VIEWS ];
- bool mLayoutSizeToggleStatus;
- Toolkit::PushButton mToggleButton;
-};
-
-} // namespace Demo
-
-#endif // DALI_DEMO_ABSOLUTE_EXAMPLE_H
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string>
-#include "animation-example.h"
-#include <dali/devel-api/actors/actor-devel.h>
-#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/layouting/linear-layout.h>
-#include <dali-toolkit/devel-api/layouting/grid.h>
-#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
-
-#include <dali/integration-api/debug.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace
-{
-const char* const TITLE = "Animation Example";
-
-// Button file names
-const char* LTR_IMAGE( DEMO_IMAGE_DIR "icon-play.png" );
-const char* LTR_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-play-selected.png" );
-
-const char* RTL_IMAGE( DEMO_IMAGE_DIR "icon-reverse.png" );
-const char* RTL_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-reverse-selected.png" );
-
-const char* ROTATE_CLOCKWISE_IMAGE( DEMO_IMAGE_DIR "icon-reset.png" );
-const char* ROTATE_CLOCKWISE_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-reset-selected.png" );
-
-const char* GRID_IMAGE( DEMO_IMAGE_DIR "icon-item-view-layout-grid.png" );
-const char* GRID_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-item-view-layout-grid-selected.png" );
-
-// Child image filenames
-const char* IMAGE_PATH[] = {
- DEMO_IMAGE_DIR "application-icon-101.png",
- DEMO_IMAGE_DIR "application-icon-102.png",
- DEMO_IMAGE_DIR "application-icon-103.png",
- DEMO_IMAGE_DIR "application-icon-104.png"
-};
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gLayoutFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_LAYOUT" );
-#endif
-
-const unsigned int NUMBER_OF_RESOURCES = sizeof(IMAGE_PATH) / sizeof(char*);
-
-// Helper function
-void CreateChild( ImageView& child, int index, Size size )
-{
- child = ImageView::New();
- Property::Map imagePropertyMap;
- imagePropertyMap[ Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imagePropertyMap[ ImageVisual::Property::URL ] = IMAGE_PATH[ index ];
- imagePropertyMap[ ImageVisual::Property::DESIRED_WIDTH ] = size.width;
- imagePropertyMap[ ImageVisual::Property::DESIRED_HEIGHT ] = size.height;
- imagePropertyMap[ ImageVisual::Property::FITTING_MODE ] = FittingMode::SCALE_TO_FILL;
- child.SetProperty( Toolkit::ImageView::Property::IMAGE, imagePropertyMap );
- std::string name = "ImageView";
- name.append( 1, '0' + index );
- child.SetName( name );
- child.SetAnchorPoint( AnchorPoint::CENTER );
- child.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
-}
-
-// Create set layout transition. A parent opacity increases 'ease in out' from semi-transparent to fully opaque and children pulse in order
-LayoutTransitionData CreateOnSetLayoutTransition( Control& container )
-{
- auto layoutTransitionData = LayoutTransitionData::New();
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::COLOR_ALPHA;
- map[ LayoutTransitionData::AnimatorKey::INITIAL_VALUE ] = 0.5f;
- map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = 1.0f;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::EASE_IN_OUT )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.25f )
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f ) );
-
- // Apply to parent only
- layoutTransitionData.AddPropertyAnimator( container, map );
-
- // Reset scale after possible focus animation
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE;
- map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3::ONE;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f));
- layoutTransitionData.AddPropertyAnimator( Actor(), map );
- }
-
- // Children pulses in/out
- for( size_t i = 0; i < container.GetChildCount(); i++ )
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
- map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 100.0f * 1.2f, 100.0f * 1.2f, 0 );
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::SIN )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.5f + 0.1f * i)
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.25f ) );
- layoutTransitionData.AddPropertyAnimator( container.GetChildAt( i ), map );
- }
-
- // Children move
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f ) );
- layoutTransitionData.AddPropertyAnimator( Actor(), map );
- }
-
- return layoutTransitionData;
-}
-
-// Create add child transition. An added child grows from (0, 0) to its full size and instantly appears in its position
-LayoutTransitionData CreateOnChildAddTransition( Control& parent )
-{
- auto layoutTransitionData = LayoutTransitionData::New();
-
- // Want the parent to resize itself instantly so children will position themselves correctly when the parent is added to stage first time
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
- layoutTransitionData.AddPropertyAnimator( parent, map );
-
- // Reset scale after possible focus animation
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE;
- map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3::ONE;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
- layoutTransitionData.AddPropertyAnimator( Actor(), map );
- }
-
- // New child is growing
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_ADD;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE;
- map[ LayoutTransitionData::AnimatorKey::INITIAL_VALUE ] = Vector3::ZERO;
- map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3::ONE;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f ) );
- layoutTransitionData.AddPropertyAnimator( Actor(), map );
- }
-
- // Want new children instantly appear in their positions
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_ADD;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
- layoutTransitionData.AddPropertyAnimator( Actor(), map );
- }
-
- // Other just move
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f ) );
- layoutTransitionData.AddPropertyAnimator( Actor(), map );
- }
-
- return layoutTransitionData;
-}
-
-// Create remove child transition. Remaining children shake around their positions
-LayoutTransitionData CreateOnChildRemoveTransition( Control& container )
-{
- auto layoutTransitionData = LayoutTransitionData::New();
-
- // Reset scale after possible focus animation
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE;
- map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3::ONE;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f));
- layoutTransitionData.AddPropertyAnimator( Actor(), map );
- }
-
- // Apply animation to remaining children - sin shaking
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::SIN )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
- layoutTransitionData.AddPropertyAnimator( Actor(), map );
- }
-
- // Add a linear to reduce a linear to half
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::LINEAR )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f)
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f));
- layoutTransitionData.AddPropertyAnimator( Actor(), map );
- }
-
- return layoutTransitionData;
-}
-
-// Create child focus transition. A focus gained child grows 120% and focus lost child gets its original size back
-LayoutTransitionData CreateOnChildFocusTransition( Control& parent, bool affectsSiblings )
-{
- auto layoutTransitionData = LayoutTransitionData::New();
-
- // Focus gain child animation
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_GAINED;
- map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = affectsSiblings;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE;
- map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 1.2f, 1.2f, 1.0f );
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::TYPE, LayoutTransitionData::Animator::ANIMATE_TO )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f ) );
- layoutTransitionData.AddPropertyAnimator( Actor(), map );
- }
-
- // Focus lost child animation
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::CONDITION ] = LayoutTransitionData::Condition::ON_FOCUS_LOST;
- map[ LayoutTransitionData::AnimatorKey::AFFECTS_SIBLINGS ] = affectsSiblings;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE;
- map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3( 1.0f, 1.0f, 1.0f );
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::TYPE, LayoutTransitionData::Animator::ANIMATE_TO )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f ) );
- layoutTransitionData.AddPropertyAnimator( Actor(), map );
- }
-
- // Linear children positioning
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
- map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Property::Value();
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f ) );
- layoutTransitionData.AddPropertyAnimator( Actor(), map );
- }
-
- return layoutTransitionData;
-}
-
-// An example of custom default transition, ease in for position animation, ease out for size animation
-LayoutTransitionData CreateCustomDefaultTransition( Control& control )
-{
- auto layoutTransitionData = LayoutTransitionData::New();
- // Resets control scale after possible focus animation
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SCALE;
- map[ LayoutTransitionData::AnimatorKey::TARGET_VALUE ] = Vector3::ONE;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.0f ) );
- layoutTransitionData.AddPropertyAnimator( control, map );
- }
-
- // Moves control ease in
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::POSITION;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::EASE_IN )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f ) );
- layoutTransitionData.AddPropertyAnimator( control, map );
- }
-
- // Sizes control ease out
- {
- Property::Map map;
- map[ LayoutTransitionData::AnimatorKey::PROPERTY ] = Actor::Property::SIZE;
- map[ LayoutTransitionData::AnimatorKey::ANIMATOR ] = Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::ALPHA_FUNCTION, AlphaFunction::EASE_OUT )
- .Add( LayoutTransitionData::AnimatorKey::TIME_PERIOD, Property::Map()
- .Add( LayoutTransitionData::AnimatorKey::DELAY, 0.0f )
- .Add( LayoutTransitionData::AnimatorKey::DURATION, 0.5f ) );
- layoutTransitionData.AddPropertyAnimator( control, map );
- }
-
- return layoutTransitionData;
-}
-
-bool OnImageTouchCallback( Actor actor, const TouchData& event )
-{
- KeyInputFocusManager manager = KeyInputFocusManager::Get();
- manager.SetFocus( Control::DownCast( actor ) );
- return true;
-}
-
-void CreateChildAndAdd( Demo::AnimationExample& animationExample, Control& container )
-{
- Toolkit::ImageView imageView;
- CreateChild( imageView, container.GetChildCount(), Size( 100.0f, 100.0f ) );
- imageView.TouchSignal().Connect( &animationExample, &OnImageTouchCallback );
- container.Add( imageView );
-
- DevelControl::GetLayout( imageView ).SetTransitionData( Toolkit::LayoutTransitionData::ON_LAYOUT_CHANGE, CreateCustomDefaultTransition( imageView ) );
-}
-
-} // namespace
-
-namespace Demo
-{
-
-AnimationExample::AnimationExample()
-: Example( TITLE ),
- mGridSet( false )
-{
-}
-
-void AnimationExample::Create()
-{
- DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "AnimationExample::Create\n");
- auto stage = Stage::GetCurrent();
-
- mRemoveButton = PushButton::New();
- mRemoveButton.SetProperty( PushButton::Property::UNSELECTED_ICON, RTL_IMAGE );
- mRemoveButton.SetProperty( PushButton::Property::SELECTED_ICON, RTL_SELECTED_IMAGE );
- mRemoveButton.ClickedSignal().Connect( this, &AnimationExample::OnRemoveClicked );
- mRemoveButton.SetParentOrigin( Vector3( 0.2f, 1.0f, 0.5f ) );
- mRemoveButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mRemoveButton.SetSize( 75, 75 );
- stage.Add( mRemoveButton );
-
- mAddButton = PushButton::New();
- mAddButton.SetProperty( PushButton::Property::UNSELECTED_ICON, LTR_IMAGE );
- mAddButton.SetProperty( PushButton::Property::SELECTED_ICON, LTR_SELECTED_IMAGE );
- mAddButton.ClickedSignal().Connect( this, &AnimationExample::OnAddClicked );
- mAddButton.SetParentOrigin( Vector3( 0.4f, 1.0f, 0.5f ) );
- mAddButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mAddButton.SetSize( 75, 75 );
- stage.Add( mAddButton );
-
- mSelectGridButton = Toolkit::PushButton::New();
- mSelectGridButton.SetProperty( PushButton::Property::UNSELECTED_ICON, GRID_IMAGE );
- mSelectGridButton.SetProperty( PushButton::Property::SELECTED_ICON, GRID_SELECTED_IMAGE );
- mSelectGridButton.ClickedSignal().Connect( this, &AnimationExample::OnSelectGridClicked );
- mSelectGridButton.SetParentOrigin( Vector3( 0.6f, 1.0f, 0.5f ) );
- mSelectGridButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mSelectGridButton.SetSize( 75, 75 );
- stage.Add( mSelectGridButton );
-
- mShakeButton = PushButton::New();
- mShakeButton.SetProperty( PushButton::Property::UNSELECTED_ICON, ROTATE_CLOCKWISE_IMAGE );
- mShakeButton.SetProperty( PushButton::Property::SELECTED_ICON, ROTATE_CLOCKWISE_SELECTED_IMAGE );
- mShakeButton.ClickedSignal().Connect( this, &AnimationExample::OnChangeClicked );
- mShakeButton.SetParentOrigin( Vector3( 0.8f, 1.0f, 0.5f ) );
- mShakeButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mShakeButton.SetSize( 75, 75 );
- stage.Add( mShakeButton );
-
- // Create a linear layout
- mAnimationContainer = Control::New();
- mAnimationContainer.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
- mAnimationContainer.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
- mAnimationContainer.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT );
- mAnimationContainer.SetParentOrigin( ParentOrigin::CENTER );
- mAnimationContainer.SetAnchorPoint( AnchorPoint::CENTER );
- mAnimationContainer.SetName( "AnimationExample" );
- mAnimationContainer.SetProperty( Toolkit::Control::Property::PADDING, Extents( 0.0f, 0.0f, 45.0f, 75.0f) );
-
- mHorizontalLayout = LinearLayout::New();
- mHorizontalLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
- mHorizontalLayout.SetAlignment( LinearLayout::Alignment::CENTER_HORIZONTAL | LinearLayout::Alignment::CENTER_VERTICAL );
- mHorizontalLayout.SetAnimateLayout(true);
- mHorizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS, CreateOnChildFocusTransition( mAnimationContainer, true ) );
- mHorizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE, CreateOnChildRemoveTransition( mAnimationContainer ) );
- mHorizontalLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, CreateOnChildAddTransition( mAnimationContainer ) );
-
- DevelControl::SetLayout( mAnimationContainer, mHorizontalLayout );
-
- mGridLayout = Grid::New();
- mGridLayout.SetAnimateLayout( true );
- mGridLayout.SetNumberOfColumns( 2 );
- mGridLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_FOCUS, CreateOnChildFocusTransition( mAnimationContainer, false ) );
- mGridLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_REMOVE, CreateOnChildRemoveTransition( mAnimationContainer ) );
- mGridLayout.SetTransitionData( LayoutTransitionData::ON_CHILD_ADD, CreateOnChildAddTransition( mAnimationContainer ) );
-
- CreateChildAndAdd( *this, mAnimationContainer );
- stage.Add( mAnimationContainer );
-}
-
-// Remove controls added by this example from stage
-void AnimationExample::Remove()
-{
- if ( mAnimationContainer )
- {
- UnparentAndReset( mRemoveButton );
- UnparentAndReset( mAddButton );
- UnparentAndReset( mSelectGridButton );
- UnparentAndReset( mShakeButton );
- UnparentAndReset( mAnimationContainer);
- }
-}
-
-bool AnimationExample::OnRemoveClicked( Button button )
-{
- DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "AnimationExample::OnRemoveClicked\n");
-
- if ( mAnimationContainer.GetChildCount() > 0 )
- {
- mAnimationContainer.Remove( mAnimationContainer.GetChildAt( mAnimationContainer.GetChildCount() - 1 ) );
- }
- return true;
-}
-
-// Change layout by setting new layout, triggers set layout transition
-bool AnimationExample::OnSelectGridClicked( Button button )
-{
- DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "AnimationExample::OnRotateClicked\n");
-
- if ( !mGridSet )
- {
- mGridLayout.SetTransitionData( LayoutTransitionData::ON_OWNER_SET, CreateOnSetLayoutTransition( mAnimationContainer ) );
- DevelControl::SetLayout( mAnimationContainer, mGridLayout );
- }
- else
- {
- mHorizontalLayout.SetTransitionData( LayoutTransitionData::ON_OWNER_SET, CreateOnSetLayoutTransition( mAnimationContainer ) );
- DevelControl::SetLayout( mAnimationContainer, mHorizontalLayout );
- }
-
- mGridSet = !mGridSet;
- return true;
-}
-
-bool AnimationExample::OnAddClicked( Button button )
-{
- if( mAnimationContainer.GetChildCount() < 4 )
- {
- CreateChildAndAdd( *this, mAnimationContainer );
- }
- return true;
-}
-
-bool AnimationExample::OnChangeClicked( Button button )
-{
- if ( !mGridSet )
- {
- auto layout = LinearLayout::DownCast( DevelControl::GetLayout( mAnimationContainer ) );
- layout.SetAlignment( LinearLayout::Alignment::CENTER_HORIZONTAL | LinearLayout::Alignment::CENTER_VERTICAL );
- if ( layout.GetOrientation() == LinearLayout::Orientation::VERTICAL )
- {
- layout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
- }
- else
- {
- layout.SetOrientation( LinearLayout::Orientation::VERTICAL );
- }
- }
- else
- {
- auto layout = Grid::DownCast( DevelControl::GetLayout( mAnimationContainer ) );
- if ( layout.GetNumberOfColumns() == 2 )
- {
- layout.SetNumberOfColumns(3);
- }
- else
- {
- layout.SetNumberOfColumns(2);
- }
- }
- return true;
-}
-
-} // namespace Demo
+++ /dev/null
-#ifndef DALI_DEMO_ANIMATION_EXAMPLE_H
-#define DALI_DEMO_ANIMATION_EXAMPLE_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/dali.h>
-#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/layouting/linear-layout.h>
-#include <dali-toolkit/devel-api/layouting/grid.h>
-
-#include "example.h"
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace Demo
-{
-
-/**
- * @file animation-example.hcpp
- * @brief Example of a layout complex animation.
- */
-class AnimationExample final: public ConnectionTracker, public Example
-{
-public:
- AnimationExample();
-
- // Creates a Animation Layout Example and displays it.
- virtual void Create() override;
-
- // Remove and destroy this layout
- virtual void Remove() override;
-
-private:
-
- bool OnRemoveClicked( Button button );
-
- bool OnSelectGridClicked( Button button );
-
- bool OnAddClicked( Button button );
-
- bool OnChangeClicked( Button button );
-
-private:
- PushButton mRemoveButton;
- PushButton mAddButton;
- PushButton mSelectGridButton;
- PushButton mShakeButton;
- Control mAnimationContainer;
- Grid mGridLayout;
- LinearLayout mHorizontalLayout;
- bool mGridSet;
-}; // class AnimationContainer
-
-} // namespace Demo
-
-#endif //DALI_DEMO_ANIMATION_CONTAINER_H
+++ /dev/null
-#ifndef DALI_DEMO_LAYOUTING_EXAMPLE_H
-#define DALI_DEMO_LAYOUTING_EXAMPLE_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-
-namespace Demo
-{
-
-/**
- * @brief Abstract base class for layouting examples.
- */
-class Example
-{
-public:
- /// Should be overridden by deriving classes to create the required Layouting example
- virtual void Create() = 0;
-
- /// Should be overridden by deriving classes to remove their layouting example from stage
- virtual void Remove() = 0;
-
- /// Virtual destructor
- virtual ~Example() = default;
-
- /**
- * Gets the title set for this example
- * @return title
- */
- const std::string& GetExampleTitle() const
- {
- return mTitle;
- }
-
-protected:
- /**
- * Constructor for Example
- * @param[in] title Title to be used for the example
- */
- Example( const std::string& title )
- : mTitle( title )
- {
- }
-
-private:
- const std::string mTitle;
-};
-
-} // namespace Demo
-
-#endif // DALI_DEMO_LAYOUTING_EXAMPLE_H
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "flex-example.h"
-#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/layouting/flex-layout.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace
-{
-const char* const TITLE = "Flex Example";
-
-// Button file names
-const char* LTR_IMAGE( DEMO_IMAGE_DIR "icon-play.png" );
-const char* LTR_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-play-selected.png" );
-
-const char* RTL_IMAGE( DEMO_IMAGE_DIR "icon-reverse.png" );
-const char* RTL_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-reverse-selected.png" );
-
-const char* ROTATE_CLOCKWISE_IMAGE( DEMO_IMAGE_DIR "icon-reset.png" );
-const char* ROTATE_CLOCKWISE_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-reset-selected.png" );
-
-const char* WRAP_IMAGE( DEMO_IMAGE_DIR "icon-replace.png" );
-const char* WRAP_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-replace-selected.png" );
-
-const char* JUSTIFY_IMAGE( DEMO_IMAGE_DIR "icon-item-view-layout-grid.png" );
-const char* JUSTIFY_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-item-view-layout-grid-selected.png" );
-
-// Child image filenames
-const char* IMAGE_PATH[] = {
- DEMO_IMAGE_DIR "application-icon-101.png",
- DEMO_IMAGE_DIR "application-icon-102.png",
- DEMO_IMAGE_DIR "application-icon-103.png",
- DEMO_IMAGE_DIR "application-icon-104.png",
- DEMO_IMAGE_DIR "application-icon-105.png",
- DEMO_IMAGE_DIR "application-icon-106.png",
- DEMO_IMAGE_DIR "application-icon-107.png",
- DEMO_IMAGE_DIR "application-icon-108.png",
- DEMO_IMAGE_DIR "application-icon-109.png",
- DEMO_IMAGE_DIR "application-icon-110.png"
-
-};
-
-const unsigned int NUMBER_OF_RESOURCES = sizeof(IMAGE_PATH) / sizeof(char*);
-
-// Helper function to create ImageViews with given filename and size.
-void CreateChildImageView( ImageView& imageView, const char* filename, Size size )
-{
- imageView = ImageView::New();
- Property::Map imagePropertyMap;
- imagePropertyMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imagePropertyMap[ Toolkit::ImageVisual::Property::URL ] = filename;
- imagePropertyMap[ ImageVisual::Property::DESIRED_WIDTH ] = size.width;
- imagePropertyMap[ ImageVisual::Property::DESIRED_HEIGHT ] = size.height;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE , imagePropertyMap );
- imageView.SetName("ImageView");
- imageView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- imageView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-}
-
-} // namespace
-
-namespace Demo
-{
-
-FlexExample::FlexExample()
-: Example( TITLE ),
- mLTRDirection(true)
-{
-
-}
-
-void FlexExample::Create()
-{
- // The Init signal is received once (only) during the Application lifetime
- auto stage = Stage::GetCurrent();
-
- mDirectionButton = PushButton::New();
- mDirectionButton.SetProperty( PushButton::Property::UNSELECTED_ICON, RTL_IMAGE );
- mDirectionButton.SetProperty( PushButton::Property::SELECTED_ICON, RTL_SELECTED_IMAGE );
- mDirectionButton.ClickedSignal().Connect( this, &FlexExample::OnDirectionClicked );
- mDirectionButton.SetParentOrigin( Vector3(0.2f, 1.0f, 0.5f ) );
- mDirectionButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mDirectionButton.SetSize(75, 75);
- stage.Add( mDirectionButton );
-
- mWrapButton = Toolkit::PushButton::New();
- mWrapButton.SetProperty( PushButton::Property::UNSELECTED_ICON, WRAP_IMAGE );
- mWrapButton.SetProperty( PushButton::Property::SELECTED_ICON, WRAP_SELECTED_IMAGE );
- mWrapButton.ClickedSignal().Connect( this, &FlexExample::OnWrapClicked );
- mWrapButton.SetParentOrigin( Vector3(0.4f, 1.0f, 0.5f ));
- mWrapButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mWrapButton.SetSize(75, 75);
- stage.Add( mWrapButton );
-
- mJustifyButton = Toolkit::PushButton::New();
- mJustifyButton.SetProperty( PushButton::Property::UNSELECTED_ICON, JUSTIFY_IMAGE );
- mJustifyButton.SetProperty( PushButton::Property::SELECTED_ICON, JUSTIFY_SELECTED_IMAGE );
- mJustifyButton.ClickedSignal().Connect( this, &FlexExample::OnJustifyClicked );
- mJustifyButton.SetParentOrigin( Vector3(0.6f, 1.0f, 0.5f ));
- mJustifyButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mJustifyButton.SetSize(75, 75);
- stage.Add( mJustifyButton );
-
- mRotateButton = PushButton::New();
- mRotateButton.SetProperty( PushButton::Property::UNSELECTED_ICON, ROTATE_CLOCKWISE_IMAGE );
- mRotateButton.SetProperty( PushButton::Property::SELECTED_ICON, ROTATE_CLOCKWISE_SELECTED_IMAGE );
- mRotateButton.ClickedSignal().Connect( this, &FlexExample::OnRotateClicked );
- mRotateButton.SetParentOrigin( Vector3(0.8f, 1.0f, 0.5f ));
- mRotateButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mRotateButton.SetSize(75, 75);
- stage.Add( mRotateButton );
-
- // Create a flex container
- mFlexContainer = Control::New();
-
- auto layout = FlexLayout::New();
- layout.SetAnimateLayout( true );
- layout.SetFlexDirection( Toolkit::FlexLayout::FlexDirection::ROW );
- layout.SetFlexWrap( Toolkit::FlexLayout::WrapType::NO_WRAP );
- layout.SetFlexJustification( Toolkit::FlexLayout::Justification::FLEX_START );
- layout.SetFlexAlignment( Toolkit::FlexLayout::Alignment::FLEX_START );
-
- DevelControl::SetLayout( mFlexContainer, layout );
-
- mFlexContainer.SetParentOrigin( ParentOrigin::CENTER );
- mFlexContainer.SetAnchorPoint( AnchorPoint::CENTER );
- mFlexContainer.SetName( "FlexExample" );
- mFlexContainer.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
- mFlexContainer.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
- mFlexContainer.SetAnchorPoint( AnchorPoint::CENTER );
- mFlexContainer.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT );
-
- for( unsigned int x = 0; x < NUMBER_OF_RESOURCES; ++x )
- {
- Toolkit::ImageView imageView;
- CreateChildImageView( imageView, IMAGE_PATH[ x ], Size(100.0f, 100.0f) );
- imageView.SetProperty( Toolkit::Control::Property::PADDING, Extents(0.f, 0.f, 0.f, 0.f) );
- imageView.SetProperty( Toolkit::Control::Property::MARGIN, Extents(2.0f, 2.0f, 2.0f, 2.0f) );
- imageView.SetProperty( Toolkit::FlexLayout::ChildProperty::ALIGN_SELF, Toolkit::FlexLayout::Alignment::CENTER );
- imageView.SetProperty( Toolkit::FlexLayout::ChildProperty::FLEX, 0.f );
- mFlexContainer.Add( imageView );
- }
- stage.Add( mFlexContainer );
-}
-
-// Remove controls added by this example from stage
-void FlexExample::Remove()
-{
- if ( mFlexContainer )
- {
- UnparentAndReset( mDirectionButton );
- UnparentAndReset( mWrapButton );
- UnparentAndReset( mJustifyButton );
- UnparentAndReset( mRotateButton );
- UnparentAndReset( mFlexContainer);
- }
-}
-
-// Mirror items in layout
-bool FlexExample::OnDirectionClicked( Button button )
-{
- mLTRDirection = !mLTRDirection;
- if( mLTRDirection )
- {
- mDirectionButton.SetProperty( PushButton::Property::UNSELECTED_ICON, LTR_IMAGE );
- mDirectionButton.SetProperty( PushButton::Property::SELECTED_ICON, LTR_SELECTED_IMAGE );
- mFlexContainer.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT );
- }
- else
- {
- mDirectionButton.SetProperty( PushButton::Property::UNSELECTED_ICON, RTL_IMAGE );
- mDirectionButton.SetProperty( PushButton::Property::SELECTED_ICON, RTL_SELECTED_IMAGE );
- mFlexContainer.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
- }
- return true;
-}
-
-// Rotate layout by changing layout
-bool FlexExample::OnRotateClicked( Button button )
-{
- auto layout = FlexLayout::DownCast(DevelControl::GetLayout( mFlexContainer ));
- if( layout.GetFlexDirection() == Toolkit::FlexLayout::FlexDirection::COLUMN )
- {
- layout.SetFlexDirection( Toolkit::FlexLayout::FlexDirection::ROW );
- }
- else
- {
- layout.SetFlexDirection( Toolkit::FlexLayout::FlexDirection::COLUMN );
- }
- return true;
-}
-
-// Alternates the layout wrapping from wrapping to none
-bool FlexExample::OnWrapClicked( Button button )
-{
- auto layout = FlexLayout::DownCast(DevelControl::GetLayout( mFlexContainer ));
- if ( layout.GetFlexWrap() == Toolkit::FlexLayout::WrapType::NO_WRAP )
- {
- layout.SetFlexWrap( Toolkit::FlexLayout::WrapType::WRAP );
- layout.SetFlexAlignment( Toolkit::FlexLayout::Alignment::CENTER );
- mFlexContainer.SetProperty( Toolkit::Control::Property::PADDING, Extents(0.0f, 0.0f, 45.0f, 75.0f) );
- }
- else
- {
- layout.SetFlexWrap( Toolkit::FlexLayout::WrapType::NO_WRAP );
- layout.SetFlexAlignment( Toolkit::FlexLayout::Alignment::FLEX_START );
- mFlexContainer.SetProperty( Toolkit::Control::Property::PADDING, Extents(0.0f, 0.0f, 0.0f, 0.0f) );
- }
- return true;
-}
-
-// Alternates the layout to justify space between items or not
-bool FlexExample::OnJustifyClicked( Button button )
-{
- auto layout = FlexLayout::DownCast(DevelControl::GetLayout( mFlexContainer ));
- if ( layout.GetFlexJustification() == Toolkit::FlexLayout::Justification::FLEX_START )
- {
- layout.SetFlexJustification( Toolkit::FlexLayout::Justification::SPACE_BETWEEN);
- }
- else
- {
- layout.SetFlexJustification( Toolkit::FlexLayout::Justification::FLEX_START );
- }
- return true;
-}
-
-} // namespace Demo
+++ /dev/null
-#ifndef DALI_DEMO_FLEX_EXAMPLE_H
-#define DALI_DEMO_FLEX_EXAMPLE_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/dali.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-#include "example.h"
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace Demo
-{
-
-/**
- * @file flex-example.hcpp
- * @brief Example of a Flex Layout with mirror feature and
- * transition from horizontal to vertical.
- */
-class FlexExample final: public ConnectionTracker, public Example
-{
-public:
-
- // Constructor
- FlexExample();
-
- // Creates a Flex Layout Example and displays it.
- virtual void Create() override;
-
- // Remove and destroy this layout
- virtual void Remove() override;
-
-private:
-
- // Changes the direction of the items.
- bool OnDirectionClicked( Button button );
-
- // Alternates the layout from horizontal to vertical
- bool OnRotateClicked( Button button );
-
- // Alternates the layout wrapping from wrapping to none
- bool OnWrapClicked( Button button );
-
- // Alternates the layout to justify space between items or not
- bool OnJustifyClicked( Button button );
-
-private:
- PushButton mDirectionButton;
- PushButton mRotateButton;
- PushButton mWrapButton;
- PushButton mJustifyButton;
- Control mFlexContainer;
- bool mLTRDirection;
-}; // class FlexExample
-
-} // namespace Demo
-
-#endif //DALI_DEMO_FLEX_EXAMPLE_H
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string>
-#include "grid-example.h"
-#include "layout-utilities.h"
-#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/layouting/absolute-layout.h>
-#include <dali-toolkit/devel-api/layouting/grid.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace
-{
-const char* const TITLE = "Grid Example";
-
-// Helper function to create ImageViews with given filename and size.
-void CreateChildImageView( ImageView& imageView, const char* filename, Size size )
-{
- imageView = ImageView::New();
- Property::Map imagePropertyMap;
- imagePropertyMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imagePropertyMap[ Toolkit::ImageVisual::Property::URL ] = filename;
- imagePropertyMap[ ImageVisual::Property::DESIRED_WIDTH ] = size.width;
- imagePropertyMap[ ImageVisual::Property::DESIRED_HEIGHT ] = size.height;
- imageView.SetProperty(Toolkit::ImageView::Property::IMAGE , imagePropertyMap );
- imageView.SetName("ImageView");
- imageView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- imageView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-}
-
-enum CurrentExample
-{
- GRID_EXACT_WIDTH = 0,
- ITEMS_WITH_MARGINS,
- GRID_MATCH_PARENT,
- GRID_WRAP_CONTENT,
- ADD_ITEMS,
- CHANGE_TO_3_COLUMNS
-};
-
-}
-
-namespace Demo
-{
-
-GridExample::GridExample()
-: Example( TITLE ),
- mToggleStatus( GRID_EXACT_WIDTH )
-{
-}
-
-void GridExample::Create()
-{
- // The Init signal is received once (only) during the Application lifetime
- mToggleStatus = 0;
- auto stage = Stage::GetCurrent();
-
- // This layout will be the size of the stage but allow the Grid layout to be any size.
- mRootLayoutControl = LayoutUtilities::CreateRootContainer();
- stage.Add( mRootLayoutControl );
-
- // Create a table view to show a pair of buttons above each image.
- mGridContainer = Control::New();
-
- // Create LinearLayout for this control.
- auto gridLayout = Grid::New();
- gridLayout.SetAnimateLayout(true);
- gridLayout.SetNumberOfColumns( 2 );
- DevelControl::SetLayout( mGridContainer, gridLayout );
- mGridContainer.SetName("GridContainer");
- mGridContainer.SetBackgroundColor( Color::WHITE );
- mGridContainer.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
- mGridContainer.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
- mGridContainer.SetProperty( Toolkit::Control::Property::PADDING, Extents( 20,20,20,20 ) );
- mGridContainer.SetParentOrigin( ParentOrigin::CENTER );
-
- mRootLayoutControl.Add( mGridContainer );
-
- for( unsigned int x = 0; x < INITIAL_NUMBER_OF_IMAGE_VIEWS; x++ )
- {
- ImageView imageView;
- CreateChildImageView( imageView, DEMO_IMAGE_DIR "gallery-small-23.jpg" , Size(100.0f, 100.0f) );
- mImageViews.push_back( imageView );
- mGridContainer.Add( mImageViews[x] );
- }
-
- // Button toggles the size of the layout
- mToggleButton = PushButton::New();
- mToggleButton.SetProperty( Toolkit::Button::Property::LABEL, "Set Width 300" );
- mToggleButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mToggleButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mToggleButton.ClickedSignal().Connect( this, &Demo::GridExample::ToggleButtonClicked );
- mToggleButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- mToggleButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
-
- stage.Add( mToggleButton );
-}
-
-void GridExample::Remove()
-{
- mImageViews.clear();
- UnparentAndReset( mGridContainer );
- UnparentAndReset( mRootLayoutControl );
- UnparentAndReset( mToggleButton );
-}
-
-void GridExample::ChangeTo3Columns()
-{
- Grid gridLayout = Grid::DownCast( DevelControl::GetLayout(mGridContainer) );
- if ( gridLayout )
- {
- gridLayout.SetNumberOfColumns( 3 );
- }
-}
-
-void GridExample::AddItemsInteractively()
-{
- if( mImageViews.size() < MAX_NUMBER_OF_IMAGE_VIEWS )
- {
- ImageView imageView;
- CreateChildImageView( imageView, DEMO_IMAGE_DIR "gallery-small-23.jpg" , Size(100.0f, 100.0f) );
- mImageViews.push_back( imageView );
- mGridContainer.Add( imageView);
-
- // Add item button shows how many items left to add.
- unsigned int numberOfAdditonalImageViews = MAX_NUMBER_OF_IMAGE_VIEWS-INITIAL_NUMBER_OF_IMAGE_VIEWS;
- unsigned int remainingImageViews = numberOfAdditonalImageViews - ( ( mImageViews.size() - INITIAL_NUMBER_OF_IMAGE_VIEWS) );
- std::string buttonLabel( "Add item["+ std::to_string( numberOfAdditonalImageViews-remainingImageViews ) +"/"+
- std::to_string( numberOfAdditonalImageViews)+"]" );
- mToggleButton.SetProperty( Toolkit::Button::Property::LABEL, buttonLabel );
- }
-}
-
-void GridExample::AddMarginToItems()
-{
- for( unsigned int x = 0; x < INITIAL_NUMBER_OF_IMAGE_VIEWS; x++ )
- {
- mImageViews[x].SetProperty(Toolkit::Control::Property::MARGIN, Extents( 20,20,20,10));
- }
-}
-
-void GridExample::RemoveMarginsFromItems()
-{
- for( unsigned int x = 0; x < INITIAL_NUMBER_OF_IMAGE_VIEWS; x++ )
- {
- mImageViews[x].SetProperty(Toolkit::Control::Property::MARGIN, Extents());
- }
-}
-
-void GridExample::MatchParentOnWidth()
-{
- mGridContainer.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION,ChildLayoutData::MATCH_PARENT );
-}
-
-void GridExample::WrapContentOnWidth()
-{
- mGridContainer.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
-}
-
-void GridExample::SetExactWidth()
-{
- mGridContainer.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, 300 );
-}
-
-bool GridExample::ToggleButtonClicked( Toolkit::Button button )
-{
- switch( mToggleStatus )
- {
- case GRID_EXACT_WIDTH :
- {
- SetExactWidth();
- mToggleButton.SetProperty( Toolkit::Button::Property::LABEL, "Set Child Margin" );
- mToggleStatus = ITEMS_WITH_MARGINS;
- break;
- }
- case ITEMS_WITH_MARGINS :
- {
- AddMarginToItems();
- mToggleStatus = GRID_MATCH_PARENT;
- mToggleButton.SetProperty( Toolkit::Button::Property::LABEL, "Set width MATCH_PARENT" );
- break;
- }
- case GRID_MATCH_PARENT :
- {
- RemoveMarginsFromItems();
- MatchParentOnWidth();
- mToggleButton.SetProperty( Toolkit::Button::Property::LABEL, "Set width WRAP_CONTENT" );
- mToggleStatus = GRID_WRAP_CONTENT;
- break;
- }
- case GRID_WRAP_CONTENT :
- {
- WrapContentOnWidth();
- mToggleButton.SetProperty( Toolkit::Button::Property::LABEL, "Add item" );
- mToggleStatus = ADD_ITEMS;
- break;
- }
- case ADD_ITEMS :
- {
- if( mGridContainer.GetChildCount() < MAX_NUMBER_OF_IMAGE_VIEWS )
- {
- AddItemsInteractively();
- }
-
- if( mGridContainer.GetChildCount() == MAX_NUMBER_OF_IMAGE_VIEWS )
- {
- // Remove button when no more items to add
- mToggleStatus= CHANGE_TO_3_COLUMNS;
- mToggleButton.SetProperty( Toolkit::Button::Property::LABEL, "Change Columns" );
- }
- break;
- }
- case CHANGE_TO_3_COLUMNS :
- {
- ChangeTo3Columns();
- mToggleStatus = GRID_EXACT_WIDTH;
- UnparentAndReset( mToggleButton );
- break;
- }
- default :
- {
- mToggleStatus = GRID_EXACT_WIDTH;
- }
- }
- return true;
-}
-
-} // namespace Demo
+++ /dev/null
-#ifndef DALI_DEMO_GRID_EXAMPLE_H
-#define DALI_DEMO_GRID_EXAMPLE_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string>
-#include <dali/dali.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-#include "example.h"
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace Demo
-{
-
-/**
- * @file grid-example.hcpp
- * @brief Example of a Grid Layout
- */
-class GridExample final: public ConnectionTracker, public Example
-{
-public:
-
- // Constructor
- GridExample();
-
- static const unsigned int MAX_NUMBER_OF_IMAGE_VIEWS = 9;
- static const unsigned int INITIAL_NUMBER_OF_IMAGE_VIEWS = 5;
-
- // Create a Grid layout of ImagesViews
- void Create() override;
-
- // Remove created Layout
- void Remove() override;
-
-private:
-
- // Callback for button pressed
- bool ToggleButtonClicked( Toolkit::Button button );
-
- // Actions to perform in this example
- void ChangeTo3Columns();
- void AddItemsInteractively();
- void AddMarginToItems();
- void RemoveMarginsFromItems();
- void MatchParentOnWidth();
- void WrapContentOnWidth();
- void SetExactWidth();
-
-private:
-
- Toolkit::Control mRootLayoutControl;
- Toolkit::Control mGridContainer;
- std::vector<Toolkit::ImageView> mImageViews;
- Toolkit::PushButton mToggleButton;
- unsigned int mToggleStatus;
-};
-
-} // namespace Demo
-
-#endif // DALI_DEMO_GRID_EXAMPLE_H
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/layouting/absolute-layout.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace LayoutUtilities
-{
-Toolkit::Control CreateRootContainer()
-{
- Control rootLayoutControl = Control::New();
- rootLayoutControl.SetName( "AbsoluteLayout");
- auto rootLayout = AbsoluteLayout::New();
- DevelControl::SetLayout( rootLayoutControl, rootLayout );
- rootLayoutControl.SetAnchorPoint( AnchorPoint::CENTER );
- rootLayoutControl.SetParentOrigin( ParentOrigin::CENTER );
-
- return rootLayoutControl;
-}
-
-} // namespace LayoutUtilities
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef DALI_DEMO_LAYOUT_UTILITIES_H
-#define DALI_DEMO_LAYOUT_UTILITIES_H
-
-#include <dali-toolkit/public-api/controls/control.h>
-
-namespace LayoutUtilities
-{
-/**
- * @brief
- * Create a root layout, ideally Dali would have a default layout in the root layer.
- * Without this root layer the mAbsoluteLayout (or any other layout) will not
- * honour WIDTH_SPECIFICATION or HEIGHT_SPECIFICATION settings.
- * It uses the default stage size and ideally should have a layout added to it.
- * @return resulting root layout
- */
-Dali::Toolkit::Control CreateRootContainer();
-} // namespace LayoutUtilities
-
-#endif // DALI_DEMO_LAYOUT_UTILITIES_H
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <memory>
-#include <string>
-#include <dali/dali.h>
-#include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/controls/control-devel.h>
-
-// INTERNAL INCLUDES
-#include "shared/view.h"
-#include "animation-example.h"
-#include "linear-example.h"
-#include "padding-example.h"
-#include "flex-example.h"
-#include "grid-example.h"
-#include "example.h"
-#include "absolute-example.h"
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace
-{
-const Property::Value BACKGROUND
-{
- { Toolkit::Visual::Property::TYPE, Visual::GRADIENT },
- { GradientVisual::Property::STOP_COLOR, Property::Array{ Vector4( 0.0f, 0.352941176f, 0.654901961f, 1.0f ),
- Vector4( 1.0f, 0.992156863f, 0.894117647f, 1.0f ) } },
- { GradientVisual::Property::START_POSITION, Vector2( 0.0f, -0.5f ) },
- { GradientVisual::Property::END_POSITION, Vector2( 0.0f, 0.5f ) }
-};
-
-const char* TOOLBAR_IMAGE( DEMO_IMAGE_DIR "top-bar.png" );
-
-typedef std::unique_ptr< Demo::Example > ExamplePointer;
-
-typedef std::vector< ExamplePointer > ExampleContainer;
-
-/// All layouting examples to be shown should be added to this method
-void CreateExamples( ExampleContainer& container )
-{
- container.push_back( ExamplePointer(new Demo::AnimationExample) );
- container.push_back( ExamplePointer(new Demo::LinearExample) );
- container.push_back( ExamplePointer(new Demo::PaddingExample) );
- container.push_back( ExamplePointer(new Demo::AbsoluteExample) );
- container.push_back( ExamplePointer(new Demo::FlexExample) ) ;
- container.push_back( ExamplePointer(new Demo::GridExample) ) ;
-}
-
-} // anonymous namespace
-
-class LayoutingExample: public ConnectionTracker
-{
- public:
-
- LayoutingExample( Application& application )
- : mApplication( application ),
- mLayoutingExamples(),
- mLayoutIndex( 0 )
- {
- // Connect to the Application's Init signal
- mApplication.InitSignal().Connect( this, &LayoutingExample::Create );
- }
-
-private:
-
- void Create( Application& application )
- {
- auto stage = Stage::GetCurrent();
- stage.KeyEventSignal().Connect( this, &LayoutingExample::OnKeyEvent );
-
- auto bg = Control::New();
- bg.SetParentOrigin( ParentOrigin::CENTER );
- bg.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- bg.SetProperty( Control::Property::BACKGROUND, BACKGROUND );
- stage.Add( bg );
- auto toolbar = ImageView::New( TOOLBAR_IMAGE );
- toolbar.SetParentOrigin( ParentOrigin::TOP_CENTER );
- toolbar.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- toolbar.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- toolbar.SetProperty( Actor::Property::SIZE_HEIGHT, 50.0f);
-
- stage.Add( toolbar );
-
- mToolbarTitle = TextLabel::New( "");
- mToolbarTitle.SetParentOrigin( ParentOrigin::CENTER );
- mToolbarTitle.SetAnchorPoint( AnchorPoint::CENTER );
- mToolbarTitle.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
- mToolbarTitle.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, HorizontalAlignment::LEFT );
- toolbar.Add( mToolbarTitle );
-
- mNextLayout = PushButton::New();
- mNextLayout.SetStyleName( "ChangeLayoutButton" );
- mNextLayout.SetProperty( Toolkit::Button::Property::LABEL, "Change Layout" );
- mNextLayout.ClickedSignal().Connect( this, &LayoutingExample::ChangeLayout );
- mNextLayout.SetParentOrigin( ParentOrigin::TOP_RIGHT );
- mNextLayout.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
- mNextLayout.SetSize(175, 50);
- toolbar.Add( mNextLayout );
-
- CreateExamples( mLayoutingExamples );
- if( ! mLayoutingExamples.empty() )
- {
- mLayoutingExamples[ mLayoutIndex ]->Create();
- mToolbarTitle.SetProperty(Toolkit::TextLabel::Property::TEXT, mLayoutingExamples[ mLayoutIndex ]->GetExampleTitle() );
- }
- }
-
- bool ChangeLayout( Button button )
- {
- if( ! mLayoutingExamples.empty() )
- {
- mLayoutingExamples[ mLayoutIndex ]->Remove();
- mLayoutIndex = ( mLayoutIndex + 1 ) % mLayoutingExamples.size();
- mLayoutingExamples[ mLayoutIndex ]->Create();
- mToolbarTitle.SetProperty(Toolkit::TextLabel::Property::TEXT, mLayoutingExamples[ mLayoutIndex ]->Example::GetExampleTitle() );
- }
- return true;
- }
-
- /**
- * Main key event handler
- */
- void OnKeyEvent(const KeyEvent& event)
- {
- if(event.state == KeyEvent::Down)
- {
- if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
- {
- mApplication.Quit();
- }
- }
- }
-
-
-private:
- Application& mApplication;
- ExampleContainer mLayoutingExamples;
- PushButton mNextLayout;
- unsigned int mLayoutIndex;
- TextLabel mToolbarTitle;
-};
-
-int DALI_EXPORT_API main( int argc, char **argv )
-{
- Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
- LayoutingExample test( application );
- application.MainLoop();
- return 0;
-};
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string>
-#include "linear-example.h"
-#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/layouting/linear-layout.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace
-{
-const char* const TITLE = "Linear Example";
-
-// Button file names
-const char* LTR_IMAGE( DEMO_IMAGE_DIR "icon-play.png" );
-const char* LTR_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-play-selected.png" );
-
-const char* RTL_IMAGE( DEMO_IMAGE_DIR "icon-reverse.png" );
-const char* RTL_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-reverse-selected.png" );
-
-const char* ROTATE_CLOCKWISE_IMAGE( DEMO_IMAGE_DIR "icon-reset.png" );
-const char* ROTATE_CLOCKWISE_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-reset-selected.png" );
-
-const char* ALIGN_IMAGE( DEMO_IMAGE_DIR "icon-replace.png" );
-const char* ALIGN_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-replace-selected.png" );
-
-const char* WEIGHT_IMAGE( DEMO_IMAGE_DIR "icon-item-view-layout-grid.png" );
-const char* WEIGHT_SELECTED_IMAGE( DEMO_IMAGE_DIR "icon-item-view-layout-grid-selected.png" );
-
-// Child image filenames
-const char* IMAGE_PATH[] = {
- DEMO_IMAGE_DIR "application-icon-101.png",
- DEMO_IMAGE_DIR "application-icon-102.png",
- DEMO_IMAGE_DIR "application-icon-103.png",
- DEMO_IMAGE_DIR "application-icon-104.png"
-};
-
-const unsigned int NUMBER_OF_RESOURCES = sizeof(IMAGE_PATH) / sizeof(char*);
-
-// Helper function to create ImageViews with given filename and size.
-void CreateChildImageView( ImageView& imageView, const char* filename, Size size )
-{
- imageView = ImageView::New();
- Property::Map imagePropertyMap;
- imagePropertyMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imagePropertyMap[ Toolkit::ImageVisual::Property::URL ] = filename;
- imagePropertyMap[ ImageVisual::Property::DESIRED_WIDTH ] = size.width;
- imagePropertyMap[ ImageVisual::Property::DESIRED_HEIGHT ] = size.height;
- imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, imagePropertyMap );
- imageView.SetName( "ImageView" );
- imageView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- imageView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-}
-
-} // namespace
-
-namespace Demo
-{
-
-LinearExample::LinearExample()
-: Example( TITLE ),
- mLTRDirection(true),
- mImagesWeighted (false )
-{
-}
-
-void LinearExample::Create()
-{
- auto stage = Stage::GetCurrent();
-
- mDirectionButton = PushButton::New();
- mDirectionButton.SetProperty( PushButton::Property::UNSELECTED_ICON, RTL_IMAGE );
- mDirectionButton.SetProperty( PushButton::Property::SELECTED_ICON, RTL_SELECTED_IMAGE );
- mDirectionButton.ClickedSignal().Connect( this, &LinearExample::OnDirectionClicked );
- mDirectionButton.SetParentOrigin( Vector3( 0.2f, 1.0f, 0.5f ) );
- mDirectionButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mDirectionButton.SetSize( 75, 75 );
- stage.Add( mDirectionButton );
-
- mAlignmentButton = PushButton::New();
- mAlignmentButton.SetProperty( PushButton::Property::UNSELECTED_ICON, ALIGN_IMAGE );
- mAlignmentButton.SetProperty( PushButton::Property::SELECTED_ICON, ALIGN_SELECTED_IMAGE );
- mAlignmentButton.ClickedSignal().Connect( this, &LinearExample::OnAlignmentClicked );
- mAlignmentButton.SetParentOrigin( Vector3( 0.4f, 1.0f, 0.5f ) );
- mAlignmentButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mAlignmentButton.SetSize( 75, 75 );
- stage.Add( mAlignmentButton );
-
- mWeightButton = Toolkit::PushButton::New();
- mWeightButton.SetProperty( PushButton::Property::UNSELECTED_ICON, WEIGHT_IMAGE );
- mWeightButton.SetProperty( PushButton::Property::SELECTED_ICON, WEIGHT_SELECTED_IMAGE );
- mWeightButton.ClickedSignal().Connect( this, &LinearExample::OnWeightClicked );
- mWeightButton.SetParentOrigin( Vector3( 0.6f, 1.0f, 0.5f ) );
- mWeightButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mWeightButton.SetSize( 75, 75 );
- stage.Add( mWeightButton );
-
- mRotateButton = PushButton::New();
- mRotateButton.SetProperty( PushButton::Property::UNSELECTED_ICON, ROTATE_CLOCKWISE_IMAGE );
- mRotateButton.SetProperty( PushButton::Property::SELECTED_ICON, ROTATE_CLOCKWISE_SELECTED_IMAGE );
- mRotateButton.ClickedSignal().Connect( this, &LinearExample::OnRotateClicked );
- mRotateButton.SetParentOrigin( Vector3( 0.8f, 1.0f, 0.5f ) );
- mRotateButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mRotateButton.SetSize( 75, 75 );
- stage.Add( mRotateButton );
-
- // Create a linear layout
- mLinearContainer = Control::New();
- auto layout = LinearLayout::New();
- layout.SetAnimateLayout(true);
- layout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
- layout.SetAlignment( LinearLayout::Alignment::CENTER_VERTICAL );
- DevelControl::SetLayout( mLinearContainer, layout );
-
- mLinearContainer.SetParentOrigin( ParentOrigin::CENTER );
- mLinearContainer.SetAnchorPoint( AnchorPoint::CENTER );
- mLinearContainer.SetName( "LinearExample" );
- stage.Add( mLinearContainer );
- mLinearContainer.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
- mLinearContainer.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
- mLinearContainer.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT );
-
- for( unsigned int x = 0; x < NUMBER_OF_RESOURCES; ++x )
- {
- Toolkit::ImageView imageView;
- CreateChildImageView( imageView, IMAGE_PATH[ x ], Size( 100.0f, 100.0f ) );
- mLinearContainer.Add( imageView );
- mImages.push_back( imageView );
- }
-}
-
-// Remove controls added by this example from stage
-void LinearExample::Remove()
-{
- if ( mLinearContainer )
- {
- UnparentAndReset( mDirectionButton );
- UnparentAndReset( mAlignmentButton );
- UnparentAndReset( mWeightButton );
- UnparentAndReset( mRotateButton );
- UnparentAndReset( mLinearContainer);
- }
-}
-
-// Mirror items in layout
-bool LinearExample::OnDirectionClicked( Button button )
-{
- auto layout = LinearLayout::DownCast( DevelControl::GetLayout( mLinearContainer ) );
- layout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
- if( !mLTRDirection )
- {
- mDirectionButton.SetProperty( PushButton::Property::UNSELECTED_ICON, LTR_IMAGE );
- mDirectionButton.SetProperty( PushButton::Property::SELECTED_ICON, LTR_SELECTED_IMAGE );
- mLinearContainer.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT );
- }
- else
- {
- mDirectionButton.SetProperty( PushButton::Property::UNSELECTED_ICON, RTL_IMAGE );
- mDirectionButton.SetProperty( PushButton::Property::SELECTED_ICON, RTL_SELECTED_IMAGE );
- mLinearContainer.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
- }
- mLTRDirection = !mLTRDirection;
- return true;
-}
-
-// Rotate layout by changing layout
-bool LinearExample::OnRotateClicked( Button button )
-{
- auto layout = LinearLayout::DownCast( DevelControl::GetLayout( mLinearContainer ) );
- if( layout.GetOrientation() == LinearLayout::Orientation::VERTICAL )
- {
- layout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
- layout.SetAlignment(LinearLayout::Alignment::CENTER_VERTICAL );
- }
- else
- {
- layout.SetOrientation( LinearLayout::Orientation::VERTICAL );
- layout.SetAlignment( LinearLayout::Alignment::CENTER_HORIZONTAL );
- }
- return true;
-}
-
-bool LinearExample::OnAlignmentClicked( Button button )
-{
- auto layout = LinearLayout::DownCast( DevelControl::GetLayout( mLinearContainer ) );
- if ( layout.GetAlignment() == LinearLayout::Alignment::CENTER_VERTICAL ) {
- layout.SetAlignment( LinearLayout::Alignment::BEGIN );
- }
- else if ( layout.GetAlignment() == LinearLayout::Alignment::BEGIN )
- {
- layout.SetAlignment( LinearLayout::Alignment::END );
- }
- else if ( layout.GetAlignment() == LinearLayout::Alignment::END )
- {
- layout.SetAlignment( LinearLayout::Alignment::CENTER_HORIZONTAL);
- }
- else if ( layout.GetAlignment() == LinearLayout::Alignment::CENTER_HORIZONTAL )
- {
- layout.SetAlignment( LinearLayout::Alignment::TOP );
- }
- else if ( layout.GetAlignment() == LinearLayout::Alignment::TOP )
- {
- layout.SetAlignment( LinearLayout::Alignment::BOTTOM );
- }
- else if ( layout.GetAlignment() == LinearLayout::Alignment::BOTTOM )
- {
- layout.SetAlignment( LinearLayout::Alignment::CENTER_VERTICAL );
- }
- return true;
-}
-
-bool LinearExample::OnWeightClicked( Button button )
-{
- if( !mImagesWeighted )
- {
- for( auto&& iter : mImages )
- {
- iter.SetProperty( Toolkit::LinearLayout::ChildProperty::WEIGHT, 0.25f );
- }
- }
- else
- {
- for( auto&& iter : mImages )
- {
- iter.SetProperty( Toolkit::LinearLayout::ChildProperty::WEIGHT, 0.0f );
- }
- }
-
- mImagesWeighted = !mImagesWeighted;
- return true;
-}
-
-} // namespace Demo
+++ /dev/null
-#ifndef DALI_DEMO_LINEAR_EXAMPLE_H
-#define DALI_DEMO_LINEAR_EXAMPLE_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/dali.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-#include "example.h"
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace Demo
-{
-
-/**
- * @file linear-example.hcpp
- * @brief Example of a Linear Layout with mirror feature and
- * transition from horizontal to vertical.
- */
-class LinearExample final: public ConnectionTracker, public Example
-{
-public:
- LinearExample();
-
- // Creates a Linear Layout Example and displays it.
- virtual void Create() override;
-
- // Remove and destroy this layout
- virtual void Remove() override;
-
-private:
-
- // Changes the direction of the items.
- bool OnDirectionClicked( Button button );
-
- // Alternates the linear layout from horizontal to vertical
- bool OnRotateClicked( Button button );
-
- // Cycles through alignment options
- bool OnAlignmentClicked( Button button );
-
- // Justifies linear layout children using weight property
- bool OnWeightClicked( Button button );
-
-private:
- PushButton mDirectionButton;
- PushButton mAlignmentButton;
- PushButton mWeightButton;
- PushButton mRotateButton;
- std::vector< Toolkit::ImageView > mImages;
- Control mLinearContainer;
- bool mLTRDirection;
- bool mImagesWeighted;
-}; // class LinearContainer
-
-} // namespace Demo
-
-#endif //DALI_DEMO_LINEAR_CONTAINER_H
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string>
-#include "padding-example.h"
-#include "layout-utilities.h"
-#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/layouting/absolute-layout.h>
-#include <dali-toolkit/devel-api/layouting/linear-layout.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-
-namespace
-{
-const char* const TITLE = "Padding Example";
-
-// Helper function to create ImageViews with given filename and size.
-void CreateChildImageView( ImageView& imageView, const char* filename, Size size )
-{
- imageView = ImageView::New();
- Property::Map imagePropertyMap;
- imagePropertyMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imagePropertyMap[ Toolkit::ImageVisual::Property::URL ] = filename;
- imagePropertyMap[ ImageVisual::Property::DESIRED_WIDTH ] = size.width;
- imagePropertyMap[ ImageVisual::Property::DESIRED_HEIGHT ] = size.height;
- imageView.SetProperty(Toolkit::ImageView::Property::IMAGE , imagePropertyMap );
- imageView.SetName("ImageView");
- imageView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- imageView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-}
-
-}
-
-namespace Demo
-{
-
-PaddingExample::PaddingExample()
-: Example( TITLE )
-{}
-
-void PaddingExample::Create()
-{
- // The Init signal is received once (only) during the Application lifetime
-
- auto stage = Stage::GetCurrent();
-
- Control rootLayoutControl = LayoutUtilities::CreateRootContainer();
- stage.Add( rootLayoutControl );
-
- // Create a table view to show a pair of buttons above each image.
- mHorizontalBox = Control::New();
-
- // Create LinearLayout for this control.
- auto hboxLayout = LinearLayout::New();
- DevelControl::SetLayout( mHorizontalBox, hboxLayout );
- mHorizontalBox.SetName("HBox");
- mHorizontalBox.SetBackgroundColor( Color::WHITE );
- mHorizontalBox.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, 480 );
- mHorizontalBox.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, 700 );
- mHorizontalBox.SetAnchorPoint( AnchorPoint::CENTER );
- mHorizontalBox.SetParentOrigin( ParentOrigin::CENTER );
-
- rootLayoutControl.Add( mHorizontalBox );
-
- mToggleButton = Toolkit::PushButton::New();
- mToggleButton.SetProperty( Toolkit::Button::Property::LABEL, "Toggle Padding on #2" );
- mToggleButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mToggleButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mToggleButton.ClickedSignal().Connect( this, &Demo::PaddingExample::ChangePaddingClicked );
- mToggleButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- mToggleButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
-
- stage.Add( mToggleButton );
-
- for( unsigned int x = 0; x < NUMBER_OF_IMAGE_VIEWS; x++ )
- {
- CreateChildImageView( mImageViews[x], DEMO_IMAGE_DIR "gallery-small-23.jpg" , Size(100.0f, 100.0f) );
-
- // Set Padding for second ImageView
- if( 1 == x )
- {
- mImageViews[x].SetProperty(Toolkit::Control::Property::PADDING, Extents( 10.0f,10.0f,5.0f, 5.0f));
- }
-
- // Set margin for first ImageView
- if( 0 == x )
- {
- mImageViews[x].SetProperty(Toolkit::Control::Property::MARGIN, Extents( 10.0f,10.0f,0.0f, 0.0f));
- }
-
- mHorizontalBox.Add( mImageViews[x] );
-
- mImageViewToggleStatus[ x ] = true;
- }
-}
-
-void PaddingExample::Remove()
-{
- UnparentAndReset( mToggleButton );
- UnparentAndReset( mHorizontalBox );
-}
-
-bool PaddingExample::ChangePaddingClicked( Toolkit::Button button )
-{
- if ( true == mImageViewToggleStatus[ 1 ] )
- {
- mImageViews[1].SetProperty(Toolkit::Control::Property::PADDING, Extents( .0f, .0f, .0f, .0f));
- mImageViews[1].SetProperty(Actor::Property::COLOR_ALPHA, 0.5f);
- mImageViewToggleStatus[ 1 ] = false;
- }
- else
- {
- mImageViews[1].SetProperty(Toolkit::Control::Property::PADDING, Extents( 10.0f, 10.0f, 5.0f, 5.0f));
- mImageViews[1].SetProperty(Actor::Property::COLOR_ALPHA, 1.0f);
- mImageViewToggleStatus[ 1 ] = true;
- }
-
- return true;
-}
-
-} // namespace Demo
+++ /dev/null
-#ifndef DALI_DEMO_PADDING_EXAMPLE_H
-#define DALI_DEMO_PADDING_EXAMPLE_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <string>
-#include <dali/dali.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-#include "example.h"
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace Demo
-{
-
-/**
- * @file padding-example.hcpp
- * @brief Example of a Linear Layout with padding applied, enables updating of padding values for
- * one of the children.
- */
-class PaddingExample final: public ConnectionTracker, public Example
-{
-public:
-
- static const unsigned int NUMBER_OF_IMAGE_VIEWS = 3;
-
- // Constructor
- PaddingExample();
-
- // Create a Linear layout of ImagesViews, one with a Margin, One with padding.
- void Create() override;
-
- // Remove created Layout
- void Remove() override;
-
-private:
-
- // Change Paddding callback
- bool ChangePaddingClicked( Toolkit::Button button );
-
-private:
-
- Toolkit::Control mHorizontalBox;
- Toolkit::ImageView mImageViews[ NUMBER_OF_IMAGE_VIEWS ];
- bool mImageViewToggleStatus[ NUMBER_OF_IMAGE_VIEWS ];
- Toolkit::PushButton mToggleButton;
-
-};
-
-} // namespace Demo
-
-#endif // DALI_DEMO_PADDING_EXAMPLE_H
#include <dali-toolkit/dali-toolkit.h>
#include <dali/integration-api/adaptors/adaptor.h>
#include <dali/devel-api/adaptor-framework/application-devel.h>
-#include <dali-toolkit/devel-api/layouting/linear-layout.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
using namespace Dali::Toolkit;
const char* SCENE_IMAGE_2( DEMO_IMAGE_DIR "gallery-small-42.jpg");
const char* SCENE_IMAGE_3( DEMO_IMAGE_DIR "gallery-small-48.jpg");
const char* ROTATE_TEXT("-\\|/");
+const float TEXT_HEIGHT = 40.0f;
-void AddText( Control textContainer, std::string text )
+void AddText( Control textContainer, std::string text, unsigned int yIndex )
{
auto label = TextLabel::New(text);
+ label.SetParentOrigin( ParentOrigin::TOP_CENTER );
label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- textContainer.Add(label);
+ label.SetSize( 300,TEXT_HEIGHT );
+ label.SetY( yIndex*TEXT_HEIGHT );
+ textContainer.Add( label );
}
class PreRenderCallbackController : public ConnectionTracker
CreateAnimatingScene();
- auto vbox = LinearLayout::New();
- vbox.SetOrientation(LinearLayout::Orientation::VERTICAL);
- vbox.SetAlignment( LinearLayout::Alignment::TOP | LinearLayout::Alignment::CENTER_HORIZONTAL );
auto textContainer = Control::New();
textContainer.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- DevelControl::SetLayout( textContainer, vbox );
- AddText(textContainer, "Click to add callback");
- AddText(textContainer, "Press 1 to add callback");
- AddText(textContainer, "Press 2 to clear callback");
- AddText(textContainer, "Press 3 to toggle keep alive");
-
- auto vbox2 = LinearLayout::New();
- vbox2.SetOrientation(LinearLayout::Orientation::VERTICAL);
- vbox2.SetAlignment( LinearLayout::Alignment::BOTTOM | LinearLayout::Alignment::CENTER_HORIZONTAL );
- auto textContainer2 = Control::New();
- textContainer2.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- DevelControl::SetLayout( textContainer2, vbox2 );
+ AddText(textContainer, "Click to add callback", 1 );
+ AddText(textContainer, "Press 1 to add callback", 2 );
+ AddText(textContainer, "Press 2 to clear callback", 3 );
+ AddText(textContainer, "Press 3 to toggle keep alive", 4 );
+
+
mSpinner = TextLabel::New("");
mSpinner.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- textContainer2.Add(mSpinner);
+ mSpinner.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mSpinner.SetSize(100,100);
+ mStage.Add(mSpinner);
mStage.Add(textContainer);
- mStage.Add(textContainer2);
DevelApplication::AddIdleWithReturnValue( application, MakeCallback( this, &PreRenderCallbackController::OnIdle ) );
}
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// CLASS HEADER
-#include "custom-layout-impl.h"
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/actor.h>
-
-namespace Demo
-{
-
-namespace Internal
-{
-
-using Dali::Actor;
-using Dali::Toolkit::MeasuredSize;
-
-CustomLayoutPtr CustomLayout::New()
-{
- CustomLayoutPtr layout( new CustomLayout() );
- return layout;
-}
-
-void CustomLayout::OnMeasure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeasureSpec )
-{
- LayoutLength accumulatedWidth = 0;
- LayoutLength maxHeight = 0;
-
- // In this layout we will:
- // Measuring the layout with the children in a horizontal configuration, one after another
- // Set the required width to be the accumulated width of our children
- // Set the required height to be the maximum height of any of our children
-
- for( unsigned int i=0; i<GetChildCount(); ++i )
- {
- auto childLayout = GetChildAt( i );
- if( childLayout )
- {
- MeasureChild( childLayout, widthMeasureSpec, heightMeasureSpec );
- accumulatedWidth += childLayout->GetMeasuredWidth();
- std::max( childLayout->GetMeasuredHeight(), maxHeight );
- }
- }
-
- // Finally, call this method to set the dimensions we would like
- SetMeasuredDimensions( MeasuredSize( accumulatedWidth ), MeasuredSize( maxHeight ) );
-}
-
-void CustomLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom )
-{
- LayoutLength childTop( 0 );
- LayoutLength childLeft( 0 );
-
- // We want to vertically align the children to the middle
- LayoutLength middle = (bottom - top) / 2;
-
- // Horizontally align the children to the middle of the space they are given too
- LayoutLength width = right - left;
- int count = GetChildCount();
- LayoutLength childIncrement = width / count;
- LayoutLength center = childIncrement / 2;
-
- // Check layout direction
- auto owner = GetOwner();
- auto actor = Actor::DownCast(owner);
- const bool isLayoutRtl = actor ? actor.GetProperty< bool >( Actor::Property::LAYOUT_DIRECTION ) : false;
-
- for( int i = 0; i < count; i++)
- {
- auto itemIndex = isLayoutRtl ? count - 1 - i : i; // If RTL, then layout the last item first
-
- Dali::Toolkit::Internal::LayoutItemPtr childLayout = GetChildAt( itemIndex );
- if( childLayout != nullptr )
- {
- LayoutLength childWidth = childLayout->GetMeasuredWidth();
- LayoutLength childHeight = childLayout->GetMeasuredHeight();
-
- childTop = middle - childHeight / 2;
-
- LayoutLength left = childLeft + center - childWidth / 2;
-
- childLayout->Layout( left, childTop, left + childWidth, childTop + childHeight );
- childLeft += childIncrement;
- }
- }
-}
-
-} // namespace Internal
-
-} // namespace Demo
+++ /dev/null
-#ifndef DEMO_INTERNAL_CUSTOM_LAYOUT_H
-#define DEMO_INTERNAL_CUSTOM_LAYOUT_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/intrusive-ptr.h>
-#include <dali-toolkit/devel-api/layouting/layout-group-impl.h>
-
-// INTERNAL INCLUDES
-#include "custom-layout.h"
-
-namespace Demo
-{
-
-namespace Internal
-{
-
-using Dali::Toolkit::MeasureSpec;
-using Dali::Toolkit::LayoutLength;
-
-class CustomLayout;
-using CustomLayoutPtr = Dali::IntrusivePtr< CustomLayout >;
-
-/**
- * @brief The implementation of our custom layout.
- *
- * Here we will override the methods that we require to mimic a very simple horizontal layout.
- */
-class CustomLayout final : public Dali::Toolkit::Internal::LayoutGroup
-{
-public:
-
- /**
- * @brief Create a new CustomLayout object.
- * @return An intrusive pointer to the created CustomLayout object
- */
- static CustomLayoutPtr New();
-
- // Movable but not copyable
- CustomLayout( const CustomLayout& other ) = delete;
- CustomLayout& operator=( const CustomLayout& ) = delete;
- CustomLayout( CustomLayout&& other ) = default;
- CustomLayout& operator=( CustomLayout&& other ) = default;
-
-private:
-
- /**
- * @brief Default Constructor
- */
- CustomLayout() = default;
-
- /**
- * Virtual Destructor
- */
- virtual ~CustomLayout() = default;
-
- /**
- * @copydoc LayoutItem::OnMeasure
- *
- * Overriding this method so that we can calculate the size we require using our children's sizes
- */
- virtual void OnMeasure( MeasureSpec widthMeasureSpec, Dali::Toolkit::MeasureSpec heightMeasureSpec ) override;
-
- /**
- * @copydoc LayoutItem::OnLayout
- *
- * Overriding this method so that we can layout our children as required.
- */
- virtual void OnLayout( bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom ) override;
-
-};
-
-} // namespace Internal
-
-inline Internal::CustomLayout& GetImplementation( Demo::CustomLayout& handle )
-{
- DALI_ASSERT_ALWAYS( handle && "CustomLayout handle is empty" );
- Dali::BaseObject& object = handle.GetBaseObject();
- return static_cast<Internal::CustomLayout&>( object );
-}
-
-inline const Internal::CustomLayout& GetImplementation( const Demo::CustomLayout& handle )
-{
- DALI_ASSERT_ALWAYS( handle && "CustomLayout handle is empty" );
- const Dali::BaseObject& object = handle.GetBaseObject();
- return static_cast<const Internal::CustomLayout&>( object );
-}
-
-} // namespace Demo
-
-#endif // DEMO_INTERNAL_CUSTOM_LAYOUT_H
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// CLASS HEADER
-#include "custom-layout.h"
-
-// INTERNAL HEADERS
-#include "custom-layout-impl.h"
-
-namespace Demo
-{
-
-CustomLayout CustomLayout::New()
-{
- Internal::CustomLayoutPtr internal = Internal::CustomLayout::New();
- return CustomLayout( internal.Get() );
-}
-
-CustomLayout CustomLayout::DownCast( BaseHandle handle )
-{
- return CustomLayout( dynamic_cast< Demo::Internal::CustomLayout* >( handle.GetObjectPtr() ) );
-}
-
-CustomLayout::CustomLayout( Internal::CustomLayout* object )
-: Dali::Toolkit::LayoutGroup( object )
-{
-}
-
-} // namespace Demo
+++ /dev/null
-#ifndef DEMO_CUSTOM_LAYOUT_H
-#define DEMO_CUSTOM_LAYOUT_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/base-handle.h>
-#include <dali-toolkit/devel-api/layouting/layout-group.h>
-
-namespace Demo
-{
-
-namespace Internal
-{
-class CustomLayout;
-}
-
-/**
- * @brief This is the handle class to a very simple Custom Layout.
- *
- * This class lays out its children horizontally in a very simple manner.
- */
-class CustomLayout : public Dali::Toolkit::LayoutGroup
-{
-public:
-
- /**
- * @brief Creates an uninitialized CustomLayout handle.
- *
- * Initialize it using CustomLayout::New().
- * Calling member functions with an uninitialized handle is not allowed.
- */
- CustomLayout() = default;
-
- /**
- * @brief Creates a CustomLayout object.
- */
- static CustomLayout New();
-
-
- /**
- * @brief Default destructor.
- *
- * This is non-virtual, since derived Handle types must not contain data or virtual methods
- */
- ~CustomLayout() = default;
-
- /**
- * @brief Copy constructor
- */
- CustomLayout( const CustomLayout& ) = default;
-
- /**
- * @brief Assigment operator
- */
- CustomLayout& operator=( const CustomLayout& ) = default;
-
- /**
- * @brief Move constructor
- */
- CustomLayout( CustomLayout&& ) = default;
-
- /**
- * @brief Movable assignment operator
- */
- CustomLayout& operator=( CustomLayout&& ) = default;
-
- /**
- * @brief Downcasts a handle to a CustomLayout handle.
- *
- * If handle points to a CustomLayout, the downcast produces a valid handle.
- * If not, the returned handle is left uninitialized.
-
- * @param[in] handle to an object
- * @return Handle to a CustomLayout or an uninitialized handle
- */
- static CustomLayout DownCast( BaseHandle handle );
-
-public: // Not intended for application developers
-
- /// @cond internal
- /**
- * @brief This constructor is used by CustomLayout::New() methods.
- *
- * @param[in] actor A pointer to a newly allocated Dali resource
- */
- explicit CustomLayout( Internal::CustomLayout* body );
- /// @endcond
-};
-
-} // namespace Demo
-
-#endif // DEMO_CUSTOM_LAYOUT_H
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali-toolkit/dali-toolkit.h>
-
-#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/layouting/layout-item-impl.h>
-
-#include "custom-layout.h"
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace
-{
-
-/// Child image filenames
-const char* IMAGE_PATH[] = {
- DEMO_IMAGE_DIR "application-icon-101.png",
- DEMO_IMAGE_DIR "application-icon-102.png",
- DEMO_IMAGE_DIR "application-icon-103.png",
- DEMO_IMAGE_DIR "application-icon-104.png",
-};
-const unsigned int NUMBER_OF_IMAGES = sizeof( IMAGE_PATH ) / sizeof( char* );
-
-/**
- * @brief Helper function to create ImageViews with given filename and size.
- * @param[in] filename The filename of the image to use
- * @param[in] size The size that the image should be loaded at
- * @return The created ImageView
- */
-ImageView CreateChildImageView( const char* filename, Size size )
-{
- ImageView imageView = ImageView::New();
- Property::Map imagePropertyMap;
- imagePropertyMap[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::IMAGE;
- imagePropertyMap[ Toolkit::ImageVisual::Property::URL ] = filename;
- imagePropertyMap[ ImageVisual::Property::DESIRED_WIDTH ] = size.width;
- imagePropertyMap[ ImageVisual::Property::DESIRED_HEIGHT ] = size.height;
- imageView.SetProperty(Toolkit::ImageView::Property::IMAGE , imagePropertyMap );
- imageView.SetName("ImageView");
- imageView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- imageView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- return imageView;
-}
-
-} // unnamed namespace
-
-/**
- * @brief Demonstrates how to create a very simple layout and apply that to any Control.
- */
-class SimpleLayoutExample : public ConnectionTracker
-{
-public:
-
- /**
- * @brief Constructor.
- * @param[in] application A reference to the Application class.
- */
- SimpleLayoutExample( Application& application )
- : mApplication( application )
- {
- // Connect to the Application's Init signal
- mApplication.InitSignal().Connect( this, &SimpleLayoutExample::Create );
- }
-
-private:
-
- /**
- * @brief Called to initialise the application content
- * @param[in] application A reference to the Application class.
- */
- void Create( Application& application )
- {
- // Get a handle to the stage, change the background color and connect to the Touch & Key signals
- Stage stage = Stage::GetCurrent();
- stage.SetBackgroundColor( Color::WHITE );
- stage.GetRootLayer().TouchSignal().Connect( this, &SimpleLayoutExample::OnTouch );
- stage.KeyEventSignal().Connect( this, &SimpleLayoutExample::OnKeyEvent );
- stage.KeepRendering(0.5f); // TODO: Should remove after bugfix, but currently required to ensure renders are done after resources are loaded
-
-
- // Create a new control
- Control control = Control::New();
- control.SetParentOrigin( ParentOrigin::CENTER );
- control.SetAnchorPoint( AnchorPoint::CENTER );
- stage.Add( control);
-
- // Set our Custom Layout on the control
- auto layout = Demo::CustomLayout::New();
- DevelControl::SetLayout( control, layout );
-
- // Add child image-views to the created control
- for( auto i = 0u; i < NUMBER_OF_IMAGES; ++i )
- {
- control.Add( CreateChildImageView( IMAGE_PATH[ i ], Size( 100.0f, 100.0f ) ) );
- }
- }
-
- /**
- * @brief Called when the stage is touched.
- *
- * We will use this to quit the application.
- */
- bool OnTouch( Actor /* actor */, const TouchData& /* touch */ )
- {
- mApplication.Quit();
- return true;
- }
-
- /**
- * @brief Called when any key event is received.
- *
- * Will use this to quit the application if Back or the Escape key is received
- * @param[in] event The key event information
- */
- void OnKeyEvent( const KeyEvent& event )
- {
- if( event.state == KeyEvent::Down )
- {
- if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
- {
- mApplication.Quit();
- }
- }
- }
-
-private:
- Application& mApplication; ///< A reference to the application object.
-};
-
-int DALI_EXPORT_API main( int argc, char **argv )
-{
- Application application = Application::New( &argc, &argv );
- SimpleLayoutExample test( application );
- application.MainLoop();
- return 0;
-}
msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS"
msgstr "Lights and Shadows"
-msgid "DALI_DEMO_STR_TITLE_LAYOUTING"
-msgstr "Layouting"
-
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "Mesh Line"
msgid "DALI_DEMO_STR_TITLE_RENDERER_STENCIL"
msgstr "Renderer Stencil"
-msgid "DALI_DEMO_STR_TITLE_SIMPLE_LAYOUT"
-msgstr "Simple Layout"
-
msgid "DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL"
msgstr "Simple Visuals Control"
msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS"
msgstr "Lights and Shadows"
-msgid "DALI_DEMO_STR_TITLE_LAYOUTING"
-msgstr "Layouting"
-
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "Mesh Line"
msgid "DALI_DEMO_STR_TITLE_RENDERER_STENCIL"
msgstr "Renderer Stencil"
-msgid "DALI_DEMO_STR_TITLE_SIMPLE_LAYOUT"
-msgstr "Simple Layout"
-
msgid "DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL"
msgstr "Simple Visuals Control"
msgid "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS"
msgstr "روشنی اور سائے"
-msgid "DALI_DEMO_STR_TITLE_LAYOUTING"
-msgstr "تَرتيب"
-
msgid "DALI_DEMO_STR_TITLE_LINE_MESH"
msgstr "لکیریں"
#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL")
#define DALI_DEMO_STR_TITLE_ITEM_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_ITEM_VIEW")
#define DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS")
-#define DALI_DEMO_STR_TITLE_LAYOUTING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LAYOUTING")
#define DALI_DEMO_STR_TITLE_LINE_MESH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LINE_MESH")
#define DALI_DEMO_STR_TITLE_MAGNIFIER dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MAGNIFIER")
#define DALI_DEMO_STR_TITLE_MESH_MORPH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_MESH_MORPH")
#define DALI_DEMO_STR_TITLE_RENDERING_RADIAL_PROGRESS dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_RADIAL_PROGRESS")
#define DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING")
#define DALI_DEMO_STR_TITLE_RENDERER_STENCIL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_RENDERER_STENCIL")
-#define DALI_DEMO_STR_TITLE_SIMPLE_LAYOUT dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SIMPLE_LAYOUT")
#define DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL")
#define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI")
#define DALI_DEMO_STR_TITLE_SCROLL_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCROLL_VIEW")
#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_URL "Image View URL"
#define DALI_DEMO_STR_TITLE_ITEM_VIEW "Item View"
#define DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS "Lights and shadows"
-#define DALI_DEMO_STR_TITLE_LAYOUTING "Layouting"
#define DALI_DEMO_STR_TITLE_LINE_MESH "Mesh Line"
#define DALI_DEMO_STR_TITLE_MAGNIFIER "Magnifier"
#define DALI_DEMO_STR_TITLE_MESH_MORPH "Mesh Morph"
#define DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING "Ray Marching"
#define DALI_DEMO_STR_TITLE_RENDERING_RADIAL_PROGRESS "Radial Progress"
#define DALI_DEMO_STR_TITLE_RENDERER_STENCIL "Renderer Stencils"
-#define DALI_DEMO_STR_TITLE_SIMPLE_LAYOUT "Simple Layout"
#define DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL "Simple Visuals Control"
#define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI "Script Based UI"
#define DALI_DEMO_STR_TITLE_SCROLL_VIEW "Scroll View"
demo.AddExample(Example("perf-scroll.example", DALI_DEMO_STR_TITLE_PERF_SCROLL));
demo.AddExample(Example("point-mesh.example", DALI_DEMO_STR_TITLE_POINT_MESH));
demo.AddExample(Example("property-notification.example", DALI_DEMO_STR_TITLE_PROPERTY_NOTIFICATION));
- demo.AddExample(Example("simple-layout.example", DALI_DEMO_STR_TITLE_SIMPLE_LAYOUT));
demo.AddExample(Example("simple-visuals-control.example", DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL));
demo.AddExample(Example("text-fonts.example", DALI_DEMO_STR_TITLE_TEXT_FONTS));
demo.AddExample(Example("text-memory-profiling.example", DALI_DEMO_STR_TITLE_TEXT_MEMORY_PROFILING));