Commit d2faadf5269d5ffa65175b35266af3bc7be3ece9
1 parent
eccc3986
Add Android DALi demo build.
Generates DALi examples shared objects and Android DALi launcher application. Android DALi application apk then can be installed on supported Android device. Change-Id: I2f87030feab33aa5c4c944323eb0ca0c042db6bd
Showing
80 changed files
with
2562 additions
and
50 deletions
README.md
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | |
| 20 | 20 | ### Requirements |
| 21 | 21 | |
| 22 | - - Ubuntu 14.04 or later | |
| 22 | + - Ubuntu 16.04 or later | |
| 23 | 23 | - Environment created using dali_env script in dali-core repository |
| 24 | 24 | - GCC version 6 |
| 25 | 25 | |
| ... | ... | @@ -71,3 +71,34 @@ Before running make install as normal: |
| 71 | 71 | - Add all source files for the required example in this directory. |
| 72 | 72 | - Modify "com.samsung.dali-demo.xml" to include your example so that it can be launched on target. |
| 73 | 73 | - No changes are required to the make system as long as the above is followed, your example will be automatically built & installed. |
| 74 | + | |
| 75 | +## 3. Building for Android | |
| 76 | + | |
| 77 | +### Requirements | |
| 78 | + | |
| 79 | + - Ubuntu 16.04 or later | |
| 80 | + - GCC version 6 | |
| 81 | + | |
| 82 | +### Building the Repository | |
| 83 | + | |
| 84 | +To build the repository enter the 'build/android' folder: | |
| 85 | + | |
| 86 | + $ cd dali-demo/build/android | |
| 87 | + | |
| 88 | +Then run the following command: | |
| 89 | + | |
| 90 | + $ ./build.sh | |
| 91 | + | |
| 92 | +For debug build: | |
| 93 | + | |
| 94 | + $ DEBUG=1 ./build.sh | |
| 95 | + | |
| 96 | +To clean the build: | |
| 97 | + | |
| 98 | + $ ./build.sh clean | |
| 99 | + | |
| 100 | +To install apks: | |
| 101 | + | |
| 102 | + $ adb install -r ./app/build/outputs/apk/debug/dali-demo-debug.apk | |
| 103 | + $ adb install -r ./app/build/outputs/apk/release/dali-demo-release.apk | |
| 104 | + | ... | ... |
build/android/.gitignore
0 → 100644
build/android/app/.gitignore
0 → 100644
| 1 | +.cxx | ... | ... |
build/android/app/build.gradle
0 → 100644
| 1 | +apply plugin: 'com.android.application' | |
| 2 | + | |
| 3 | +def buildType = "debug" | |
| 4 | +def androidABI = System.getenv('TARGET') | |
| 5 | +def daliDir = System.getenv('DALI_DIR') | |
| 6 | +def daliEnvDir = System.getenv('DALI_ENV_DIR') | |
| 7 | +def daliEnvLibDir = daliEnvDir + '/lib' | |
| 8 | +def daliEnvFilesDir = daliEnvDir + '/files' | |
| 9 | + | |
| 10 | +android { | |
| 11 | + signingConfigs { | |
| 12 | + config { | |
| 13 | + storeFile file("../key.jks") | |
| 14 | + storePassword "Samsung" | |
| 15 | + keyAlias "key0" | |
| 16 | + keyPassword "Samsung" | |
| 17 | + } | |
| 18 | + } | |
| 19 | + compileSdkVersion 28 | |
| 20 | + defaultConfig { | |
| 21 | + applicationId = 'com.sec.dalidemo' | |
| 22 | + minSdkVersion 26 | |
| 23 | + targetSdkVersion 26 | |
| 24 | + versionCode 1 | |
| 25 | + versionName "1.0" | |
| 26 | + externalNativeBuild { | |
| 27 | + cmake { | |
| 28 | + cppFlags "-fexceptions -frtti -w -Wall -std=gnu++11" | |
| 29 | + arguments '-DANDROID_STL=c++_shared' | |
| 30 | + } | |
| 31 | + } | |
| 32 | + } | |
| 33 | + project.archivesBaseName = 'dali-demo' | |
| 34 | + aaptOptions { | |
| 35 | + noCompress '' | |
| 36 | + } | |
| 37 | + buildTypes { | |
| 38 | + debug { | |
| 39 | + ndk { | |
| 40 | + abiFilters androidABI | |
| 41 | + } | |
| 42 | + buildType = "debug" | |
| 43 | + } | |
| 44 | + release { | |
| 45 | + minifyEnabled false | |
| 46 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), | |
| 47 | + 'proguard-rules.pro' | |
| 48 | + ndk { | |
| 49 | + abiFilters androidABI | |
| 50 | + } | |
| 51 | + | |
| 52 | + signingConfig signingConfigs.config | |
| 53 | + buildType = "release" | |
| 54 | + } | |
| 55 | + } | |
| 56 | + packagingOptions { | |
| 57 | + if( androidABI == "arm64-v8a" ) | |
| 58 | + { | |
| 59 | + pickFirst 'lib/arm64-v8a/libc++_shared.so' | |
| 60 | + pickFirst 'lib/arm64-v8a/libdaliview.so' | |
| 61 | + } | |
| 62 | + else | |
| 63 | + { | |
| 64 | + pickFirst 'lib/armeabi-v7a/libc++_shared.so' | |
| 65 | + pickFirst 'lib/armeabi-v7a/libdaliview.so' | |
| 66 | + } | |
| 67 | + } | |
| 68 | + sourceSets { | |
| 69 | + main { | |
| 70 | + jniLibs.srcDirs += daliEnvLibDir | |
| 71 | + assets.srcDirs += daliEnvFilesDir | |
| 72 | + } | |
| 73 | + } | |
| 74 | + lintOptions { | |
| 75 | + checkReleaseBuilds false | |
| 76 | + } | |
| 77 | + externalNativeBuild { | |
| 78 | + cmake { | |
| 79 | + version '3.10.2' | |
| 80 | + path 'src/main/cpp/CMakeLists.txt' | |
| 81 | + } | |
| 82 | + } | |
| 83 | + compileOptions { | |
| 84 | + targetCompatibility = 1.6 | |
| 85 | + sourceCompatibility = 1.6 | |
| 86 | + } | |
| 87 | +} | |
| 88 | + | |
| 89 | +dependencies { | |
| 90 | + implementation fileTree(include: ['*.jar'], dir: 'libs') | |
| 91 | + implementation 'androidx.appcompat:appcompat:1.1.0' | |
| 92 | + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' | |
| 93 | +} | |
| 94 | + | |
| 95 | +task buildDaliDependencies(type:Exec) { | |
| 96 | + environment "PREFIX", daliEnvDir | |
| 97 | + environment "ANDROID_ABI", androidABI | |
| 98 | + environment "ANDROID_PLATFORM", "26" | |
| 99 | + if (buildType == 'debug') | |
| 100 | + environment "DEBUG", "1" | |
| 101 | + workingDir file(daliDir + '/android-dependencies/cmake').getAbsolutePath() | |
| 102 | + commandLine 'sh', './buildall.sh' | |
| 103 | +} | |
| 104 | + | |
| 105 | +task buildDali(type:Exec) { | |
| 106 | + workingDir "../dali" | |
| 107 | + if (buildType == 'debug') | |
| 108 | + environment "DEBUG", "1" | |
| 109 | + commandLine 'sh', './build.sh' | |
| 110 | +} | |
| 111 | + | |
| 112 | +task cleanDali(type:Exec) { | |
| 113 | + workingDir "../dali" | |
| 114 | + commandLine 'sh', './build.sh', 'clean' | |
| 115 | +} | |
| 116 | + | |
| 117 | +buildDali.dependsOn buildDaliDependencies | |
| 118 | +preBuild.dependsOn buildDali | |
| 119 | + | |
| 120 | +clean.dependsOn cleanDali | ... | ... |
build/android/app/src/main/AndroidManifest.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<!-- BEGIN_INCLUDE(manifest) --> | |
| 3 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| 4 | + package="com.sec.dalidemo" | |
| 5 | + android:versionCode="1" | |
| 6 | + android:versionName="1.0"> | |
| 7 | + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> | |
| 8 | + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | |
| 9 | + | |
| 10 | + <application | |
| 11 | + android:allowBackup="false" | |
| 12 | + android:fullBackupContent="false" | |
| 13 | + android:icon="@mipmap/dali_launcher" | |
| 14 | + android:label="@string/app_name" | |
| 15 | + android:name="com.sec.dalidemo.DaliDemoApplication"> | |
| 16 | + | |
| 17 | + <!-- Our activity is the built-in NativeActivity framework class. | |
| 18 | + This will take care of integrating with our NDK code. --> | |
| 19 | + <activity android:name="com.sec.dalidemo.DaliDemoNativeActivity" | |
| 20 | + android:icon="@mipmap/dali_launcher" | |
| 21 | + android:label="@string/demo_name" | |
| 22 | + android:screenOrientation="portrait" | |
| 23 | + android:windowSoftInputMode="stateAlwaysVisible"> | |
| 24 | + <!-- Tell NativeActivity the name of our .so --> | |
| 25 | + <meta-data android:name="android.app.lib_name" | |
| 26 | + android:value="native-activity" /> | |
| 27 | + <meta-data android:name="start" | |
| 28 | + android:value="dali-demo" /> | |
| 29 | + <intent-filter> | |
| 30 | + <action android:name="android.intent.action.MAIN" /> | |
| 31 | + <category android:name="android.intent.category.LAUNCHER" /> | |
| 32 | + </intent-filter> | |
| 33 | + </activity> | |
| 34 | + | |
| 35 | + <activity | |
| 36 | + android:name="com.sec.dalidemo.DaliExamplesNativeActivity" | |
| 37 | + android:icon="@mipmap/dali_examples" | |
| 38 | + android:label="@string/examples_name" | |
| 39 | + android:screenOrientation="portrait" | |
| 40 | + android:windowSoftInputMode="stateAlwaysVisible"> | |
| 41 | + <!-- Tell NativeActivity the name of our .so --> | |
| 42 | + <meta-data android:name="android.app.lib_name" | |
| 43 | + android:value="native-activity" /> | |
| 44 | + <meta-data android:name="start" | |
| 45 | + android:value="dali-examples" /> | |
| 46 | + <intent-filter> | |
| 47 | + <action android:name="android.intent.action.MAIN" /> | |
| 48 | + <category android:name="android.intent.category.LAUNCHER" /> | |
| 49 | + </intent-filter> | |
| 50 | + </activity> | |
| 51 | + | |
| 52 | + <activity | |
| 53 | + android:name="com.sec.dalidemo.DaliTestsNativeActivity" | |
| 54 | + android:icon="@mipmap/dali_tests" | |
| 55 | + android:label="@string/tests_name" | |
| 56 | + android:screenOrientation="portrait" | |
| 57 | + android:windowSoftInputMode="stateAlwaysVisible"> | |
| 58 | + <!-- Tell NativeActivity the name of our .so --> | |
| 59 | + <meta-data android:name="android.app.lib_name" | |
| 60 | + android:value="native-activity" /> | |
| 61 | + <meta-data android:name="start" | |
| 62 | + android:value="dali-tests" /> | |
| 63 | + <intent-filter> | |
| 64 | + <action android:name="android.intent.action.MAIN" /> | |
| 65 | + <category android:name="android.intent.category.LAUNCHER" /> | |
| 66 | + </intent-filter> | |
| 67 | + </activity> | |
| 68 | + | |
| 69 | + </application> | |
| 70 | + | |
| 71 | +</manifest> | |
| 72 | +<!-- END_INCLUDE(manifest) --> | ... | ... |
build/android/app/src/main/cpp/CMakeLists.txt
0 → 100644
| 1 | +CMAKE_MINIMUM_REQUIRED(VERSION 3.4.1) | |
| 2 | + | |
| 3 | +SET(DALI_ENV_DIR $ENV{DALI_ENV_DIR}) | |
| 4 | +SET(ENV{PKG_CONFIG_PATH} "${DALI_ENV_DIR}/lib/${ANDROID_ABI}/pkgconfig:$ENV{PKG_CONFIG_PATH}") | |
| 5 | +FIND_PACKAGE(PkgConfig REQUIRED) | |
| 6 | + | |
| 7 | +SET(ANDROID_SDK $ENV{ANDROID_SDK}) | |
| 8 | +SET(ANDROID_NDK $ENV{ANDROID_NDK}) | |
| 9 | + | |
| 10 | +# build native_app_glue as a static lib | |
| 11 | +ADD_LIBRARY(native_app_glue STATIC | |
| 12 | + ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c) | |
| 13 | + | |
| 14 | +# now build app's shared lib | |
| 15 | +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -frtti -w -Wall -std=gnu++11") | |
| 16 | + | |
| 17 | +# Export ANativeActivity_onCreate(), | |
| 18 | +# Refer to: https://github.com/android-ndk/ndk/issues/381. | |
| 19 | +SET(CMAKE_SHARED_LINKER_FLAGS | |
| 20 | + "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate") | |
| 21 | + | |
| 22 | +ADD_LIBRARY(native-activity SHARED main.cpp) | |
| 23 | + | |
| 24 | +TARGET_INCLUDE_DIRECTORIES(native-activity PRIVATE | |
| 25 | + ${ANDROID_NDK}/sources/android/native_app_glue) | |
| 26 | + | |
| 27 | +INCLUDE_DIRECTORIES(${DALI_ENV_DIR}/include) | |
| 28 | +INCLUDE_DIRECTORIES(${DALI_ENV_DIR}/include/dali) | |
| 29 | + | |
| 30 | +IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug") | |
| 31 | + SET(ENABLE_TRACE ON) | |
| 32 | +ELSE() | |
| 33 | + SET(ENABLE_TRACE OFF) | |
| 34 | +ENDIF() | |
| 35 | + | |
| 36 | +IF(EXISTS "${DALI_ENV_DIR}") | |
| 37 | + PKG_CHECK_MODULES(DALI_CORE dali-core REQUIRED NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH) | |
| 38 | + PKG_CHECK_MODULES(DALI_ADAPTOR dali-adaptor REQUIRED NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH) | |
| 39 | + PKG_CHECK_MODULES(DALI_TOOLKIT dali-toolkit REQUIRED NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH) | |
| 40 | +ELSE() | |
| 41 | + MESSAGE(WARNING "${DALI_ENV_DIR} not found!") | |
| 42 | +ENDIF() | |
| 43 | + | |
| 44 | +# add lib dependencies | |
| 45 | +TARGET_LINK_LIBRARIES(native-activity | |
| 46 | + ${DALI_TOOLKIT_LDFLAGS} | |
| 47 | + ${DALI_ADAPTOR_LDFLAGS} | |
| 48 | + ${DALI_CORE_LDFLAGS} | |
| 49 | + native_app_glue | |
| 50 | + z | |
| 51 | + android | |
| 52 | + log | |
| 53 | + EGL | |
| 54 | + GLESv3) | ... | ... |
build/android/app/src/main/cpp/main.cpp
0 → 100644
| 1 | +/* | |
| 2 | + * Copyright (c) 2020 Samsung Electronics Co., Ltd. | |
| 3 | + * | |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | + * you may not use this file except in compliance with the License. | |
| 6 | + * You may obtain a copy of the License at | |
| 7 | + * | |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | + * | |
| 10 | + * Unless required by applicable law or agreed to in writing, software | |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing permissions and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + */ | |
| 17 | + | |
| 18 | +// EXTERNAL INCLUDES | |
| 19 | +#include <sys/types.h> | |
| 20 | +#include <sys/stat.h> | |
| 21 | +#include <unistd.h> | |
| 22 | + | |
| 23 | +#include <android/log.h> | |
| 24 | +#include <android_native_app_glue.h> | |
| 25 | +#include <dali/devel-api/adaptor-framework/application-devel.h> | |
| 26 | +#include <dali/integration-api/debug.h> | |
| 27 | +#include <dali/integration-api/adaptor-framework/android/android-framework.h> | |
| 28 | +#include <dlfcn.h> | |
| 29 | + | |
| 30 | +// from android_native_app_glue.c | |
| 31 | +#ifndef NDEBUG | |
| 32 | +#define LOGV(...) ((void)__android_log_print(ANDROID_LOG_VERBOSE, "dalidemo", __VA_ARGS__)) | |
| 33 | +#else | |
| 34 | +#define LOGV(...) ((void)0) | |
| 35 | +#endif | |
| 36 | + | |
| 37 | +namespace | |
| 38 | +{ | |
| 39 | + | |
| 40 | +void free_saved_state(struct android_app *android_app) | |
| 41 | +{ | |
| 42 | + pthread_mutex_lock(&android_app->mutex); | |
| 43 | + | |
| 44 | + if (android_app->savedState != NULL) | |
| 45 | + { | |
| 46 | + free(android_app->savedState); | |
| 47 | + android_app->savedState = NULL; | |
| 48 | + android_app->savedStateSize = 0; | |
| 49 | + } | |
| 50 | + | |
| 51 | + pthread_mutex_unlock(&android_app->mutex); | |
| 52 | +} | |
| 53 | + | |
| 54 | +void android_app_destroy(struct android_app *android_app) | |
| 55 | +{ | |
| 56 | + LOGV("android_app_destroy"); | |
| 57 | + free_saved_state(android_app); | |
| 58 | + pthread_mutex_lock(&android_app->mutex); | |
| 59 | + | |
| 60 | + if (android_app->inputQueue != NULL) | |
| 61 | + { | |
| 62 | + AInputQueue_detachLooper(android_app->inputQueue); | |
| 63 | + } | |
| 64 | + | |
| 65 | + AConfiguration_delete(android_app->config); | |
| 66 | + android_app->destroyed = 1; | |
| 67 | + | |
| 68 | + pthread_cond_broadcast(&android_app->cond); | |
| 69 | + pthread_mutex_unlock(&android_app->mutex); | |
| 70 | + | |
| 71 | + // Can't touch android_app object after this. | |
| 72 | +} | |
| 73 | + | |
| 74 | +} | |
| 75 | + | |
| 76 | +void ExtractAsset(struct android_app* state, const std::string& assetPath, const std::string& filePath) | |
| 77 | +{ | |
| 78 | + AAsset* asset = AAssetManager_open(state->activity->assetManager, assetPath.c_str(), AASSET_MODE_BUFFER); | |
| 79 | + if (asset) | |
| 80 | + { | |
| 81 | + size_t length = AAsset_getLength(asset) + 1; | |
| 82 | + | |
| 83 | + char* buffer = new char[length]; | |
| 84 | + length = AAsset_read(asset, buffer, length); | |
| 85 | + | |
| 86 | + FILE* file = fopen(filePath.c_str(), "wb"); | |
| 87 | + if (file) | |
| 88 | + { | |
| 89 | + fwrite(buffer, 1, length, file); | |
| 90 | + fclose(file); | |
| 91 | + } | |
| 92 | + | |
| 93 | + delete[] buffer; | |
| 94 | + AAsset_close(asset); | |
| 95 | + } | |
| 96 | +} | |
| 97 | + | |
| 98 | +void ExtractAssets(struct android_app* state, const std::string& assetDirPath, const std::string& filesDirPath) | |
| 99 | +{ | |
| 100 | + AAssetDir* assetDir = AAssetManager_openDir(state->activity->assetManager, assetDirPath.c_str()); | |
| 101 | + if (assetDir) | |
| 102 | + { | |
| 103 | + if (mkdir(filesDirPath.c_str(), S_IRWXU) != -1) | |
| 104 | + { | |
| 105 | + const char *filename = NULL; | |
| 106 | + std::string assetPath = assetDirPath + "/"; | |
| 107 | + while ((filename = AAssetDir_getNextFileName(assetDir)) != NULL) | |
| 108 | + { | |
| 109 | + ExtractAsset(state, assetPath + filename, filesDirPath + "/" + filename); | |
| 110 | + } | |
| 111 | + } | |
| 112 | + | |
| 113 | + AAssetDir_close(assetDir); | |
| 114 | + } | |
| 115 | +} | |
| 116 | + | |
| 117 | +void ExtractFontConfig(struct android_app* state, std::string assetFontConfig, std::string fontsPath) | |
| 118 | +{ | |
| 119 | + AAsset* asset = AAssetManager_open(state->activity->assetManager, assetFontConfig.c_str(), AASSET_MODE_BUFFER); | |
| 120 | + if (asset) | |
| 121 | + { | |
| 122 | + size_t length = AAsset_getLength(asset) + 1; | |
| 123 | + | |
| 124 | + char* buffer = new char[length]; | |
| 125 | + length = AAsset_read(asset, buffer, length); | |
| 126 | + | |
| 127 | + std::string fontConfig = std::string(buffer, length); | |
| 128 | + int i = fontConfig.find("~"); | |
| 129 | + if (i != std::string::npos) | |
| 130 | + { | |
| 131 | + std::string filesDir = state->activity->internalDataPath; | |
| 132 | + fontConfig.replace(i, 1, filesDir); | |
| 133 | + } | |
| 134 | + | |
| 135 | + std::string fontsFontConfig = fontsPath; | |
| 136 | + FILE* file = fopen(fontsFontConfig.c_str(), "wb"); | |
| 137 | + if (file) | |
| 138 | + { | |
| 139 | + fwrite(fontConfig.c_str(), 1, fontConfig.size(), file); | |
| 140 | + fclose(file); | |
| 141 | + } | |
| 142 | + | |
| 143 | + delete[] buffer; | |
| 144 | + AAsset_close(asset); | |
| 145 | + } | |
| 146 | +} | |
| 147 | + | |
| 148 | +class DaliDemoNativeActivity | |
| 149 | +{ | |
| 150 | +public: | |
| 151 | + ANativeActivity* activity; | |
| 152 | + DaliDemoNativeActivity(ANativeActivity* activity) | |
| 153 | + : activity(activity) | |
| 154 | + { | |
| 155 | + } | |
| 156 | + | |
| 157 | + class NativeActivityJNI | |
| 158 | + { | |
| 159 | + public: | |
| 160 | + ANativeActivity* activity; | |
| 161 | + JNIEnv* env; | |
| 162 | + jclass clazz; | |
| 163 | + | |
| 164 | + NativeActivityJNI(ANativeActivity* activity) | |
| 165 | + : activity(activity) | |
| 166 | + { | |
| 167 | + activity->vm->AttachCurrentThread(&env, NULL); | |
| 168 | + clazz = env->GetObjectClass(activity->clazz); | |
| 169 | + } | |
| 170 | + | |
| 171 | + ~NativeActivityJNI() | |
| 172 | + { | |
| 173 | + activity->vm->DetachCurrentThread(); | |
| 174 | + } | |
| 175 | + | |
| 176 | + jstring toJString(const std::string& str) | |
| 177 | + { | |
| 178 | + return env->NewStringUTF(str.c_str()); | |
| 179 | + } | |
| 180 | + | |
| 181 | + std::string toString(jstring jstr) | |
| 182 | + { | |
| 183 | + std::string out; | |
| 184 | + if (jstr) | |
| 185 | + { | |
| 186 | + const char* utf = env->GetStringUTFChars(jstr, 0); | |
| 187 | + out = std::string(utf); | |
| 188 | + env->ReleaseStringUTFChars(jstr, utf); | |
| 189 | + } | |
| 190 | + | |
| 191 | + return out; | |
| 192 | + } | |
| 193 | + | |
| 194 | + std::string callStringMethod(const std::string& name, const std::string& arg) | |
| 195 | + { | |
| 196 | + jmethodID methodID = env->GetMethodID(clazz, name.c_str(), "(Ljava/lang/String;)Ljava/lang/String;"); | |
| 197 | + jstring jstr = (jstring)env->CallObjectMethod(activity->clazz, methodID, toJString(arg)); | |
| 198 | + return toString(jstr); | |
| 199 | + } | |
| 200 | + }; | |
| 201 | + | |
| 202 | + std::string getMetaData(const std::string& key) | |
| 203 | + { | |
| 204 | + NativeActivityJNI nativeActivityJNI(activity); | |
| 205 | + return nativeActivityJNI.callStringMethod("getMetaData", key); | |
| 206 | + } | |
| 207 | + | |
| 208 | + std::string getIntentStringExtra(const std::string& key) | |
| 209 | + { | |
| 210 | + NativeActivityJNI nativeActivityJNI(activity); | |
| 211 | + return nativeActivityJNI.callStringMethod("getIntentStringExtra", key); | |
| 212 | + } | |
| 213 | +}; | |
| 214 | + | |
| 215 | +extern "C" void FcConfigPathInit(const char* path, const char* file); | |
| 216 | + | |
| 217 | +void android_main( struct android_app* state ) | |
| 218 | +{ | |
| 219 | + std::string filesDir = state->activity->internalDataPath; | |
| 220 | + | |
| 221 | + std::string fontconfigPath = filesDir + "/fonts"; | |
| 222 | + setenv("FONTCONFIG_PATH", fontconfigPath.c_str(), 1); | |
| 223 | + | |
| 224 | + std::string fontconfigFile = fontconfigPath + "/fonts.conf"; | |
| 225 | + setenv("FONTCONFIG_FILE", fontconfigFile.c_str(), 1); | |
| 226 | + | |
| 227 | + struct stat st = { 0 }; | |
| 228 | + FcConfigPathInit( fontconfigPath.c_str(), fontconfigFile.c_str() ); | |
| 229 | + | |
| 230 | + if (stat(fontconfigPath.c_str(), &st) == -1) | |
| 231 | + { | |
| 232 | + mkdir(fontconfigPath.c_str(), S_IRWXU); | |
| 233 | + ExtractFontConfig(state, "fonts/fonts.conf", fontconfigPath + "/fonts.conf"); | |
| 234 | + ExtractFontConfig(state, "fonts/fonts.dtd", fontconfigPath + "/fonts.dtd" ); | |
| 235 | + ExtractFontConfig(state, "fonts/local.conf", fontconfigPath + "/local.conf"); | |
| 236 | + ExtractAssets(state, "fonts/dejavu", fontconfigPath + "/dejavu"); | |
| 237 | + ExtractAssets(state, "fonts/tizen", fontconfigPath + "/tizen"); | |
| 238 | + ExtractAssets(state, "fonts/bitmap", fontconfigPath + "/bitmap"); | |
| 239 | + } | |
| 240 | + | |
| 241 | + Dali::Integration::AndroidFramework::New(); | |
| 242 | + Dali::Integration::AndroidFramework::Get().SetNativeApplication( state ); | |
| 243 | + Dali::Integration::AndroidFramework::Get().SetApplicationConfiguration( state->config ); | |
| 244 | + Dali::Integration::AndroidFramework::Get().SetApplicationAssets( state->activity->assetManager ); | |
| 245 | + Dali::Integration::AndroidFramework::Get().SetInternalDataPath( filesDir ); | |
| 246 | + | |
| 247 | + DaliDemoNativeActivity nativeActivity(state->activity); | |
| 248 | + | |
| 249 | + int status = 0; | |
| 250 | + std::string libpath = "/data/data/com.sec.dalidemo/lib/libdali-demo.so"; | |
| 251 | + std::string callParam = nativeActivity.getIntentStringExtra("start"); | |
| 252 | + if (callParam.empty()) | |
| 253 | + { | |
| 254 | + callParam = nativeActivity.getMetaData("start"); | |
| 255 | + } | |
| 256 | + | |
| 257 | + if (!callParam.empty()) | |
| 258 | + { | |
| 259 | + libpath = "/data/data/com.sec.dalidemo/lib/lib" + callParam + ".so"; | |
| 260 | + } | |
| 261 | + | |
| 262 | + void* handle = dlopen( libpath.c_str(), RTLD_LAZY ); | |
| 263 | + if (!handle) | |
| 264 | + { | |
| 265 | + std::exit(status); | |
| 266 | + } | |
| 267 | + | |
| 268 | + dlerror(); /* Clear any existing error */ | |
| 269 | + | |
| 270 | + int (*main)(int, char**) = (int(*)(int, char**))dlsym(handle, "main"); | |
| 271 | + if (main) | |
| 272 | + { | |
| 273 | + status = main( 0, nullptr ); | |
| 274 | + } | |
| 275 | + | |
| 276 | + if (handle) | |
| 277 | + { | |
| 278 | + dlclose(handle); | |
| 279 | + handle = nullptr; | |
| 280 | + } | |
| 281 | + | |
| 282 | + android_app_destroy(state); | |
| 283 | + | |
| 284 | + Dali::Integration::AndroidFramework::Get().SetNativeApplication(nullptr); | |
| 285 | + Dali::Integration::AndroidFramework::Get().SetApplicationConfiguration(nullptr); | |
| 286 | + Dali::Integration::AndroidFramework::Get().SetApplicationAssets(nullptr); | |
| 287 | + Dali::Integration::AndroidFramework::Delete(); | |
| 288 | + | |
| 289 | + // We need to kill the application process manually, DALi cannot restart in the same process due to memory leaks | |
| 290 | + std::exit(status); | |
| 291 | +} | |
| 292 | + | |
| 293 | +//END_INCLUDE(all) | ... | ... |
build/android/app/src/main/java/com/sec/dalidemo/DaliDemoApplication.java
0 → 100644
build/android/app/src/main/java/com/sec/dalidemo/DaliDemoNativeActivity.java
0 → 100644
| 1 | +package com.sec.dalidemo; | |
| 2 | + | |
| 3 | +import android.annotation.TargetApi; | |
| 4 | +import android.app.NativeActivity; | |
| 5 | +import android.content.ComponentName; | |
| 6 | +import android.content.Context; | |
| 7 | +import android.content.pm.ActivityInfo; | |
| 8 | +import android.content.pm.ApplicationInfo; | |
| 9 | +import android.content.pm.PackageManager; | |
| 10 | +import android.os.Bundle; | |
| 11 | +import android.view.View; | |
| 12 | +import android.view.WindowManager; | |
| 13 | + | |
| 14 | +public class DaliDemoNativeActivity extends NativeActivity { | |
| 15 | + @Override | |
| 16 | + protected void onCreate(Bundle savedInstanceState) { | |
| 17 | + super.onCreate(savedInstanceState); | |
| 18 | + | |
| 19 | + // Hide toolbar | |
| 20 | + int SDK_INT = android.os.Build.VERSION.SDK_INT; | |
| 21 | + if(SDK_INT >= 19) | |
| 22 | + { | |
| 23 | + setImmersiveSticky(); | |
| 24 | + | |
| 25 | + View decorView = getWindow().getDecorView(); | |
| 26 | + decorView.setOnSystemUiVisibilityChangeListener | |
| 27 | + (new View.OnSystemUiVisibilityChangeListener() { | |
| 28 | + @Override | |
| 29 | + public void onSystemUiVisibilityChange(int visibility) { | |
| 30 | + setImmersiveSticky(); | |
| 31 | + } | |
| 32 | + }); | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + @TargetApi(19) | |
| 37 | + void setImmersiveSticky() { | |
| 38 | + View decorView = getWindow().getDecorView(); | |
| 39 | + decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | |
| 40 | + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | |
| 41 | + | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | |
| 42 | + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | |
| 43 | + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | |
| 44 | + | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); | |
| 45 | + } | |
| 46 | + | |
| 47 | + @TargetApi(19) | |
| 48 | + protected void onResume() { | |
| 49 | + super.onResume(); | |
| 50 | + | |
| 51 | + //Hide toolbar | |
| 52 | + int SDK_INT = android.os.Build.VERSION.SDK_INT; | |
| 53 | + if (SDK_INT >= 11 && SDK_INT < 14) | |
| 54 | + { | |
| 55 | + getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN); | |
| 56 | + } | |
| 57 | + else if (SDK_INT >= 14 && SDK_INT < 19) | |
| 58 | + { | |
| 59 | + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LOW_PROFILE); | |
| 60 | + } | |
| 61 | + else if (SDK_INT >= 19) | |
| 62 | + { | |
| 63 | + setImmersiveSticky(); | |
| 64 | + } | |
| 65 | + } | |
| 66 | + | |
| 67 | + protected void onPause() { | |
| 68 | + super.onPause(); | |
| 69 | + } | |
| 70 | + | |
| 71 | + public final void setSoftInputMode(boolean visible) { | |
| 72 | + if (visible) { | |
| 73 | + getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); | |
| 74 | + } | |
| 75 | + else { | |
| 76 | + getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); | |
| 77 | + } | |
| 78 | + } | |
| 79 | + | |
| 80 | + public final String getMetaData(String key) { | |
| 81 | + try { | |
| 82 | + ActivityInfo ai = getApplicationContext().getPackageManager() | |
| 83 | + .getActivityInfo(getComponentName(), PackageManager.GET_META_DATA); | |
| 84 | + Bundle bundle = ai.metaData; | |
| 85 | + if (bundle != null) | |
| 86 | + return bundle.getString(key); | |
| 87 | + } catch (PackageManager.NameNotFoundException e) { | |
| 88 | + e.printStackTrace(); | |
| 89 | + } | |
| 90 | + | |
| 91 | + return null; | |
| 92 | + } | |
| 93 | + | |
| 94 | + public final String getIntentStringExtra(String key) { | |
| 95 | + return getIntent().getStringExtra(key); | |
| 96 | + } | |
| 97 | +} | ... | ... |
build/android/app/src/main/java/com/sec/dalidemo/DaliExamplesNativeActivity.java
0 → 100644
build/android/app/src/main/java/com/sec/dalidemo/DaliTestsNativeActivity.java
0 → 100644
build/android/app/src/main/res/mipmap-hdpi/dali_examples.png
0 → 100644
15 KB
build/android/app/src/main/res/mipmap-hdpi/dali_launcher.png
0 → 100644
7.38 KB
build/android/app/src/main/res/mipmap-hdpi/dali_tests.png
0 → 100644
14.8 KB
build/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
0 → 100644
3.34 KB
build/android/app/src/main/res/mipmap-mdpi/dali_examples.png
0 → 100644
15 KB
build/android/app/src/main/res/mipmap-mdpi/dali_launcher.png
0 → 100644
4.46 KB
build/android/app/src/main/res/mipmap-mdpi/dali_tests.png
0 → 100644
14.8 KB
build/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
0 → 100644
2.15 KB
build/android/app/src/main/res/mipmap-xhdpi/dali_examples.png
0 → 100644
15 KB
build/android/app/src/main/res/mipmap-xhdpi/dali_launcher.png
0 → 100644
12.2 KB
build/android/app/src/main/res/mipmap-xhdpi/dali_tests.png
0 → 100644
14.8 KB
build/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
0 → 100644
4.73 KB
build/android/app/src/main/res/mipmap-xxhdpi/dali_examples.png
0 → 100644
15 KB
build/android/app/src/main/res/mipmap-xxhdpi/dali_launcher.png
0 → 100644
17.9 KB
build/android/app/src/main/res/mipmap-xxhdpi/dali_tests.png
0 → 100644
14.8 KB
build/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
0 → 100644
7.54 KB
build/android/app/src/main/res/values/strings.xml
0 → 100644
build/android/build.gradle
0 → 100644
| 1 | +// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
| 2 | +buildscript { | |
| 3 | + repositories { | |
| 4 | + google() | |
| 5 | + jcenter() | |
| 6 | + } | |
| 7 | + dependencies { | |
| 8 | + classpath 'com.android.tools.build:gradle:3.5.2' | |
| 9 | + } | |
| 10 | +} | |
| 11 | + | |
| 12 | +allprojects { | |
| 13 | + repositories { | |
| 14 | + google() | |
| 15 | + jcenter() | |
| 16 | + } | |
| 17 | +} | |
| 18 | + | |
| 19 | +task clean(type: Delete) { | |
| 20 | + delete rootProject.buildDir | |
| 21 | +} | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | ... | ... |
build/android/build.sh
0 → 100755
| 1 | +[ -z $ROOT_DIR ] && ROOT_DIR=$HOME | |
| 2 | +echo "Using ROOT_DIR=\"$ROOT_DIR\"" | |
| 3 | + | |
| 4 | +[ -z $DALI_DIR ] && DALI_DIR=$(cd ../../../;pwd) | |
| 5 | +echo "Using DALI_DIR=\"$DALI_DIR\"" | |
| 6 | +export DALI_DIR=$DALI_DIR | |
| 7 | + | |
| 8 | +[ -z $DALI_ENV_DIR ] && DALI_ENV_DIR=$DALI_DIR/dali-env/android | |
| 9 | +echo "Using DALI_ENV_DIR=\"$DALI_ENV_DIR\"" | |
| 10 | +export DALI_ENV_DIR=$DALI_ENV_DIR | |
| 11 | + | |
| 12 | +[ -z $TARGET ] && export TARGET=armeabi-v7a | |
| 13 | +echo "Using TARGET=\"$TARGET\"" | |
| 14 | + | |
| 15 | +if [ ! -z $http_proxy ] | |
| 16 | +then | |
| 17 | + proxyFull=${http_proxy/http:\/\/} | |
| 18 | + proxyHost=$(echo $proxyFull | cut -d: -f 1) | |
| 19 | + proxyPort=$(echo $proxyFull | cut -d: -f 2) | |
| 20 | + SdbProxyOptions="--proxy=http --proxy_host=$proxyHost --proxy_port=$proxyPort" | |
| 21 | + echo "Proxy detected Host:$proxyHost Port:$proxyPort" | |
| 22 | +fi | |
| 23 | + | |
| 24 | +if [ ! -d "$ANDROID_SDK" ]; then | |
| 25 | + if [ ! -d "$ROOT_DIR/Android/Sdk" ]; then | |
| 26 | + mkdir -p "$ROOT_DIR/Android/Sdk" | |
| 27 | + cd "$ROOT_DIR/Android/Sdk" | |
| 28 | + wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip | |
| 29 | + unzip sdk-tools-linux-4333796.zip | |
| 30 | + tools/bin/sdkmanager --update $SdbProxyOptions | |
| 31 | + yes | tools/bin/sdkmanager $SdbProxyOptions "patcher;v4" "platform-tools" "platforms;android-29" "build-tools;29.0.2" "lldb;3.1" "cmake;3.10.2.4988404" "ndk-bundle" "ndk;20.1.5948944" | |
| 32 | + cd - | |
| 33 | + fi | |
| 34 | +fi | |
| 35 | + | |
| 36 | +if [ ! -d "$ANDROID_SDK" ]; then | |
| 37 | +# try default path | |
| 38 | + if [ -d "$ROOT_DIR/Android/Sdk" ]; then | |
| 39 | + export ANDROID_SDK=$ROOT_DIR/Android/Sdk | |
| 40 | + fi | |
| 41 | +fi | |
| 42 | + | |
| 43 | +if [ ! -d "$ANDROID_NDK" ]; then | |
| 44 | + if [ -d "$ANDROID_SDK" ]; then | |
| 45 | + NDK_DIR=$(find $ANDROID_SDK -maxdepth 2 -name ndk-build | sed 's/\/ndk-build//') | |
| 46 | + if [ -d "$NDK_DIR" ]; then | |
| 47 | + export ANDROID_NDK=$NDK_DIR | |
| 48 | + fi | |
| 49 | + fi | |
| 50 | +fi | |
| 51 | + | |
| 52 | +if [ ! -d "$ROOT_DIR/gradle/gradle-5.4.1" ]; then | |
| 53 | + mkdir -p $ROOT_DIR/gradle | |
| 54 | + cd $ROOT_DIR/gradle | |
| 55 | + wget https://services.gradle.org/distributions/gradle-5.4.1-bin.zip | |
| 56 | + unzip gradle-5.4.1-bin.zip | |
| 57 | + cd - | |
| 58 | +fi | |
| 59 | + | |
| 60 | +GRADLE_PROPERTIES_FILE=gradle.properties | |
| 61 | +if [ ! -f $GRADLE_PROPERTIES_FILE ] | |
| 62 | +then | |
| 63 | + echo "org.gradle.jvmargs=-Xmx1536m" > $GRADLE_PROPERTIES_FILE | |
| 64 | + if [ ! -z $http_proxy ] | |
| 65 | + then | |
| 66 | + echo "systemProp.http.proxyHost=$proxyHost" >> $GRADLE_PROPERTIES_FILE | |
| 67 | + echo "systemProp.http.proxyPort=$proxyPort" >> $GRADLE_PROPERTIES_FILE | |
| 68 | + | |
| 69 | + if [ ! -z $https_proxy ] | |
| 70 | + then | |
| 71 | + httpsProxyFull=${https_proxy/https:\/\/} | |
| 72 | + httpsProxyHost=$(echo $httpsProxyFull | cut -d: -f 1) | |
| 73 | + httpsProxyPort=$(echo $httpsProxyFull | cut -d: -f 2) | |
| 74 | + echo "systemProp.https.proxyHost=$httpsProxyHost" >> $GRADLE_PROPERTIES_FILE | |
| 75 | + echo "systemProp.https.proxyPort=$httpsProxyPort" >> $GRADLE_PROPERTIES_FILE | |
| 76 | + fi | |
| 77 | + fi | |
| 78 | +fi | |
| 79 | + | |
| 80 | +export PATH=$PATH:$ROOT_DIR/gradle/gradle-5.4.1/bin | |
| 81 | +[ ! -f local.properties ] && echo 'sdk.dir='$(echo $ANDROID_SDK) > local.properties | |
| 82 | + | |
| 83 | +gradle wrapper | |
| 84 | +if [ "$1" = "clean" ]; then | |
| 85 | + ./gradlew clean | |
| 86 | +else | |
| 87 | + if [ -z "$DEBUG" ]; then | |
| 88 | + ./gradlew assembleRelease | |
| 89 | + else | |
| 90 | + ./gradlew assembleDebug | |
| 91 | + fi | |
| 92 | +fi | |
| 93 | + | ... | ... |
build/android/dali/.gitignore
0 → 100644
build/android/dali/build.sh
0 → 100755
| 1 | +#!/bin/bash | |
| 2 | +if [ -z "$ANDROID_SDK" ]; then | |
| 3 | + . ./env.sh | |
| 4 | +fi | |
| 5 | + | |
| 6 | +if [ ! -d "$ANDROID_SDK" ]; then | |
| 7 | + echo "Please install Android SDK into "$ANDROID_SDK | |
| 8 | + exit 1 | |
| 9 | +fi | |
| 10 | + | |
| 11 | +if [ ! -d "$ANDROID_NDK" ]; then | |
| 12 | + echo "Please install Android NDK into "$ANDROID_NDK | |
| 13 | + exit 1 | |
| 14 | +fi | |
| 15 | + | |
| 16 | +if [ "$1" = "clean" ]; then | |
| 17 | + echo "Cleaning dali..." | |
| 18 | + rm -rf ./dali-core | |
| 19 | + rm -rf ./dali-adaptor | |
| 20 | + rm -rf ./dali-toolkit | |
| 21 | + rm -rf ./dali-demo | |
| 22 | + exit 0 | |
| 23 | +fi | |
| 24 | + | |
| 25 | +if [ ! -z "$DEBUG" ]; then | |
| 26 | + export ENABLE_TRACE=ON | |
| 27 | +fi | |
| 28 | + | |
| 29 | +ANDROID_PLATFORM=26 ANDROID_ABI=${TARGET} ./build_core.sh || exit 1 | |
| 30 | +ANDROID_PLATFORM=26 ANDROID_ABI=${TARGET} ./build_adaptor.sh || exit 1 | |
| 31 | +ANDROID_PLATFORM=26 ANDROID_ABI=${TARGET} ./build_toolkit.sh || exit 1 | |
| 32 | +ANDROID_PLATFORM=26 ANDROID_ABI=${TARGET} ./build_demo.sh || exit 1 | |
| 33 | + | ... | ... |
build/android/dali/build_adaptor.sh
0 → 100755
| 1 | +if [ -d ./dali-adaptor/cmake/${ANDROID_ABI} ]; then | |
| 2 | + cd ./dali-adaptor/cmake/${ANDROID_ABI} | |
| 3 | +else | |
| 4 | + mkdir -p ./dali-adaptor/cmake/${ANDROID_ABI} | |
| 5 | + cd ./dali-adaptor/cmake/${ANDROID_ABI} | |
| 6 | + | |
| 7 | + if [ ! -z "$DEBUG" ]; then | |
| 8 | + export CMAKE_BUILD_TYPE=Debug | |
| 9 | + else | |
| 10 | + export CMAKE_BUILD_TYPE=Release | |
| 11 | + fi | |
| 12 | + | |
| 13 | + if [ -z "$ENABLE_TRACE" ]; then | |
| 14 | + export ENABLE_TRACE=OFF | |
| 15 | + fi | |
| 16 | + | |
| 17 | + export PREFIX=${DALI_ENV_DIR} | |
| 18 | + export PKG_CONFIG_LIBDIR=${ANDROID_NDK}/prebuilt/linux-x86_64/lib/pkgconfig | |
| 19 | + export PKG_CONFIG_PATH=${PREFIX}/lib/${ANDROID_ABI}/pkgconfig | |
| 20 | + export DALI_DATA_RO_DIR=assets | |
| 21 | + export DALI_DATA_RW_DIR=/data/data/com.sec.dali_demo/files | |
| 22 | + ${ANDROID_SDK}/cmake/3.10.2.4988404/bin/cmake ${DALI_DIR}/dali-adaptor/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=gnu++11' -DINCLUDE_DIR=${PREFIX}/include -DLIB_DIR=${PREFIX}/lib/${ANDROID_ABI} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DENABLE_TRACE=${ENABLE_TRACE} -DENABLE_PROFILE=ANDROID | |
| 23 | +fi | |
| 24 | + | |
| 25 | +make -j8 || exit 1 | |
| 26 | +make install || exit 1 | |
| 27 | +cd - | ... | ... |
build/android/dali/build_core.sh
0 → 100755
| 1 | + | |
| 2 | +if [ -d ./dali-core/cmake/${ANDROID_ABI} ]; then | |
| 3 | + cd ./dali-core/cmake/${ANDROID_ABI} | |
| 4 | +else | |
| 5 | + mkdir -p ./dali-core/cmake/${ANDROID_ABI} | |
| 6 | + cd ./dali-core/cmake/${ANDROID_ABI} | |
| 7 | + | |
| 8 | + if [ ! -z "$DEBUG" ]; then | |
| 9 | + export CMAKE_BUILD_TYPE=Debug | |
| 10 | + else | |
| 11 | + export CMAKE_BUILD_TYPE=Release | |
| 12 | + fi | |
| 13 | + | |
| 14 | + if [ -z "$ENABLE_TRACE" ]; then | |
| 15 | + export ENABLE_TRACE=OFF | |
| 16 | + fi | |
| 17 | + | |
| 18 | + export PREFIX=${DALI_ENV_DIR} | |
| 19 | + export PKG_CONFIG_LIBDIR=${ANDROID_NDK}/prebuilt/linux-x86_64/lib/pkgconfig | |
| 20 | + export PKG_CONFIG_PATH=${PREFIX}/lib/${ANDROID_ABI}/pkgconfig | |
| 21 | + ${ANDROID_SDK}/cmake/3.10.2.4988404/bin/cmake ${DALI_DIR}/dali-core/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=gnu++11' -DINCLUDE_DIR=${PREFIX}/include -DLIB_DIR=${PREFIX}/lib/${ANDROID_ABI} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DENABLE_TRACE=${ENABLE_TRACE} | |
| 22 | +fi | |
| 23 | + | |
| 24 | +make -j8 || exit 1 | |
| 25 | +make install || exit 1 | |
| 26 | + | |
| 27 | +cd - | ... | ... |
build/android/dali/build_demo.sh
0 → 100755
| 1 | + | |
| 2 | +if [ -d ./dali-demo/cmake/${ANDROID_ABI} ]; then | |
| 3 | + cd ./dali-demo/cmake/${ANDROID_ABI} | |
| 4 | +else | |
| 5 | + mkdir -p ./dali-demo/cmake/${ANDROID_ABI} | |
| 6 | + cd ./dali-demo/cmake/${ANDROID_ABI} | |
| 7 | + | |
| 8 | + if [ ! -z "$DEBUG" ]; then | |
| 9 | + export CMAKE_BUILD_TYPE=Debug | |
| 10 | + else | |
| 11 | + export CMAKE_BUILD_TYPE=Release | |
| 12 | + fi | |
| 13 | + | |
| 14 | + if [ -z "$ENABLE_TRACE" ]; then | |
| 15 | + export ENABLE_TRACE=OFF | |
| 16 | + fi | |
| 17 | + | |
| 18 | + export PREFIX=${DALI_ENV_DIR} | |
| 19 | + export PKG_CONFIG_LIBDIR=${ANDROID_NDK}/prebuilt/linux-x86_64/lib/pkgconfig | |
| 20 | + export PKG_CONFIG_PATH=${PREFIX}/lib/${ANDROID_ABI}/pkgconfig | |
| 21 | + export DALI_APP_RES_DIR=${PREFIX}/files | |
| 22 | + export DALI_APP_DIR=${PREFIX}/lib/${ANDROID_ABI} | |
| 23 | + export DALI_DEMO_RES_DIR=assets | |
| 24 | + | |
| 25 | + ${ANDROID_SDK}/cmake/3.10.2.4988404/bin/cmake ${DALI_DIR}/dali-demo/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=gnu++11' -DINCLUDE_DIR=${PREFIX}/include -DLIB_DIR=${PREFIX}/lib/${ANDROID_ABI} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DENABLE_TRACE=${ENABLE_TRACE} -DINTERNATIONALIZATION=OFF -DSHARED=ON -DDALI_APP_RES_DIR=${DALI_APP_RES_DIR} -DDALI_APP_DIR=${DALI_APP_DIR} -DDALI_DEMO_RES_DIR=${DALI_DEMO_RES_DIR} | |
| 26 | +fi | |
| 27 | + | |
| 28 | +make -j8 || exit 1 | |
| 29 | +make install || exit 1 | |
| 30 | + | |
| 31 | +cd - | |
| 32 | + | ... | ... |
build/android/dali/build_toolkit.sh
0 → 100755
| 1 | + | |
| 2 | +if [ -d ./dali-toolkit/cmake/${ANDROID_ABI} ]; then | |
| 3 | + cd ./dali-toolkit/cmake/${ANDROID_ABI} | |
| 4 | +else | |
| 5 | + mkdir -p ./dali-toolkit/cmake/${ANDROID_ABI} | |
| 6 | + cd ./dali-toolkit/cmake/${ANDROID_ABI} | |
| 7 | + | |
| 8 | + if [ ! -z "$DEBUG" ]; then | |
| 9 | + export CMAKE_BUILD_TYPE=Debug | |
| 10 | + else | |
| 11 | + export CMAKE_BUILD_TYPE=Release | |
| 12 | + fi | |
| 13 | + | |
| 14 | + if [ -z "$ENABLE_TRACE" ]; then | |
| 15 | + export ENABLE_TRACE=OFF | |
| 16 | + fi | |
| 17 | + | |
| 18 | + export PREFIX=${DALI_ENV_DIR} | |
| 19 | + export PKG_CONFIG_LIBDIR=${ANDROID_NDK}/prebuilt/linux-x86_64/lib/pkgconfig | |
| 20 | + export PKG_CONFIG_PATH=${PREFIX}/lib/${ANDROID_ABI}/pkgconfig | |
| 21 | + export DALI_DATA_RO_DIR=assets | |
| 22 | + export DALI_DATA_RW_DIR=/data/data/com.sec.dali_demo/files | |
| 23 | + export DALI_DATA_RO_INSTALL_DIR=${PREFIX}/files | |
| 24 | + export DALI_DATA_RW_INSTALL_DIR=${PREFIX}/files | |
| 25 | + | |
| 26 | + ${ANDROID_SDK}/cmake/3.10.2.4988404/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=gnu++11' -DINCLUDE_DIR=${PREFIX}/include -DLIB_DIR=${PREFIX}/lib/${ANDROID_ABI} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DENABLE_TRACE=${ENABLE_TRACE} -DWITH_STYLE='2048x1080' | |
| 27 | +fi | |
| 28 | + | |
| 29 | +make -j8 || exit 1 | |
| 30 | +make install || exit 1 | |
| 31 | +cp -R ${DALI_DIR}/dali-toolkit/automated-tests/resources/fonts/* ${DALI_DIR}/dali-env/android/files/fonts | |
| 32 | + | |
| 33 | +cd - | ... | ... |
build/android/dali/env.sh
0 → 100755
| 1 | +if [ ! -d "$ANDROID_SDK" ]; then | |
| 2 | +# try default path | |
| 3 | +if [ -d "$HOME/Android/Sdk" ]; then | |
| 4 | +export ANDROID_SDK=$HOME/Android/Sdk | |
| 5 | +fi | |
| 6 | +fi | |
| 7 | + | |
| 8 | +if [ ! -d "$ANDROID_NDK" ]; then | |
| 9 | +if [ -d $ANDROID_SDK ]; then | |
| 10 | +NDK_DIR=$(find $ANDROID_SDK -maxdepth 2 -name ndk-build | sed 's/\/ndk-build//') | |
| 11 | +if [ -d "$NDK_DIR" ]; then | |
| 12 | +export ANDROID_NDK=$NDK_DIR | |
| 13 | +fi | |
| 14 | +fi | |
| 15 | +fi | |
| 16 | + | |
| 17 | +if [ ! -d "$DALI_DIR" ]; then | |
| 18 | +export DALI_DIR=$(cd ../../../../; pwd) | |
| 19 | +fi | |
| 20 | + | |
| 21 | +if [ ! -d "$DALI_ENV_DIR" ]; then | |
| 22 | +export DALI_ENV_DIR=$DALI_DIR/dali-env/android | |
| 23 | +fi | ... | ... |
build/android/key.jks
0 → 100644
No preview for this file type
build/android/settings.gradle
0 → 100644
build/tizen/CMakeLists.txt
| ... | ... | @@ -17,15 +17,15 @@ SET(DEMO_SHARED ${CMAKE_SOURCE_DIR}/../../shared) |
| 17 | 17 | SET(PREFIX ${CMAKE_INSTALL_PREFIX}) |
| 18 | 18 | |
| 19 | 19 | IF(DEFINED DALI_APP_DIR) |
| 20 | - SET(BINDIR ${DALI_APP_DIR}/bin) | |
| 20 | + SET(BINDIR ${DALI_APP_DIR}) | |
| 21 | 21 | ELSE() |
| 22 | - SET(BINDIR ${PREFIX}/bin) | |
| 22 | + SET(BINDIR ${PREFIX}/bin) | |
| 23 | 23 | ENDIF() |
| 24 | 24 | |
| 25 | 25 | IF(DEFINED DALI_APP_RES_DIR) |
| 26 | - SET(APP_DATA_RES_DIR ${DALI_APP_RES_DIR}) | |
| 26 | + SET(APP_DATA_RES_DIR ${DALI_APP_RES_DIR}) | |
| 27 | 27 | ELSE() |
| 28 | - SET(APP_DATA_RES_DIR ${PREFIX}/share/com.samsung.dali-demo/res) | |
| 28 | + SET(APP_DATA_RES_DIR ${PREFIX}/share/com.samsung.dali-demo/res) | |
| 29 | 29 | ENDIF() |
| 30 | 30 | |
| 31 | 31 | MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} ) |
| ... | ... | @@ -42,7 +42,11 @@ SET(LOCAL_MODELS_DIR ${RESOURCE_DIR}/models) |
| 42 | 42 | SET(LOCAL_SCRIPTS_DIR ${RESOURCE_DIR}/scripts) |
| 43 | 43 | SET(LOCAL_SHADERS_DIR ${RESOURCE_DIR}/shaders) |
| 44 | 44 | IF(NOT DEFINED LOCAL_STYLE_DIR) |
| 45 | - SET(LOCAL_STYLE_DIR ${RESOURCE_DIR}/style) | |
| 45 | + SET(LOCAL_STYLE_DIR ${RESOURCE_DIR}/style) | |
| 46 | +ENDIF() | |
| 47 | + | |
| 48 | +IF(ANDROID) | |
| 49 | + SET(LOCAL_STYLE_ANDROID_DIR ${RESOURCE_DIR}/style/android) | |
| 46 | 50 | ENDIF() |
| 47 | 51 | |
| 48 | 52 | SET(IMAGES_DIR ${APP_DATA_RES_DIR}/images/) |
| ... | ... | @@ -54,23 +58,36 @@ SET(SHADERS_DIR ${APP_DATA_RES_DIR}/shaders/) |
| 54 | 58 | SET(STYLE_DIR ${APP_DATA_RES_DIR}/style/) |
| 55 | 59 | |
| 56 | 60 | IF(NOT DEFINED LOCALE_DIR) |
| 57 | - SET(LOCALE_DIR ${PREFIX}/share/locale) | |
| 61 | + SET(LOCALE_DIR ${PREFIX}/share/locale) | |
| 62 | +ENDIF() | |
| 63 | + | |
| 64 | +IF(DEFINED DALI_DEMO_RES_DIR) | |
| 65 | + SET(DEMO_IMAGE_DIR \\"${DALI_DEMO_RES_DIR}/images/\\") | |
| 66 | + SET(DEMO_GAME_DIR \\"${DALI_DEMO_RES_DIR}/game/\\") | |
| 67 | + SET(DEMO_VIDEO_DIR \\"${DALI_DEMO_RES_DIR}/videos/\\") | |
| 68 | + SET(DEMO_MODEL_DIR \\"${DALI_DEMO_RES_DIR}/models/\\") | |
| 69 | + SET(DEMO_SCRIPT_DIR \\"${DALI_DEMO_RES_DIR}/scripts/\\") | |
| 70 | + SET(DEMO_SHADER_DIR \\"${DALI_DEMO_RES_DIR}/shaders/\\") | |
| 71 | + SET(DEMO_STYLE_DIR \\"${DALI_DEMO_RES_DIR}/style/\\") | |
| 72 | + SET(DEMO_THEME_PATH \\"${DALI_DEMO_RES_DIR}/style/demo-theme.json\\") | |
| 73 | + SET(DEMO_LOCALE_DIR \\"${DALI_DEMO_RES_DIR}/locale\\") | |
| 74 | + SET(DEMO_STYLE_IMAGE_DIR \\"${DALI_DEMO_RES_DIR}/style/images\\") | |
| 75 | +ELSE() | |
| 76 | + SET(DEMO_GAME_DIR \\"${GAME_DIR}\\") | |
| 77 | + SET(DEMO_IMAGE_DIR \\"${IMAGES_DIR}\\") | |
| 78 | + SET(DEMO_VIDEO_DIR \\"${VIDEOS_DIR}\\") | |
| 79 | + SET(DEMO_MODEL_DIR \\"${MODELS_DIR}\\") | |
| 80 | + SET(DEMO_SCRIPT_DIR \\"${SCRIPTS_DIR}\\") | |
| 81 | + SET(DEMO_SHADER_DIR \\"${SHADERS_DIR}\\") | |
| 82 | + SET(DEMO_STYLE_DIR \\"${STYLE_DIR}\\") | |
| 83 | + SET(DEMO_THEME_PATH \\"${STYLE_DIR}demo-theme.json\\") | |
| 84 | + SET(DEMO_LOCALE_DIR \\"${LOCALE_DIR}\\") | |
| 85 | + SET(DEMO_STYLE_IMAGE_DIR ${STYLE_DIR}/images) | |
| 58 | 86 | ENDIF() |
| 59 | 87 | |
| 60 | -SET(DEMO_GAME_DIR \\"${GAME_DIR}\\") | |
| 61 | -SET(DEMO_IMAGE_DIR \\"${IMAGES_DIR}\\") | |
| 62 | -SET(DEMO_VIDEO_DIR \\"${VIDEOS_DIR}\\") | |
| 63 | -SET(DEMO_MODEL_DIR \\"${MODELS_DIR}\\") | |
| 64 | -SET(DEMO_SCRIPT_DIR \\"${SCRIPTS_DIR}\\") | |
| 65 | -SET(DEMO_SHADER_DIR \\"${SHADERS_DIR}\\") | |
| 66 | -SET(DEMO_STYLE_DIR \\"${STYLE_DIR}\\") | |
| 67 | -SET(DEMO_THEME_PATH \\"${STYLE_DIR}demo-theme.json\\") | |
| 68 | 88 | SET(DEMO_EXAMPLE_BIN \\"${BINDIR}/\\") |
| 69 | -SET(DEMO_LOCALE_DIR \\"${LOCALE_DIR}\\") | |
| 70 | 89 | SET(DEMO_LANG \\"${LANG}\\") |
| 71 | 90 | |
| 72 | -SET(DEMO_STYLE_IMAGE_DIR ${STYLE_DIR}/images) | |
| 73 | - | |
| 74 | 91 | FILE(GLOB LOCAL_IMAGES_PNG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.png") |
| 75 | 92 | FILE(GLOB LOCAL_IMAGES_JPG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.jpg") |
| 76 | 93 | FILE(GLOB LOCAL_IMAGES_GIF RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.gif") |
| ... | ... | @@ -121,6 +138,14 @@ FOREACH(flag ${LOCAL_STYLES_LIST}) |
| 121 | 138 | ENDFOREACH(flag) |
| 122 | 139 | MESSAGE("Installed ${LOCAL_STYLES_LIST} to ${STYLE_DIR}") |
| 123 | 140 | |
| 141 | +IF(ANDROID) | |
| 142 | +FILE(GLOB LOCAL_STYLES_ANDROID_LIST "${LOCAL_STYLE_ANDROID_DIR}/*.json") | |
| 143 | +FOREACH(flag ${LOCAL_STYLES_ANDROID_LIST}) | |
| 144 | + INSTALL(FILES ${flag} DESTINATION ${STYLE_DIR}) | |
| 145 | +ENDFOREACH(flag) | |
| 146 | +MESSAGE("Installed ${LOCAL_STYLES_ANDROID_LIST} to ${STYLE_DIR}") | |
| 147 | +ENDIF() | |
| 148 | + | |
| 124 | 149 | FILE(GLOB LOCAL_STYLE_IMAGES_LIST "${LOCAL_STYLE_DIR}/images/*.png") |
| 125 | 150 | FOREACH(flag ${LOCAL_STYLE_IMAGES_LIST}) |
| 126 | 151 | INSTALL(FILES ${flag} DESTINATION ${STYLE_DIR}/images) | ... | ... |
build/tizen/demo/CMakeLists.txt
| ... | ... | @@ -6,10 +6,26 @@ SET(DEMO_SRCS |
| 6 | 6 | ${DEMO_SRCS} |
| 7 | 7 | "${ROOT_SRC_DIR}/shared/resources-location.cpp" |
| 8 | 8 | "${ROOT_SRC_DIR}/shared/dali-table-view.cpp" |
| 9 | - "${ROOT_SRC_DIR}/shared/execute-process-unix.cpp" | |
| 10 | 9 | ) |
| 11 | 10 | |
| 12 | -ADD_EXECUTABLE(${PROJECT_NAME} ${DEMO_SRCS}) | |
| 11 | +IF(ANDROID) | |
| 12 | + SET(DEMO_SRCS | |
| 13 | + ${DEMO_SRCS} | |
| 14 | + "${ROOT_SRC_DIR}/shared/execute-process-android.cpp" | |
| 15 | + ) | |
| 16 | +ELSE() | |
| 17 | + SET(DEMO_SRCS | |
| 18 | + ${DEMO_SRCS} | |
| 19 | + "${ROOT_SRC_DIR}/shared/execute-process-unix.cpp" | |
| 20 | + ) | |
| 21 | +ENDIF() | |
| 22 | + | |
| 23 | +IF(SHARED) | |
| 24 | + ADD_LIBRARY(${PROJECT_NAME} SHARED ${DEMO_SRCS}) | |
| 25 | +ELSE() | |
| 26 | + ADD_EXECUTABLE(${PROJECT_NAME} ${DEMO_SRCS}) | |
| 27 | +ENDIF() | |
| 28 | + | |
| 13 | 29 | TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${REQUIRED_PKGS_LDFLAGS} -pie) |
| 14 | 30 | |
| 15 | 31 | INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) | ... | ... |
build/tizen/examples-reel/CMakeLists.txt
| ... | ... | @@ -6,10 +6,26 @@ SET(EXAMPLES_REEL_SRCS |
| 6 | 6 | ${EXAMPLES_REEL_SRCS} |
| 7 | 7 | "${ROOT_SRC_DIR}/shared/resources-location.cpp" |
| 8 | 8 | "${ROOT_SRC_DIR}/shared/dali-table-view.cpp" |
| 9 | - "${ROOT_SRC_DIR}/shared/execute-process-unix.cpp" | |
| 10 | 9 | ) |
| 11 | 10 | |
| 12 | -ADD_EXECUTABLE(dali-examples ${EXAMPLES_REEL_SRCS}) | |
| 11 | +IF(ANDROID) | |
| 12 | + SET(EXAMPLES_REEL_SRCS | |
| 13 | + ${EXAMPLES_REEL_SRCS} | |
| 14 | + "${ROOT_SRC_DIR}/shared/execute-process-android.cpp" | |
| 15 | + ) | |
| 16 | +ELSE() | |
| 17 | + SET(EXAMPLES_REEL_SRCS | |
| 18 | + ${EXAMPLES_REEL_SRCS} | |
| 19 | + "${ROOT_SRC_DIR}/shared/execute-process-unix.cpp" | |
| 20 | + ) | |
| 21 | +ENDIF() | |
| 22 | + | |
| 23 | +IF(SHARED) | |
| 24 | + ADD_LIBRARY(dali-examples SHARED ${EXAMPLES_REEL_SRCS}) | |
| 25 | +ELSE() | |
| 26 | + ADD_EXECUTABLE(dali-examples ${EXAMPLES_REEL_SRCS}) | |
| 27 | +ENDIF() | |
| 28 | + | |
| 13 | 29 | TARGET_LINK_LIBRARIES(dali-examples ${REQUIRED_PKGS_LDFLAGS} -pie) |
| 14 | 30 | |
| 15 | 31 | INSTALL(TARGETS dali-examples DESTINATION ${BINDIR}) | ... | ... |
build/tizen/examples/CMakeLists.txt
| ... | ... | @@ -16,7 +16,11 @@ SUBDIRLIST(SUBDIRS ${EXAMPLES_SRC_DIR}) |
| 16 | 16 | FOREACH(EXAMPLE ${SUBDIRS}) |
| 17 | 17 | FILE(GLOB SRCS "${EXAMPLES_SRC_DIR}/${EXAMPLE}/*.cpp") |
| 18 | 18 | SET(SRCS ${SRCS} "${ROOT_SRC_DIR}/shared/resources-location.cpp") |
| 19 | - ADD_EXECUTABLE(${EXAMPLE}.example ${SRCS}) | |
| 19 | + IF(SHARED) | |
| 20 | + ADD_LIBRARY(${EXAMPLE}.example SHARED ${SRCS}) | |
| 21 | + ELSE() | |
| 22 | + ADD_EXECUTABLE(${EXAMPLE}.example ${SRCS}) | |
| 23 | + ENDIF() | |
| 20 | 24 | TARGET_LINK_LIBRARIES(${EXAMPLE}.example ${REQUIRED_PKGS_LDFLAGS} -pie) |
| 21 | 25 | INSTALL(TARGETS ${EXAMPLE}.example DESTINATION ${BINDIR}) |
| 22 | 26 | ENDFOREACH(EXAMPLE) | ... | ... |
build/tizen/tests-reel/CMakeLists.txt
| ... | ... | @@ -6,10 +6,25 @@ SET(TESTS_REEL_SRCS |
| 6 | 6 | ${TESTS_REEL_SRCS} |
| 7 | 7 | "${ROOT_SRC_DIR}/shared/resources-location.cpp" |
| 8 | 8 | "${ROOT_SRC_DIR}/shared/dali-table-view.cpp" |
| 9 | - "${ROOT_SRC_DIR}/shared/execute-process-unix.cpp" | |
| 10 | 9 | ) |
| 11 | 10 | |
| 12 | -ADD_EXECUTABLE(dali-tests ${TESTS_REEL_SRCS}) | |
| 11 | +IF(ANDROID) | |
| 12 | + SET(TESTS_REEL_SRCS | |
| 13 | + ${TESTS_REEL_SRCS} | |
| 14 | + "${ROOT_SRC_DIR}/shared/execute-process-android.cpp" | |
| 15 | + ) | |
| 16 | +ELSE() | |
| 17 | + SET(TESTS_REEL_SRCS | |
| 18 | + ${TESTS_REEL_SRCS} | |
| 19 | + "${ROOT_SRC_DIR}/shared/execute-process-unix.cpp" | |
| 20 | + ) | |
| 21 | +ENDIF() | |
| 22 | + | |
| 23 | +IF(SHARED) | |
| 24 | + ADD_LIBRARY(dali-tests SHARED ${TESTS_REEL_SRCS}) | |
| 25 | +ELSE() | |
| 26 | + ADD_EXECUTABLE(dali-tests ${TESTS_REEL_SRCS}) | |
| 27 | +ENDIF() | |
| 13 | 28 | TARGET_LINK_LIBRARIES(dali-tests ${REQUIRED_PKGS_LDFLAGS} -pie) |
| 14 | 29 | |
| 15 | 30 | INSTALL(TARGETS dali-tests DESTINATION ${BINDIR}) | ... | ... |
demo/dali-demo.cpp
| ... | ... | @@ -27,9 +27,11 @@ using namespace Dali; |
| 27 | 27 | int DALI_EXPORT_API main(int argc, char **argv) |
| 28 | 28 | { |
| 29 | 29 | // Configure gettext for internalization |
| 30 | +#ifdef INTERNATIONALIZATION_ENABLED | |
| 30 | 31 | bindtextdomain(DALI_DEMO_DOMAIN_LOCAL, DEMO_LOCALE_DIR); |
| 31 | 32 | textdomain(DALI_DEMO_DOMAIN_LOCAL); |
| 32 | 33 | setlocale(LC_ALL, DEMO_LANG); |
| 34 | +#endif | |
| 33 | 35 | |
| 34 | 36 | Application app = Application::New(&argc, &argv, DEMO_THEME_PATH); |
| 35 | 37 | ... | ... |
examples-reel/dali-examples-reel.cpp
| ... | ... | @@ -27,9 +27,11 @@ using namespace Dali; |
| 27 | 27 | int DALI_EXPORT_API main(int argc, char **argv) |
| 28 | 28 | { |
| 29 | 29 | // Configure gettext for internalization |
| 30 | +#ifdef INTERNATIONALIZATION_ENABLED | |
| 30 | 31 | bindtextdomain(DALI_DEMO_DOMAIN_LOCAL, DEMO_LOCALE_DIR); |
| 31 | 32 | textdomain(DALI_DEMO_DOMAIN_LOCAL); |
| 32 | 33 | setlocale(LC_ALL, DEMO_LANG); |
| 34 | +#endif | |
| 33 | 35 | |
| 34 | 36 | Application app = Application::New( &argc, &argv, DEMO_STYLE_DIR "/examples-theme.json" ); |
| 35 | 37 | ... | ... |
examples/animated-gradient-call-active/animated-gradient-call-active.cpp
examples/animated-gradient-card-active/animated-gradient-card-active.cpp
examples/bezier-curve/bezier-curve-example.cpp
| ... | ... | @@ -23,6 +23,7 @@ |
| 23 | 23 | |
| 24 | 24 | using namespace Dali; |
| 25 | 25 | using namespace Dali::Toolkit; |
| 26 | +using namespace std; | |
| 26 | 27 | |
| 27 | 28 | namespace |
| 28 | 29 | { |
| ... | ... | @@ -444,7 +445,7 @@ public: |
| 444 | 445 | auto gridSize = mGrid.GetProperty<Vector3>( Actor::Property::SIZE ); // Get target value |
| 445 | 446 | auto currentPosition = actor.GetCurrentPosition(); // Get constrained current value |
| 446 | 447 | |
| 447 | - position = Vector2( std::floor( currentPosition.x ), std::floor( currentPosition.y ) ); | |
| 448 | + position = Vector2( floor( currentPosition.x ), floor( currentPosition.y ) ); | |
| 448 | 449 | |
| 449 | 450 | point.x = Clamp( position.x / gridSize.x, -0.5f, 0.5f ) + 0.5f; |
| 450 | 451 | point.y = 0.5f - position.y / gridSize.y; |
| ... | ... | @@ -612,7 +613,7 @@ private: |
| 612 | 613 | }; |
| 613 | 614 | |
| 614 | 615 | |
| 615 | -int main( int argc, char **argv ) | |
| 616 | +int DALI_EXPORT_API main( int argc, char **argv ) | |
| 616 | 617 | { |
| 617 | 618 | Application application = Application::New( &argc, &argv ); |
| 618 | 619 | ... | ... |
examples/bloom-view/bloom-view-example.cpp
examples/frame-callback/frame-callback.cpp
| ... | ... | @@ -19,6 +19,7 @@ |
| 19 | 19 | #include "frame-callback.h" |
| 20 | 20 | |
| 21 | 21 | using namespace Dali; |
| 22 | +using namespace std; | |
| 22 | 23 | |
| 23 | 24 | FrameCallback::FrameCallback() |
| 24 | 25 | : mActorIdContainer(), |
| ... | ... | @@ -46,7 +47,7 @@ void FrameCallback::Update( Dali::UpdateProxy& updateProxy, float /* elapsedSeco |
| 46 | 47 | if( updateProxy.GetPositionAndSize( i, position, size ) ) // Retrieve the position and size using the Actor ID. |
| 47 | 48 | { |
| 48 | 49 | float halfWidthPoint = stageHalfWidth - size.width * 0.5f; |
| 49 | - float xTranslation = std::abs( position.x ); | |
| 50 | + float xTranslation = abs( position.x ); | |
| 50 | 51 | if( xTranslation > halfWidthPoint ) |
| 51 | 52 | { |
| 52 | 53 | // Actor has hit the edge, adjust the size accordingly. | ... | ... |
examples/gestures/gesture-example.cpp
| ... | ... | @@ -23,6 +23,7 @@ |
| 23 | 23 | |
| 24 | 24 | using namespace Dali; |
| 25 | 25 | using namespace Dali::Toolkit; |
| 26 | +using namespace std; | |
| 26 | 27 | |
| 27 | 28 | namespace |
| 28 | 29 | { |
| ... | ... | @@ -322,8 +323,8 @@ private: |
| 322 | 323 | |
| 323 | 324 | // Move actor back to center if we're out of bounds |
| 324 | 325 | Vector2 halfStageSize = Stage::GetCurrent().GetSize() * 0.5f; |
| 325 | - if( ( std::abs( newPosition.x ) > halfStageSize.width ) || | |
| 326 | - ( std::abs( newPosition.y ) > halfStageSize.height ) ) | |
| 326 | + if( ( abs( newPosition.x ) > halfStageSize.width ) || | |
| 327 | + ( abs( newPosition.y ) > halfStageSize.height ) ) | |
| 327 | 328 | { |
| 328 | 329 | anim.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3::ZERO, AlphaFunction::EASE_IN ); |
| 329 | 330 | } | ... | ... |
examples/page-turn-view/page-turn-view-example.cpp
| ... | ... | @@ -277,7 +277,7 @@ void PageTurnExample::OnKeyEvent(const KeyEvent& event) |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | // Entry point for applications |
| 280 | -int main( int argc, char **argv ) | |
| 280 | +int DALI_EXPORT_API main( int argc, char **argv ) | |
| 281 | 281 | { |
| 282 | 282 | Application app = Application::New(&argc, &argv); |
| 283 | 283 | PageTurnExample test ( app ); | ... | ... |
examples/pre-render-callback/pre-render-callback-example.cpp
| ... | ... | @@ -253,7 +253,7 @@ private: |
| 253 | 253 | |
| 254 | 254 | } // namespace Dali |
| 255 | 255 | |
| 256 | -int main( int argc, char **argv ) | |
| 256 | +int DALI_EXPORT_API main( int argc, char **argv ) | |
| 257 | 257 | { |
| 258 | 258 | Dali::Application application = Dali::Application::New( &argc, &argv ); |
| 259 | 259 | Dali::PreRenderCallbackController controller( application ); | ... | ... |
examples/refraction-effect/refraction-effect-example.cpp
| ... | ... | @@ -475,7 +475,7 @@ private: |
| 475 | 475 | Dali::Vector<char> fileBuffer; |
| 476 | 476 | if( !Dali::FileLoader::ReadFile( objFileName, bufferSize, fileBuffer, Dali::FileLoader::FileType::TEXT ) ) |
| 477 | 477 | { |
| 478 | - DALI_LOG_WARNING( "file open failed for: \"%s\"", objFileName ); | |
| 478 | + DALI_LOG_WARNING( "file open failed for: \"%s\"", objFileName.c_str() ); | |
| 479 | 479 | return; |
| 480 | 480 | } |
| 481 | 481 | ... | ... |
examples/rendering-basic-pbr/ktx-loader.cpp
| ... | ... | @@ -114,7 +114,7 @@ bool LoadCubeMapFromKtxFile( const std::string& path, CubeData& cubedata ) |
| 114 | 114 | // Skip the key-values: |
| 115 | 115 | const long int imageSizeOffset = sizeof(KtxFileHeader) + header.bytesOfKeyValueData; |
| 116 | 116 | |
| 117 | - if( fseek(fp, imageSizeOffset, SEEK_END) ) | |
| 117 | + if( fseek(fp, 0, SEEK_END) ) | |
| 118 | 118 | { |
| 119 | 119 | return false; |
| 120 | 120 | } |
| ... | ... | @@ -125,6 +125,8 @@ bool LoadCubeMapFromKtxFile( const std::string& path, CubeData& cubedata ) |
| 125 | 125 | return false; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | + lSize -= imageSizeOffset; | |
| 129 | + | |
| 128 | 130 | rewind(fp); |
| 129 | 131 | |
| 130 | 132 | if( fseek(fp, imageSizeOffset, SEEK_SET) ) | ... | ... |
examples/simple-bitmap-font-text-label/simple-text-label-example.cpp
| ... | ... | @@ -194,7 +194,7 @@ void RunTest( Application& application ) |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** Entry point for Linux & Tizen applications */ |
| 197 | -int main( int argc, char **argv ) | |
| 197 | +int DALI_EXPORT_API main( int argc, char **argv ) | |
| 198 | 198 | { |
| 199 | 199 | Application application = Application::New( &argc, &argv ); |
| 200 | 200 | ... | ... |
examples/simple-text-field/simple-text-field.cpp
| ... | ... | @@ -96,7 +96,7 @@ void RunTest( Application& application ) |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** Entry point for Linux & Tizen applications */ |
| 99 | -int main( int argc, char **argv ) | |
| 99 | +int DALI_EXPORT_API main( int argc, char **argv ) | |
| 100 | 100 | { |
| 101 | 101 | // DALI_DEMO_THEME_PATH not passed to Application so TextField example uses default Toolkit style sheet. |
| 102 | 102 | Application application = Application::New( &argc, &argv ); | ... | ... |
examples/simple-text-label/simple-text-label-example.cpp
| ... | ... | @@ -95,7 +95,7 @@ void RunTest( Application& application ) |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** Entry point for Linux & Tizen applications */ |
| 98 | -int main( int argc, char **argv ) | |
| 98 | +int DALI_EXPORT_API main( int argc, char **argv ) | |
| 99 | 99 | { |
| 100 | 100 | Application application = Application::New( &argc, &argv ); |
| 101 | 101 | ... | ... |
examples/simple-text-renderer/simple-text-renderer-example.cpp
| ... | ... | @@ -342,7 +342,7 @@ private: |
| 342 | 342 | }; |
| 343 | 343 | |
| 344 | 344 | /** Entry point for Linux & Tizen applications */ |
| 345 | -int main( int argc, char **argv ) | |
| 345 | +int DALI_EXPORT_API main( int argc, char **argv ) | |
| 346 | 346 | { |
| 347 | 347 | Application application = Application::New( &argc, &argv ); |
| 348 | 348 | ... | ... |
examples/simple-text-visual/simple-text-visual-example.cpp
| ... | ... | @@ -104,7 +104,7 @@ void RunTest( Application& application ) |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** Entry point for Linux & Tizen applications */ |
| 107 | -int main( int argc, char **argv ) | |
| 107 | +int DALI_EXPORT_API main( int argc, char **argv ) | |
| 108 | 108 | { |
| 109 | 109 | Application application = Application::New( &argc, &argv ); |
| 110 | 110 | ... | ... |
packaging/com.samsung.dali-demo.spec
| ... | ... | @@ -57,7 +57,7 @@ CXXFLAGS+=" -D_ARCH_ARM_" |
| 57 | 57 | |
| 58 | 58 | cd %{_builddir}/%{name}-%{version}/build/tizen |
| 59 | 59 | |
| 60 | -cmake -DDALI_APP_DIR=%{dali_app_ro_dir} \ | |
| 60 | +cmake -DDALI_APP_DIR=%{dali_app_ro_dir}/bin \ | |
| 61 | 61 | -DLOCALE_DIR=%{locale_dir} \ |
| 62 | 62 | -DDALI_APP_RES_DIR=%{dali_app_res_dir} \ |
| 63 | 63 | %if 0%{?enable_debug} |
| ... | ... | @@ -75,7 +75,7 @@ make %{?jobs:-j%jobs} |
| 75 | 75 | %install |
| 76 | 76 | rm -rf %{buildroot} |
| 77 | 77 | cd build/tizen |
| 78 | -%make_install DALI_APP_DIR=%{dali_app_ro_dir} | |
| 78 | +%make_install DALI_APP_DIR=%{dali_app_ro_dir}/bin | |
| 79 | 79 | %make_install DDALI_APP_RES_DIR=%{dali_app_res_dir} |
| 80 | 80 | |
| 81 | 81 | mkdir -p %{buildroot}%{dali_xml_file_dir} | ... | ... |
resources/style/android/animated-gradient-call-active-style.json
0 → 100644
| 1 | +{ | |
| 2 | + "styles": { | |
| 3 | + "IncomeBackground": { | |
| 4 | + "background": { | |
| 5 | + "visualType": "ANIMATED_GRADIENT", | |
| 6 | + "gradientType": "RADIAL", | |
| 7 | + "unitType": "USER_SPACE", | |
| 8 | + "startPosition": [0.0, 0.0], | |
| 9 | + "endPosition": [180.0, 0.0], | |
| 10 | + "startColor": [0.1333, 0.1647, 0.2941, 1.0], | |
| 11 | + "endColor": [0.0784, 0.3961, 0.4863, 1.0], | |
| 12 | + "rotateCenter": [0.0, 0.0], | |
| 13 | + "rotateAmount": 0.0, | |
| 14 | + "offset": { | |
| 15 | + "startValue": 0.0, | |
| 16 | + "targetValue": 2.0, | |
| 17 | + "directionType": "BACKWARD", | |
| 18 | + "duration": 1.25, | |
| 19 | + "delay": 0.0, | |
| 20 | + "repeat": -1, | |
| 21 | + "repeatDelay": 0.0, | |
| 22 | + "motionType": "LOOP", | |
| 23 | + "easingType": "LINEAR" | |
| 24 | + } | |
| 25 | + } | |
| 26 | + }, | |
| 27 | + "ActiveBackground":{ | |
| 28 | + "background":{ | |
| 29 | + "visualType": "ANIMATED_GRADIENT", | |
| 30 | + "gradientType": "RADIAL", | |
| 31 | + "unitType": "USER_SPACE", | |
| 32 | + "startPosition": [0.0, 0.0], | |
| 33 | + "endPosition": [180.0, 0.0], | |
| 34 | + "startColor": [0.1066, 0.1318, 0.2353, 1.0], | |
| 35 | + "endColor": [0.0627, 0.3169, 0.3890, 1.0], | |
| 36 | + "rotateCenter": [0.0, 0.0], | |
| 37 | + "rotateAmount": 0.0, | |
| 38 | + "offset": { | |
| 39 | + "startValue": 0.0, | |
| 40 | + "targetValue": 2.0, | |
| 41 | + "directionType": "BACKWARD", | |
| 42 | + "duration": 4.0, | |
| 43 | + "delay": 0.0, | |
| 44 | + "repeat": -1, | |
| 45 | + "repeatDelay": 0.0, | |
| 46 | + "motionType": "LOOP", | |
| 47 | + "easingType": "LINEAR" | |
| 48 | + } | |
| 49 | + } | |
| 50 | + }, | |
| 51 | + "DeclineButton":{ | |
| 52 | + "background":{ | |
| 53 | + "visualType": "ANIMATED_GRADIENT", | |
| 54 | + "gradientType": "LINEAR", | |
| 55 | + "unitType": "USER_SPACE", | |
| 56 | + "startPosition": [-180.0, 0.0], | |
| 57 | + "endPosition": [180.0, 0.0], | |
| 58 | + "startColor": [0.8941, 0.0078, 0.0078, 1.0], | |
| 59 | + "endColor": [1.0000, 0.5961, 0.0000, 1.0], | |
| 60 | + "rotateCenter": [0.0, 0.0], | |
| 61 | + "rotateAmount": 0.78539816, | |
| 62 | + "offset": { | |
| 63 | + "startValue": 0.0, | |
| 64 | + "targetValue": 2.0, | |
| 65 | + "directionType": "FORWARD", | |
| 66 | + "duration": 1.8, | |
| 67 | + "delay": -1.2, | |
| 68 | + "repeat": -1, | |
| 69 | + "repeatDelay": 1.2, | |
| 70 | + "motionType": "LOOP", | |
| 71 | + "easingType": "IN_OUT" | |
| 72 | + } | |
| 73 | + } | |
| 74 | + } | |
| 75 | + } | |
| 76 | +} | ... | ... |
resources/style/android/base-theme.json
0 → 100644
| 1 | +/* | |
| 2 | + * Copyright (c) 2019 Samsung Electronics Co., Ltd | |
| 3 | + * | |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | + * you may not use this file except in compliance with the License. | |
| 6 | + * You may obtain a copy of the License at | |
| 7 | + * | |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | + * | |
| 10 | + * Unless required by applicable law or agreed to in writing, software | |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing permissions and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + */ | |
| 17 | + | |
| 18 | +{ | |
| 19 | + "styles": | |
| 20 | + { | |
| 21 | + "ConfirmationPopup":{ | |
| 22 | + "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/00_popup_bg.9.png" | |
| 23 | + }, | |
| 24 | + | |
| 25 | + "CustomPopupStyle":{ | |
| 26 | + "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/popup.9.png", | |
| 27 | + "popupBackgroundBorder":[0,4,4,0], | |
| 28 | + "tailUpImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-up.png", | |
| 29 | + "tailDownImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-down.png", | |
| 30 | + "tailLeftImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-left.png", | |
| 31 | + "tailRightImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-right.png" | |
| 32 | + }, | |
| 33 | + | |
| 34 | + "DemoTileBase": | |
| 35 | + { | |
| 36 | + "states": | |
| 37 | + { | |
| 38 | + "NORMAL": | |
| 39 | + { | |
| 40 | + "color":[0.4, 0.6, 0.9, 0.6], | |
| 41 | + "visuals": | |
| 42 | + { | |
| 43 | + "image": | |
| 44 | + { | |
| 45 | + "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture.9.png", | |
| 46 | +// TILE_BACKGROUND_ALPHA | |
| 47 | +// This shader takes a texture. | |
| 48 | +// An alpha discard is performed. | |
| 49 | +// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect. | |
| 50 | + "shader": | |
| 51 | + { | |
| 52 | + "fragmentShader":[ | |
| 53 | + " varying mediump vec2 vTexCoord;", | |
| 54 | + " uniform lowp vec4 uColor;", | |
| 55 | + " uniform sampler2D sTexture;", | |
| 56 | + " uniform mediump vec3 uCustomPosition;", | |
| 57 | + "", | |
| 58 | + " void main()", | |
| 59 | + " {", | |
| 60 | + " if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )", | |
| 61 | + " {", | |
| 62 | + " discard;", | |
| 63 | + " }", | |
| 64 | + "", | |
| 65 | + " mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );", | |
| 66 | + " mediump vec4 color = texture2D( sTexture, wrapTexCoord );", | |
| 67 | + " mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;", | |
| 68 | + "", | |
| 69 | + " gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );", | |
| 70 | + " }" | |
| 71 | + ] | |
| 72 | + } | |
| 73 | + } | |
| 74 | + } | |
| 75 | + }, | |
| 76 | + "FOCUSED": | |
| 77 | + { | |
| 78 | + "color":[0.3, 0.5, 0.8, 0.5], | |
| 79 | + "visuals": | |
| 80 | + { | |
| 81 | + "image": | |
| 82 | + { | |
| 83 | + "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture-focused.9.png", | |
| 84 | +// TILE_BACKGROUND_ALPHA | |
| 85 | +// This shader takes a texture. | |
| 86 | +// An alpha discard is performed. | |
| 87 | +// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect. | |
| 88 | + "shader": | |
| 89 | + { | |
| 90 | + "fragmentShader":[ | |
| 91 | + " varying mediump vec2 vTexCoord;", | |
| 92 | + " uniform lowp vec4 uColor;", | |
| 93 | + " uniform sampler2D sTexture;", | |
| 94 | + " uniform mediump vec3 uCustomPosition;", | |
| 95 | + "", | |
| 96 | + " void main()", | |
| 97 | + " {", | |
| 98 | + " if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )", | |
| 99 | + " {", | |
| 100 | + " discard;", | |
| 101 | + " }", | |
| 102 | + "", | |
| 103 | + " mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );", | |
| 104 | + " mediump vec4 color = texture2D( sTexture, wrapTexCoord );", | |
| 105 | + " mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;", | |
| 106 | + "", | |
| 107 | + " gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );", | |
| 108 | + " }" | |
| 109 | + ] | |
| 110 | + } | |
| 111 | + } | |
| 112 | + } | |
| 113 | + } | |
| 114 | + } | |
| 115 | + }, | |
| 116 | + "FocusActor": | |
| 117 | + { | |
| 118 | + "visuals": | |
| 119 | + { | |
| 120 | + "image": | |
| 121 | + { | |
| 122 | + "url":"{APPLICATION_RESOURCE_PATH}/images/tile-focus.9.png" | |
| 123 | + } | |
| 124 | + } | |
| 125 | + }, | |
| 126 | + "DemoTileBorder": | |
| 127 | + { | |
| 128 | + "visuals": | |
| 129 | + { | |
| 130 | + "image": | |
| 131 | + { | |
| 132 | + "url":"{APPLICATION_RESOURCE_PATH}/images/item-background.9.png" // TILE_BACKGROUND | |
| 133 | + } | |
| 134 | + } | |
| 135 | + }, | |
| 136 | + "TextLabelRosemary": | |
| 137 | + { | |
| 138 | + "fontFamily":"Rosemary" | |
| 139 | + }, | |
| 140 | + "TextLabel": | |
| 141 | + { | |
| 142 | + "fontStyle":{"weight":"normal"}, | |
| 143 | + "pointSize":8 | |
| 144 | + }, | |
| 145 | + "LauncherLabel": | |
| 146 | + { | |
| 147 | + "pointSize":8 | |
| 148 | + }, | |
| 149 | + | |
| 150 | + "ToolbarLabel": | |
| 151 | + { | |
| 152 | + "pointSize":8 | |
| 153 | + }, | |
| 154 | + | |
| 155 | + "BuilderLabel": | |
| 156 | + { | |
| 157 | + "pointSize":8 | |
| 158 | + }, | |
| 159 | + | |
| 160 | + "ScrollView": | |
| 161 | + { | |
| 162 | + "overshootEffectColor":"B018" | |
| 163 | + }, | |
| 164 | + | |
| 165 | + "ImageScalingGroupLabel": | |
| 166 | + { | |
| 167 | + "pointSize":8 | |
| 168 | + }, | |
| 169 | + | |
| 170 | + "ImageScalingButton": | |
| 171 | + { | |
| 172 | + "label":{ | |
| 173 | + "pointSize":8 | |
| 174 | + } | |
| 175 | + }, | |
| 176 | +// | |
| 177 | +// Simple Visuals Application Style section | |
| 178 | +// | |
| 179 | + "MyControl": | |
| 180 | + { | |
| 181 | + "states": | |
| 182 | + { | |
| 183 | + "NORMAL": | |
| 184 | + { | |
| 185 | + "visuals": | |
| 186 | + { | |
| 187 | + "iconVisual": | |
| 188 | + { | |
| 189 | + "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-13.png" | |
| 190 | + } | |
| 191 | + } | |
| 192 | + }, | |
| 193 | + "FOCUSED": | |
| 194 | + { | |
| 195 | + "visuals": | |
| 196 | + { | |
| 197 | + "iconVisual": | |
| 198 | + { | |
| 199 | + "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-83.png" | |
| 200 | + } | |
| 201 | + } | |
| 202 | + } | |
| 203 | + } | |
| 204 | + } | |
| 205 | + } | |
| 206 | +} | ... | ... |
resources/style/android/basic-light-theme.json
0 → 100644
| 1 | +/* | |
| 2 | + * Copyright (c) 2000-2017 Samsung Electronics Co., Ltd | |
| 3 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 | + * you may not use this file except in compliance with the License. | |
| 5 | + * You may obtain a copy of the License at | |
| 6 | + * | |
| 7 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 | + * | |
| 9 | + * Unless required by applicable law or agreed to in writing, software | |
| 10 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 | + * See the License for the specific language governing permissions and | |
| 13 | + * limitations under the License. | |
| 14 | + * | |
| 15 | + */ | |
| 16 | + | |
| 17 | +{ | |
| 18 | + "styles": | |
| 19 | + { | |
| 20 | + // | |
| 21 | + // Simple Visuals Application styling | |
| 22 | + // | |
| 23 | + "BasicLightButton": | |
| 24 | + { | |
| 25 | + "states": | |
| 26 | + { | |
| 27 | + "NORMAL": | |
| 28 | + { | |
| 29 | + "unselectedBackgroundVisual": | |
| 30 | + { | |
| 31 | + "url":"{APPLICATION_RESOURCE_PATH}/images/button-white-up.9.png" | |
| 32 | + } | |
| 33 | + }, | |
| 34 | + "FOCUSED": | |
| 35 | + { | |
| 36 | + "unselectedBackgroundVisual": | |
| 37 | + { | |
| 38 | + "url":"{APPLICATION_RESOURCE_PATH}/images/button-white-up.9.png" | |
| 39 | + } | |
| 40 | + } | |
| 41 | + } | |
| 42 | + } | |
| 43 | + } | |
| 44 | +} | ... | ... |
resources/style/android/contact-cards-example-theme.json
0 → 100644
| 1 | +/* | |
| 2 | + * Copyright (c) 2019 Samsung Electronics Co., Ltd. | |
| 3 | + * | |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | + * you may not use this file except in compliance with the License. | |
| 6 | + * You may obtain a copy of the License at | |
| 7 | + * | |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | + * | |
| 10 | + * Unless required by applicable law or agreed to in writing, software | |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing permissions and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + */ | |
| 17 | + | |
| 18 | +{ | |
| 19 | + "styles": | |
| 20 | + { | |
| 21 | + "ContactNameTextLabel": | |
| 22 | + { | |
| 23 | + "textColor": [ 0, 0, 0, 1 ], | |
| 24 | + "horizontalAlignment": "CENTER", | |
| 25 | + "pointSize": 8 | |
| 26 | + }, | |
| 27 | + | |
| 28 | + "ContactDetailTextLabel": | |
| 29 | + { | |
| 30 | + "textColor": [ 0, 0, 0, 1 ], | |
| 31 | + "multiLine": true, | |
| 32 | + "pointSize": 8 | |
| 33 | + } | |
| 34 | + } | |
| 35 | +} | ... | ... |
resources/style/android/progress-bar-example-theme.json
0 → 100644
| 1 | +/* | |
| 2 | + * Copyright (c) 2016 Samsung Electronics Co., Ltd. | |
| 3 | + * | |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | + * you may not use this file except in compliance with the License. | |
| 6 | + * You may obtain a copy of the License at | |
| 7 | + * | |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | + * | |
| 10 | + * Unless required by applicable law or agreed to in writing, software | |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing permissions and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + */ | |
| 17 | + | |
| 18 | +{ | |
| 19 | + "styles": | |
| 20 | + { | |
| 21 | + "ProgressBar": | |
| 22 | + { | |
| 23 | + "trackVisual":{ | |
| 24 | + "url":"{APPLICATION_RESOURCE_PATH}/images/new-progress-bar-track.9.png" | |
| 25 | + }, | |
| 26 | + "progressVisual":{ | |
| 27 | + "url":"{APPLICATION_RESOURCE_PATH}/images/new-progress-bar-progress.9.png" | |
| 28 | + }, | |
| 29 | + "secondaryProgressVisual":{ | |
| 30 | + "url":"{APPLICATION_RESOURCE_PATH}/images/new-progress-bar-secondary-progress.9.png" | |
| 31 | + } | |
| 32 | + } | |
| 33 | + } | |
| 34 | +} | ... | ... |
resources/style/android/simple-example-theme.json
0 → 100644
| 1 | +/* | |
| 2 | + * Copyright (c) 2000-2017 Samsung Electronics Co., Ltd | |
| 3 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 | + * you may not use this file except in compliance with the License. | |
| 5 | + * You may obtain a copy of the License at | |
| 6 | + * | |
| 7 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 | + * | |
| 9 | + * Unless required by applicable law or agreed to in writing, software | |
| 10 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 | + * See the License for the specific language governing permissions and | |
| 13 | + * limitations under the License. | |
| 14 | + * | |
| 15 | + */ | |
| 16 | + | |
| 17 | +{ | |
| 18 | + "styles": | |
| 19 | + { | |
| 20 | + // | |
| 21 | + // Simple Visuals Application styling | |
| 22 | + // | |
| 23 | + "MyControl": | |
| 24 | + { | |
| 25 | + "states": | |
| 26 | + { | |
| 27 | + "NORMAL": | |
| 28 | + { | |
| 29 | + "visuals": | |
| 30 | + { | |
| 31 | + "iconVisual": | |
| 32 | + { | |
| 33 | + "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-13.png" | |
| 34 | + } | |
| 35 | + } | |
| 36 | + }, | |
| 37 | + "FOCUSED": | |
| 38 | + { | |
| 39 | + "visuals": | |
| 40 | + { | |
| 41 | + "iconVisual": | |
| 42 | + { | |
| 43 | + "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-83.png" | |
| 44 | + } | |
| 45 | + } | |
| 46 | + } | |
| 47 | + } | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} | ... | ... |
resources/style/android/style-example-theme-one.json
0 → 100644
| 1 | +{ | |
| 2 | + "constants": | |
| 3 | + { | |
| 4 | + "STYLE_DIR":"{APPLICATION_RESOURCE_PATH}/style" | |
| 5 | + }, | |
| 6 | + "styles": | |
| 7 | + { | |
| 8 | + "Title":{ | |
| 9 | + "textColor":"#0000ff", | |
| 10 | + "background": | |
| 11 | + { | |
| 12 | + "visualType":"COLOR", | |
| 13 | + "mixColor": [ 1.0, 1.0, 1.0, 1.0 ] | |
| 14 | + } | |
| 15 | + }, | |
| 16 | + "TableView":{ | |
| 17 | + "background": | |
| 18 | + { | |
| 19 | + "visualType":"COLOR", | |
| 20 | + "mixColor": [ 1.0, 1.0, 1.0, 0.03 ] | |
| 21 | + } | |
| 22 | + }, | |
| 23 | + "FlexContainer":{ | |
| 24 | + "background": | |
| 25 | + { | |
| 26 | + "visualType":"COLOR", | |
| 27 | + "mixColor": [ 1.0, 1.0, 1.0, 0.1 ] | |
| 28 | + } | |
| 29 | + }, | |
| 30 | + "RadioButton":{ | |
| 31 | + "label":{ | |
| 32 | + "textColor": [1,1,1,1] | |
| 33 | + } | |
| 34 | + }, | |
| 35 | + "CheckBoxButton":{ | |
| 36 | + "label":{ | |
| 37 | + "textColor": [1,1,1,1] | |
| 38 | + } | |
| 39 | + }, | |
| 40 | + "ColorLabel1":{ | |
| 41 | + "textColor": [1,0,0,1] | |
| 42 | + }, | |
| 43 | + "ColorLabel2":{ | |
| 44 | + "textColor": [0,1,0,1] | |
| 45 | + }, | |
| 46 | + "ColorLabel3":{ | |
| 47 | + "textColor": [0.3,0.3,1,1] | |
| 48 | + }, | |
| 49 | + "ThemeLabel":{ | |
| 50 | + "textColor":[0,1,1,1] | |
| 51 | + }, | |
| 52 | + "PopupTitle":{ | |
| 53 | + "textColor":[1,1,1,1] | |
| 54 | + }, | |
| 55 | + "PopupBody":{ | |
| 56 | + "textColor":[1,1,0,1] | |
| 57 | + }, | |
| 58 | + "TextLabel":{ | |
| 59 | + "textColor":[0,0,0,1] | |
| 60 | + }, | |
| 61 | + "ColorSlider1":{ | |
| 62 | + "styles":["Slider"] | |
| 63 | + }, | |
| 64 | + "ColorSlider2":{ | |
| 65 | + "styles":["slider"] | |
| 66 | + }, | |
| 67 | + "ColorSlider3":{ | |
| 68 | + "styles":["slider"] | |
| 69 | + }, | |
| 70 | + "ImageChannelControl": | |
| 71 | + { | |
| 72 | + "enableVisibilityTransition": | |
| 73 | + [ | |
| 74 | + { | |
| 75 | + "target":"imageVisual", | |
| 76 | + "property":"opacity", | |
| 77 | + "initialValue":0, | |
| 78 | + "targetValue":1, | |
| 79 | + "animator": | |
| 80 | + { | |
| 81 | + "alphaFunction":"EASE_IN_OUT", | |
| 82 | + "timePeriod": | |
| 83 | + { | |
| 84 | + "duration":0.25, | |
| 85 | + "delay":0 | |
| 86 | + } | |
| 87 | + } | |
| 88 | + }, | |
| 89 | + { | |
| 90 | + "target":"imageVisual", | |
| 91 | + "property":"size", | |
| 92 | + "targetValue":[1,1] | |
| 93 | + } | |
| 94 | + ], | |
| 95 | + "disableVisibilityTransition": | |
| 96 | + [ | |
| 97 | + { | |
| 98 | + "target":"imageVisual", | |
| 99 | + "property":"opacity", | |
| 100 | + "targetValue":0, | |
| 101 | + "animator": | |
| 102 | + { | |
| 103 | + "alphaFunction":"EASE_IN_OUT", | |
| 104 | + "timePeriod": | |
| 105 | + { | |
| 106 | + "duration":0.25, | |
| 107 | + "delay":0 | |
| 108 | + } | |
| 109 | + } | |
| 110 | + }, | |
| 111 | + { | |
| 112 | + "target":"imageVisual", | |
| 113 | + "property":"size", | |
| 114 | + "targetValue":[1,1,1] | |
| 115 | + } | |
| 116 | + ] | |
| 117 | + }, | |
| 118 | + "ShadowButton": | |
| 119 | + { | |
| 120 | + "states": | |
| 121 | + { | |
| 122 | + "NORMAL": | |
| 123 | + { | |
| 124 | + "visuals": | |
| 125 | + { | |
| 126 | + "backgroundVisual":{ | |
| 127 | + "visualType":"IMAGE", | |
| 128 | + "url":"{STYLE_DIR}/images/shadowButtonBg.9.png", | |
| 129 | + "depthIndex":0 | |
| 130 | + }, | |
| 131 | + | |
| 132 | + "checkboxBgVisual":{ | |
| 133 | + "visualType":"IMAGE", | |
| 134 | + "url":"{STYLE_DIR}/images/CheckBg.png", | |
| 135 | + "transform":{ | |
| 136 | + "size":[0.12, 0.37], | |
| 137 | + "offset":[30,0], | |
| 138 | + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], | |
| 139 | + "sizePolicy":["RELATIVE", "RELATIVE"], | |
| 140 | + "origin":"CENTER_BEGIN", | |
| 141 | + "anchorPoint":"CENTER_BEGIN" | |
| 142 | + }, | |
| 143 | + "depthIndex":1 | |
| 144 | + }, | |
| 145 | + | |
| 146 | + "labelVisual":{ | |
| 147 | + "visualType":"TEXT", | |
| 148 | + "text":"Don't show again", | |
| 149 | + "pointSize":8, | |
| 150 | + "horizontalAlignment":"END", | |
| 151 | + "verticalAlignment":"CENTER", | |
| 152 | + "textColor":[1,1,1,1], | |
| 153 | + "mixColor":[0,0,0,1], | |
| 154 | + "transform":{ | |
| 155 | + "size":[0.9, 0.9], | |
| 156 | + "offset":[-30,0], | |
| 157 | + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], | |
| 158 | + "sizePolicy":["RELATIVE", "RELATIVE"], | |
| 159 | + "origin":"CENTER_END", | |
| 160 | + "anchorPoint":"CENTER_END" | |
| 161 | + }, | |
| 162 | + "depthIndex":1 | |
| 163 | + } | |
| 164 | + }, | |
| 165 | + | |
| 166 | + "states": | |
| 167 | + { | |
| 168 | + "CHECKED": | |
| 169 | + { | |
| 170 | + "visuals": | |
| 171 | + { | |
| 172 | + "checkboxFgVisual":{ | |
| 173 | + "visualType":"IMAGE", | |
| 174 | + "url":"{STYLE_DIR}/images/Tick.png", | |
| 175 | + "transform":{ | |
| 176 | + "size":[0.12, 0.37], | |
| 177 | + "offset":[30,0], | |
| 178 | + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], | |
| 179 | + "sizePolicy":["RELATIVE", "RELATIVE"], | |
| 180 | + "origin":"CENTER_BEGIN", | |
| 181 | + "anchorPoint":"CENTER_BEGIN" | |
| 182 | + }, | |
| 183 | + "depthIndex":2 | |
| 184 | + } | |
| 185 | + }, | |
| 186 | + "entryTransition": | |
| 187 | + [ | |
| 188 | + { | |
| 189 | + "target":"checkboxFgVisual", | |
| 190 | + "property":"pixelArea", | |
| 191 | + "initialValue":[0.0, 0.0, 0.0, 1.0], | |
| 192 | + "targetValue":[0.0, 0.0, 1.0, 1.0], | |
| 193 | + "animator": | |
| 194 | + { | |
| 195 | + "alphaFunction":"EASE_IN", | |
| 196 | + "timePeriod": | |
| 197 | + { | |
| 198 | + "duration":0.4, | |
| 199 | + "delay":0 | |
| 200 | + } | |
| 201 | + } | |
| 202 | + }, | |
| 203 | + { | |
| 204 | + "target":"checkboxFgVisual", | |
| 205 | + "property":"size", | |
| 206 | + "initialValue":[0.0, 0.37], | |
| 207 | + "targetValue":[0.12, 0.37], | |
| 208 | + "animator": | |
| 209 | + { | |
| 210 | + "alphaFunction":"EASE_IN", | |
| 211 | + "timePeriod": | |
| 212 | + { | |
| 213 | + "duration":0.4, | |
| 214 | + "delay":0 | |
| 215 | + } | |
| 216 | + } | |
| 217 | + } | |
| 218 | + ], | |
| 219 | + "exitTransition": | |
| 220 | + [ | |
| 221 | + { | |
| 222 | + "target":"checkboxFgVisual", | |
| 223 | + "property":"pixelArea", | |
| 224 | + "initialValue":[0.0, 0.0, 1.0, 1.0], | |
| 225 | + "targetValue":[0.0, 0.0, 0.0, 1.0], | |
| 226 | + "animator": | |
| 227 | + { | |
| 228 | + "alphaFunction":"EASE_OUT", | |
| 229 | + "timePeriod": | |
| 230 | + { | |
| 231 | + "duration":0.4, | |
| 232 | + "delay":0 | |
| 233 | + } | |
| 234 | + } | |
| 235 | + }, | |
| 236 | + { | |
| 237 | + "target":"checkboxFgVisual", | |
| 238 | + "property":"size", | |
| 239 | + "targetValue":[0.0, 0.37], | |
| 240 | + "animator": | |
| 241 | + { | |
| 242 | + "alphaFunction":"EASE_OUT", | |
| 243 | + "timePeriod": | |
| 244 | + { | |
| 245 | + "duration":0.4, | |
| 246 | + "delay":0 | |
| 247 | + } | |
| 248 | + } | |
| 249 | + } | |
| 250 | + ] | |
| 251 | + }, | |
| 252 | + "UNCHECKED": | |
| 253 | + { | |
| 254 | + } | |
| 255 | + } | |
| 256 | + }, | |
| 257 | + //"FOCUSED" | |
| 258 | + "DISABLED": | |
| 259 | + { | |
| 260 | + "visuals": | |
| 261 | + { | |
| 262 | + "checkboxBgVisual":{ | |
| 263 | + "visualType":"IMAGE", | |
| 264 | + "url":"{STYLE_DIR}/images/CheckBg.png", | |
| 265 | + "transform":{ | |
| 266 | + "size":[0.09, 0.28], | |
| 267 | + "offset":[30,0], | |
| 268 | + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], | |
| 269 | + "sizePolicy":["RELATIVE", "RELATIVE"], | |
| 270 | + "origin":"CENTER_BEGIN", | |
| 271 | + "anchorPoint":"CENTER_BEGIN" | |
| 272 | + }, | |
| 273 | + "depthIndex":0 | |
| 274 | + }, | |
| 275 | + | |
| 276 | + "checkboxFgVisual":{ | |
| 277 | + "visualType":"IMAGE", | |
| 278 | + "url":"{STYLE_DIR}/images/Tick.png", | |
| 279 | + "transform":{ | |
| 280 | + "size":[0.09, 0.28], | |
| 281 | + "offset":[30,0], | |
| 282 | + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], | |
| 283 | + "sizePolicy":["RELATIVE", "RELATIVE"], | |
| 284 | + "origin":"CENTER_BEGIN", | |
| 285 | + "anchorPoint":"CENTER_BEGIN" | |
| 286 | + }, | |
| 287 | + "depthIndex":1 | |
| 288 | + }, | |
| 289 | + | |
| 290 | + "labelVisual":{ | |
| 291 | + "visualType":"TEXT", | |
| 292 | + "text":"Don't show again", | |
| 293 | + "pointSize":8, | |
| 294 | + "horizontalAlignment":"END", | |
| 295 | + "verticalAlignment":"CENTER", | |
| 296 | + "textColor":[1,1,1,1], | |
| 297 | + "mixColor":[0.3, 0.3, 0.3, 1], | |
| 298 | + "transform":{ | |
| 299 | + "size":[0.9, 0.9], | |
| 300 | + "offset":[-30,0], | |
| 301 | + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], | |
| 302 | + "sizePolicy":["RELATIVE", "RELATIVE"], | |
| 303 | + "origin":"CENTER_END", | |
| 304 | + "anchorPoint":"CENTER_END" | |
| 305 | + }, | |
| 306 | + "depthIndex":1 | |
| 307 | + } | |
| 308 | + }, | |
| 309 | + "states": | |
| 310 | + { | |
| 311 | + "CHECKED": | |
| 312 | + { | |
| 313 | + "visuals": | |
| 314 | + { | |
| 315 | + "checkboxFgVisual":{ | |
| 316 | + "visualType":"IMAGE", | |
| 317 | + "url":"{STYLE_DIR}/images/Tick.png", | |
| 318 | + "transform":{ | |
| 319 | + "size":[0.09, 0.28], | |
| 320 | + "offset":[30,0], | |
| 321 | + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], | |
| 322 | + "sizePolicy":["RELATIVE", "RELATIVE"], | |
| 323 | + "origin":"CENTER_BEGIN", | |
| 324 | + "anchorPoint":"CENTER_BEGIN" | |
| 325 | + }, | |
| 326 | + "depthIndex":2 | |
| 327 | + } | |
| 328 | + } | |
| 329 | + }, | |
| 330 | + "UNCHECKED": | |
| 331 | + { | |
| 332 | + } | |
| 333 | + } | |
| 334 | + } | |
| 335 | + }, | |
| 336 | + "transitions": | |
| 337 | + [ | |
| 338 | + { | |
| 339 | + "from":"DISABLED", | |
| 340 | + "to":"NORMAL", | |
| 341 | + "visualName":"backgroundVisual", | |
| 342 | + "effect":"FADE_IN", | |
| 343 | + "animator": | |
| 344 | + { | |
| 345 | + "alphaFunction":"EASE_OUT_BACK", | |
| 346 | + "duration":0.8 | |
| 347 | + } | |
| 348 | + }, | |
| 349 | + { | |
| 350 | + "from":"DISABLED", | |
| 351 | + "to":"NORMAL", | |
| 352 | + "visualName":"*", | |
| 353 | + "effect":"CROSSFADE", | |
| 354 | + "animator": | |
| 355 | + { | |
| 356 | + "alphaFunction":"EASE_OUT_BACK", | |
| 357 | + "duration":0.8 | |
| 358 | + } | |
| 359 | + }, | |
| 360 | + { | |
| 361 | + "from":"NORMAL", | |
| 362 | + "to":"DISABLED", | |
| 363 | + "visualName":"backgroundVisual", | |
| 364 | + "effect":"FADE_OUT", | |
| 365 | + "animator": | |
| 366 | + { | |
| 367 | + "alphaFunction":"EASE_OUT_BACK", | |
| 368 | + "duration":0.8 | |
| 369 | + } | |
| 370 | + }, | |
| 371 | + { | |
| 372 | + "from":"NORMAL", | |
| 373 | + "to":"DISABLED", | |
| 374 | + "visualName":"*", | |
| 375 | + "effect":"CROSSFADE", | |
| 376 | + "animator": | |
| 377 | + { | |
| 378 | + "alphaFunction":"EASE_OUT_BACK", | |
| 379 | + "duration":0.8 | |
| 380 | + } | |
| 381 | + } | |
| 382 | + ] | |
| 383 | + }, | |
| 384 | + "BeatControl": | |
| 385 | + { | |
| 386 | + "beatVisual":{ | |
| 387 | + "visualType":"IMAGE", | |
| 388 | + "url":"{APPLICATION_RESOURCE_PATH}/images/Logo-for-demo.png" | |
| 389 | + }, | |
| 390 | + | |
| 391 | + "bounceTransition": | |
| 392 | + [ | |
| 393 | + { | |
| 394 | + "target":"beatVisual", | |
| 395 | + "property":"size", | |
| 396 | + "initialValue":[0.5, 0.5], | |
| 397 | + "targetValue":[0.75, 0.75], | |
| 398 | + "animator": | |
| 399 | + { | |
| 400 | + "alphaFunction":"BOUNCE", | |
| 401 | + "timePeriod": | |
| 402 | + { | |
| 403 | + "duration":0.5, | |
| 404 | + "delay":0 | |
| 405 | + } | |
| 406 | + } | |
| 407 | + } | |
| 408 | + ], | |
| 409 | + | |
| 410 | + "leftTransition": | |
| 411 | + [ | |
| 412 | + { | |
| 413 | + "target":"beatVisual", | |
| 414 | + "property":"offset", | |
| 415 | + "initialValue":[0, 0], | |
| 416 | + "targetValue":[0.25, 0], | |
| 417 | + "animator": | |
| 418 | + { | |
| 419 | + "alphaFunction":"BOUNCE", | |
| 420 | + "timePeriod": | |
| 421 | + { | |
| 422 | + "duration":0.5, | |
| 423 | + "delay":0 | |
| 424 | + } | |
| 425 | + } | |
| 426 | + } | |
| 427 | + ], | |
| 428 | + | |
| 429 | + "upTransition": | |
| 430 | + [ | |
| 431 | + { | |
| 432 | + "target":"beatVisual", | |
| 433 | + "property":"offset", | |
| 434 | + "initialValue":[0, 0], | |
| 435 | + "targetValue":[0, 0.25], | |
| 436 | + "animator": | |
| 437 | + { | |
| 438 | + "alphaFunction":"BOUNCE", | |
| 439 | + "timePeriod": | |
| 440 | + { | |
| 441 | + "duration":0.5, | |
| 442 | + "delay":0 | |
| 443 | + } | |
| 444 | + } | |
| 445 | + } | |
| 446 | + ], | |
| 447 | + | |
| 448 | + "fadeTransition": | |
| 449 | + [ | |
| 450 | + { | |
| 451 | + "target":"beatVisual", | |
| 452 | + "property":"opacity", | |
| 453 | + "targetValue":0, | |
| 454 | + "animator": | |
| 455 | + { | |
| 456 | + "alphaFunction":"BOUNCE", | |
| 457 | + "timePeriod": | |
| 458 | + { | |
| 459 | + "duration":0.8, | |
| 460 | + "delay":0 | |
| 461 | + } | |
| 462 | + } | |
| 463 | + } | |
| 464 | + ] | |
| 465 | + } | |
| 466 | + } | |
| 467 | +} | ... | ... |
resources/style/android/style-example-theme-three.json
0 → 100644
| 1 | +{ | |
| 2 | + "styles": | |
| 3 | + { | |
| 4 | + "Title":{ | |
| 5 | + "textColor":"#0000ff", | |
| 6 | + "background": | |
| 7 | + { | |
| 8 | + "visualType":"COLOR", | |
| 9 | + "mixColor": [ 1.0, 1.0, 1.0, 1.0 ] | |
| 10 | + } | |
| 11 | + }, | |
| 12 | + "TableView":{ | |
| 13 | + "background": | |
| 14 | + { | |
| 15 | + "visualType":"COLOR", | |
| 16 | + "mixColor": [ 1.0, 1.0, 1.0, 0.03 ] | |
| 17 | + } | |
| 18 | + }, | |
| 19 | + "RadioButton":{ | |
| 20 | + "label":{ | |
| 21 | + "textColor": [1,1,1,1] | |
| 22 | + } | |
| 23 | + }, | |
| 24 | + "CheckboxButton":{ | |
| 25 | + "label":{ | |
| 26 | + "textColor": [1,1,1,1] | |
| 27 | + } | |
| 28 | + }, | |
| 29 | + "ColorLabel1":{ | |
| 30 | + "textColor": [1,0,0,1] | |
| 31 | + }, | |
| 32 | + "ColorLabel2":{ | |
| 33 | + "textColor": [0,1,0,1] | |
| 34 | + }, | |
| 35 | + "ColorLabel3":{ | |
| 36 | + "textColor": [0.3,0.3,1,1] | |
| 37 | + }, | |
| 38 | + "ThemeLabel":{ | |
| 39 | + "textColor":[0,1,1,1] | |
| 40 | + }, | |
| 41 | + "PopupTitle":{ | |
| 42 | + "textColor":[1,1,1,1] | |
| 43 | + }, | |
| 44 | + "PopupBody":{ | |
| 45 | + "textColor":[1,1,0,1] | |
| 46 | + }, | |
| 47 | + "TextLabel":{ | |
| 48 | + "textColor":[0,0,0,1] | |
| 49 | + }, | |
| 50 | + "ImageChannelControl": | |
| 51 | + { | |
| 52 | + "enableVisibilityTransition": | |
| 53 | + [ | |
| 54 | + { | |
| 55 | + "target":"imageVisual", | |
| 56 | + "property":"size", | |
| 57 | + "initialValue":[0.1,0.1], | |
| 58 | + "targetValue":[1,1], | |
| 59 | + "animator": | |
| 60 | + { | |
| 61 | + "alphaFunction":"EASE_IN", | |
| 62 | + "timePeriod": | |
| 63 | + { | |
| 64 | + "duration":0.3, | |
| 65 | + "delay":0.1 | |
| 66 | + } | |
| 67 | + } | |
| 68 | + }, | |
| 69 | + { | |
| 70 | + "target":"imageVisual", | |
| 71 | + "property":"mixColor", | |
| 72 | + "targetValue":[1,1,1,1] | |
| 73 | + } | |
| 74 | + ], | |
| 75 | + "disableVisibilityTransition": | |
| 76 | + [ | |
| 77 | + { | |
| 78 | + "target":"imageVisual", | |
| 79 | + "property":"size", | |
| 80 | + "initialValue":[1,1], | |
| 81 | + "targetValue":[0.1,0.1], | |
| 82 | + "animator": | |
| 83 | + { | |
| 84 | + "alphaFunction":"EASE_OUT", | |
| 85 | + "timePeriod": | |
| 86 | + { | |
| 87 | + "duration":0.3, | |
| 88 | + "delay":0.0 | |
| 89 | + } | |
| 90 | + } | |
| 91 | + }, | |
| 92 | + { | |
| 93 | + "target":"imageVisual", | |
| 94 | + "property":"mixColor", | |
| 95 | + "targetValue":[1,1,1,0], | |
| 96 | + "animator": | |
| 97 | + { | |
| 98 | + "alphaFunction":"EASE_OUT", | |
| 99 | + "timePeriod": | |
| 100 | + { | |
| 101 | + "duration":0.3, | |
| 102 | + "delay":0.0 | |
| 103 | + } | |
| 104 | + } | |
| 105 | + } | |
| 106 | + ] | |
| 107 | + } | |
| 108 | + } | |
| 109 | +} | ... | ... |
resources/style/android/style-example-theme-two.json
0 → 100644
| 1 | +{ | |
| 2 | + "constants": | |
| 3 | + { | |
| 4 | + "STYLE_DIR":"{APPLICATION_RESOURCE_PATH}/style" | |
| 5 | + }, | |
| 6 | + "styles": | |
| 7 | + { | |
| 8 | + "Title":{ | |
| 9 | + "textColor":"#0000ff", | |
| 10 | + "background": | |
| 11 | + { | |
| 12 | + "visualType":"COLOR", | |
| 13 | + "mixColor": [ 1.0, 1.0, 1.0, 1.0 ] | |
| 14 | + } | |
| 15 | + }, | |
| 16 | + "TableView":{ | |
| 17 | + "background": | |
| 18 | + { | |
| 19 | + "visualType":"GRADIENT", | |
| 20 | + "startPosition": [0,-1], | |
| 21 | + "endPosition": [0,1], | |
| 22 | + "stopColor": [ [ 1.0, 0.0, 1.0, 0.03 ], [1.0,0.0,1.0,0.15] ] | |
| 23 | + } | |
| 24 | + }, | |
| 25 | + | |
| 26 | + // Change an icon size, see if it gets properly re-sized | |
| 27 | + "RadioButton":{ | |
| 28 | + "unselectedVisual": | |
| 29 | + { | |
| 30 | + "visualType": "IMAGE", | |
| 31 | + "url": "{STYLE_DIR}/images/radio-button-unselected.png" | |
| 32 | + }, | |
| 33 | + "selectedVisual": | |
| 34 | + { | |
| 35 | + "visualType": "IMAGE", | |
| 36 | + "url": "{STYLE_DIR}/images/radio-button-selected.png" | |
| 37 | + }, | |
| 38 | + "label":{ | |
| 39 | + "textColor": [0.1,1,1,1] | |
| 40 | + } | |
| 41 | + }, | |
| 42 | + "checkboxbutton":{ | |
| 43 | + "label":{ | |
| 44 | + "textColor": [1,1,1,1] | |
| 45 | + } | |
| 46 | + }, | |
| 47 | + "colorLabel1":{ | |
| 48 | + "textColor": [1,0,0,1] | |
| 49 | + }, | |
| 50 | + "colorLabel2":{ | |
| 51 | + "textColor": [0,1,0,1] | |
| 52 | + }, | |
| 53 | + "colorLabel3":{ | |
| 54 | + "textColor": [0.3,0.3,1,1] | |
| 55 | + }, | |
| 56 | + "themelabel":{ | |
| 57 | + "textColor":[0,1,1,1] | |
| 58 | + }, | |
| 59 | + "popupTitle":{ | |
| 60 | + "textColor":[1,1,1,1] | |
| 61 | + }, | |
| 62 | + "popupBody":{ | |
| 63 | + "textColor":[1,1,0,1] | |
| 64 | + }, | |
| 65 | + | |
| 66 | + // Note, this overrides any non-renamed label styles, e.g. those in a button. | |
| 67 | + "TextLabel":{ | |
| 68 | + //"textColor":[0,0,0,1] | |
| 69 | + }, | |
| 70 | + | |
| 71 | + "ThinSlider":{ | |
| 72 | + "styles": ["slider"], | |
| 73 | + "showPopup":true, | |
| 74 | + "showValue":false, | |
| 75 | + "valuePrecision":0, | |
| 76 | + "handleVisual":{ | |
| 77 | + "size":[48,48] | |
| 78 | + }, | |
| 79 | + "trackVisual":{ | |
| 80 | + "size":[10, 10] | |
| 81 | + }, | |
| 82 | + "enabled":true | |
| 83 | + }, | |
| 84 | + "ColorSlider1":{ | |
| 85 | + "styles":["ThinSlider"], | |
| 86 | + "progressVisual":{ | |
| 87 | + "url":"{STYLE_DIR}/images/slider-skin-progress-red.9.png" | |
| 88 | + } | |
| 89 | + }, | |
| 90 | + "ColorSlider2":{ | |
| 91 | + "styles":["ThinSlider"], | |
| 92 | + "progressVisual":{ | |
| 93 | + "url":"{STYLE_DIR}/images/slider-skin-progress-green.9.png" | |
| 94 | + } | |
| 95 | + }, | |
| 96 | + "ColorSlider3":{ | |
| 97 | + "styles":["thinslider"], | |
| 98 | + "progressVisual":{ | |
| 99 | + "url":"{STYLE_DIR}/images/slider-skin-progress-blue.9.png" | |
| 100 | + } | |
| 101 | + }, | |
| 102 | + "ImageChannelControl": | |
| 103 | + { | |
| 104 | + "enableVisibilityTransition": | |
| 105 | + [ | |
| 106 | + { | |
| 107 | + "target":"imageVisual", | |
| 108 | + "property":"mixColor", | |
| 109 | + "initialValue":[1,1,1,0], | |
| 110 | + "targetValue":[1,1,1,1], | |
| 111 | + "animator": | |
| 112 | + { | |
| 113 | + "alphaFunction":"EASE_IN_OUT", | |
| 114 | + "timePeriod": | |
| 115 | + { | |
| 116 | + "duration":0.4, | |
| 117 | + "delay":0 | |
| 118 | + } | |
| 119 | + } | |
| 120 | + }, | |
| 121 | + { | |
| 122 | + "target":"imageVisual", | |
| 123 | + "property":"size", | |
| 124 | + "targetValue":[1,1] | |
| 125 | + } | |
| 126 | + ], | |
| 127 | + "disableVisibilityTransition": | |
| 128 | + [ | |
| 129 | + { | |
| 130 | + "target":"imageVisual", | |
| 131 | + "property":"mixColor", | |
| 132 | + "targetValue":[1,1,1,0], | |
| 133 | + "animator": | |
| 134 | + { | |
| 135 | + "alphaFunction":"EASE_IN_OUT", | |
| 136 | + "timePeriod": | |
| 137 | + { | |
| 138 | + "duration":0.4, | |
| 139 | + "delay":0.2 | |
| 140 | + } | |
| 141 | + } | |
| 142 | + }, | |
| 143 | + { | |
| 144 | + "target":"imageVisual", | |
| 145 | + "property":"size", | |
| 146 | + "targetValue":[1,1] | |
| 147 | + } | |
| 148 | + ] | |
| 149 | + }, | |
| 150 | + "ShadowButton": | |
| 151 | + { | |
| 152 | + "backgroundVisual":{ | |
| 153 | + "visualType":"IMAGE", | |
| 154 | + "url":"{STYLE_DIR}/images/shadowButtonBg.9.png" | |
| 155 | + }, | |
| 156 | + "checkboxBgVisual":{ | |
| 157 | + "visualType":"IMAGE", | |
| 158 | + "url":"{STYLE_DIR}/images/CheckBg.png", | |
| 159 | + "transform":{ | |
| 160 | + "size":[0.09, 0.28], | |
| 161 | + "offset":[30,0], | |
| 162 | + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], | |
| 163 | + "sizePolicy":["RELATIVE", "RELATIVE"], | |
| 164 | + "origin":"CENTER_BEGIN", | |
| 165 | + "anchorPoint":"CENTER_BEGIN" | |
| 166 | + } | |
| 167 | + }, | |
| 168 | + "checkboxFgVisual":{ | |
| 169 | + "visualType":"IMAGE", | |
| 170 | + "url":"{STYLE_DIR}/images/Tick.png", | |
| 171 | + "transform":{ | |
| 172 | + "size":[0.09, 0.28], | |
| 173 | + "offset":[30,0], | |
| 174 | + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], | |
| 175 | + "sizePolicy":["RELATIVE", "RELATIVE"], | |
| 176 | + "origin":"CENTER_BEGIN", | |
| 177 | + "anchorPoint":"CENTER_BEGIN" | |
| 178 | + } | |
| 179 | + }, | |
| 180 | + "labelVisual":{ | |
| 181 | + "visualType":"TEXT", | |
| 182 | + "text":"Don't show again", | |
| 183 | + "pointSize":8, | |
| 184 | + "horizontalAlignment":"END", | |
| 185 | + "verticalAlignment":"CENTER", | |
| 186 | + "textColor":[1,1,1,1], | |
| 187 | + "mixColor":[0.3, 0.3, 0.3, 1], | |
| 188 | + "transform":{ | |
| 189 | + "size":[0.9, 0.9], | |
| 190 | + "offset":[-30,0], | |
| 191 | + "offsetPolicy":["ABSOLUTE", "ABSOLUTE"], | |
| 192 | + "sizePolicy":["RELATIVE", "RELATIVE"], | |
| 193 | + "origin":"CENTER_END", | |
| 194 | + "anchorPoint":"CENTER_END" | |
| 195 | + } | |
| 196 | + }, | |
| 197 | + "activeTransition": | |
| 198 | + [ | |
| 199 | + { | |
| 200 | + "target":"checkboxBgVisual", | |
| 201 | + "property":"size", | |
| 202 | + "initialValue":[0.09, 0.28], | |
| 203 | + "targetValue":[0.12, 0.37], | |
| 204 | + "animator": | |
| 205 | + { | |
| 206 | + "alphaFunction":"EASE_OUT_BACK", | |
| 207 | + "timePeriod": | |
| 208 | + { | |
| 209 | + "duration":0.8, | |
| 210 | + "delay":0 | |
| 211 | + } | |
| 212 | + } | |
| 213 | + } | |
| 214 | + ], | |
| 215 | + "inactiveTransition": | |
| 216 | + [ | |
| 217 | + { | |
| 218 | + "target":"checkboxBgVisual", | |
| 219 | + "property":"size", | |
| 220 | + "initialValue":[0.12, 0.37], | |
| 221 | + "targetValue":[0.09, 0.28], | |
| 222 | + "animator": | |
| 223 | + { | |
| 224 | + "alphaFunction":"EASE_OUT_BACK", | |
| 225 | + "timePeriod": | |
| 226 | + { | |
| 227 | + "duration":0.8, | |
| 228 | + "delay":0 | |
| 229 | + } | |
| 230 | + } | |
| 231 | + } | |
| 232 | + ] | |
| 233 | + } | |
| 234 | + } | |
| 235 | +} | ... | ... |
resources/style/android/text-editor-example-theme.json
0 → 100644
| 1 | +/* | |
| 2 | + * Copyright (c) 2000-2017 Samsung Electronics Co., Ltd | |
| 3 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 | + * you may not use this file except in compliance with the License. | |
| 5 | + * You may obtain a copy of the License at | |
| 6 | + * | |
| 7 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 | + * | |
| 9 | + * Unless required by applicable law or agreed to in writing, software | |
| 10 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 | + * See the License for the specific language governing permissions and | |
| 13 | + * limitations under the License. | |
| 14 | + * | |
| 15 | + */ | |
| 16 | + | |
| 17 | +{ | |
| 18 | + "styles": | |
| 19 | + { | |
| 20 | + "ScrollBar": | |
| 21 | + { | |
| 22 | + "indicatorShowDuration":1.0, | |
| 23 | + "indicatorHideDuration":1.0, | |
| 24 | + "background": { | |
| 25 | + "rendererType": "image", | |
| 26 | + "url": "{APPLICATION_RESOURCE_PATH}/images/button-disabled.9.png" | |
| 27 | + } | |
| 28 | + }, | |
| 29 | + "ScrollBarIndicator": | |
| 30 | + { | |
| 31 | + "resourceUrl":"{APPLICATION_RESOURCE_PATH}/images/button-white-up.9.png" | |
| 32 | + } | |
| 33 | + } | |
| 34 | +} | ... | ... |
resources/style/android/tooltip-example-theme.json
0 → 100644
| 1 | +/* | |
| 2 | + * Copyright (c) 2016 Samsung Electronics Co., Ltd. | |
| 3 | + * | |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | + * you may not use this file except in compliance with the License. | |
| 6 | + * You may obtain a copy of the License at | |
| 7 | + * | |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | + * | |
| 10 | + * Unless required by applicable law or agreed to in writing, software | |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing permissions and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + */ | |
| 17 | + | |
| 18 | +{ | |
| 19 | + "styles": | |
| 20 | + { | |
| 21 | + "TooltipTextOnly" : | |
| 22 | + { | |
| 23 | + "tooltip": "Using defaults defined in the Toolkit stylesheet" | |
| 24 | + }, | |
| 25 | + | |
| 26 | + "TooltipArray" : | |
| 27 | + { | |
| 28 | + "tooltip" : | |
| 29 | + { | |
| 30 | + "content" : | |
| 31 | + [ | |
| 32 | + { | |
| 33 | + "visualType" : "IMAGE", | |
| 34 | + "url" : "{APPLICATION_RESOURCE_PATH}/images/application-icon-0.png", | |
| 35 | + "desiredWidth" : 75, | |
| 36 | + "desiredHeight" : 75 | |
| 37 | + }, | |
| 38 | + { | |
| 39 | + "visualType" : "TEXT", | |
| 40 | + "text" : "An icon on the left and\nmulti-line text on the right", | |
| 41 | + "multiLine" : true, | |
| 42 | + "pointSize" : 8 | |
| 43 | + } | |
| 44 | + ], | |
| 45 | + "tail" : true | |
| 46 | + } | |
| 47 | + }, | |
| 48 | + | |
| 49 | + "TooltipCustom" : | |
| 50 | + { | |
| 51 | + "tooltip": | |
| 52 | + { | |
| 53 | + "content": | |
| 54 | + { | |
| 55 | + "visualType" : "TEXT", | |
| 56 | + "textColor" : [1,1,1,1], | |
| 57 | + "text" : "Completely custom style\nthat disappears on movement", | |
| 58 | + "multiLine" : true, | |
| 59 | + "pointSize" : 8 | |
| 60 | + }, | |
| 61 | + "waitTime":0.5, | |
| 62 | + "background": | |
| 63 | + { | |
| 64 | + "visual":"{APPLICATION_RESOURCE_PATH}/images/tooltip.9.png", | |
| 65 | + "border":[1,5,5,1] | |
| 66 | + }, | |
| 67 | + "tail": | |
| 68 | + { | |
| 69 | + "visibility":true, | |
| 70 | + "aboveVisual":"{APPLICATION_RESOURCE_PATH}/images/tooltip-tail-above.png", | |
| 71 | + "belowVisual":"{APPLICATION_RESOURCE_PATH}/images/tooltip-tail-below.png" | |
| 72 | + }, | |
| 73 | + "position":"ABOVE", | |
| 74 | + "hoverPointOffset":[10,10], | |
| 75 | + "movementThreshold":5, | |
| 76 | + "disappearOnMovement":true | |
| 77 | + } | |
| 78 | + }, | |
| 79 | + | |
| 80 | + "TableView" : | |
| 81 | + { | |
| 82 | + "cellPadding" : [ 5.0, 5.0 ] | |
| 83 | + } | |
| 84 | + } | |
| 85 | +} | ... | ... |
shared/dali-demo-strings.h
shared/dali-table-view.cpp
| ... | ... | @@ -620,7 +620,7 @@ void DaliTableView::OnPressedAnimationFinished( Dali::Animation& source ) |
| 620 | 620 | { |
| 621 | 621 | std::string name = mPressedActor.GetName(); |
| 622 | 622 | |
| 623 | - ExecuteProcess( name ); | |
| 623 | + ExecuteProcess( name, mApplication ); | |
| 624 | 624 | |
| 625 | 625 | mPressedActor.Reset(); |
| 626 | 626 | } | ... | ... |
shared/execute-process-android.cpp
0 → 100644
| 1 | +/* | |
| 2 | + * Copyright (c) 2020 Samsung Electronics Co., Ltd. | |
| 3 | + * | |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | + * you may not use this file except in compliance with the License. | |
| 6 | + * You may obtain a copy of the License at | |
| 7 | + * | |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | + * | |
| 10 | + * Unless required by applicable law or agreed to in writing, software | |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | + * See the License for the specific language governing permissions and | |
| 14 | + * limitations under the License. | |
| 15 | + * | |
| 16 | + */ | |
| 17 | + | |
| 18 | + // FILE HEADER | |
| 19 | +#include "execute-process.h" | |
| 20 | + | |
| 21 | + // EXTERNAL INCLUDES | |
| 22 | +#include <sstream> | |
| 23 | +#include <unistd.h> | |
| 24 | +#include <dali/public-api/common/dali-common.h> | |
| 25 | + | |
| 26 | +void ExecuteProcess( const std::string& processName, Dali::Application& application ) | |
| 27 | +{ | |
| 28 | + std::stringstream stream; | |
| 29 | + stream << "am start -a android.intent.action.MAIN -n com.sec.dalidemo/.DaliDemoNativeActivity --user 0 --es start " << processName.c_str(); | |
| 30 | + pid_t parentPID = getpid(); | |
| 31 | + | |
| 32 | + pid_t pid = fork(); | |
| 33 | + if( pid == 0 ) | |
| 34 | + { | |
| 35 | + do | |
| 36 | + { | |
| 37 | + sleep( 1 ); | |
| 38 | + } | |
| 39 | + while( kill( parentPID, 0 ) == 0 ); | |
| 40 | + | |
| 41 | + system( stream.str().c_str() ); | |
| 42 | + exit( 0 ); | |
| 43 | + } | |
| 44 | + else | |
| 45 | + { | |
| 46 | + application.Quit(); | |
| 47 | + } | |
| 48 | +} | ... | ... |
shared/execute-process-unix.cpp
| ... | ... | @@ -23,12 +23,12 @@ |
| 23 | 23 | #include <unistd.h> |
| 24 | 24 | #include <dali/public-api/common/dali-common.h> |
| 25 | 25 | |
| 26 | -void ExecuteProcess( const std::string& processName ) | |
| 26 | +void ExecuteProcess( const std::string& processName, Dali::Application& application ) | |
| 27 | 27 | { |
| 28 | 28 | std::stringstream stream; |
| 29 | 29 | stream << DEMO_EXAMPLE_BIN << processName.c_str(); |
| 30 | 30 | pid_t pid = fork(); |
| 31 | - if( pid == 0) | |
| 31 | + if( pid == 0 ) | |
| 32 | 32 | { |
| 33 | 33 | execlp( stream.str().c_str(), processName.c_str(), NULL ); |
| 34 | 34 | DALI_ASSERT_ALWAYS(false && "exec failed!"); | ... | ... |
shared/execute-process-win.cpp
| ... | ... | @@ -27,7 +27,7 @@ namespace |
| 27 | 27 | const std::string PATH_SEPARATOR( "\\" ); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -void ExecuteProcess( const std::string& processName ) | |
| 30 | +void ExecuteProcess( const std::string& processName, Dali::Application& application ) | |
| 31 | 31 | { |
| 32 | 32 | char currentPath[MAX_PATH]; |
| 33 | 33 | DWORD numberOfCharacters = GetCurrentDirectory( MAX_PATH, currentPath ); | ... | ... |
shared/execute-process.h
| ... | ... | @@ -20,8 +20,9 @@ |
| 20 | 20 | |
| 21 | 21 | // EXTERNAL INCLUDES |
| 22 | 22 | #include <string> |
| 23 | +#include <dali/public-api/adaptor-framework/application.h> | |
| 23 | 24 | |
| 24 | -void ExecuteProcess( const std::string& processName ); | |
| 25 | +void ExecuteProcess( const std::string& processName, Dali::Application& application ); | |
| 25 | 26 | |
| 26 | 27 | |
| 27 | 28 | #endif // DALI_DEMO_EXECUTE_PROCESS_H | ... | ... |
tests-reel/dali-tests-reel.cpp
| ... | ... | @@ -27,10 +27,11 @@ using namespace Dali; |
| 27 | 27 | int DALI_EXPORT_API main(int argc, char **argv) |
| 28 | 28 | { |
| 29 | 29 | // Configure gettext for internalization |
| 30 | +#if INTERNATIONALIZATION_ENABLED | |
| 30 | 31 | bindtextdomain(DALI_DEMO_DOMAIN_LOCAL, DEMO_LOCALE_DIR); |
| 31 | 32 | textdomain(DALI_DEMO_DOMAIN_LOCAL); |
| 32 | 33 | setlocale(LC_ALL, DEMO_LANG); |
| 33 | - | |
| 34 | +#endif | |
| 34 | 35 | Application app = Application::New( &argc, &argv, DEMO_STYLE_DIR "/tests-theme.json" ); |
| 35 | 36 | |
| 36 | 37 | // Create the demo launcher | ... | ... |