From 64eb4f9f2c16148f2d0bae24533881eca0911083 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Thu, 16 Mar 2017 18:35:16 +0000 Subject: [PATCH] Updates following size and offset policy property changes Change-Id: I59fbcbdea60da95ec599528fe76b2a227355711c --- examples/styling/image-channel-control-impl.cpp | 5 +++-- examples/transitions/shadow-button-impl.cpp | 4 ++-- .../style/mobile/style-example-theme-one.json.in | 21 ++++++++++++++------- .../style/mobile/style-example-theme-two.json.in | 9 ++++++--- resources/style/style-example-theme-one.json.in | 21 ++++++++++++++------- resources/style/style-example-theme-two.json.in | 9 ++++++--- 6 files changed, 45 insertions(+), 24 deletions(-) diff --git a/examples/styling/image-channel-control-impl.cpp b/examples/styling/image-channel-control-impl.cpp index 631c0fa..2d2f48c 100644 --- a/examples/styling/image-channel-control-impl.cpp +++ b/examples/styling/image-channel-control-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * 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. @@ -185,7 +185,8 @@ void ImageChannelControl::OnSizeSet( const Vector3& targetSize ) .Add( Toolkit::DevelVisual::Transform::Property::SIZE, Vector2(1.0f, 1.0f) ) .Add( Toolkit::DevelVisual::Transform::Property::ORIGIN, Toolkit::Align::CENTER ) .Add( Toolkit::DevelVisual::Transform::Property::ANCHOR_POINT, Toolkit::Align::CENTER ) - .Add( Toolkit::DevelVisual::Transform::Property::OFFSET_SIZE_MODE, Vector4::ZERO ); + .Add( Toolkit::DevelVisual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::DevelVisual::Transform::Policy::RELATIVE, Toolkit::DevelVisual::Transform::Policy::RELATIVE ) ) + .Add( Toolkit::DevelVisual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::DevelVisual::Transform::Policy::RELATIVE, Toolkit::DevelVisual::Transform::Policy::RELATIVE ) ); mVisual.SetTransformAndSize( transformMap, size ); } diff --git a/examples/transitions/shadow-button-impl.cpp b/examples/transitions/shadow-button-impl.cpp index 8a6ea56..e24041a 100644 --- a/examples/transitions/shadow-button-impl.cpp +++ b/examples/transitions/shadow-button-impl.cpp @@ -399,7 +399,7 @@ void ShadowButton::ResetVisual( bool IsTransformProperty( const std::string& property ) { - const char* transformProperties[]= { "size", "offset", "origin", "anchorPoint", "offsetSizeMode" }; + const char* transformProperties[]= { "size", "offset", "origin", "anchorPoint", "offsetPolicy", "sizePolicy" }; const int NUM_TRANSFORM_PROPERTIES = sizeof( transformProperties ) / sizeof( const char * ); bool found=false; @@ -418,7 +418,7 @@ void ShadowButton::StoreTargetLayouts( TransitionData transitionData ) { // Pseudo code // foreach animator in transitionData - // if animator{"property"} in [ "size", "offset", "origin", "anchorPoint", "offsetSizeMode" ] + // if animator{"property"} in [ "size", "offset", "origin", "anchorPoint", "offsetPolicy", "sizePolicy" ] // transforms{ animator{"target"} }->{animator{"property"}} = animator{"targetValue"} diff --git a/resources/style/mobile/style-example-theme-one.json.in b/resources/style/mobile/style-example-theme-one.json.in index 67ade2d..74025d2 100644 --- a/resources/style/mobile/style-example-theme-one.json.in +++ b/resources/style/mobile/style-example-theme-one.json.in @@ -135,7 +135,8 @@ "transform":{ "size":[0.12, 0.37], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" }, @@ -153,7 +154,8 @@ "transform":{ "size":[0.9, 0.9], "offset":[-30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_END", "anchorPoint":"CENTER_END" }, @@ -173,7 +175,8 @@ "transform":{ "size":[0.12, 0.37], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" }, @@ -262,7 +265,8 @@ "transform":{ "size":[0.09, 0.28], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" }, @@ -275,7 +279,8 @@ "transform":{ "size":[0.09, 0.28], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" }, @@ -293,7 +298,8 @@ "transform":{ "size":[0.9, 0.9], "offset":[-30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_END", "anchorPoint":"CENTER_END" }, @@ -312,7 +318,8 @@ "transform":{ "size":[0.09, 0.28], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" }, diff --git a/resources/style/mobile/style-example-theme-two.json.in b/resources/style/mobile/style-example-theme-two.json.in index 54857ba..fa8ed33 100644 --- a/resources/style/mobile/style-example-theme-two.json.in +++ b/resources/style/mobile/style-example-theme-two.json.in @@ -159,7 +159,8 @@ "transform":{ "size":[0.09, 0.28], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" } @@ -170,7 +171,8 @@ "transform":{ "size":[0.09, 0.28], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" } @@ -186,7 +188,8 @@ "transform":{ "size":[0.9, 0.9], "offset":[-30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_END", "anchorPoint":"CENTER_END" } diff --git a/resources/style/style-example-theme-one.json.in b/resources/style/style-example-theme-one.json.in index eb10fa3..51ddc8b 100644 --- a/resources/style/style-example-theme-one.json.in +++ b/resources/style/style-example-theme-one.json.in @@ -135,7 +135,8 @@ "transform":{ "size":[0.12, 0.37], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" }, @@ -153,7 +154,8 @@ "transform":{ "size":[0.9, 0.9], "offset":[-30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_END", "anchorPoint":"CENTER_END" }, @@ -173,7 +175,8 @@ "transform":{ "size":[0.12, 0.37], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" }, @@ -262,7 +265,8 @@ "transform":{ "size":[0.09, 0.28], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" }, @@ -275,7 +279,8 @@ "transform":{ "size":[0.09, 0.28], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" }, @@ -293,7 +298,8 @@ "transform":{ "size":[0.9, 0.9], "offset":[-30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_END", "anchorPoint":"CENTER_END" }, @@ -312,7 +318,8 @@ "transform":{ "size":[0.09, 0.28], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" }, diff --git a/resources/style/style-example-theme-two.json.in b/resources/style/style-example-theme-two.json.in index 791a79e..d689bff 100644 --- a/resources/style/style-example-theme-two.json.in +++ b/resources/style/style-example-theme-two.json.in @@ -159,7 +159,8 @@ "transform":{ "size":[0.09, 0.28], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" } @@ -170,7 +171,8 @@ "transform":{ "size":[0.09, 0.28], "offset":[30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_BEGIN", "anchorPoint":"CENTER_BEGIN" } @@ -186,7 +188,8 @@ "transform":{ "size":[0.9, 0.9], "offset":[-30,0], - "offsetSizeMode":[1,1,0,0], + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], + "sizePolicy":["RELATIVE", "RELATIVE"], "origin":"CENTER_END", "anchorPoint":"CENTER_END" } -- 2.7.4