Change background colors of the launcher 19/214519/3
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Mon, 23 Sep 2019 15:12:30 +0000 (16:12 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 24 Sep 2019 09:48:15 +0000 (10:48 +0100)
- Also removed ununsed consts from dali-table-view
- Also removed unused js file from scripts directory

Change-Id: Ibb0c0d087ad19943518ce223feb1652f2e7de4e3

14 files changed:
build/tizen/CMakeLists.txt
examples-reel/dali-examples-reel.cpp
resources/scripts/simple-image-wall.js.in [deleted file]
resources/style/.gitignore
resources/style/base-theme.json.in [new file with mode: 0644]
resources/style/demo-theme.json.in
resources/style/examples-theme.json.in [new file with mode: 0644]
resources/style/mobile/base-theme.json.in [new file with mode: 0644]
resources/style/mobile/demo-theme.json.in
resources/style/mobile/examples-theme.json.in [new file with mode: 0644]
resources/style/mobile/tests-theme.json.in [new file with mode: 0644]
resources/style/tests-theme.json.in [new file with mode: 0644]
shared/dali-table-view.cpp
tests-reel/dali-tests-reel.cpp

index 08f1a79..a98071e 100644 (file)
@@ -109,7 +109,10 @@ ENDFOREACH(flag)
 CONFIGURE_FILE( resources-location.in ${DEMO_SHARED}/resources-location.cpp )
 
 #Replace @DEMO_STYLE_IMAGE_DIR@ in following files
+CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/base-theme.json.in ${LOCAL_STYLE_DIR}/base-theme.json )
 CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/demo-theme.json.in ${LOCAL_STYLE_DIR}/demo-theme.json )
+CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/examples-theme.json.in ${LOCAL_STYLE_DIR}/examples-theme.json )
+CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/tests-theme.json.in ${LOCAL_STYLE_DIR}/tests-theme.json )
 CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/animated-gradient-call-active-style.json.in ${LOCAL_STYLE_DIR}/animated-gradient-call-active-style.json )
 CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/contact-cards-example-theme.json.in ${LOCAL_STYLE_DIR}/contact-cards-example-theme.json )
 CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/progress-bar-example-theme.json.in ${LOCAL_STYLE_DIR}/progress-bar-example-theme.json )
index cc401a9..a1358a8 100644 (file)
@@ -31,7 +31,7 @@ int DALI_EXPORT_API main(int argc, char **argv)
   textdomain(DALI_DEMO_DOMAIN_LOCAL);
   setlocale(LC_ALL, DEMO_LANG);
 
-  Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
+  Application app = Application::New( &argc, &argv, DEMO_STYLE_DIR "/examples-theme.json" );
 
   // Create the demo launcher
   DaliTableView demo(app);
