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
### Requirements
- - Ubuntu 14.04 or later
+ - Ubuntu 16.04 or later
- Environment created using dali_env script in dali-core repository
- GCC version 6
- Add all source files for the required example in this directory.
- Modify "com.samsung.dali-demo.xml" to include your example so that it can be launched on target.
- No changes are required to the make system as long as the above is followed, your example will be automatically built & installed.
+
+## 3. Building for Android
+
+### Requirements
+
+ - Ubuntu 16.04 or later
+ - GCC version 6
+
+### Building the Repository
+
+To build the repository enter the 'build/android' folder:
+
+ $ cd dali-demo/build/android
+
+Then run the following command:
+
+ $ ./build.sh
+
+For debug build:
+
+ $ DEBUG=1 ./build.sh
+
+To clean the build:
+
+ $ ./build.sh clean
+
+To install apks:
+
+ $ adb install -r ./app/build/outputs/apk/debug/dali-demo-debug.apk
+ $ adb install -r ./app/build/outputs/apk/release/dali-demo-release.apk
+
--- /dev/null
+build
+gradle
+.gradle
+gradlew
+gradlew.bat
+local.properties
+gradle.properties
--- /dev/null
+apply plugin: 'com.android.application'
+
+def buildType = "debug"
+def androidABI = System.getenv('TARGET')
+def daliDir = System.getenv('DALI_DIR')
+def daliEnvDir = System.getenv('DALI_ENV_DIR')
+def daliEnvLibDir = daliEnvDir + '/lib'
+def daliEnvFilesDir = daliEnvDir + '/files'
+
+android {
+ signingConfigs {
+ config {
+ storeFile file("../key.jks")
+ storePassword "Samsung"
+ keyAlias "key0"
+ keyPassword "Samsung"
+ }
+ }
+ compileSdkVersion 28
+ defaultConfig {
+ applicationId = 'com.sec.dalidemo'
+ minSdkVersion 26
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+ externalNativeBuild {
+ cmake {
+ cppFlags "-fexceptions -frtti -w -Wall -std=gnu++11"
+ arguments '-DANDROID_STL=c++_shared'
+ }
+ }
+ }
+ project.archivesBaseName = 'dali-demo'
+ aaptOptions {
+ noCompress ''
+ }
+ buildTypes {
+ debug {
+ ndk {
+ abiFilters androidABI
+ }
+ buildType = "debug"
+ }
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'),
+ 'proguard-rules.pro'
+ ndk {
+ abiFilters androidABI
+ }
+
+ signingConfig signingConfigs.config
+ buildType = "release"
+ }
+ }
+ packagingOptions {
+ if( androidABI == "arm64-v8a" )
+ {
+ pickFirst 'lib/arm64-v8a/libc++_shared.so'
+ pickFirst 'lib/arm64-v8a/libdaliview.so'
+ }
+ else
+ {
+ pickFirst 'lib/armeabi-v7a/libc++_shared.so'
+ pickFirst 'lib/armeabi-v7a/libdaliview.so'
+ }
+ }
+ sourceSets {
+ main {
+ jniLibs.srcDirs += daliEnvLibDir
+ assets.srcDirs += daliEnvFilesDir
+ }
+ }
+ lintOptions {
+ checkReleaseBuilds false
+ }
+ externalNativeBuild {
+ cmake {
+ version '3.10.2'
+ path 'src/main/cpp/CMakeLists.txt'
+ }
+ }
+ compileOptions {
+ targetCompatibility = 1.6
+ sourceCompatibility = 1.6
+ }
+}
+
+dependencies {
+ implementation fileTree(include: ['*.jar'], dir: 'libs')
+ implementation 'androidx.appcompat:appcompat:1.1.0'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+}
+
+task buildDaliDependencies(type:Exec) {
+ environment "PREFIX", daliEnvDir
+ environment "ANDROID_ABI", androidABI
+ environment "ANDROID_PLATFORM", "26"
+ if (buildType == 'debug')
+ environment "DEBUG", "1"
+ workingDir file(daliDir + '/android-dependencies/cmake').getAbsolutePath()
+ commandLine 'sh', './buildall.sh'
+}
+
+task buildDali(type:Exec) {
+ workingDir "../dali"
+ if (buildType == 'debug')
+ environment "DEBUG", "1"
+ commandLine 'sh', './build.sh'
+}
+
+task cleanDali(type:Exec) {
+ workingDir "../dali"
+ commandLine 'sh', './build.sh', 'clean'
+}
+
+buildDali.dependsOn buildDaliDependencies
+preBuild.dependsOn buildDali
+
+clean.dependsOn cleanDali
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- BEGIN_INCLUDE(manifest) -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.sec.dalidemo"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+
+ <application
+ android:allowBackup="false"
+ android:fullBackupContent="false"
+ android:icon="@mipmap/dali_launcher"
+ android:label="@string/app_name"
+ android:name="com.sec.dalidemo.DaliDemoApplication">
+
+ <!-- Our activity is the built-in NativeActivity framework class.
+ This will take care of integrating with our NDK code. -->
+ <activity android:name="com.sec.dalidemo.DaliDemoNativeActivity"
+ android:icon="@mipmap/dali_launcher"
+ android:label="@string/demo_name"
+ android:screenOrientation="portrait"
+ android:windowSoftInputMode="stateAlwaysVisible">
+ <!-- Tell NativeActivity the name of our .so -->
+ <meta-data android:name="android.app.lib_name"
+ android:value="native-activity" />
+ <meta-data android:name="start"
+ android:value="dali-demo" />
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <activity
+ android:name="com.sec.dalidemo.DaliExamplesNativeActivity"
+ android:icon="@mipmap/dali_examples"
+ android:label="@string/examples_name"
+ android:screenOrientation="portrait"
+ android:windowSoftInputMode="stateAlwaysVisible">
+ <!-- Tell NativeActivity the name of our .so -->
+ <meta-data android:name="android.app.lib_name"
+ android:value="native-activity" />
+ <meta-data android:name="start"
+ android:value="dali-examples" />
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <activity
+ android:name="com.sec.dalidemo.DaliTestsNativeActivity"
+ android:icon="@mipmap/dali_tests"
+ android:label="@string/tests_name"
+ android:screenOrientation="portrait"
+ android:windowSoftInputMode="stateAlwaysVisible">
+ <!-- Tell NativeActivity the name of our .so -->
+ <meta-data android:name="android.app.lib_name"
+ android:value="native-activity" />
+ <meta-data android:name="start"
+ android:value="dali-tests" />
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ </application>
+
+</manifest>
+<!-- END_INCLUDE(manifest) -->
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 3.4.1)
+
+SET(DALI_ENV_DIR $ENV{DALI_ENV_DIR})
+SET(ENV{PKG_CONFIG_PATH} "${DALI_ENV_DIR}/lib/${ANDROID_ABI}/pkgconfig:$ENV{PKG_CONFIG_PATH}")
+FIND_PACKAGE(PkgConfig REQUIRED)
+
+SET(ANDROID_SDK $ENV{ANDROID_SDK})
+SET(ANDROID_NDK $ENV{ANDROID_NDK})
+
+# build native_app_glue as a static lib
+ADD_LIBRARY(native_app_glue STATIC
+ ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
+
+# now build app's shared lib
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -frtti -w -Wall -std=gnu++11")
+
+# Export ANativeActivity_onCreate(),
+# Refer to: https://github.com/android-ndk/ndk/issues/381.
+SET(CMAKE_SHARED_LINKER_FLAGS
+ "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
+
+ADD_LIBRARY(native-activity SHARED main.cpp)
+
+TARGET_INCLUDE_DIRECTORIES(native-activity PRIVATE
+ ${ANDROID_NDK}/sources/android/native_app_glue)
+
+INCLUDE_DIRECTORIES(${DALI_ENV_DIR}/include)
+INCLUDE_DIRECTORIES(${DALI_ENV_DIR}/include/dali)
+
+IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+ SET(ENABLE_TRACE ON)
+ELSE()
+ SET(ENABLE_TRACE OFF)
+ENDIF()
+
+IF(EXISTS "${DALI_ENV_DIR}")
+ PKG_CHECK_MODULES(DALI_CORE dali-core REQUIRED NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH)
+ PKG_CHECK_MODULES(DALI_ADAPTOR dali-adaptor REQUIRED NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH)
+ PKG_CHECK_MODULES(DALI_TOOLKIT dali-toolkit REQUIRED NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH)
+ELSE()
+ MESSAGE(WARNING "${DALI_ENV_DIR} not found!")
+ENDIF()
+
+# add lib dependencies
+TARGET_LINK_LIBRARIES(native-activity
+ ${DALI_TOOLKIT_LDFLAGS}
+ ${DALI_ADAPTOR_LDFLAGS}
+ ${DALI_CORE_LDFLAGS}
+ native_app_glue
+ z
+ android
+ log
+ EGL
+ GLESv3)
--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <android/log.h>
+#include <android_native_app_glue.h>
+#include <dali/devel-api/adaptor-framework/application-devel.h>
+#include <dali/integration-api/debug.h>
+#include <dali/integration-api/adaptor-framework/android/android-framework.h>
+#include <dlfcn.h>
+
+// from android_native_app_glue.c
+#ifndef NDEBUG
+#define LOGV(...) ((void)__android_log_print(ANDROID_LOG_VERBOSE, "dalidemo", __VA_ARGS__))
+#else
+#define LOGV(...) ((void)0)
+#endif
+
+namespace
+{
+
+void free_saved_state(struct android_app *android_app)
+{
+ pthread_mutex_lock(&android_app->mutex);
+
+ if (android_app->savedState != NULL)
+ {
+ free(android_app->savedState);
+ android_app->savedState = NULL;
+ android_app->savedStateSize = 0;
+ }
+
+ pthread_mutex_unlock(&android_app->mutex);
+}
+
+void android_app_destroy(struct android_app *android_app)
+{
+ LOGV("android_app_destroy");
+ free_saved_state(android_app);
+ pthread_mutex_lock(&android_app->mutex);
+
+ if (android_app->inputQueue != NULL)
+ {
+ AInputQueue_detachLooper(android_app->inputQueue);
+ }
+
+ AConfiguration_delete(android_app->config);
+ android_app->destroyed = 1;
+
+ pthread_cond_broadcast(&android_app->cond);
+ pthread_mutex_unlock(&android_app->mutex);
+
+ // Can't touch android_app object after this.
+}
+
+}
+
+void ExtractAsset(struct android_app* state, const std::string& assetPath, const std::string& filePath)
+{
+ AAsset* asset = AAssetManager_open(state->activity->assetManager, assetPath.c_str(), AASSET_MODE_BUFFER);
+ if (asset)
+ {
+ size_t length = AAsset_getLength(asset) + 1;
+
+ char* buffer = new char[length];
+ length = AAsset_read(asset, buffer, length);
+
+ FILE* file = fopen(filePath.c_str(), "wb");
+ if (file)
+ {
+ fwrite(buffer, 1, length, file);
+ fclose(file);
+ }
+
+ delete[] buffer;
+ AAsset_close(asset);
+ }
+}
+
+void ExtractAssets(struct android_app* state, const std::string& assetDirPath, const std::string& filesDirPath)
+{
+ AAssetDir* assetDir = AAssetManager_openDir(state->activity->assetManager, assetDirPath.c_str());
+ if (assetDir)
+ {
+ if (mkdir(filesDirPath.c_str(), S_IRWXU) != -1)
+ {
+ const char *filename = NULL;
+ std::string assetPath = assetDirPath + "/";
+ while ((filename = AAssetDir_getNextFileName(assetDir)) != NULL)
+ {
+ ExtractAsset(state, assetPath + filename, filesDirPath + "/" + filename);
+ }
+ }
+
+ AAssetDir_close(assetDir);
+ }
+}
+
+void ExtractFontConfig(struct android_app* state, std::string assetFontConfig, std::string fontsPath)
+{
+ AAsset* asset = AAssetManager_open(state->activity->assetManager, assetFontConfig.c_str(), AASSET_MODE_BUFFER);
+ if (asset)
+ {
+ size_t length = AAsset_getLength(asset) + 1;
+
+ char* buffer = new char[length];
+ length = AAsset_read(asset, buffer, length);
+
+ std::string fontConfig = std::string(buffer, length);
+ int i = fontConfig.find("~");
+ if (i != std::string::npos)
+ {
+ std::string filesDir = state->activity->internalDataPath;
+ fontConfig.replace(i, 1, filesDir);
+ }
+
+ std::string fontsFontConfig = fontsPath;
+ FILE* file = fopen(fontsFontConfig.c_str(), "wb");
+ if (file)
+ {
+ fwrite(fontConfig.c_str(), 1, fontConfig.size(), file);
+ fclose(file);
+ }
+
+ delete[] buffer;
+ AAsset_close(asset);
+ }
+}
+
+class DaliDemoNativeActivity
+{
+public:
+ ANativeActivity* activity;
+ DaliDemoNativeActivity(ANativeActivity* activity)
+ : activity(activity)
+ {
+ }
+
+ class NativeActivityJNI
+ {
+ public:
+ ANativeActivity* activity;
+ JNIEnv* env;
+ jclass clazz;
+
+ NativeActivityJNI(ANativeActivity* activity)
+ : activity(activity)
+ {
+ activity->vm->AttachCurrentThread(&env, NULL);
+ clazz = env->GetObjectClass(activity->clazz);
+ }
+
+ ~NativeActivityJNI()
+ {
+ activity->vm->DetachCurrentThread();
+ }
+
+ jstring toJString(const std::string& str)
+ {
+ return env->NewStringUTF(str.c_str());
+ }
+
+ std::string toString(jstring jstr)
+ {
+ std::string out;
+ if (jstr)
+ {
+ const char* utf = env->GetStringUTFChars(jstr, 0);
+ out = std::string(utf);
+ env->ReleaseStringUTFChars(jstr, utf);
+ }
+
+ return out;
+ }
+
+ std::string callStringMethod(const std::string& name, const std::string& arg)
+ {
+ jmethodID methodID = env->GetMethodID(clazz, name.c_str(), "(Ljava/lang/String;)Ljava/lang/String;");
+ jstring jstr = (jstring)env->CallObjectMethod(activity->clazz, methodID, toJString(arg));
+ return toString(jstr);
+ }
+ };
+
+ std::string getMetaData(const std::string& key)
+ {
+ NativeActivityJNI nativeActivityJNI(activity);
+ return nativeActivityJNI.callStringMethod("getMetaData", key);
+ }
+
+ std::string getIntentStringExtra(const std::string& key)
+ {
+ NativeActivityJNI nativeActivityJNI(activity);
+ return nativeActivityJNI.callStringMethod("getIntentStringExtra", key);
+ }
+};
+
+extern "C" void FcConfigPathInit(const char* path, const char* file);
+
+void android_main( struct android_app* state )
+{
+ std::string filesDir = state->activity->internalDataPath;
+
+ std::string fontconfigPath = filesDir + "/fonts";
+ setenv("FONTCONFIG_PATH", fontconfigPath.c_str(), 1);
+
+ std::string fontconfigFile = fontconfigPath + "/fonts.conf";
+ setenv("FONTCONFIG_FILE", fontconfigFile.c_str(), 1);
+
+ struct stat st = { 0 };
+ FcConfigPathInit( fontconfigPath.c_str(), fontconfigFile.c_str() );
+
+ if (stat(fontconfigPath.c_str(), &st) == -1)
+ {
+ mkdir(fontconfigPath.c_str(), S_IRWXU);
+ ExtractFontConfig(state, "fonts/fonts.conf", fontconfigPath + "/fonts.conf");
+ ExtractFontConfig(state, "fonts/fonts.dtd", fontconfigPath + "/fonts.dtd" );
+ ExtractFontConfig(state, "fonts/local.conf", fontconfigPath + "/local.conf");
+ ExtractAssets(state, "fonts/dejavu", fontconfigPath + "/dejavu");
+ ExtractAssets(state, "fonts/tizen", fontconfigPath + "/tizen");
+ ExtractAssets(state, "fonts/bitmap", fontconfigPath + "/bitmap");
+ }
+
+ Dali::Integration::AndroidFramework::New();
+ Dali::Integration::AndroidFramework::Get().SetNativeApplication( state );
+ Dali::Integration::AndroidFramework::Get().SetApplicationConfiguration( state->config );
+ Dali::Integration::AndroidFramework::Get().SetApplicationAssets( state->activity->assetManager );
+ Dali::Integration::AndroidFramework::Get().SetInternalDataPath( filesDir );
+
+ DaliDemoNativeActivity nativeActivity(state->activity);
+
+ int status = 0;
+ std::string libpath = "/data/data/com.sec.dalidemo/lib/libdali-demo.so";
+ std::string callParam = nativeActivity.getIntentStringExtra("start");
+ if (callParam.empty())
+ {
+ callParam = nativeActivity.getMetaData("start");
+ }
+
+ if (!callParam.empty())
+ {
+ libpath = "/data/data/com.sec.dalidemo/lib/lib" + callParam + ".so";
+ }
+
+ void* handle = dlopen( libpath.c_str(), RTLD_LAZY );
+ if (!handle)
+ {
+ std::exit(status);
+ }
+
+ dlerror(); /* Clear any existing error */
+
+ int (*main)(int, char**) = (int(*)(int, char**))dlsym(handle, "main");
+ if (main)
+ {
+ status = main( 0, nullptr );
+ }
+
+ if (handle)
+ {
+ dlclose(handle);
+ handle = nullptr;
+ }
+
+ android_app_destroy(state);
+
+ Dali::Integration::AndroidFramework::Get().SetNativeApplication(nullptr);
+ Dali::Integration::AndroidFramework::Get().SetApplicationConfiguration(nullptr);
+ Dali::Integration::AndroidFramework::Get().SetApplicationAssets(nullptr);
+ Dali::Integration::AndroidFramework::Delete();
+
+ // We need to kill the application process manually, DALi cannot restart in the same process due to memory leaks
+ std::exit(status);
+}
+
+//END_INCLUDE(all)
--- /dev/null
+package com.sec.dalidemo;
+
+import android.app.Application;
+
+public class DaliDemoApplication extends Application {
+}
--- /dev/null
+package com.sec.dalidemo;
+
+import android.annotation.TargetApi;
+import android.app.NativeActivity;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.pm.ActivityInfo;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.os.Bundle;
+import android.view.View;
+import android.view.WindowManager;
+
+public class DaliDemoNativeActivity extends NativeActivity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // Hide toolbar
+ int SDK_INT = android.os.Build.VERSION.SDK_INT;
+ if(SDK_INT >= 19)
+ {
+ setImmersiveSticky();
+
+ View decorView = getWindow().getDecorView();
+ decorView.setOnSystemUiVisibilityChangeListener
+ (new View.OnSystemUiVisibilityChangeListener() {
+ @Override
+ public void onSystemUiVisibilityChange(int visibility) {
+ setImmersiveSticky();
+ }
+ });
+ }
+ }
+
+ @TargetApi(19)
+ void setImmersiveSticky() {
+ View decorView = getWindow().getDecorView();
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+ }
+
+ @TargetApi(19)
+ protected void onResume() {
+ super.onResume();
+
+ //Hide toolbar
+ int SDK_INT = android.os.Build.VERSION.SDK_INT;
+ if (SDK_INT >= 11 && SDK_INT < 14)
+ {
+ getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
+ }
+ else if (SDK_INT >= 14 && SDK_INT < 19)
+ {
+ getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LOW_PROFILE);
+ }
+ else if (SDK_INT >= 19)
+ {
+ setImmersiveSticky();
+ }
+ }
+
+ protected void onPause() {
+ super.onPause();
+ }
+
+ public final void setSoftInputMode(boolean visible) {
+ if (visible) {
+ getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
+ }
+ else {
+ getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
+ }
+ }
+
+ public final String getMetaData(String key) {
+ try {
+ ActivityInfo ai = getApplicationContext().getPackageManager()
+ .getActivityInfo(getComponentName(), PackageManager.GET_META_DATA);
+ Bundle bundle = ai.metaData;
+ if (bundle != null)
+ return bundle.getString(key);
+ } catch (PackageManager.NameNotFoundException e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+ public final String getIntentStringExtra(String key) {
+ return getIntent().getStringExtra(key);
+ }
+}
--- /dev/null
+package com.sec.dalidemo;
+
+public class DaliExamplesNativeActivity extends DaliDemoNativeActivity {
+}
+
--- /dev/null
+package com.sec.dalidemo;
+
+public class DaliTestsNativeActivity extends DaliDemoNativeActivity {
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">DALi</string>
+ <string name="demo_name">DALi Demo</string>
+ <string name="examples_name">DALi Examples</string>
+ <string name="tests_name">DALi Tests</string>
+</resources>
--- /dev/null
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.5.2'
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
+
+
+
+
+
--- /dev/null
+[ -z $ROOT_DIR ] && ROOT_DIR=$HOME
+echo "Using ROOT_DIR=\"$ROOT_DIR\""
+
+[ -z $DALI_DIR ] && DALI_DIR=$(cd ../../../;pwd)
+echo "Using DALI_DIR=\"$DALI_DIR\""
+export DALI_DIR=$DALI_DIR
+
+[ -z $DALI_ENV_DIR ] && DALI_ENV_DIR=$DALI_DIR/dali-env/android
+echo "Using DALI_ENV_DIR=\"$DALI_ENV_DIR\""
+export DALI_ENV_DIR=$DALI_ENV_DIR
+
+[ -z $TARGET ] && export TARGET=armeabi-v7a
+echo "Using TARGET=\"$TARGET\""
+
+if [ ! -z $http_proxy ]
+then
+ proxyFull=${http_proxy/http:\/\/}
+ proxyHost=$(echo $proxyFull | cut -d: -f 1)
+ proxyPort=$(echo $proxyFull | cut -d: -f 2)
+ SdbProxyOptions="--proxy=http --proxy_host=$proxyHost --proxy_port=$proxyPort"
+ echo "Proxy detected Host:$proxyHost Port:$proxyPort"
+fi
+
+if [ ! -d "$ANDROID_SDK" ]; then
+ if [ ! -d "$ROOT_DIR/Android/Sdk" ]; then
+ mkdir -p "$ROOT_DIR/Android/Sdk"
+ cd "$ROOT_DIR/Android/Sdk"
+ wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
+ unzip sdk-tools-linux-4333796.zip
+ tools/bin/sdkmanager --update $SdbProxyOptions
+ 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"
+ cd -
+ fi
+fi
+
+if [ ! -d "$ANDROID_SDK" ]; then
+# try default path
+ if [ -d "$ROOT_DIR/Android/Sdk" ]; then
+ export ANDROID_SDK=$ROOT_DIR/Android/Sdk
+ fi
+fi
+
+if [ ! -d "$ANDROID_NDK" ]; then
+ if [ -d "$ANDROID_SDK" ]; then
+ NDK_DIR=$(find $ANDROID_SDK -maxdepth 2 -name ndk-build | sed 's/\/ndk-build//')
+ if [ -d "$NDK_DIR" ]; then
+ export ANDROID_NDK=$NDK_DIR
+ fi
+ fi
+fi
+
+if [ ! -d "$ROOT_DIR/gradle/gradle-5.4.1" ]; then
+ mkdir -p $ROOT_DIR/gradle
+ cd $ROOT_DIR/gradle
+ wget https://services.gradle.org/distributions/gradle-5.4.1-bin.zip
+ unzip gradle-5.4.1-bin.zip
+ cd -
+fi
+
+GRADLE_PROPERTIES_FILE=gradle.properties
+if [ ! -f $GRADLE_PROPERTIES_FILE ]
+then
+ echo "org.gradle.jvmargs=-Xmx1536m" > $GRADLE_PROPERTIES_FILE
+ if [ ! -z $http_proxy ]
+ then
+ echo "systemProp.http.proxyHost=$proxyHost" >> $GRADLE_PROPERTIES_FILE
+ echo "systemProp.http.proxyPort=$proxyPort" >> $GRADLE_PROPERTIES_FILE
+
+ if [ ! -z $https_proxy ]
+ then
+ httpsProxyFull=${https_proxy/https:\/\/}
+ httpsProxyHost=$(echo $httpsProxyFull | cut -d: -f 1)
+ httpsProxyPort=$(echo $httpsProxyFull | cut -d: -f 2)
+ echo "systemProp.https.proxyHost=$httpsProxyHost" >> $GRADLE_PROPERTIES_FILE
+ echo "systemProp.https.proxyPort=$httpsProxyPort" >> $GRADLE_PROPERTIES_FILE
+ fi
+ fi
+fi
+
+export PATH=$PATH:$ROOT_DIR/gradle/gradle-5.4.1/bin
+[ ! -f local.properties ] && echo 'sdk.dir='$(echo $ANDROID_SDK) > local.properties
+
+gradle wrapper
+if [ "$1" = "clean" ]; then
+ ./gradlew clean
+else
+ if [ -z "$DEBUG" ]; then
+ ./gradlew assembleRelease
+ else
+ ./gradlew assembleDebug
+ fi
+fi
+
--- /dev/null
+lib
+obj
+dali-core
+dali-adaptor
+dali-toolkit
+dali-demo
+
--- /dev/null
+#!/bin/bash
+if [ -z "$ANDROID_SDK" ]; then
+ . ./env.sh
+fi
+
+if [ ! -d "$ANDROID_SDK" ]; then
+ echo "Please install Android SDK into "$ANDROID_SDK
+ exit 1
+fi
+
+if [ ! -d "$ANDROID_NDK" ]; then
+ echo "Please install Android NDK into "$ANDROID_NDK
+ exit 1
+fi
+
+if [ "$1" = "clean" ]; then
+ echo "Cleaning dali..."
+ rm -rf ./dali-core
+ rm -rf ./dali-adaptor
+ rm -rf ./dali-toolkit
+ rm -rf ./dali-demo
+ exit 0
+fi
+
+if [ ! -z "$DEBUG" ]; then
+ export ENABLE_TRACE=ON
+fi
+
+ANDROID_PLATFORM=26 ANDROID_ABI=${TARGET} ./build_core.sh || exit 1
+ANDROID_PLATFORM=26 ANDROID_ABI=${TARGET} ./build_adaptor.sh || exit 1
+ANDROID_PLATFORM=26 ANDROID_ABI=${TARGET} ./build_toolkit.sh || exit 1
+ANDROID_PLATFORM=26 ANDROID_ABI=${TARGET} ./build_demo.sh || exit 1
+
--- /dev/null
+if [ -d ./dali-adaptor/cmake/${ANDROID_ABI} ]; then
+ cd ./dali-adaptor/cmake/${ANDROID_ABI}
+else
+ mkdir -p ./dali-adaptor/cmake/${ANDROID_ABI}
+ cd ./dali-adaptor/cmake/${ANDROID_ABI}
+
+ if [ ! -z "$DEBUG" ]; then
+ export CMAKE_BUILD_TYPE=Debug
+ else
+ export CMAKE_BUILD_TYPE=Release
+ fi
+
+ if [ -z "$ENABLE_TRACE" ]; then
+ export ENABLE_TRACE=OFF
+ fi
+
+ export PREFIX=${DALI_ENV_DIR}
+ export PKG_CONFIG_LIBDIR=${ANDROID_NDK}/prebuilt/linux-x86_64/lib/pkgconfig
+ export PKG_CONFIG_PATH=${PREFIX}/lib/${ANDROID_ABI}/pkgconfig
+ export DALI_DATA_RO_DIR=assets
+ export DALI_DATA_RW_DIR=/data/data/com.sec.dali_demo/files
+ ${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
+fi
+
+make -j8 || exit 1
+make install || exit 1
+cd -
--- /dev/null
+
+if [ -d ./dali-core/cmake/${ANDROID_ABI} ]; then
+ cd ./dali-core/cmake/${ANDROID_ABI}
+else
+ mkdir -p ./dali-core/cmake/${ANDROID_ABI}
+ cd ./dali-core/cmake/${ANDROID_ABI}
+
+ if [ ! -z "$DEBUG" ]; then
+ export CMAKE_BUILD_TYPE=Debug
+ else
+ export CMAKE_BUILD_TYPE=Release
+ fi
+
+ if [ -z "$ENABLE_TRACE" ]; then
+ export ENABLE_TRACE=OFF
+ fi
+
+ export PREFIX=${DALI_ENV_DIR}
+ export PKG_CONFIG_LIBDIR=${ANDROID_NDK}/prebuilt/linux-x86_64/lib/pkgconfig
+ export PKG_CONFIG_PATH=${PREFIX}/lib/${ANDROID_ABI}/pkgconfig
+ ${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}
+fi
+
+make -j8 || exit 1
+make install || exit 1
+
+cd -
--- /dev/null
+
+if [ -d ./dali-demo/cmake/${ANDROID_ABI} ]; then
+ cd ./dali-demo/cmake/${ANDROID_ABI}
+else
+ mkdir -p ./dali-demo/cmake/${ANDROID_ABI}
+ cd ./dali-demo/cmake/${ANDROID_ABI}
+
+ if [ ! -z "$DEBUG" ]; then
+ export CMAKE_BUILD_TYPE=Debug
+ else
+ export CMAKE_BUILD_TYPE=Release
+ fi
+
+ if [ -z "$ENABLE_TRACE" ]; then
+ export ENABLE_TRACE=OFF
+ fi
+
+ export PREFIX=${DALI_ENV_DIR}
+ export PKG_CONFIG_LIBDIR=${ANDROID_NDK}/prebuilt/linux-x86_64/lib/pkgconfig
+ export PKG_CONFIG_PATH=${PREFIX}/lib/${ANDROID_ABI}/pkgconfig
+ export DALI_APP_RES_DIR=${PREFIX}/files
+ export DALI_APP_DIR=${PREFIX}/lib/${ANDROID_ABI}
+ export DALI_DEMO_RES_DIR=assets
+
+ ${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}
+fi
+
+make -j8 || exit 1
+make install || exit 1
+
+cd -
+
--- /dev/null
+
+if [ -d ./dali-toolkit/cmake/${ANDROID_ABI} ]; then
+ cd ./dali-toolkit/cmake/${ANDROID_ABI}
+else
+ mkdir -p ./dali-toolkit/cmake/${ANDROID_ABI}
+ cd ./dali-toolkit/cmake/${ANDROID_ABI}
+
+ if [ ! -z "$DEBUG" ]; then
+ export CMAKE_BUILD_TYPE=Debug
+ else
+ export CMAKE_BUILD_TYPE=Release
+ fi
+
+ if [ -z "$ENABLE_TRACE" ]; then
+ export ENABLE_TRACE=OFF
+ fi
+
+ export PREFIX=${DALI_ENV_DIR}
+ export PKG_CONFIG_LIBDIR=${ANDROID_NDK}/prebuilt/linux-x86_64/lib/pkgconfig
+ export PKG_CONFIG_PATH=${PREFIX}/lib/${ANDROID_ABI}/pkgconfig
+ export DALI_DATA_RO_DIR=assets
+ export DALI_DATA_RW_DIR=/data/data/com.sec.dali_demo/files
+ export DALI_DATA_RO_INSTALL_DIR=${PREFIX}/files
+ export DALI_DATA_RW_INSTALL_DIR=${PREFIX}/files
+
+ ${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'
+fi
+
+make -j8 || exit 1
+make install || exit 1
+cp -R ${DALI_DIR}/dali-toolkit/automated-tests/resources/fonts/* ${DALI_DIR}/dali-env/android/files/fonts
+
+cd -
--- /dev/null
+if [ ! -d "$ANDROID_SDK" ]; then
+# try default path
+if [ -d "$HOME/Android/Sdk" ]; then
+export ANDROID_SDK=$HOME/Android/Sdk
+fi
+fi
+
+if [ ! -d "$ANDROID_NDK" ]; then
+if [ -d $ANDROID_SDK ]; then
+NDK_DIR=$(find $ANDROID_SDK -maxdepth 2 -name ndk-build | sed 's/\/ndk-build//')
+if [ -d "$NDK_DIR" ]; then
+export ANDROID_NDK=$NDK_DIR
+fi
+fi
+fi
+
+if [ ! -d "$DALI_DIR" ]; then
+export DALI_DIR=$(cd ../../../../; pwd)
+fi
+
+if [ ! -d "$DALI_ENV_DIR" ]; then
+export DALI_ENV_DIR=$DALI_DIR/dali-env/android
+fi
--- /dev/null
+include ':app'
+
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
IF(DEFINED DALI_APP_DIR)
- SET(BINDIR ${DALI_APP_DIR}/bin)
+ SET(BINDIR ${DALI_APP_DIR})
ELSE()
- SET(BINDIR ${PREFIX}/bin)
+ SET(BINDIR ${PREFIX}/bin)
ENDIF()
IF(DEFINED DALI_APP_RES_DIR)
- SET(APP_DATA_RES_DIR ${DALI_APP_RES_DIR})
+ SET(APP_DATA_RES_DIR ${DALI_APP_RES_DIR})
ELSE()
- SET(APP_DATA_RES_DIR ${PREFIX}/share/com.samsung.dali-demo/res)
+ SET(APP_DATA_RES_DIR ${PREFIX}/share/com.samsung.dali-demo/res)
ENDIF()
MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
SET(LOCAL_SCRIPTS_DIR ${RESOURCE_DIR}/scripts)
SET(LOCAL_SHADERS_DIR ${RESOURCE_DIR}/shaders)
IF(NOT DEFINED LOCAL_STYLE_DIR)
- SET(LOCAL_STYLE_DIR ${RESOURCE_DIR}/style)
+ SET(LOCAL_STYLE_DIR ${RESOURCE_DIR}/style)
+ENDIF()
+
+IF(ANDROID)
+ SET(LOCAL_STYLE_ANDROID_DIR ${RESOURCE_DIR}/style/android)
ENDIF()
SET(IMAGES_DIR ${APP_DATA_RES_DIR}/images/)
SET(STYLE_DIR ${APP_DATA_RES_DIR}/style/)
IF(NOT DEFINED LOCALE_DIR)
- SET(LOCALE_DIR ${PREFIX}/share/locale)
+ SET(LOCALE_DIR ${PREFIX}/share/locale)
+ENDIF()
+
+IF(DEFINED DALI_DEMO_RES_DIR)
+ SET(DEMO_IMAGE_DIR \\"${DALI_DEMO_RES_DIR}/images/\\")
+ SET(DEMO_GAME_DIR \\"${DALI_DEMO_RES_DIR}/game/\\")
+ SET(DEMO_VIDEO_DIR \\"${DALI_DEMO_RES_DIR}/videos/\\")
+ SET(DEMO_MODEL_DIR \\"${DALI_DEMO_RES_DIR}/models/\\")
+ SET(DEMO_SCRIPT_DIR \\"${DALI_DEMO_RES_DIR}/scripts/\\")
+ SET(DEMO_SHADER_DIR \\"${DALI_DEMO_RES_DIR}/shaders/\\")
+ SET(DEMO_STYLE_DIR \\"${DALI_DEMO_RES_DIR}/style/\\")
+ SET(DEMO_THEME_PATH \\"${DALI_DEMO_RES_DIR}/style/demo-theme.json\\")
+ SET(DEMO_LOCALE_DIR \\"${DALI_DEMO_RES_DIR}/locale\\")
+ SET(DEMO_STYLE_IMAGE_DIR \\"${DALI_DEMO_RES_DIR}/style/images\\")
+ELSE()
+ SET(DEMO_GAME_DIR \\"${GAME_DIR}\\")
+ SET(DEMO_IMAGE_DIR \\"${IMAGES_DIR}\\")
+ SET(DEMO_VIDEO_DIR \\"${VIDEOS_DIR}\\")
+ SET(DEMO_MODEL_DIR \\"${MODELS_DIR}\\")
+ SET(DEMO_SCRIPT_DIR \\"${SCRIPTS_DIR}\\")
+ SET(DEMO_SHADER_DIR \\"${SHADERS_DIR}\\")
+ SET(DEMO_STYLE_DIR \\"${STYLE_DIR}\\")
+ SET(DEMO_THEME_PATH \\"${STYLE_DIR}demo-theme.json\\")
+ SET(DEMO_LOCALE_DIR \\"${LOCALE_DIR}\\")
+ SET(DEMO_STYLE_IMAGE_DIR ${STYLE_DIR}/images)
ENDIF()
-SET(DEMO_GAME_DIR \\"${GAME_DIR}\\")
-SET(DEMO_IMAGE_DIR \\"${IMAGES_DIR}\\")
-SET(DEMO_VIDEO_DIR \\"${VIDEOS_DIR}\\")
-SET(DEMO_MODEL_DIR \\"${MODELS_DIR}\\")
-SET(DEMO_SCRIPT_DIR \\"${SCRIPTS_DIR}\\")
-SET(DEMO_SHADER_DIR \\"${SHADERS_DIR}\\")
-SET(DEMO_STYLE_DIR \\"${STYLE_DIR}\\")
-SET(DEMO_THEME_PATH \\"${STYLE_DIR}demo-theme.json\\")
SET(DEMO_EXAMPLE_BIN \\"${BINDIR}/\\")
-SET(DEMO_LOCALE_DIR \\"${LOCALE_DIR}\\")
SET(DEMO_LANG \\"${LANG}\\")
-SET(DEMO_STYLE_IMAGE_DIR ${STYLE_DIR}/images)
-
FILE(GLOB LOCAL_IMAGES_PNG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.png")
FILE(GLOB LOCAL_IMAGES_JPG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.jpg")
FILE(GLOB LOCAL_IMAGES_GIF RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.gif")
ENDFOREACH(flag)
MESSAGE("Installed ${LOCAL_STYLES_LIST} to ${STYLE_DIR}")
+IF(ANDROID)
+FILE(GLOB LOCAL_STYLES_ANDROID_LIST "${LOCAL_STYLE_ANDROID_DIR}/*.json")
+FOREACH(flag ${LOCAL_STYLES_ANDROID_LIST})
+ INSTALL(FILES ${flag} DESTINATION ${STYLE_DIR})
+ENDFOREACH(flag)
+MESSAGE("Installed ${LOCAL_STYLES_ANDROID_LIST} to ${STYLE_DIR}")
+ENDIF()
+
FILE(GLOB LOCAL_STYLE_IMAGES_LIST "${LOCAL_STYLE_DIR}/images/*.png")
FOREACH(flag ${LOCAL_STYLE_IMAGES_LIST})
INSTALL(FILES ${flag} DESTINATION ${STYLE_DIR}/images)
${DEMO_SRCS}
"${ROOT_SRC_DIR}/shared/resources-location.cpp"
"${ROOT_SRC_DIR}/shared/dali-table-view.cpp"
- "${ROOT_SRC_DIR}/shared/execute-process-unix.cpp"
)
-ADD_EXECUTABLE(${PROJECT_NAME} ${DEMO_SRCS})
+IF(ANDROID)
+ SET(DEMO_SRCS
+ ${DEMO_SRCS}
+ "${ROOT_SRC_DIR}/shared/execute-process-android.cpp"
+ )
+ELSE()
+ SET(DEMO_SRCS
+ ${DEMO_SRCS}
+ "${ROOT_SRC_DIR}/shared/execute-process-unix.cpp"
+ )
+ENDIF()
+
+IF(SHARED)
+ ADD_LIBRARY(${PROJECT_NAME} SHARED ${DEMO_SRCS})
+ELSE()
+ ADD_EXECUTABLE(${PROJECT_NAME} ${DEMO_SRCS})
+ENDIF()
+
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${REQUIRED_PKGS_LDFLAGS} -pie)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
${EXAMPLES_REEL_SRCS}
"${ROOT_SRC_DIR}/shared/resources-location.cpp"
"${ROOT_SRC_DIR}/shared/dali-table-view.cpp"
- "${ROOT_SRC_DIR}/shared/execute-process-unix.cpp"
)
-ADD_EXECUTABLE(dali-examples ${EXAMPLES_REEL_SRCS})
+IF(ANDROID)
+ SET(EXAMPLES_REEL_SRCS
+ ${EXAMPLES_REEL_SRCS}
+ "${ROOT_SRC_DIR}/shared/execute-process-android.cpp"
+ )
+ELSE()
+ SET(EXAMPLES_REEL_SRCS
+ ${EXAMPLES_REEL_SRCS}
+ "${ROOT_SRC_DIR}/shared/execute-process-unix.cpp"
+ )
+ENDIF()
+
+IF(SHARED)
+ ADD_LIBRARY(dali-examples SHARED ${EXAMPLES_REEL_SRCS})
+ELSE()
+ ADD_EXECUTABLE(dali-examples ${EXAMPLES_REEL_SRCS})
+ENDIF()
+
TARGET_LINK_LIBRARIES(dali-examples ${REQUIRED_PKGS_LDFLAGS} -pie)
INSTALL(TARGETS dali-examples DESTINATION ${BINDIR})
FOREACH(EXAMPLE ${SUBDIRS})
FILE(GLOB SRCS "${EXAMPLES_SRC_DIR}/${EXAMPLE}/*.cpp")
SET(SRCS ${SRCS} "${ROOT_SRC_DIR}/shared/resources-location.cpp")
- ADD_EXECUTABLE(${EXAMPLE}.example ${SRCS})
+ IF(SHARED)
+ ADD_LIBRARY(${EXAMPLE}.example SHARED ${SRCS})
+ ELSE()
+ ADD_EXECUTABLE(${EXAMPLE}.example ${SRCS})
+ ENDIF()
TARGET_LINK_LIBRARIES(${EXAMPLE}.example ${REQUIRED_PKGS_LDFLAGS} -pie)
INSTALL(TARGETS ${EXAMPLE}.example DESTINATION ${BINDIR})
ENDFOREACH(EXAMPLE)
${TESTS_REEL_SRCS}
"${ROOT_SRC_DIR}/shared/resources-location.cpp"
"${ROOT_SRC_DIR}/shared/dali-table-view.cpp"
- "${ROOT_SRC_DIR}/shared/execute-process-unix.cpp"
)
-ADD_EXECUTABLE(dali-tests ${TESTS_REEL_SRCS})
+IF(ANDROID)
+ SET(TESTS_REEL_SRCS
+ ${TESTS_REEL_SRCS}
+ "${ROOT_SRC_DIR}/shared/execute-process-android.cpp"
+ )
+ELSE()
+ SET(TESTS_REEL_SRCS
+ ${TESTS_REEL_SRCS}
+ "${ROOT_SRC_DIR}/shared/execute-process-unix.cpp"
+ )
+ENDIF()
+
+IF(SHARED)
+ ADD_LIBRARY(dali-tests SHARED ${TESTS_REEL_SRCS})
+ELSE()
+ ADD_EXECUTABLE(dali-tests ${TESTS_REEL_SRCS})
+ENDIF()
TARGET_LINK_LIBRARIES(dali-tests ${REQUIRED_PKGS_LDFLAGS} -pie)
INSTALL(TARGETS dali-tests DESTINATION ${BINDIR})
int DALI_EXPORT_API main(int argc, char **argv)
{
// Configure gettext for internalization
+#ifdef INTERNATIONALIZATION_ENABLED
bindtextdomain(DALI_DEMO_DOMAIN_LOCAL, DEMO_LOCALE_DIR);
textdomain(DALI_DEMO_DOMAIN_LOCAL);
setlocale(LC_ALL, DEMO_LANG);
+#endif
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
int DALI_EXPORT_API main(int argc, char **argv)
{
// Configure gettext for internalization
+#ifdef INTERNATIONALIZATION_ENABLED
bindtextdomain(DALI_DEMO_DOMAIN_LOCAL, DEMO_LOCALE_DIR);
textdomain(DALI_DEMO_DOMAIN_LOCAL);
setlocale(LC_ALL, DEMO_LANG);
+#endif
Application app = Application::New( &argc, &argv, DEMO_STYLE_DIR "/examples-theme.json" );
float mButtonDelay;
};
-int main(int argc, char **argv)
+int DALI_EXPORT_API main(int argc, char **argv)
{
Application application = Application::New( &argc, &argv );
bool mIsTouchedActor;
};
-int main(int argc, char **argv)
+int DALI_EXPORT_API main(int argc, char **argv)
{
Application application = Application::New( &argc, &argv );
using namespace Dali;
using namespace Dali::Toolkit;
+using namespace std;
namespace
{
auto gridSize = mGrid.GetProperty<Vector3>( Actor::Property::SIZE ); // Get target value
auto currentPosition = actor.GetCurrentPosition(); // Get constrained current value
- position = Vector2( std::floor( currentPosition.x ), std::floor( currentPosition.y ) );
+ position = Vector2( floor( currentPosition.x ), floor( currentPosition.y ) );
point.x = Clamp( position.x / gridSize.x, -0.5f, 0.5f ) + 0.5f;
point.y = 0.5f - position.y / gridSize.y;
};
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
BloomView mBloomView;
};
-int main(int argc, char **argv)
+int DALI_EXPORT_API main(int argc, char **argv)
{
Application application = Application::New( &argc, &argv );
#include "frame-callback.h"
using namespace Dali;
+using namespace std;
FrameCallback::FrameCallback()
: mActorIdContainer(),
if( updateProxy.GetPositionAndSize( i, position, size ) ) // Retrieve the position and size using the Actor ID.
{
float halfWidthPoint = stageHalfWidth - size.width * 0.5f;
- float xTranslation = std::abs( position.x );
+ float xTranslation = abs( position.x );
if( xTranslation > halfWidthPoint )
{
// Actor has hit the edge, adjust the size accordingly.
using namespace Dali;
using namespace Dali::Toolkit;
+using namespace std;
namespace
{
// Move actor back to center if we're out of bounds
Vector2 halfStageSize = Stage::GetCurrent().GetSize() * 0.5f;
- if( ( std::abs( newPosition.x ) > halfStageSize.width ) ||
- ( std::abs( newPosition.y ) > halfStageSize.height ) )
+ if( ( abs( newPosition.x ) > halfStageSize.width ) ||
+ ( abs( newPosition.y ) > halfStageSize.height ) )
{
anim.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3::ZERO, AlphaFunction::EASE_IN );
}
}
// Entry point for applications
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
{
Application app = Application::New(&argc, &argv);
PageTurnExample test ( app );
} // namespace Dali
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
{
Dali::Application application = Dali::Application::New( &argc, &argv );
Dali::PreRenderCallbackController controller( application );
Dali::Vector<char> fileBuffer;
if( !Dali::FileLoader::ReadFile( objFileName, bufferSize, fileBuffer, Dali::FileLoader::FileType::TEXT ) )
{
- DALI_LOG_WARNING( "file open failed for: \"%s\"", objFileName );
+ DALI_LOG_WARNING( "file open failed for: \"%s\"", objFileName.c_str() );
return;
}
// Skip the key-values:
const long int imageSizeOffset = sizeof(KtxFileHeader) + header.bytesOfKeyValueData;
- if( fseek(fp, imageSizeOffset, SEEK_END) )
+ if( fseek(fp, 0, SEEK_END) )
{
return false;
}
return false;
}
+ lSize -= imageSizeOffset;
+
rewind(fp);
if( fseek(fp, imageSizeOffset, SEEK_SET) )
}
/** Entry point for Linux & Tizen applications */
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
}
/** Entry point for Linux & Tizen applications */
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
{
// DALI_DEMO_THEME_PATH not passed to Application so TextField example uses default Toolkit style sheet.
Application application = Application::New( &argc, &argv );
}
/** Entry point for Linux & Tizen applications */
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
};
/** Entry point for Linux & Tizen applications */
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
}
/** Entry point for Linux & Tizen applications */
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
cd %{_builddir}/%{name}-%{version}/build/tizen
-cmake -DDALI_APP_DIR=%{dali_app_ro_dir} \
+cmake -DDALI_APP_DIR=%{dali_app_ro_dir}/bin \
-DLOCALE_DIR=%{locale_dir} \
-DDALI_APP_RES_DIR=%{dali_app_res_dir} \
%if 0%{?enable_debug}
%install
rm -rf %{buildroot}
cd build/tizen
-%make_install DALI_APP_DIR=%{dali_app_ro_dir}
+%make_install DALI_APP_DIR=%{dali_app_ro_dir}/bin
%make_install DDALI_APP_RES_DIR=%{dali_app_res_dir}
mkdir -p %{buildroot}%{dali_xml_file_dir}
--- /dev/null
+{
+ "styles": {
+ "IncomeBackground": {
+ "background": {
+ "visualType": "ANIMATED_GRADIENT",
+ "gradientType": "RADIAL",
+ "unitType": "USER_SPACE",
+ "startPosition": [0.0, 0.0],
+ "endPosition": [180.0, 0.0],
+ "startColor": [0.1333, 0.1647, 0.2941, 1.0],
+ "endColor": [0.0784, 0.3961, 0.4863, 1.0],
+ "rotateCenter": [0.0, 0.0],
+ "rotateAmount": 0.0,
+ "offset": {
+ "startValue": 0.0,
+ "targetValue": 2.0,
+ "directionType": "BACKWARD",
+ "duration": 1.25,
+ "delay": 0.0,
+ "repeat": -1,
+ "repeatDelay": 0.0,
+ "motionType": "LOOP",
+ "easingType": "LINEAR"
+ }
+ }
+ },
+ "ActiveBackground":{
+ "background":{
+ "visualType": "ANIMATED_GRADIENT",
+ "gradientType": "RADIAL",
+ "unitType": "USER_SPACE",
+ "startPosition": [0.0, 0.0],
+ "endPosition": [180.0, 0.0],
+ "startColor": [0.1066, 0.1318, 0.2353, 1.0],
+ "endColor": [0.0627, 0.3169, 0.3890, 1.0],
+ "rotateCenter": [0.0, 0.0],
+ "rotateAmount": 0.0,
+ "offset": {
+ "startValue": 0.0,
+ "targetValue": 2.0,
+ "directionType": "BACKWARD",
+ "duration": 4.0,
+ "delay": 0.0,
+ "repeat": -1,
+ "repeatDelay": 0.0,
+ "motionType": "LOOP",
+ "easingType": "LINEAR"
+ }
+ }
+ },
+ "DeclineButton":{
+ "background":{
+ "visualType": "ANIMATED_GRADIENT",
+ "gradientType": "LINEAR",
+ "unitType": "USER_SPACE",
+ "startPosition": [-180.0, 0.0],
+ "endPosition": [180.0, 0.0],
+ "startColor": [0.8941, 0.0078, 0.0078, 1.0],
+ "endColor": [1.0000, 0.5961, 0.0000, 1.0],
+ "rotateCenter": [0.0, 0.0],
+ "rotateAmount": 0.78539816,
+ "offset": {
+ "startValue": 0.0,
+ "targetValue": 2.0,
+ "directionType": "FORWARD",
+ "duration": 1.8,
+ "delay": -1.2,
+ "repeat": -1,
+ "repeatDelay": 1.2,
+ "motionType": "LOOP",
+ "easingType": "IN_OUT"
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+{
+ "styles":
+ {
+ "ConfirmationPopup":{
+ "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/00_popup_bg.9.png"
+ },
+
+ "CustomPopupStyle":{
+ "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/popup.9.png",
+ "popupBackgroundBorder":[0,4,4,0],
+ "tailUpImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-up.png",
+ "tailDownImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-down.png",
+ "tailLeftImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-left.png",
+ "tailRightImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-right.png"
+ },
+
+ "DemoTileBase":
+ {
+ "states":
+ {
+ "NORMAL":
+ {
+ "color":[0.4, 0.6, 0.9, 0.6],
+ "visuals":
+ {
+ "image":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture.9.png",
+// TILE_BACKGROUND_ALPHA
+// This shader takes a texture.
+// An alpha discard is performed.
+// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
+ "shader":
+ {
+ "fragmentShader":[
+ " varying mediump vec2 vTexCoord;",
+ " uniform lowp vec4 uColor;",
+ " uniform sampler2D sTexture;",
+ " uniform mediump vec3 uCustomPosition;",
+ "",
+ " void main()",
+ " {",
+ " if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )",
+ " {",
+ " discard;",
+ " }",
+ "",
+ " mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );",
+ " mediump vec4 color = texture2D( sTexture, wrapTexCoord );",
+ " mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;",
+ "",
+ " gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );",
+ " }"
+ ]
+ }
+ }
+ }
+ },
+ "FOCUSED":
+ {
+ "color":[0.3, 0.5, 0.8, 0.5],
+ "visuals":
+ {
+ "image":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture-focused.9.png",
+// TILE_BACKGROUND_ALPHA
+// This shader takes a texture.
+// An alpha discard is performed.
+// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
+ "shader":
+ {
+ "fragmentShader":[
+ " varying mediump vec2 vTexCoord;",
+ " uniform lowp vec4 uColor;",
+ " uniform sampler2D sTexture;",
+ " uniform mediump vec3 uCustomPosition;",
+ "",
+ " void main()",
+ " {",
+ " if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )",
+ " {",
+ " discard;",
+ " }",
+ "",
+ " mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );",
+ " mediump vec4 color = texture2D( sTexture, wrapTexCoord );",
+ " mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;",
+ "",
+ " gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );",
+ " }"
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "FocusActor":
+ {
+ "visuals":
+ {
+ "image":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/tile-focus.9.png"
+ }
+ }
+ },
+ "DemoTileBorder":
+ {
+ "visuals":
+ {
+ "image":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/item-background.9.png" // TILE_BACKGROUND
+ }
+ }
+ },
+ "TextLabelRosemary":
+ {
+ "fontFamily":"Rosemary"
+ },
+ "TextLabel":
+ {
+ "fontStyle":{"weight":"normal"},
+ "pointSize":8
+ },
+ "LauncherLabel":
+ {
+ "pointSize":8
+ },
+
+ "ToolbarLabel":
+ {
+ "pointSize":8
+ },
+
+ "BuilderLabel":
+ {
+ "pointSize":8
+ },
+
+ "ScrollView":
+ {
+ "overshootEffectColor":"B018"
+ },
+
+ "ImageScalingGroupLabel":
+ {
+ "pointSize":8
+ },
+
+ "ImageScalingButton":
+ {
+ "label":{
+ "pointSize":8
+ }
+ },
+//
+// Simple Visuals Application Style section
+//
+ "MyControl":
+ {
+ "states":
+ {
+ "NORMAL":
+ {
+ "visuals":
+ {
+ "iconVisual":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-13.png"
+ }
+ }
+ },
+ "FOCUSED":
+ {
+ "visuals":
+ {
+ "iconVisual":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-83.png"
+ }
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2000-2017 Samsung Electronics Co., Ltd
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+{
+ "styles":
+ {
+ //
+ // Simple Visuals Application styling
+ //
+ "BasicLightButton":
+ {
+ "states":
+ {
+ "NORMAL":
+ {
+ "unselectedBackgroundVisual":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/button-white-up.9.png"
+ }
+ },
+ "FOCUSED":
+ {
+ "unselectedBackgroundVisual":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/button-white-up.9.png"
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+{
+ "styles":
+ {
+ "ContactNameTextLabel":
+ {
+ "textColor": [ 0, 0, 0, 1 ],
+ "horizontalAlignment": "CENTER",
+ "pointSize": 8
+ },
+
+ "ContactDetailTextLabel":
+ {
+ "textColor": [ 0, 0, 0, 1 ],
+ "multiLine": true,
+ "pointSize": 8
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+{
+ "styles":
+ {
+ "ProgressBar":
+ {
+ "trackVisual":{
+ "url":"{APPLICATION_RESOURCE_PATH}/images/new-progress-bar-track.9.png"
+ },
+ "progressVisual":{
+ "url":"{APPLICATION_RESOURCE_PATH}/images/new-progress-bar-progress.9.png"
+ },
+ "secondaryProgressVisual":{
+ "url":"{APPLICATION_RESOURCE_PATH}/images/new-progress-bar-secondary-progress.9.png"
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2000-2017 Samsung Electronics Co., Ltd
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+{
+ "styles":
+ {
+ //
+ // Simple Visuals Application styling
+ //
+ "MyControl":
+ {
+ "states":
+ {
+ "NORMAL":
+ {
+ "visuals":
+ {
+ "iconVisual":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-13.png"
+ }
+ }
+ },
+ "FOCUSED":
+ {
+ "visuals":
+ {
+ "iconVisual":
+ {
+ "url":"{APPLICATION_RESOURCE_PATH}/images/application-icon-83.png"
+ }
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+{
+ "constants":
+ {
+ "STYLE_DIR":"{APPLICATION_RESOURCE_PATH}/style"
+ },
+ "styles":
+ {
+ "Title":{
+ "textColor":"#0000ff",
+ "background":
+ {
+ "visualType":"COLOR",
+ "mixColor": [ 1.0, 1.0, 1.0, 1.0 ]
+ }
+ },
+ "TableView":{
+ "background":
+ {
+ "visualType":"COLOR",
+ "mixColor": [ 1.0, 1.0, 1.0, 0.03 ]
+ }
+ },
+ "FlexContainer":{
+ "background":
+ {
+ "visualType":"COLOR",
+ "mixColor": [ 1.0, 1.0, 1.0, 0.1 ]
+ }
+ },
+ "RadioButton":{
+ "label":{
+ "textColor": [1,1,1,1]
+ }
+ },
+ "CheckBoxButton":{
+ "label":{
+ "textColor": [1,1,1,1]
+ }
+ },
+ "ColorLabel1":{
+ "textColor": [1,0,0,1]
+ },
+ "ColorLabel2":{
+ "textColor": [0,1,0,1]
+ },
+ "ColorLabel3":{
+ "textColor": [0.3,0.3,1,1]
+ },
+ "ThemeLabel":{
+ "textColor":[0,1,1,1]
+ },
+ "PopupTitle":{
+ "textColor":[1,1,1,1]
+ },
+ "PopupBody":{
+ "textColor":[1,1,0,1]
+ },
+ "TextLabel":{
+ "textColor":[0,0,0,1]
+ },
+ "ColorSlider1":{
+ "styles":["Slider"]
+ },
+ "ColorSlider2":{
+ "styles":["slider"]
+ },
+ "ColorSlider3":{
+ "styles":["slider"]
+ },
+ "ImageChannelControl":
+ {
+ "enableVisibilityTransition":
+ [
+ {
+ "target":"imageVisual",
+ "property":"opacity",
+ "initialValue":0,
+ "targetValue":1,
+ "animator":
+ {
+ "alphaFunction":"EASE_IN_OUT",
+ "timePeriod":
+ {
+ "duration":0.25,
+ "delay":0
+ }
+ }
+ },
+ {
+ "target":"imageVisual",
+ "property":"size",
+ "targetValue":[1,1]
+ }
+ ],
+ "disableVisibilityTransition":
+ [
+ {
+ "target":"imageVisual",
+ "property":"opacity",
+ "targetValue":0,
+ "animator":
+ {
+ "alphaFunction":"EASE_IN_OUT",
+ "timePeriod":
+ {
+ "duration":0.25,
+ "delay":0
+ }
+ }
+ },
+ {
+ "target":"imageVisual",
+ "property":"size",
+ "targetValue":[1,1,1]
+ }
+ ]
+ },
+ "ShadowButton":
+ {
+ "states":
+ {
+ "NORMAL":
+ {
+ "visuals":
+ {
+ "backgroundVisual":{
+ "visualType":"IMAGE",
+ "url":"{STYLE_DIR}/images/shadowButtonBg.9.png",
+ "depthIndex":0
+ },
+
+ "checkboxBgVisual":{
+ "visualType":"IMAGE",
+ "url":"{STYLE_DIR}/images/CheckBg.png",
+ "transform":{
+ "size":[0.12, 0.37],
+ "offset":[30,0],
+ "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
+ "sizePolicy":["RELATIVE", "RELATIVE"],
+ "origin":"CENTER_BEGIN",
+ "anchorPoint":"CENTER_BEGIN"
+ },
+ "depthIndex":1
+ },
+
+ "labelVisual":{
+ "visualType":"TEXT",
+ "text":"Don't show again",
+ "pointSize":8,
+ "horizontalAlignment":"END",
+ "verticalAlignment":"CENTER",
+ "textColor":[1,1,1,1],
+ "mixColor":[0,0,0,1],
+ "transform":{
+ "size":[0.9, 0.9],
+ "offset":[-30,0],
+ "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
+ "sizePolicy":["RELATIVE", "RELATIVE"],
+ "origin":"CENTER_END",
+ "anchorPoint":"CENTER_END"
+ },
+ "depthIndex":1
+ }
+ },
+
+ "states":
+ {
+ "CHECKED":
+ {
+ "visuals":
+ {
+ "checkboxFgVisual":{
+ "visualType":"IMAGE",
+ "url":"{STYLE_DIR}/images/Tick.png",
+ "transform":{
+ "size":[0.12, 0.37],
+ "offset":[30,0],
+ "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
+ "sizePolicy":["RELATIVE", "RELATIVE"],
+ "origin":"CENTER_BEGIN",
+ "anchorPoint":"CENTER_BEGIN"
+ },
+ "depthIndex":2
+ }
+ },
+ "entryTransition":
+ [
+ {
+ "target":"checkboxFgVisual",
+ "property":"pixelArea",
+ "initialValue":[0.0, 0.0, 0.0, 1.0],
+ "targetValue":[0.0, 0.0, 1.0, 1.0],
+ "animator":
+ {
+ "alphaFunction":"EASE_IN",
+ "timePeriod":
+ {
+ "duration":0.4,
+ "delay":0
+ }
+ }
+ },
+ {
+ "target":"checkboxFgVisual",
+ "property":"size",
+ "initialValue":[0.0, 0.37],
+ "targetValue":[0.12, 0.37],
+ "animator":
+ {
+ "alphaFunction":"EASE_IN",
+ "timePeriod":
+ {
+ "duration":0.4,
+ "delay":0
+ }
+ }
+ }
+ ],
+ "exitTransition":
+ [
+ {
+ "target":"checkboxFgVisual",
+ "property":"pixelArea",
+ "initialValue":[0.0, 0.0, 1.0, 1.0],
+ "targetValue":[0.0, 0.0, 0.0, 1.0],
+ "animator":
+ {
+ "alphaFunction":"EASE_OUT",
+ "timePeriod":
+ {
+ "duration":0.4,
+ "delay":0
+ }
+ }
+ },
+ {
+ "target":"checkboxFgVisual",
+ "property":"size",
+ "targetValue":[0.0, 0.37],
+ "animator":
+ {
+ "alphaFunction":"EASE_OUT",
+ "timePeriod":
+ {
+ "duration":0.4,
+ "delay":0
+ }
+ }
+ }
+ ]
+ },
+ "UNCHECKED":
+ {
+ }
+ }
+ },
+ //"FOCUSED"
+ "DISABLED":
+ {
+ "visuals":
+ {
+ "checkboxBgVisual":{
+ "visualType":"IMAGE",
+ "url":"{STYLE_DIR}/images/CheckBg.png",
+ "transform":{
+ "size":[0.09, 0.28],
+ "offset":[30,0],
+ "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
+ "sizePolicy":["RELATIVE", "RELATIVE"],
+ "origin":"CENTER_BEGIN",
+ "anchorPoint":"CENTER_BEGIN"
+ },
+ "depthIndex":0
+ },
+
+ "checkboxFgVisual":{
+ "visualType":"IMAGE",
+ "url":"{STYLE_DIR}/images/Tick.png",
+ "transform":{
+ "size":[0.09, 0.28],
+ "offset":[30,0],
+ "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
+ "sizePolicy":["RELATIVE", "RELATIVE"],
+ "origin":"CENTER_BEGIN",
+ "anchorPoint":"CENTER_BEGIN"
+ },
+ "depthIndex":1
+ },
+
+ "labelVisual":{
+ "visualType":"TEXT",
+ "text":"Don't show again",
+ "pointSize":8,
+ "horizontalAlignment":"END",
+ "verticalAlignment":"CENTER",
+ "textColor":[1,1,1,1],
+ "mixColor":[0.3, 0.3, 0.3, 1],
+ "transform":{
+ "size":[0.9, 0.9],
+ "offset":[-30,0],
+ "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
+ "sizePolicy":["RELATIVE", "RELATIVE"],
+ "origin":"CENTER_END",
+ "anchorPoint":"CENTER_END"
+ },
+ "depthIndex":1
+ }
+ },
+ "states":
+ {
+ "CHECKED":
+ {
+ "visuals":
+ {
+ "checkboxFgVisual":{
+ "visualType":"IMAGE",
+ "url":"{STYLE_DIR}/images/Tick.png",
+ "transform":{
+ "size":[0.09, 0.28],
+ "offset":[30,0],
+ "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
+ "sizePolicy":["RELATIVE", "RELATIVE"],
+ "origin":"CENTER_BEGIN",
+ "anchorPoint":"CENTER_BEGIN"
+ },
+ "depthIndex":2
+ }
+ }
+ },
+ "UNCHECKED":
+ {
+ }
+ }
+ }
+ },
+ "transitions":
+ [
+ {
+ "from":"DISABLED",
+ "to":"NORMAL",
+ "visualName":"backgroundVisual",
+ "effect":"FADE_IN",
+ "animator":
+ {
+ "alphaFunction":"EASE_OUT_BACK",
+ "duration":0.8
+ }
+ },
+ {
+ "from":"DISABLED",
+ "to":"NORMAL",
+ "visualName":"*",
+ "effect":"CROSSFADE",
+ "animator":
+ {
+ "alphaFunction":"EASE_OUT_BACK",
+ "duration":0.8
+ }
+ },
+ {
+ "from":"NORMAL",
+ "to":"DISABLED",
+ "visualName":"backgroundVisual",
+ "effect":"FADE_OUT",
+ "animator":
+ {
+ "alphaFunction":"EASE_OUT_BACK",
+ "duration":0.8
+ }
+ },
+ {
+ "from":"NORMAL",
+ "to":"DISABLED",
+ "visualName":"*",
+ "effect":"CROSSFADE",
+ "animator":
+ {
+ "alphaFunction":"EASE_OUT_BACK",
+ "duration":0.8
+ }
+ }
+ ]
+ },
+ "BeatControl":
+ {
+ "beatVisual":{
+ "visualType":"IMAGE",
+ "url":"{APPLICATION_RESOURCE_PATH}/images/Logo-for-demo.png"
+ },
+
+ "bounceTransition":
+ [
+ {
+ "target":"beatVisual",
+ "property":"size",
+ "initialValue":[0.5, 0.5],
+ "targetValue":[0.75, 0.75],
+ "animator":
+ {
+ "alphaFunction":"BOUNCE",
+ "timePeriod":
+ {
+ "duration":0.5,
+ "delay":0
+ }
+ }
+ }
+ ],
+
+ "leftTransition":
+ [
+ {
+ "target":"beatVisual",
+ "property":"offset",
+ "initialValue":[0, 0],
+ "targetValue":[0.25, 0],
+ "animator":
+ {
+ "alphaFunction":"BOUNCE",
+ "timePeriod":
+ {
+ "duration":0.5,
+ "delay":0
+ }
+ }
+ }
+ ],
+
+ "upTransition":
+ [
+ {
+ "target":"beatVisual",
+ "property":"offset",
+ "initialValue":[0, 0],
+ "targetValue":[0, 0.25],
+ "animator":
+ {
+ "alphaFunction":"BOUNCE",
+ "timePeriod":
+ {
+ "duration":0.5,
+ "delay":0
+ }
+ }
+ }
+ ],
+
+ "fadeTransition":
+ [
+ {
+ "target":"beatVisual",
+ "property":"opacity",
+ "targetValue":0,
+ "animator":
+ {
+ "alphaFunction":"BOUNCE",
+ "timePeriod":
+ {
+ "duration":0.8,
+ "delay":0
+ }
+ }
+ }
+ ]
+ }
+ }
+}
--- /dev/null
+{
+ "styles":
+ {
+ "Title":{
+ "textColor":"#0000ff",
+ "background":
+ {
+ "visualType":"COLOR",
+ "mixColor": [ 1.0, 1.0, 1.0, 1.0 ]
+ }
+ },
+ "TableView":{
+ "background":
+ {
+ "visualType":"COLOR",
+ "mixColor": [ 1.0, 1.0, 1.0, 0.03 ]
+ }
+ },
+ "RadioButton":{
+ "label":{
+ "textColor": [1,1,1,1]
+ }
+ },
+ "CheckboxButton":{
+ "label":{
+ "textColor": [1,1,1,1]
+ }
+ },
+ "ColorLabel1":{
+ "textColor": [1,0,0,1]
+ },
+ "ColorLabel2":{
+ "textColor": [0,1,0,1]
+ },
+ "ColorLabel3":{
+ "textColor": [0.3,0.3,1,1]
+ },
+ "ThemeLabel":{
+ "textColor":[0,1,1,1]
+ },
+ "PopupTitle":{
+ "textColor":[1,1,1,1]
+ },
+ "PopupBody":{
+ "textColor":[1,1,0,1]
+ },
+ "TextLabel":{
+ "textColor":[0,0,0,1]
+ },
+ "ImageChannelControl":
+ {
+ "enableVisibilityTransition":
+ [
+ {
+ "target":"imageVisual",
+ "property":"size",
+ "initialValue":[0.1,0.1],
+ "targetValue":[1,1],
+ "animator":
+ {
+ "alphaFunction":"EASE_IN",
+ "timePeriod":
+ {
+ "duration":0.3,
+ "delay":0.1
+ }
+ }
+ },
+ {
+ "target":"imageVisual",
+ "property":"mixColor",
+ "targetValue":[1,1,1,1]
+ }
+ ],
+ "disableVisibilityTransition":
+ [
+ {
+ "target":"imageVisual",
+ "property":"size",
+ "initialValue":[1,1],
+ "targetValue":[0.1,0.1],
+ "animator":
+ {
+ "alphaFunction":"EASE_OUT",
+ "timePeriod":
+ {
+ "duration":0.3,
+ "delay":0.0
+ }
+ }
+ },
+ {
+ "target":"imageVisual",
+ "property":"mixColor",
+ "targetValue":[1,1,1,0],
+ "animator":
+ {
+ "alphaFunction":"EASE_OUT",
+ "timePeriod":
+ {
+ "duration":0.3,
+ "delay":0.0
+ }
+ }
+ }
+ ]
+ }
+ }
+}
--- /dev/null
+{
+ "constants":
+ {
+ "STYLE_DIR":"{APPLICATION_RESOURCE_PATH}/style"
+ },
+ "styles":
+ {
+ "Title":{
+ "textColor":"#0000ff",
+ "background":
+ {
+ "visualType":"COLOR",
+ "mixColor": [ 1.0, 1.0, 1.0, 1.0 ]
+ }
+ },
+ "TableView":{
+ "background":
+ {
+ "visualType":"GRADIENT",
+ "startPosition": [0,-1],
+ "endPosition": [0,1],
+ "stopColor": [ [ 1.0, 0.0, 1.0, 0.03 ], [1.0,0.0,1.0,0.15] ]
+ }
+ },
+
+ // Change an icon size, see if it gets properly re-sized
+ "RadioButton":{
+ "unselectedVisual":
+ {
+ "visualType": "IMAGE",
+ "url": "{STYLE_DIR}/images/radio-button-unselected.png"
+ },
+ "selectedVisual":
+ {
+ "visualType": "IMAGE",
+ "url": "{STYLE_DIR}/images/radio-button-selected.png"
+ },
+ "label":{
+ "textColor": [0.1,1,1,1]
+ }
+ },
+ "checkboxbutton":{
+ "label":{
+ "textColor": [1,1,1,1]
+ }
+ },
+ "colorLabel1":{
+ "textColor": [1,0,0,1]
+ },
+ "colorLabel2":{
+ "textColor": [0,1,0,1]
+ },
+ "colorLabel3":{
+ "textColor": [0.3,0.3,1,1]
+ },
+ "themelabel":{
+ "textColor":[0,1,1,1]
+ },
+ "popupTitle":{
+ "textColor":[1,1,1,1]
+ },
+ "popupBody":{
+ "textColor":[1,1,0,1]
+ },
+
+ // Note, this overrides any non-renamed label styles, e.g. those in a button.
+ "TextLabel":{
+ //"textColor":[0,0,0,1]
+ },
+
+ "ThinSlider":{
+ "styles": ["slider"],
+ "showPopup":true,
+ "showValue":false,
+ "valuePrecision":0,
+ "handleVisual":{
+ "size":[48,48]
+ },
+ "trackVisual":{
+ "size":[10, 10]
+ },
+ "enabled":true
+ },
+ "ColorSlider1":{
+ "styles":["ThinSlider"],
+ "progressVisual":{
+ "url":"{STYLE_DIR}/images/slider-skin-progress-red.9.png"
+ }
+ },
+ "ColorSlider2":{
+ "styles":["ThinSlider"],
+ "progressVisual":{
+ "url":"{STYLE_DIR}/images/slider-skin-progress-green.9.png"
+ }
+ },
+ "ColorSlider3":{
+ "styles":["thinslider"],
+ "progressVisual":{
+ "url":"{STYLE_DIR}/images/slider-skin-progress-blue.9.png"
+ }
+ },
+ "ImageChannelControl":
+ {
+ "enableVisibilityTransition":
+ [
+ {
+ "target":"imageVisual",
+ "property":"mixColor",
+ "initialValue":[1,1,1,0],
+ "targetValue":[1,1,1,1],
+ "animator":
+ {
+ "alphaFunction":"EASE_IN_OUT",
+ "timePeriod":
+ {
+ "duration":0.4,
+ "delay":0
+ }
+ }
+ },
+ {
+ "target":"imageVisual",
+ "property":"size",
+ "targetValue":[1,1]
+ }
+ ],
+ "disableVisibilityTransition":
+ [
+ {
+ "target":"imageVisual",
+ "property":"mixColor",
+ "targetValue":[1,1,1,0],
+ "animator":
+ {
+ "alphaFunction":"EASE_IN_OUT",
+ "timePeriod":
+ {
+ "duration":0.4,
+ "delay":0.2
+ }
+ }
+ },
+ {
+ "target":"imageVisual",
+ "property":"size",
+ "targetValue":[1,1]
+ }
+ ]
+ },
+ "ShadowButton":
+ {
+ "backgroundVisual":{
+ "visualType":"IMAGE",
+ "url":"{STYLE_DIR}/images/shadowButtonBg.9.png"
+ },
+ "checkboxBgVisual":{
+ "visualType":"IMAGE",
+ "url":"{STYLE_DIR}/images/CheckBg.png",
+ "transform":{
+ "size":[0.09, 0.28],
+ "offset":[30,0],
+ "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
+ "sizePolicy":["RELATIVE", "RELATIVE"],
+ "origin":"CENTER_BEGIN",
+ "anchorPoint":"CENTER_BEGIN"
+ }
+ },
+ "checkboxFgVisual":{
+ "visualType":"IMAGE",
+ "url":"{STYLE_DIR}/images/Tick.png",
+ "transform":{
+ "size":[0.09, 0.28],
+ "offset":[30,0],
+ "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
+ "sizePolicy":["RELATIVE", "RELATIVE"],
+ "origin":"CENTER_BEGIN",
+ "anchorPoint":"CENTER_BEGIN"
+ }
+ },
+ "labelVisual":{
+ "visualType":"TEXT",
+ "text":"Don't show again",
+ "pointSize":8,
+ "horizontalAlignment":"END",
+ "verticalAlignment":"CENTER",
+ "textColor":[1,1,1,1],
+ "mixColor":[0.3, 0.3, 0.3, 1],
+ "transform":{
+ "size":[0.9, 0.9],
+ "offset":[-30,0],
+ "offsetPolicy":["ABSOLUTE", "ABSOLUTE"],
+ "sizePolicy":["RELATIVE", "RELATIVE"],
+ "origin":"CENTER_END",
+ "anchorPoint":"CENTER_END"
+ }
+ },
+ "activeTransition":
+ [
+ {
+ "target":"checkboxBgVisual",
+ "property":"size",
+ "initialValue":[0.09, 0.28],
+ "targetValue":[0.12, 0.37],
+ "animator":
+ {
+ "alphaFunction":"EASE_OUT_BACK",
+ "timePeriod":
+ {
+ "duration":0.8,
+ "delay":0
+ }
+ }
+ }
+ ],
+ "inactiveTransition":
+ [
+ {
+ "target":"checkboxBgVisual",
+ "property":"size",
+ "initialValue":[0.12, 0.37],
+ "targetValue":[0.09, 0.28],
+ "animator":
+ {
+ "alphaFunction":"EASE_OUT_BACK",
+ "timePeriod":
+ {
+ "duration":0.8,
+ "delay":0
+ }
+ }
+ }
+ ]
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2000-2017 Samsung Electronics Co., Ltd
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+{
+ "styles":
+ {
+ "ScrollBar":
+ {
+ "indicatorShowDuration":1.0,
+ "indicatorHideDuration":1.0,
+ "background": {
+ "rendererType": "image",
+ "url": "{APPLICATION_RESOURCE_PATH}/images/button-disabled.9.png"
+ }
+ },
+ "ScrollBarIndicator":
+ {
+ "resourceUrl":"{APPLICATION_RESOURCE_PATH}/images/button-white-up.9.png"
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+{
+ "styles":
+ {
+ "TooltipTextOnly" :
+ {
+ "tooltip": "Using defaults defined in the Toolkit stylesheet"
+ },
+
+ "TooltipArray" :
+ {
+ "tooltip" :
+ {
+ "content" :
+ [
+ {
+ "visualType" : "IMAGE",
+ "url" : "{APPLICATION_RESOURCE_PATH}/images/application-icon-0.png",
+ "desiredWidth" : 75,
+ "desiredHeight" : 75
+ },
+ {
+ "visualType" : "TEXT",
+ "text" : "An icon on the left and\nmulti-line text on the right",
+ "multiLine" : true,
+ "pointSize" : 8
+ }
+ ],
+ "tail" : true
+ }
+ },
+
+ "TooltipCustom" :
+ {
+ "tooltip":
+ {
+ "content":
+ {
+ "visualType" : "TEXT",
+ "textColor" : [1,1,1,1],
+ "text" : "Completely custom style\nthat disappears on movement",
+ "multiLine" : true,
+ "pointSize" : 8
+ },
+ "waitTime":0.5,
+ "background":
+ {
+ "visual":"{APPLICATION_RESOURCE_PATH}/images/tooltip.9.png",
+ "border":[1,5,5,1]
+ },
+ "tail":
+ {
+ "visibility":true,
+ "aboveVisual":"{APPLICATION_RESOURCE_PATH}/images/tooltip-tail-above.png",
+ "belowVisual":"{APPLICATION_RESOURCE_PATH}/images/tooltip-tail-below.png"
+ },
+ "position":"ABOVE",
+ "hoverPointOffset":[10,10],
+ "movementThreshold":5,
+ "disappearOnMovement":true
+ }
+ },
+
+ "TableView" :
+ {
+ "cellPadding" : [ 5.0, 5.0 ]
+ }
+ }
+}
#ifndef DALI_DEMO_STRINGS_H
#define DALI_DEMO_STRINGS_H
+#ifdef INTERNATIONALIZATION_ENABLED
#include <libintl.h>
+#endif
#ifdef __cplusplus
extern "C"
{
std::string name = mPressedActor.GetName();
- ExecuteProcess( name );
+ ExecuteProcess( name, mApplication );
mPressedActor.Reset();
}
--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+ // FILE HEADER
+#include "execute-process.h"
+
+ // EXTERNAL INCLUDES
+#include <sstream>
+#include <unistd.h>
+#include <dali/public-api/common/dali-common.h>
+
+void ExecuteProcess( const std::string& processName, Dali::Application& application )
+{
+ std::stringstream stream;
+ stream << "am start -a android.intent.action.MAIN -n com.sec.dalidemo/.DaliDemoNativeActivity --user 0 --es start " << processName.c_str();
+ pid_t parentPID = getpid();
+
+ pid_t pid = fork();
+ if( pid == 0 )
+ {
+ do
+ {
+ sleep( 1 );
+ }
+ while( kill( parentPID, 0 ) == 0 );
+
+ system( stream.str().c_str() );
+ exit( 0 );
+ }
+ else
+ {
+ application.Quit();
+ }
+}
#include <unistd.h>
#include <dali/public-api/common/dali-common.h>
-void ExecuteProcess( const std::string& processName )
+void ExecuteProcess( const std::string& processName, Dali::Application& application )
{
std::stringstream stream;
stream << DEMO_EXAMPLE_BIN << processName.c_str();
pid_t pid = fork();
- if( pid == 0)
+ if( pid == 0 )
{
execlp( stream.str().c_str(), processName.c_str(), NULL );
DALI_ASSERT_ALWAYS(false && "exec failed!");
const std::string PATH_SEPARATOR( "\\" );
}
-void ExecuteProcess( const std::string& processName )
+void ExecuteProcess( const std::string& processName, Dali::Application& application )
{
char currentPath[MAX_PATH];
DWORD numberOfCharacters = GetCurrentDirectory( MAX_PATH, currentPath );
// EXTERNAL INCLUDES
#include <string>
+#include <dali/public-api/adaptor-framework/application.h>
-void ExecuteProcess( const std::string& processName );
+void ExecuteProcess( const std::string& processName, Dali::Application& application );
#endif // DALI_DEMO_EXECUTE_PROCESS_H
int DALI_EXPORT_API main(int argc, char **argv)
{
// Configure gettext for internalization
+#if INTERNATIONALIZATION_ENABLED
bindtextdomain(DALI_DEMO_DOMAIN_LOCAL, DEMO_LOCALE_DIR);
textdomain(DALI_DEMO_DOMAIN_LOCAL);
setlocale(LC_ALL, DEMO_LANG);
-
+#endif
Application app = Application::New( &argc, &argv, DEMO_STYLE_DIR "/tests-theme.json" );
// Create the demo launcher