Updates following size and offset policy property changes 97/119397/2
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 16 Mar 2017 18:35:16 +0000 (18:35 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 16 Mar 2017 18:45:44 +0000 (18:45 +0000)
Change-Id: I59fbcbdea60da95ec599528fe76b2a227355711c

examples/styling/image-channel-control-impl.cpp
examples/transitions/shadow-button-impl.cpp
resources/style/mobile/style-example-theme-one.json.in
resources/style/mobile/style-example-theme-two.json.in
resources/style/style-example-theme-one.json.in
resources/style/style-example-theme-two.json.in

index 631c0fa..2d2f48c 100644 (file)
@@ -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 );
   }
index 8a6ea56..e24041a 100644 (file)
@@ -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"}
 
 
index 67ade2d..74025d2 100644 (file)
               "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"
               },
               "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"
               },
                   "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"
                   },
               "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"
               },
               "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"
               },
               "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"
               },
                   "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"
                   },
index 54857ba..fa8ed33 100644 (file)
         "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"
         }
         "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"
         }
         "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"
         }
index eb10fa3..51ddc8b 100644 (file)
               "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"
               },
               "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"
               },
                   "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"
                   },
               "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"
               },
               "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"
               },
               "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"
               },
                   "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"
                   },
index 791a79e..d689bff 100644 (file)
         "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"
         }
         "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"
         }
         "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"
         }