diff --git a/resources/scripts/simple-image-wall.js.in b/resources/scripts/simple-image-wall.js.in
deleted file mode 100644 (file)
index 36aba3f..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-// Image Wall example
-//
-// Example usage of Dali API
-//
-
-var imageDir = "@DEMO_STYLE_IMAGE_DIR@";
-
-var NUMBER_OF_IMAGES = 40; // for now use 16 ( demo files go up to 30)
-var VIDEO_WALL_ROWS = 7; // use 3 rows for the video wall
-var VIDEO_WALL_COLUMNS = 12; // use 12 columns for the video wall
-var VIDEO_WALL_ITEM_SIZE = 128; // width / height of a item in the video wall
-var BORDER_SIZE = 5;
-var VIDEO_WALL_ITEM_SIZE_NO_BORDER = VIDEO_WALL_ITEM_SIZE - BORDER_SIZE;
-var VIDEO_WALL_WIDTH = VIDEO_WALL_COLUMNS * VIDEO_WALL_ITEM_SIZE;
-var VIDEO_WALL_HEIGHT = VIDEO_WALL_ROWS * VIDEO_WALL_ITEM_SIZE;
-
-var daliApp = {};
-
-var wallRootActor; // the root actor of the video wall
-
-// we want demo images of format gallery-small-1.jpg
-daliApp.getFileName = function(index) {
-    fileName = "gallery-small-" + (index+1) + ".jpg";
-    return fileName;
-}
-
-daliApp.createRootActor = function() {
-    wallRootActor = new dali.Actor();
-    wallRootActor.parentOrigin = dali.CENTER;
-    wallRootActor.anchorPoint = dali.CENTER;
-    dali.stage.add(wallRootActor);
-}
-
-daliApp.getWallActorIndex = function(x, y) {
-    return x + y * VIDEO_WALL_COLUMNS;
-}
-
-daliApp.createActors = function() {
-    daliApp.createRootActor();
-
-    for (y = 0; y < VIDEO_WALL_ROWS; ++y) {
-        for (x = 0; x < VIDEO_WALL_COLUMNS; ++x) {
-
-            var actorIndex = daliApp.getWallActorIndex(x, y);
-            var imageView = new dali.Control("ImageView");
-
-            // wrap image index between 0 and NUMBER_OF_IMAGES
-            var imageIndex = actorIndex % NUMBER_OF_IMAGES;
-
-            imageView.image = imageDir + daliApp.getFileName(imageIndex);
-
-            imageView.parentOrigin = dali.CENTER;
-            imageView.anchorPoint = dali.CENTER;
-            imageView.size = [VIDEO_WALL_ITEM_SIZE_NO_BORDER, VIDEO_WALL_ITEM_SIZE_NO_BORDER, 1.0]; // start with zero size so it zooms up
-
-            var xPosition = x * VIDEO_WALL_ITEM_SIZE;
-            //  as the middle the wall is at zero (relative to wallRootActor), we need to subtract half the wall width.
-            // + add half item size because the item anchor point is the center of the wallRootActor.
-            xPosition = xPosition - (VIDEO_WALL_WIDTH / 2) + (VIDEO_WALL_ITEM_SIZE / 2);
-
-            var yPosition = y * VIDEO_WALL_ITEM_SIZE;
-            yPosition = yPosition - (VIDEO_WALL_HEIGHT / 2) + (VIDEO_WALL_ITEM_SIZE / 2);
-
-            imageView.position = [xPosition, yPosition, 0.0];
-
-            // Add to the video wall root actor.
-            wallRootActor.add(imageView);
-        }
-    }
-}
-
-function Initialise() {
-    daliApp.createActors();
-}
-
-Initialise();
index 7458468..5582fe8 100644 (file)
@@ -1,4 +1,7 @@
+base-theme.json
 demo-theme.json
+examples-theme.json
+tests-theme.json
 animated-gradient-call-active-style.json
 contact-cards-example-theme.json
 progress-bar-example-theme.json
