From: minho.sun Date: Fri, 22 Jun 2018 01:07:47 +0000 (+0900) Subject: Revert "[Tizen] Update demo to use LinearLayout." X-Git-Tag: accepted/tizen/unified/20180622.122736~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F17%2F182317%2F1;hp=1c22cc2b91aaac24f5d39a2b7d36ba53e3386487;p=platform%2Fcore%2Fuifw%2Fdali-demo.git Revert "[Tizen] Update demo to use LinearLayout." This reverts commit 1c22cc2b91aaac24f5d39a2b7d36ba53e3386487. Change-Id: I441364df021c737f2a3ee975a45ea425438fa8b3 --- diff --git a/examples/layouting/linear-example.cpp b/examples/layouting/linear-example.cpp index 9f56222..a499005 100644 --- a/examples/layouting/linear-example.cpp +++ b/examples/layouting/linear-example.cpp @@ -20,7 +20,8 @@ #include #include #include -#include +#include +#include using namespace Dali; using namespace Dali::Toolkit; @@ -68,11 +69,6 @@ void CreateChildImageView( ImageView& imageView, const char* filename, Size size namespace Demo { -LinearExample::LinearExample() -: mLTRDirection(true) -{ -} - void LinearExample::Create() { auto stage = Stage::GetCurrent(); @@ -97,9 +93,10 @@ void LinearExample::Create() // Create a linear layout mLinearContainer = Control::New(); - auto layout = LinearLayout::New(); + mIsHorizontal = false; + + auto layout = VboxLayout::New(); layout.SetAnimateLayout(true); - layout.SetOrientation( LinearLayout::Orientation::VERTICAL ); DevelControl::SetLayout( mLinearContainer, layout ); mLinearContainer.SetParentOrigin( ParentOrigin::CENTER ); @@ -132,7 +129,7 @@ void LinearExample::Remove() // Mirror items in layout bool LinearExample::OnDirectionClicked( Button button ) { - if( !mLTRDirection ) + if( mDirection ) { mDirectionButton.SetProperty( PushButton::Property::UNSELECTED_ICON, LTR_IMAGE ); mDirectionButton.SetProperty( PushButton::Property::SELECTED_ICON, LTR_SELECTED_IMAGE ); @@ -144,23 +141,27 @@ bool LinearExample::OnDirectionClicked( Button button ) mDirectionButton.SetProperty( PushButton::Property::SELECTED_ICON, RTL_SELECTED_IMAGE ); mLinearContainer.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT ); } - mLTRDirection = !mLTRDirection; + mDirection = !mDirection; 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 ) + mIsHorizontal = !mIsHorizontal; + if( mIsHorizontal ) { - layout.SetOrientation( LinearLayout::Orientation::HORIZONTAL ); + auto hboxLayout = HboxLayout::New(); + hboxLayout.SetAnimateLayout(true); + DevelControl::SetLayout( mLinearContainer, hboxLayout ); } else { - layout.SetOrientation( LinearLayout::Orientation::VERTICAL ); + auto vboxLayout = VboxLayout::New(); + vboxLayout.SetAnimateLayout(true); + DevelControl::SetLayout( mLinearContainer, vboxLayout ); } return true; } -} // namespace Demo +} // namespace Demo \ No newline at end of file diff --git a/examples/layouting/linear-example.h b/examples/layouting/linear-example.h index c170e0f..a1496bb 100644 --- a/examples/layouting/linear-example.h +++ b/examples/layouting/linear-example.h @@ -32,12 +32,11 @@ namespace Demo /** * @file linear-example.hcpp * @brief Example of a Linear Layout with mirror feature and - * transition from horizontal to vertical. + * tranisition 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; @@ -57,7 +56,8 @@ private: PushButton mDirectionButton; PushButton mRotateButton; Control mLinearContainer; - bool mLTRDirection; + bool mDirection = false; + bool mIsHorizontal = true; }; // class LinearContainer } // namespace Demo diff --git a/examples/layouting/padding-example.cpp b/examples/layouting/padding-example.cpp index 70457dc..fc8ba41 100644 --- a/examples/layouting/padding-example.cpp +++ b/examples/layouting/padding-example.cpp @@ -20,8 +20,8 @@ #include #include #include +#include #include -#include using namespace Dali; using namespace Dali::Toolkit; @@ -70,8 +70,8 @@ void PaddingExample::Create() // 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(); + // Create HBoxLayout for this control. + auto hboxLayout = HboxLayout::New(); DevelControl::SetLayout( mHorizontalBox, hboxLayout ); mHorizontalBox.SetName("HBox"); mHorizontalBox.SetBackgroundColor( Color::WHITE ); diff --git a/examples/simple-layout/simple-layout-example.cpp b/examples/simple-layout/simple-layout-example.cpp index ac24ea1..efa5351 100644 --- a/examples/simple-layout/simple-layout-example.cpp +++ b/examples/simple-layout/simple-layout-example.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include "custom-layout.h"