From 00f02c1c10c41fdb8727d0673f5ae60cc127b042 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Mon, 23 Sep 2019 16:12:30 +0100 Subject: [PATCH] Change background colors of the launcher - Also removed ununsed consts from dali-table-view - Also removed unused js file from scripts directory Change-Id: Ibb0c0d087ad19943518ce223feb1652f2e7de4e3 --- build/tizen/CMakeLists.txt | 3 + examples-reel/dali-examples-reel.cpp | 2 +- resources/scripts/simple-image-wall.js.in | 76 ------- resources/style/.gitignore | 3 + resources/style/base-theme.json.in | 206 ++++++++++++++++++ resources/style/demo-theme.json.in | 190 +--------------- resources/style/examples-theme.json.in | 50 +++++ resources/style/mobile/base-theme.json.in | 194 +++++++++++++++++ resources/style/mobile/demo-theme.json.in | 179 +-------------- resources/style/mobile/examples-theme.json.in | 50 +++++ resources/style/mobile/tests-theme.json.in | 49 +++++ resources/style/tests-theme.json.in | 49 +++++ shared/dali-table-view.cpp | 6 - tests-reel/dali-tests-reel.cpp | 2 +- 14 files changed, 622 insertions(+), 437 deletions(-) delete mode 100644 resources/scripts/simple-image-wall.js.in create mode 100644 resources/style/base-theme.json.in create mode 100644 resources/style/examples-theme.json.in create mode 100644 resources/style/mobile/base-theme.json.in create mode 100644 resources/style/mobile/examples-theme.json.in create mode 100644 resources/style/mobile/tests-theme.json.in create mode 100644 resources/style/tests-theme.json.in diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index 08f1a790..a98071e9 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -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 ) diff --git a/examples-reel/dali-examples-reel.cpp b/examples-reel/dali-examples-reel.cpp index cc401a92..a1358a81 100644 --- a/examples-reel/dali-examples-reel.cpp +++ b/examples-reel/dali-examples-reel.cpp @@ -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 index 36aba3fc..00000000 --- a/resources/scripts/simple-image-wall.js.in +++ /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(); diff --git a/resources/style/.gitignore b/resources/style/.gitignore index 74584685..5582fe85 100644 --- a/resources/style/.gitignore +++ b/resources/style/.gitignore @@ -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 index 00000000..12404e94 --- /dev/null +++ b/resources/style/base-theme.json.in @@ -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" + } + } + } + } + } + } +} diff --git a/resources/style/demo-theme.json.in b/resources/style/demo-theme.json.in index 62d717aa..1c2dc278 100644 --- a/resources/style/demo-theme.json.in +++ b/resources/style/demo-theme.json.in @@ -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 @@ -15,162 +16,16 @@ */ { + "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": @@ -183,35 +38,6 @@ "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 index 00000000..054a3a9f --- /dev/null +++ b/resources/style/examples-theme.json.in @@ -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 index 00000000..3a817c5c --- /dev/null +++ b/resources/style/mobile/base-theme.json.in @@ -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 + } + } + } +} diff --git a/resources/style/mobile/demo-theme.json.in b/resources/style/mobile/demo-theme.json.in index d050213b..acf3c919 100644 --- a/resources/style/mobile/demo-theme.json.in +++ b/resources/style/mobile/demo-theme.json.in @@ -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 @@ -16,172 +16,16 @@ */ { + "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": @@ -194,13 +38,6 @@ "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 index 00000000..591b5b26 --- /dev/null +++ b/resources/style/mobile/examples-theme.json.in @@ -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 index 00000000..078a049e --- /dev/null +++ b/resources/style/mobile/tests-theme.json.in @@ -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 index 00000000..c8111c82 --- /dev/null +++ b/resources/style/tests-theme.json.in @@ -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]] + } + } + } +} diff --git a/shared/dali-table-view.cpp b/shared/dali-table-view.cpp index 6f28caee..de20ab1f 100644 --- a/shared/dali-table-view.cpp +++ b/shared/dali-table-view.cpp @@ -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; diff --git a/tests-reel/dali-tests-reel.cpp b/tests-reel/dali-tests-reel.cpp index 8300496c..0b7d19ab 100644 --- a/tests-reel/dali-tests-reel.cpp +++ b/tests-reel/dali-tests-reel.cpp @@ -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); -- 2.34.1