diff --git a/resources/style/base-theme.json.in b/resources/style/base-theme.json.in
new file mode 100644 (file)
index 0000000..12404e9
--- /dev/null
@@ -0,0 +1,206 @@
+/*
+ * 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.
+ *
+ */
+
+{
+  "styles":
+  {
+    "ConfirmationPopup":{
+      "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/00_popup_bg.9.png"
+    },
+
+    "CustomPopupStyle":{
+      "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/popup.9.png",
+      "popupBackgroundBorder":[0,4,4,0],
+      "tailUpImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-up.png",
+      "tailDownImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-down.png",
+      "tailLeftImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-left.png",
+      "tailRightImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-right.png"
+    },
+
+    "DemoTileBase":
+    {
+      "states":
+      {
+        "NORMAL":
+        {
+          "color":[0.4, 0.6, 0.9, 0.6],
+          "visuals":
+          {
+            "image":
+            {
+              "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture.9.png",
+// TILE_BACKGROUND_ALPHA
+// This shader takes a texture.
+// An alpha discard is performed.
+// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
+              "shader":
+              {
+                "fragmentShader":[
+                  "  varying mediump vec2  vTexCoord;",
+                  "  uniform lowp    vec4  uColor;",
+                  "  uniform sampler2D     sTexture;",
+                  "  uniform mediump vec3  uCustomPosition;",
+                  "",
+                  "  void main()",
+                  "  {",
+                  "    if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )",
+                  "    {",
+                  "      discard;",
+                  "    }",
+                  "",
+                  "    mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );",
+                  "    mediump vec4 color = texture2D( sTexture, wrapTexCoord );",
+                  "    mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;",
+                  "",
+                  "    gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );",
+                  "  }"
+                ]
+              }
+            }
+          }
+        },
+        "FOCUSED":
+        {
+          "color":[0.3, 0.5, 0.8, 0.5],
+          "visuals":
+          {
+            "image":
+            {
+              "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture-focused.9.png",
+// TILE_BACKGROUND_ALPHA
+// This shader takes a texture.
+// An alpha discard is performed.
+// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
+              "shader":
+              {
+                "fragmentShader":[
+                  "  varying mediump vec2  vTexCoord;",
+                  "  uniform lowp    vec4  uColor;",
+                  "  uniform sampler2D     sTexture;",
+                  "  uniform mediump vec3  uCustomPosition;",
+                  "",
+                  "  void main()",
+                  "  {",
+                  "    if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )",
+                  "    {",
+                  "      discard;",
+                  "    }",
+                  "",
+                  "    mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );",
+                  "    mediump vec4 color = texture2D( sTexture, wrapTexCoord );",
+                  "    mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;",
+                  "",
+                  "    gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );",
+                  "  }"
+                ]
+              }
+            }
+          }
+        }
+      }
+    },
+    "FocusActor":
+    {
+      "visuals":
+      {
+        "image":
+        {
+          "url":"{APPLICATION_RESOURCE_PATH}/images/tile-focus.9.png"
+        }
+      }
+    },
+    "DemoTileBorder":
+    {
+      "visuals":
+      {
+        "image":
+        {
+          "url":"{APPLICATION_RESOURCE_PATH}/images/item-background.9.png" // TILE_BACKGROUND
+        }
+      }
+    },
+    "TextLabelRosemary":
+    {
+      "fontFamily":"Rosemary"
+    },
+    "TextLabel":
+    {
+      "fontStyle":{"weight":"normal"},
+      "pointSize":18
+    },
+    "LauncherLabel":
+    {
+      "pointSize":18
+    },
+
+    "ToolbarLabel":
+    {
+      "pointSize":18
+    },
+
+    "BuilderLabel":
+    {
+      "pointSize":13
+    },
+
+    "ScrollView":
+    {
+      "overshootEffectColor":"B018"
+    },
+
+    "ImageScalingGroupLabel":
+    {
+      "pointSize":9
+    },
+
+    "ImageScalingButton":
+    {
+      "label":{
+        "pointSize":11
+      }
+    },
+//
+// Simple Visuals Application Style section
+//
+    "MyControl":
+    {
+      "states":
+      {
+        "NORMAL":
+        {
+          "visuals":
+          {
+            "iconVisual":
+            {
+              "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-13.png"
+            }
+          }
+        },
+        "FOCUSED":
+        {
+          "visuals":
+          {
+            "iconVisual":
+            {
+              "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-83.png"
+            }
+          }
+        }
+      }
+    }
+  }
+}
index 62d717a..1c2dc27 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2000-2016 Samsung Electronics Co., Ltd
+ * 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
  */
 
 {
+  "includes":
+  [
+    "{APPLICATION_RESOURCE_PATH}/style/base-theme.json"
+  ],
+
   "styles":
   {
-    "ConfirmationPopup":{
-      "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/00_popup_bg.9.png"
-    },
-
-    "CustomPopupStyle":{
-      "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/popup.9.png",
-      "popupBackgroundBorder":[0,4,4,0],
-      "tailUpImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-up.png",
-      "tailDownImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-down.png",
-      "tailLeftImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-left.png",
-      "tailRightImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-right.png"
-    },
-
     "DemoTile":
     {
-      "states":
-      {
-        "NORMAL":
-        {
-          "color":[0.4, 0.6, 0.9, 0.6],
-          "visuals":
-          {
-            "image":
-            {
-              "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture.9.png",
-// TILE_BACKGROUND_ALPHA
-// This shader takes a texture.
-// An alpha discard is performed.
-// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
-              "shader":
-              {
-                "fragmentShader":[
-                  "  varying mediump vec2  vTexCoord;",
-                  "  uniform lowp    vec4  uColor;",
-                  "  uniform sampler2D     sTexture;",
-                  "  uniform mediump vec3  uCustomPosition;",
-                  "",
-                  "  void main()",
-                  "  {",
-                  "    if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )",
-                  "    {",
-                  "      discard;",
-                  "    }",
-                  "",
-                  "    mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );",
-                  "    mediump vec4 color = texture2D( sTexture, wrapTexCoord );",
-                  "    mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;",
-                  "",
-                  "    gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );",
-                  "  }"
-                ]
-              }
-            }
-          }
-        },
-        "FOCUSED":
-        {
-          "color":[0.3, 0.5, 0.8, 0.5],
-          "visuals":
-          {
-            "image":
-            {
-              "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture-focused.9.png",
-// TILE_BACKGROUND_ALPHA
-// This shader takes a texture.
-// An alpha discard is performed.
-// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
-              "shader":
-              {
-                "fragmentShader":[
-                  "  varying mediump vec2  vTexCoord;",
-                  "  uniform lowp    vec4  uColor;",
-                  "  uniform sampler2D     sTexture;",
-                  "  uniform mediump vec3  uCustomPosition;",
-                  "",
-                  "  void main()",
-                  "  {",
-                  "    if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )",
-                  "    {",
-                  "      discard;",
-                  "    }",
-                  "",
-                  "    mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );",
-                  "    mediump vec4 color = texture2D( sTexture, wrapTexCoord );",
-                  "    mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;",
-                  "",
-                  "    gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );",
-                  "  }"
-                ]
-              }
-            }
-          }
-        }
-      }
-    },
-    "FocusActor":
-    {
-      "visuals":
-      {
-        "image":
-        {
-          "url":"{APPLICATION_RESOURCE_PATH}/images/tile-focus.9.png"
-        }
-      }
-    },
-    "DemoTileBorder":
-    {
-      "visuals":
-      {
-        "image":
-        {
-          "url":"{APPLICATION_RESOURCE_PATH}/images/item-background.9.png" // TILE_BACKGROUND
-        }
-      }
-    },
-    "TextLabelRosemary":
-    {
-      "fontFamily":"Rosemary"
-    },
-    "TextLabel":
-    {
-      "fontStyle":{"weight":"normal"},
-      "pointSize":18
-    },
-    "LauncherLabel":
-    {
-      "pointSize":18
-    },
-
-    "ToolbarLabel":
-    {
-      "pointSize":18
-    },
-
-    "BuilderLabel":
-    {
-      "pointSize":13
-    },
-
-    "ScrollView":
-    {
-      "overshootEffectColor":"B018"
-    },
-
-    "ImageScalingGroupLabel":
-    {
-      "pointSize":9
-    },
-
-    "ImageScalingButton":
-    {
-      "label":{
-        "pointSize":11
-      }
+      "styles":[ "DemoTileBase" ]
     },
 
     "LauncherBackground":
         "units": "USER_SPACE",
         "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]]
       }
-    },
-//
-// Simple Visuals Application Style section
-//
-    "MyControl":
-    {
-      "states":
-      {
-        "NORMAL":
-        {
-          "visuals":
-          {
-            "iconVisual":
-            {
-              "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-13.png"
-            }
-          }
-        },
-        "FOCUSED":
-        {
-          "visuals":
-          {
-            "iconVisual":
-            {
-              "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-83.png"
-            }
-          }
-        }
-      }
     }
   }
 }
