Commit 64eb4f9f2c16148f2d0bae24533881eca0911083

Authored by Adeel Kazmi
1 parent 9a0c0fa5

Updates following size and offset policy property changes

Change-Id: I59fbcbdea60da95ec599528fe76b2a227355711c
examples/styling/image-channel-control-impl.cpp
1 /* 1 /*
2 - * Copyright (c) 2016 Samsung Electronics Co., Ltd. 2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
@@ -185,7 +185,8 @@ void ImageChannelControl::OnSizeSet( const Vector3& targetSize ) @@ -185,7 +185,8 @@ void ImageChannelControl::OnSizeSet( const Vector3& targetSize )
185 .Add( Toolkit::DevelVisual::Transform::Property::SIZE, Vector2(1.0f, 1.0f) ) 185 .Add( Toolkit::DevelVisual::Transform::Property::SIZE, Vector2(1.0f, 1.0f) )
186 .Add( Toolkit::DevelVisual::Transform::Property::ORIGIN, Toolkit::Align::CENTER ) 186 .Add( Toolkit::DevelVisual::Transform::Property::ORIGIN, Toolkit::Align::CENTER )
187 .Add( Toolkit::DevelVisual::Transform::Property::ANCHOR_POINT, Toolkit::Align::CENTER ) 187 .Add( Toolkit::DevelVisual::Transform::Property::ANCHOR_POINT, Toolkit::Align::CENTER )
188 - .Add( Toolkit::DevelVisual::Transform::Property::OFFSET_SIZE_MODE, Vector4::ZERO ); 188 + .Add( Toolkit::DevelVisual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::DevelVisual::Transform::Policy::RELATIVE, Toolkit::DevelVisual::Transform::Policy::RELATIVE ) )
  189 + .Add( Toolkit::DevelVisual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::DevelVisual::Transform::Policy::RELATIVE, Toolkit::DevelVisual::Transform::Policy::RELATIVE ) );
189 190
190 mVisual.SetTransformAndSize( transformMap, size ); 191 mVisual.SetTransformAndSize( transformMap, size );
191 } 192 }
examples/transitions/shadow-button-impl.cpp
@@ -399,7 +399,7 @@ void ShadowButton::ResetVisual( @@ -399,7 +399,7 @@ void ShadowButton::ResetVisual(
399 399
400 bool IsTransformProperty( const std::string& property ) 400 bool IsTransformProperty( const std::string& property )
401 { 401 {
402 - const char* transformProperties[]= { "size", "offset", "origin", "anchorPoint", "offsetSizeMode" }; 402 + const char* transformProperties[]= { "size", "offset", "origin", "anchorPoint", "offsetPolicy", "sizePolicy" };
403 const int NUM_TRANSFORM_PROPERTIES = sizeof( transformProperties ) / sizeof( const char * ); 403 const int NUM_TRANSFORM_PROPERTIES = sizeof( transformProperties ) / sizeof( const char * );
404 404
405 bool found=false; 405 bool found=false;
@@ -418,7 +418,7 @@ void ShadowButton::StoreTargetLayouts( TransitionData transitionData ) @@ -418,7 +418,7 @@ void ShadowButton::StoreTargetLayouts( TransitionData transitionData )
418 { 418 {
419 // Pseudo code 419 // Pseudo code
420 // foreach animator in transitionData 420 // foreach animator in transitionData
421 - // if animator{"property"} in [ "size", "offset", "origin", "anchorPoint", "offsetSizeMode" ] 421 + // if animator{"property"} in [ "size", "offset", "origin", "anchorPoint", "offsetPolicy", "sizePolicy" ]
422 // transforms{ animator{"target"} }->{animator{"property"}} = animator{"targetValue"} 422 // transforms{ animator{"target"} }->{animator{"property"}} = animator{"targetValue"}
423 423
424 424
resources/style/mobile/style-example-theme-one.json.in
@@ -135,7 +135,8 @@ @@ -135,7 +135,8 @@
135 "transform":{ 135 "transform":{
136 "size":[0.12, 0.37], 136 "size":[0.12, 0.37],
137 "offset":[30,0], 137 "offset":[30,0],
138 - "offsetSizeMode":[1,1,0,0], 138 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  139 + "sizePolicy":["RELATIVE", "RELATIVE"],
139 "origin":"CENTER_BEGIN", 140 "origin":"CENTER_BEGIN",
140 "anchorPoint":"CENTER_BEGIN" 141 "anchorPoint":"CENTER_BEGIN"
141 }, 142 },
@@ -153,7 +154,8 @@ @@ -153,7 +154,8 @@
153 "transform":{ 154 "transform":{
154 "size":[0.9, 0.9], 155 "size":[0.9, 0.9],
155 "offset":[-30,0], 156 "offset":[-30,0],
156 - "offsetSizeMode":[1,1,0,0], 157 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  158 + "sizePolicy":["RELATIVE", "RELATIVE"],
157 "origin":"CENTER_END", 159 "origin":"CENTER_END",
158 "anchorPoint":"CENTER_END" 160 "anchorPoint":"CENTER_END"
159 }, 161 },
@@ -173,7 +175,8 @@ @@ -173,7 +175,8 @@
173 "transform":{ 175 "transform":{
174 "size":[0.12, 0.37], 176 "size":[0.12, 0.37],
175 "offset":[30,0], 177 "offset":[30,0],
176 - "offsetSizeMode":[1,1,0,0], 178 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  179 + "sizePolicy":["RELATIVE", "RELATIVE"],
177 "origin":"CENTER_BEGIN", 180 "origin":"CENTER_BEGIN",
178 "anchorPoint":"CENTER_BEGIN" 181 "anchorPoint":"CENTER_BEGIN"
179 }, 182 },
@@ -262,7 +265,8 @@ @@ -262,7 +265,8 @@
262 "transform":{ 265 "transform":{
263 "size":[0.09, 0.28], 266 "size":[0.09, 0.28],
264 "offset":[30,0], 267 "offset":[30,0],
265 - "offsetSizeMode":[1,1,0,0], 268 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  269 + "sizePolicy":["RELATIVE", "RELATIVE"],
266 "origin":"CENTER_BEGIN", 270 "origin":"CENTER_BEGIN",
267 "anchorPoint":"CENTER_BEGIN" 271 "anchorPoint":"CENTER_BEGIN"
268 }, 272 },
@@ -275,7 +279,8 @@ @@ -275,7 +279,8 @@
275 "transform":{ 279 "transform":{
276 "size":[0.09, 0.28], 280 "size":[0.09, 0.28],
277 "offset":[30,0], 281 "offset":[30,0],
278 - "offsetSizeMode":[1,1,0,0], 282 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  283 + "sizePolicy":["RELATIVE", "RELATIVE"],
279 "origin":"CENTER_BEGIN", 284 "origin":"CENTER_BEGIN",
280 "anchorPoint":"CENTER_BEGIN" 285 "anchorPoint":"CENTER_BEGIN"
281 }, 286 },
@@ -293,7 +298,8 @@ @@ -293,7 +298,8 @@
293 "transform":{ 298 "transform":{
294 "size":[0.9, 0.9], 299 "size":[0.9, 0.9],
295 "offset":[-30,0], 300 "offset":[-30,0],
296 - "offsetSizeMode":[1,1,0,0], 301 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  302 + "sizePolicy":["RELATIVE", "RELATIVE"],
297 "origin":"CENTER_END", 303 "origin":"CENTER_END",
298 "anchorPoint":"CENTER_END" 304 "anchorPoint":"CENTER_END"
299 }, 305 },
@@ -312,7 +318,8 @@ @@ -312,7 +318,8 @@
312 "transform":{ 318 "transform":{
313 "size":[0.09, 0.28], 319 "size":[0.09, 0.28],
314 "offset":[30,0], 320 "offset":[30,0],
315 - "offsetSizeMode":[1,1,0,0], 321 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  322 + "sizePolicy":["RELATIVE", "RELATIVE"],
316 "origin":"CENTER_BEGIN", 323 "origin":"CENTER_BEGIN",
317 "anchorPoint":"CENTER_BEGIN" 324 "anchorPoint":"CENTER_BEGIN"
318 }, 325 },
resources/style/mobile/style-example-theme-two.json.in
@@ -159,7 +159,8 @@ @@ -159,7 +159,8 @@
159 "transform":{ 159 "transform":{
160 "size":[0.09, 0.28], 160 "size":[0.09, 0.28],
161 "offset":[30,0], 161 "offset":[30,0],
162 - "offsetSizeMode":[1,1,0,0], 162 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  163 + "sizePolicy":["RELATIVE", "RELATIVE"],
163 "origin":"CENTER_BEGIN", 164 "origin":"CENTER_BEGIN",
164 "anchorPoint":"CENTER_BEGIN" 165 "anchorPoint":"CENTER_BEGIN"
165 } 166 }
@@ -170,7 +171,8 @@ @@ -170,7 +171,8 @@
170 "transform":{ 171 "transform":{
171 "size":[0.09, 0.28], 172 "size":[0.09, 0.28],
172 "offset":[30,0], 173 "offset":[30,0],
173 - "offsetSizeMode":[1,1,0,0], 174 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  175 + "sizePolicy":["RELATIVE", "RELATIVE"],
174 "origin":"CENTER_BEGIN", 176 "origin":"CENTER_BEGIN",
175 "anchorPoint":"CENTER_BEGIN" 177 "anchorPoint":"CENTER_BEGIN"
176 } 178 }
@@ -186,7 +188,8 @@ @@ -186,7 +188,8 @@
186 "transform":{ 188 "transform":{
187 "size":[0.9, 0.9], 189 "size":[0.9, 0.9],
188 "offset":[-30,0], 190 "offset":[-30,0],
189 - "offsetSizeMode":[1,1,0,0], 191 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  192 + "sizePolicy":["RELATIVE", "RELATIVE"],
190 "origin":"CENTER_END", 193 "origin":"CENTER_END",
191 "anchorPoint":"CENTER_END" 194 "anchorPoint":"CENTER_END"
192 } 195 }
resources/style/style-example-theme-one.json.in
@@ -135,7 +135,8 @@ @@ -135,7 +135,8 @@
135 "transform":{ 135 "transform":{
136 "size":[0.12, 0.37], 136 "size":[0.12, 0.37],
137 "offset":[30,0], 137 "offset":[30,0],
138 - "offsetSizeMode":[1,1,0,0], 138 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  139 + "sizePolicy":["RELATIVE", "RELATIVE"],
139 "origin":"CENTER_BEGIN", 140 "origin":"CENTER_BEGIN",
140 "anchorPoint":"CENTER_BEGIN" 141 "anchorPoint":"CENTER_BEGIN"
141 }, 142 },
@@ -153,7 +154,8 @@ @@ -153,7 +154,8 @@
153 "transform":{ 154 "transform":{
154 "size":[0.9, 0.9], 155 "size":[0.9, 0.9],
155 "offset":[-30,0], 156 "offset":[-30,0],
156 - "offsetSizeMode":[1,1,0,0], 157 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  158 + "sizePolicy":["RELATIVE", "RELATIVE"],
157 "origin":"CENTER_END", 159 "origin":"CENTER_END",
158 "anchorPoint":"CENTER_END" 160 "anchorPoint":"CENTER_END"
159 }, 161 },
@@ -173,7 +175,8 @@ @@ -173,7 +175,8 @@
173 "transform":{ 175 "transform":{
174 "size":[0.12, 0.37], 176 "size":[0.12, 0.37],
175 "offset":[30,0], 177 "offset":[30,0],
176 - "offsetSizeMode":[1,1,0,0], 178 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  179 + "sizePolicy":["RELATIVE", "RELATIVE"],
177 "origin":"CENTER_BEGIN", 180 "origin":"CENTER_BEGIN",
178 "anchorPoint":"CENTER_BEGIN" 181 "anchorPoint":"CENTER_BEGIN"
179 }, 182 },
@@ -262,7 +265,8 @@ @@ -262,7 +265,8 @@
262 "transform":{ 265 "transform":{
263 "size":[0.09, 0.28], 266 "size":[0.09, 0.28],
264 "offset":[30,0], 267 "offset":[30,0],
265 - "offsetSizeMode":[1,1,0,0], 268 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  269 + "sizePolicy":["RELATIVE", "RELATIVE"],
266 "origin":"CENTER_BEGIN", 270 "origin":"CENTER_BEGIN",
267 "anchorPoint":"CENTER_BEGIN" 271 "anchorPoint":"CENTER_BEGIN"
268 }, 272 },
@@ -275,7 +279,8 @@ @@ -275,7 +279,8 @@
275 "transform":{ 279 "transform":{
276 "size":[0.09, 0.28], 280 "size":[0.09, 0.28],
277 "offset":[30,0], 281 "offset":[30,0],
278 - "offsetSizeMode":[1,1,0,0], 282 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  283 + "sizePolicy":["RELATIVE", "RELATIVE"],
279 "origin":"CENTER_BEGIN", 284 "origin":"CENTER_BEGIN",
280 "anchorPoint":"CENTER_BEGIN" 285 "anchorPoint":"CENTER_BEGIN"
281 }, 286 },
@@ -293,7 +298,8 @@ @@ -293,7 +298,8 @@
293 "transform":{ 298 "transform":{
294 "size":[0.9, 0.9], 299 "size":[0.9, 0.9],
295 "offset":[-30,0], 300 "offset":[-30,0],
296 - "offsetSizeMode":[1,1,0,0], 301 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  302 + "sizePolicy":["RELATIVE", "RELATIVE"],
297 "origin":"CENTER_END", 303 "origin":"CENTER_END",
298 "anchorPoint":"CENTER_END" 304 "anchorPoint":"CENTER_END"
299 }, 305 },
@@ -312,7 +318,8 @@ @@ -312,7 +318,8 @@
312 "transform":{ 318 "transform":{
313 "size":[0.09, 0.28], 319 "size":[0.09, 0.28],
314 "offset":[30,0], 320 "offset":[30,0],
315 - "offsetSizeMode":[1,1,0,0], 321 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  322 + "sizePolicy":["RELATIVE", "RELATIVE"],
316 "origin":"CENTER_BEGIN", 323 "origin":"CENTER_BEGIN",
317 "anchorPoint":"CENTER_BEGIN" 324 "anchorPoint":"CENTER_BEGIN"
318 }, 325 },
resources/style/style-example-theme-two.json.in
@@ -159,7 +159,8 @@ @@ -159,7 +159,8 @@
159 "transform":{ 159 "transform":{
160 "size":[0.09, 0.28], 160 "size":[0.09, 0.28],
161 "offset":[30,0], 161 "offset":[30,0],
162 - "offsetSizeMode":[1,1,0,0], 162 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  163 + "sizePolicy":["RELATIVE", "RELATIVE"],
163 "origin":"CENTER_BEGIN", 164 "origin":"CENTER_BEGIN",
164 "anchorPoint":"CENTER_BEGIN" 165 "anchorPoint":"CENTER_BEGIN"
165 } 166 }
@@ -170,7 +171,8 @@ @@ -170,7 +171,8 @@
170 "transform":{ 171 "transform":{
171 "size":[0.09, 0.28], 172 "size":[0.09, 0.28],
172 "offset":[30,0], 173 "offset":[30,0],
173 - "offsetSizeMode":[1,1,0,0], 174 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  175 + "sizePolicy":["RELATIVE", "RELATIVE"],
174 "origin":"CENTER_BEGIN", 176 "origin":"CENTER_BEGIN",
175 "anchorPoint":"CENTER_BEGIN" 177 "anchorPoint":"CENTER_BEGIN"
176 } 178 }
@@ -186,7 +188,8 @@ @@ -186,7 +188,8 @@
186 "transform":{ 188 "transform":{
187 "size":[0.9, 0.9], 189 "size":[0.9, 0.9],
188 "offset":[-30,0], 190 "offset":[-30,0],
189 - "offsetSizeMode":[1,1,0,0], 191 + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
  192 + "sizePolicy":["RELATIVE", "RELATIVE"],
190 "origin":"CENTER_END", 193 "origin":"CENTER_END",
191 "anchorPoint":"CENTER_END" 194 "anchorPoint":"CENTER_END"
192 } 195 }