From f64ea9462f978d1c2566ed9e76ca3999dc32acdf Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Thu, 23 May 2024 17:20:41 +0100 Subject: [PATCH] (Android) Ensure fonts are correct size on target Change-Id: Ie907754ab346dd63b534c9de595a63ef6dfafef8 --- build/android/dali/build_toolkit.sh | 2 +- build/tizen/CMakeLists.txt | 24 +++---- resources/style/android/demo-theme.json | 64 +++++++++++++++++++ resources/style/android/examples-theme.json | 71 +++++++++++++++++++++ resources/style/android/tests-theme.json | 70 ++++++++++++++++++++ 5 files changed, 218 insertions(+), 13 deletions(-) create mode 100644 resources/style/android/demo-theme.json create mode 100644 resources/style/android/examples-theme.json create mode 100644 resources/style/android/tests-theme.json diff --git a/build/android/dali/build_toolkit.sh b/build/android/dali/build_toolkit.sh index 9d556389..87de7b34 100755 --- a/build/android/dali/build_toolkit.sh +++ b/build/android/dali/build_toolkit.sh @@ -27,7 +27,7 @@ else export DALI_DATA_RO_INSTALL_DIR=${PREFIX}/files export DALI_DATA_RW_INSTALL_DIR=${PREFIX}/files - ${ANDROID_SDK}/cmake/3.22.1/bin/cmake ${DALI_DIR}/dali-toolkit/build/tizen -DCMAKE_C_COMPILER=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -DCMAKE_CXX_COMPILER=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=${ANDROID_PLATFORM} -DANDROID_ABI=${ANDROID_ABI} -DANDROID_NDK=${ANDROID_NDK} -DANDROID_STL=c++_shared -DCMAKE_CXX_FLAGS='-fexceptions -frtti -w -Wall -std=c++17' -DINCLUDE_DIR=${PREFIX}/include -DLIB_DIR=${PREFIX}/lib/${ANDROID_ABI} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DENABLE_TRACE=${ENABLE_TRACE} -DWITH_STYLE='720x1280' -DANDROID_HOST_COMPILER="$CXX" + ${ANDROID_SDK}/cmake/3.22.1/bin/cmake ${DALI_DIR}/dali-toolkit/build/tizen -DCMAKE_C_COMPILER=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -DCMAKE_CXX_COMPILER=${ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=${ANDROID_PLATFORM} -DANDROID_ABI=${ANDROID_ABI} -DANDROID_NDK=${ANDROID_NDK} -DANDROID_STL=c++_shared -DCMAKE_CXX_FLAGS='-fexceptions -frtti -w -Wall -std=c++17' -DINCLUDE_DIR=${PREFIX}/include -DLIB_DIR=${PREFIX}/lib/${ANDROID_ABI} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DENABLE_TRACE=${ENABLE_TRACE} -DWITH_STYLE='2048x1080' -DANDROID_HOST_COMPILER="$CXX" fi make -j8 || exit 1 diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index 68e3ca25..55cca356 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -195,19 +195,19 @@ ENDIF() #Create resources location file CONFIGURE_FILE( resources-location.in ${DEMO_SHARED}/resources-location.cpp ) -MESSAGE("Installing from: ${LOCAL_STYLE_DIR}") -FILE(GLOB LOCAL_STYLES_LIST "${LOCAL_STYLE_DIR}/*.json") -FOREACH(flag ${LOCAL_STYLES_LIST}) - INSTALL(FILES ${flag} DESTINATION ${STYLE_DIR}) -ENDFOREACH(flag) -MESSAGE("Installed ${LOCAL_STYLES_LIST} to ${STYLE_DIR}") - IF(ANDROID) -FILE(GLOB LOCAL_STYLES_ANDROID_LIST "${LOCAL_STYLE_ANDROID_DIR}/*.json") -FOREACH(flag ${LOCAL_STYLES_ANDROID_LIST}) - INSTALL(FILES ${flag} DESTINATION ${STYLE_DIR}) -ENDFOREACH(flag) -MESSAGE("Installed ${LOCAL_STYLES_ANDROID_LIST} to ${STYLE_DIR}") + FILE(GLOB LOCAL_STYLES_ANDROID_LIST "${LOCAL_STYLE_ANDROID_DIR}/*.json") + FOREACH(flag ${LOCAL_STYLES_ANDROID_LIST}) + INSTALL(FILES ${flag} DESTINATION ${STYLE_DIR}) + ENDFOREACH(flag) + MESSAGE("Installed ${LOCAL_STYLES_ANDROID_LIST} to ${STYLE_DIR}") +ELSE() + MESSAGE("Installing from: ${LOCAL_STYLE_DIR}") + FILE(GLOB LOCAL_STYLES_LIST "${LOCAL_STYLE_DIR}/*.json") + FOREACH(flag ${LOCAL_STYLES_LIST}) + INSTALL(FILES ${flag} DESTINATION ${STYLE_DIR}) + ENDFOREACH(flag) + MESSAGE("Installed ${LOCAL_STYLES_LIST} to ${STYLE_DIR}") ENDIF() FILE(GLOB LOCAL_STYLE_IMAGES_LIST "${LOCAL_STYLE_DIR}/images/*.png") diff --git a/resources/style/android/demo-theme.json b/resources/style/android/demo-theme.json new file mode 100644 index 00000000..335b0577 --- /dev/null +++ b/resources/style/android/demo-theme.json @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024 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" ] + }, + + "LauncherBackground": + { + "background": + { + "visualType": "GRADIENT", + "center": [240, 400], + "radius": 932, + "units": "USER_SPACE", + "stopColor": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]] + } + }, + + "BubbleColor1": + { + "color": [ 0.3255, 0.3412, 0.6353, 0.32 ] + }, + + "BubbleColor2": + { + "color": [ 0.3647, 0.7569, 0.8157, 0.32 ] + }, + + "BubbleColor3": + { + "color": [ 0.3804, 0.7412, 0.6510, 0.32 ] + }, + + "BubbleColor4": + { + "color": [ 1, 1, 1, 0.13 ] + } + + } +} diff --git a/resources/style/android/examples-theme.json b/resources/style/android/examples-theme.json new file mode 100644 index 00000000..bb30bc5b --- /dev/null +++ b/resources/style/android/examples-theme.json @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2024 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]] + } + }, + + "BubbleColor1": + { + "color": [ 0.8255, 0.2412, 0.1353, 0.32 ] + }, + + "BubbleColor2": + { + "color": [ 0.8647, 0.4569, 0.3157, 0.32 ] + }, + + "BubbleColor3": + { + "color": [ 0.9804, 0.5412, 0.5510, 0.32 ] + }, + + "BubbleColor4": + { + "color": [ 1, 0, 0, 0.13 ] + } + + } +} diff --git a/resources/style/android/tests-theme.json b/resources/style/android/tests-theme.json new file mode 100644 index 00000000..44db03e8 --- /dev/null +++ b/resources/style/android/tests-theme.json @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2024 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]] + } + }, + + "BubbleColor1": + { + "color": [ 0.8255, 0.2412, 0.9353, 0.32 ] + }, + + "BubbleColor2": + { + "color": [ 0.8647, 0.4569, 0.8157, 0.32 ] + }, + + "BubbleColor3": + { + "color": [ 0.9804, 0.5412, 0.9510, 0.32 ] + }, + + "BubbleColor4": + { + "color": [ 1, 1, 1, 0.13 ] + } + + } +} -- 2.34.1