diff --git a/resources/style/examples-theme.json.in b/resources/style/examples-theme.json.in
new file mode 100644 (file)
index 0000000..054a3a9
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ *
+ */
+
+{
+  "includes":
+  [
+    "{APPLICATION_RESOURCE_PATH}/style/base-theme.json"
+  ],
+
+  "styles":
+  {
+    "DemoTile":
+    {
+      "styles": ["DemoTileBase"],
+      "states":
+      {
+        "NORMAL":
+        {
+          "color":[0.9, 0.4, 0.4, 0.6]
+        }
+      }
+    },
+
+    "LauncherBackground":
+    {
+      "background":
+      {
+        "visualType": "GRADIENT",
+        "center": [240, 400],
+        "radius": 932,
+        "units": "USER_SPACE",
+        "stopColor": [[0,0,0,1.0],[0.556863,0.054902,0,1.0]]
+      }
+    }
+  }
+}
diff --git a/resources/style/mobile/base-theme.json.in b/resources/style/mobile/base-theme.json.in
new file mode 100644 (file)
index 0000000..3a817c5
--- /dev/null
@@ -0,0 +1,194 @@
+/*
+ * 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.
+ *
+ */
+
+{
+  "styles":
+  {
+    "CustomPopupStyle":{
+      "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/popup.9.png",
+      "popupBackgroundBorder":[0,4,4,0],
+      "tailUpImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-up.png",
+      "tailDownImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-down.png",
+      "tailLeftImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-left.png",
+      "tailRightImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-right.png"
+    },
+
+    "DemoTileBase":
+    {
+      "states":
+      {
+        "NORMAL":
+        {
+          "color":[0.4, 0.6, 0.9, 0.6],
+          "visuals":
+          {
+            "image":
+            {
+              "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture.9.png",
+// TILE_BACKGROUND_ALPHA
+// This shader takes a texture.
+// An alpha discard is performed.
+// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
+              "shader":
+              {
+                "fragmentShader":[
+                  "  varying mediump vec2  vTexCoord;",
+                  "  uniform lowp    vec4  uColor;",
+                  "  uniform sampler2D     sTexture;",
+                  "  uniform mediump vec3  uCustomPosition;",
+                  "",
+                  "  void main()",
+                  "  {",
+                  "    if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )",
+                  "    {",
+                  "      discard;",
+                  "    }",
+                  "",
+                  "    mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );",
+                  "    mediump vec4 color = texture2D( sTexture, wrapTexCoord );",
+                  "    mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;",
+                  "",
+                  "    gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );",
+                  "  }"
+                ]
+              }
+            }
+          }
+        },
+        "FOCUSED":
+        {
+          "color":[0.3, 0.5, 0.8, 0.5],
+          "visuals":
+          {
+            "image":
+            {
+              "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture-focused.9.png",
+// TILE_BACKGROUND_ALPHA
+// This shader takes a texture.
+// An alpha discard is performed.
+// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
+              "shader":
+              {
+                "fragmentShader":[
+                  "  varying mediump vec2  vTexCoord;",
+                  "  uniform lowp    vec4  uColor;",
+                  "  uniform sampler2D     sTexture;",
+                  "  uniform mediump vec3  uCustomPosition;",
+                  "",
+                  "  void main()",
+                  "  {",
+                  "    if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )",
+                  "    {",
+                  "      discard;",
+                  "    }",
+                  "",
+                  "    mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );",
+                  "    mediump vec4 color = texture2D( sTexture, wrapTexCoord );",
+                  "    mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;",
+                  "",
+                  "    gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );",
+                  "  }"
+                ]
+              }
+            }
+          }
+        }
+      }
+    },
+    "FocusActor":
+    {
+      "visuals":
+      {
+        "image":
+        {
+          "url":"{APPLICATION_RESOURCE_PATH}/images/tile-focus.9.png"
+        }
+      }
+    },
+    "DemoTileBorder":
+    {
+      "visuals":
+      {
+        "image":
+        {
+          "url":"{APPLICATION_RESOURCE_PATH}/images/item-background.9.png" // TILE_BACKGROUND
+        }
+      }
+    },
+    "TextLabelRosemary":
+    {
+      "fontFamily":"Rosemary"
+    },
+    "TextLabel":
+    {
+      "fontStyle":{"weight":"normal"},
+      "pointSize":18
+    },
+    "TextLabelFontSize0":
+    {
+      "pointSize":8
+    },
+    "TextLabelFontSize1":
+    {
+      "pointSize":10
+    },
+    "TextLabelFontSize2":
+    {
+      "pointSize":15
+    },
+    "TextLabelFontSize3":
+    {
+      "pointSize":19
+    },
+    "TextLabelFontSize4":
+    {
+      "pointSize":25
+    },
+
+    "Launcherlabel":
+    {
+      "pointSize":8
+    },
+
+    "ToolbarLabel":
+    {
+      "pointSize":10
+    },
+
+    "BuilderLabel":
+    {
+      "pointSize":10
+    },
+
+    "ScrollView":
+    {
+      "overshootEffectColor":"B018"
+    },
+
+    "GroupLabel":
+    {
+      "pointSize":6
+    },
+
+    "ChangeLayoutButton":
+    {
+      "label":{
+        "pointSize":5
+      }
+    }
+  }
+}
index d050213..acf3c91 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2000-2016 Samsung Electronics Co., Ltd
-
+ * 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
  */
 
 {
+  "includes":
+  [
+    "{APPLICATION_RESOURCE_PATH}/style/base-theme.json"
+  ],
+
   "styles":
   {
-    "CustomPopupStyle":{
-      "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/popup.9.png",
-      "popupBackgroundBorder":[0,4,4,0],
-      "tailUpImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-up.png",
-      "tailDownImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-down.png",
-      "tailLeftImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-left.png",
-      "tailRightImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-right.png"
-    },
-
     "DemoTile":
     {
-      "states":
-      {
-        "NORMAL":
-        {
-          "color":[0.4, 0.6, 0.9, 0.6],
-          "visuals":
-          {
-            "image":
-            {
-              "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture.9.png",
-// TILE_BACKGROUND_ALPHA
-// This shader takes a texture.
-// An alpha discard is performed.
-// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
-              "shader":
-              {
-                "fragmentShader":[
-                  "  varying mediump vec2  vTexCoord;",
-                  "  uniform lowp    vec4  uColor;",
-                  "  uniform sampler2D     sTexture;",
-                  "  uniform mediump vec3  uCustomPosition;",
-                  "",
-                  "  void main()",
-                  "  {",
-                  "    if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )",
-                  "    {",
-                  "      discard;",
-                  "    }",
-                  "",
-                  "    mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );",
-                  "    mediump vec4 color = texture2D( sTexture, wrapTexCoord );",
-                  "    mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;",
-                  "",
-                  "    gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );",
-                  "  }"
-                ]
-              }
-            }
-          }
-        },
-        "FOCUSED":
-        {
-          "color":[0.3, 0.5, 0.8, 0.5],
-          "visuals":
-          {
-            "image":
-            {
-              "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture-focused.9.png",
-// TILE_BACKGROUND_ALPHA
-// This shader takes a texture.
-// An alpha discard is performed.
-// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
-              "shader":
-              {
-                "fragmentShader":[
-                  "  varying mediump vec2  vTexCoord;",
-                  "  uniform lowp    vec4  uColor;",
-                  "  uniform sampler2D     sTexture;",
-                  "  uniform mediump vec3  uCustomPosition;",
-                  "",
-                  "  void main()",
-                  "  {",
-                  "    if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )",
-                  "    {",
-                  "      discard;",
-                  "    }",
-                  "",
-                  "    mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );",
-                  "    mediump vec4 color = texture2D( sTexture, wrapTexCoord );",
-                  "    mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;",
-                  "",
-                  "    gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );",
-                  "  }"
-                ]
-              }
-            }
-          }
-        }
-      }
-    },
-    "FocusActor":
-    {
-      "visuals":
-      {
-        "image":
-        {
-          "url":"{APPLICATION_RESOURCE_PATH}/images/tile-focus.9.png"
-        }
-      }
-    },
-    "DemoTileBorder":
-    {
-      "visuals":
-      {
-        "image":
-        {
-          "url":"{APPLICATION_RESOURCE_PATH}/images/item-background.9.png" // TILE_BACKGROUND
-        }
-      }
-    },
-    "TextLabelRosemary":
-    {
-      "fontFamily":"Rosemary"
-    },
-    "TextLabel":
-    {
-      "fontStyle":{"weight":"normal"},
-      "pointSize":18
-    },
-    "TextLabelFontSize0":
-    {
-      "pointSize":8
-    },
-    "TextLabelFontSize1":
-    {
-      "pointSize":10
-    },
-    "TextLabelFontSize2":
-    {
-      "pointSize":15
-    },
-    "TextLabelFontSize3":
-    {
-      "pointSize":19
-    },
-    "TextLabelFontSize4":
-    {
-      "pointSize":25
-    },
-
-    "Launcherlabel":
-    {
-      "pointSize":8
-    },
-
-    "ToolbarLabel":
-    {
-      "pointSize":10
-    },
-
-    "BuilderLabel":
-    {
-      "pointSize":10
-    },
-
-    "ScrollView":
-    {
-      "overshootEffectColor":"B018"
-    },
-
-    "GroupLabel":
-    {
-      "pointSize":6
+      "styles":[ "DemoTileBase" ]
     },
 
     "LauncherBackground":
         "units": "USER_SPACE",
         "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]]
       }
-    },
-
-    "ChangeLayoutButton":
-    {
-      "label":{
-        "pointSize":5
-      }
     }
   }
 }
diff --git a/resources/style/mobile/examples-theme.json.in b/resources/style/mobile/examples-theme.json.in
new file mode 100644 (file)
index 0000000..591b5b2
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ *
+ */
+
+{
+  "includes":
+  [
+    "{APPLICATION_RESOURCE_PATH}/style/base-theme.json"
+  ],
+
+  "styles":
+  {
+    "DemoTile":
+    {
+      "styles": ["DemoTileBase"],
+      "states":
+      {
+        "NORMAL":
+        {
+          "color":[0.9, 0.4, 0.4, 0.6]
+        }
+      }
+    },
+
+    "LauncherBackground":
+    {
+      "background":
+      {
+        "visualType": "GRADIENT",
+        "center": [360, 640],
+        "radius": 1468,
+        "units": "USER_SPACE",
+        "stopColor": [[0,0,0,1.0],[0.556863,0.054902,0,1.0]]
+      }
+    }
+  }
+}
diff --git a/resources/style/mobile/tests-theme.json.in b/resources/style/mobile/tests-theme.json.in
new file mode 100644 (file)
index 0000000..078a049
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ *
+ */
+
+{
+  "includes":
+  [
+    "{APPLICATION_RESOURCE_PATH}/style/base-theme.json"
+  ],
+
+  "styles":
+  {
+    "DemoTile":
+    {
+      "styles": ["DemoTileBase"],
+      "states":
+      {
+        "NORMAL":
+        {
+          "color":[0.6, 0.4, 0.9, 0.6]
+        }
+      }
+    },
+
+    "LauncherBackground":
+    {
+      "background":
+      {
+        "visualType": "GRADIENT",
+        "center": [360, 640],
+        "radius": 1468,
+        "units": "USER_SPACE",
+        "stopColor": [[0.392157,0.254902,0.647059,1.0],[0.164706,0.0313725,0.270588,1.0]]
+      }
+    }
+  }
+}
diff --git a/resources/style/tests-theme.json.in b/resources/style/tests-theme.json.in
new file mode 100644 (file)
index 0000000..c8111c8
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ *
+ */
+
+{
+  "includes":
+  [
+    "{APPLICATION_RESOURCE_PATH}/style/base-theme.json"
+  ],
+
+  "styles":
+  {
+    "DemoTile":
+    {
+      "styles": ["DemoTileBase"],
+      "states":
+      {
+        "NORMAL":
+        {
+          "color":[0.6, 0.4, 0.9, 0.6]
+        }
+      }
+    },
+
+    "LauncherBackground":
+    {
+      "background":
+      {
+        "visualType": "GRADIENT",
+        "center": [240, 400],
+        "radius": 932,
+        "units": "USER_SPACE",
+        "stopColor": [[0.392157,0.254902,0.647059,1.0],[0.164706,0.0313725,0.270588,1.0]]
+      }
+    }
+  }
+}
index 6f28cae..de20ab1 100644 (file)
@@ -87,16 +87,10 @@ const char * const SHAPE_IMAGE_TABLE[] =
 const int NUMBER_OF_SHAPE_IMAGES( sizeof( SHAPE_IMAGE_TABLE ) / sizeof( SHAPE_IMAGE_TABLE[0] ) );
 
 const int NUM_BACKGROUND_IMAGES = 18;
-const float BACKGROUND_SWIPE_SCALE = 0.025f;
 const float BACKGROUND_SPREAD_SCALE = 1.5f;
-const float SCALE_MOD = 1000.0f * Math::PI * 2.0f;
-const float SCALE_SPEED = 10.0f;
-const float SCALE_SPEED_SIN = 0.1f;
 
 const unsigned int BACKGROUND_ANIMATION_DURATION = 15000; // 15 secs
 
-const Vector4 BACKGROUND_COLOR( 0.3569f, 0.5451f, 0.7294f, 1.0f );
-
 const float BUBBLE_MIN_Z = -1.0;
 const float BUBBLE_MAX_Z = 0.0f;
 
index 8300496..0b7d19a 100644 (file)
@@ -31,7 +31,7 @@ int DALI_EXPORT_API main(int argc, char **argv)
   textdomain(DALI_DEMO_DOMAIN_LOCAL);
   setlocale(LC_ALL, DEMO_LANG);
 
-  Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
+  Application app = Application::New( &argc, &argv, DEMO_STYLE_DIR "/tests-theme.json" );
 
   // Create the demo launcher
   DaliTableView demo(app);