Add Android DALi demo build. 31/223431/11
authorAnton Obzhirov <a.obzhirov@samsung.com>
Wed, 29 Jan 2020 18:02:54 +0000 (18:02 +0000)
committerAnton Obzhirov <a.obzhirov@samsung.com>
Thu, 13 Feb 2020 16:53:10 +0000 (16:53 +0000)
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

80 files changed:
README.md
build/android/.gitignore [new file with mode: 0644]
build/android/app/.gitignore [new file with mode: 0644]
build/android/app/build.gradle [new file with mode: 0644]
build/android/app/src/main/AndroidManifest.xml [new file with mode: 0644]
build/android/app/src/main/cpp/CMakeLists.txt [new file with mode: 0644]
build/android/app/src/main/cpp/main.cpp [new file with mode: 0644]
build/android/app/src/main/java/com/sec/dalidemo/DaliDemoApplication.java [new file with mode: 0644]
build/android/app/src/main/java/com/sec/dalidemo/DaliDemoNativeActivity.java [new file with mode: 0644]
build/android/app/src/main/java/com/sec/dalidemo/DaliExamplesNativeActivity.java [new file with mode: 0644]
build/android/app/src/main/java/com/sec/dalidemo/DaliTestsNativeActivity.java [new file with mode: 0644]
build/android/app/src/main/res/mipmap-hdpi/dali_examples.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-hdpi/dali_launcher.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-hdpi/dali_tests.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-hdpi/ic_launcher.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-mdpi/dali_examples.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-mdpi/dali_launcher.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-mdpi/dali_tests.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-mdpi/ic_launcher.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-xhdpi/dali_examples.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-xhdpi/dali_launcher.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-xhdpi/dali_tests.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-xxhdpi/dali_examples.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-xxhdpi/dali_launcher.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-xxhdpi/dali_tests.png [new file with mode: 0644]
build/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png [new file with mode: 0644]
build/android/app/src/main/res/values/strings.xml [new file with mode: 0644]
build/android/build.gradle [new file with mode: 0644]
build/android/build.sh [new file with mode: 0755]
build/android/dali/.gitignore [new file with mode: 0644]
build/android/dali/build.sh [new file with mode: 0755]
build/android/dali/build_adaptor.sh [new file with mode: 0755]
build/android/dali/build_core.sh [new file with mode: 0755]
build/android/dali/build_demo.sh [new file with mode: 0755]
build/android/dali/build_toolkit.sh [new file with mode: 0755]
build/android/dali/env.sh [new file with mode: 0755]
build/android/key.jks [new file with mode: 0644]
build/android/settings.gradle [new file with mode: 0644]
build/tizen/CMakeLists.txt
build/tizen/demo/CMakeLists.txt
build/tizen/examples-reel/CMakeLists.txt
build/tizen/examples/CMakeLists.txt
build/tizen/tests-reel/CMakeLists.txt
demo/dali-demo.cpp
examples-reel/dali-examples-reel.cpp
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
examples/bloom-view/bloom-view-example.cpp
examples/frame-callback/frame-callback.cpp
examples/gestures/gesture-example.cpp
examples/page-turn-view/page-turn-view-example.cpp
examples/pre-render-callback/pre-render-callback-example.cpp
examples/refraction-effect/refraction-effect-example.cpp
examples/rendering-basic-pbr/ktx-loader.cpp
examples/simple-bitmap-font-text-label/simple-text-label-example.cpp
examples/simple-text-field/simple-text-field.cpp
examples/simple-text-label/simple-text-label-example.cpp
examples/simple-text-renderer/simple-text-renderer-example.cpp
examples/simple-text-visual/simple-text-visual-example.cpp
packaging/com.samsung.dali-demo.spec
resources/style/android/animated-gradient-call-active-style.json [new file with mode: 0644]
resources/style/android/base-theme.json [new file with mode: 0644]
resources/style/android/basic-light-theme.json [new file with mode: 0644]
resources/style/android/contact-cards-example-theme.json [new file with mode: 0644]
resources/style/android/progress-bar-example-theme.json [new file with mode: 0644]
resources/style/android/simple-example-theme.json [new file with mode: 0644]
resources/style/android/style-example-theme-one.json [new file with mode: 0644]
resources/style/android/style-example-theme-three.json [new file with mode: 0644]
resources/style/android/style-example-theme-two.json [new file with mode: 0644]
resources/style/android/text-editor-example-theme.json [new file with mode: 0644]
resources/style/android/tooltip-example-theme.json [new file with mode: 0644]
shared/dali-demo-strings.h
shared/dali-table-view.cpp
shared/execute-process-android.cpp [new file with mode: 0644]
shared/execute-process-unix.cpp
shared/execute-process-win.cpp
shared/execute-process.h
tests-reel/dali-tests-reel.cpp

index e4ee78816d06116d25a0ed3355f1874deb9512ba..d154302ac8dffd57f56073fadd202247b114f0f8 100644 (file)
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
 
 ### Requirements
 
- - Ubuntu 14.04 or later
+ - Ubuntu 16.04 or later
  - Environment created using dali_env script in dali-core repository
  - GCC version 6
 
@@ -71,3 +71,34 @@ Before running make install as normal:
  - 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
+
diff --git a/build/android/.gitignore b/build/android/.gitignore
new file mode 100644 (file)
index 0000000..e136078
--- /dev/null
@@ -0,0 +1,7 @@
+build
+gradle
+.gradle
+gradlew
+gradlew.bat
+local.properties
+gradle.properties
diff --git a/build/android/app/.gitignore b/build/android/app/.gitignore
new file mode 100644 (file)
index 0000000..0e60033
--- /dev/null
@@ -0,0 +1 @@
+.cxx
diff --git a/build/android/app/build.gradle b/build/android/app/build.gradle
new file mode 100644 (file)
index 0000000..28042e4
--- /dev/null
@@ -0,0 +1,120 @@
+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
diff --git a/build/android/app/src/main/AndroidManifest.xml b/build/android/app/src/main/AndroidManifest.xml
new file mode 100644 (file)
index 0000000..15e8dc0
--- /dev/null
@@ -0,0 +1,72 @@
+<?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) -->
diff --git a/build/android/app/src/main/cpp/CMakeLists.txt b/build/android/app/src/main/cpp/CMakeLists.txt
new file mode 100644 (file)
index 0000000..39e67ad
--- /dev/null
@@ -0,0 +1,54 @@
+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)
diff --git a/build/android/app/src/main/cpp/main.cpp b/build/android/app/src/main/cpp/main.cpp
new file mode 100644 (file)
index 0000000..02fb4c4
--- /dev/null
@@ -0,0 +1,293 @@
+/*
+ * 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)
diff --git a/build/android/app/src/main/java/com/sec/dalidemo/DaliDemoApplication.java b/build/android/app/src/main/java/com/sec/dalidemo/DaliDemoApplication.java
new file mode 100644 (file)
index 0000000..7c853cc
--- /dev/null
@@ -0,0 +1,6 @@
+package com.sec.dalidemo;
+
+import android.app.Application;
+
+public class DaliDemoApplication extends Application {
+}
diff --git a/build/android/app/src/main/java/com/sec/dalidemo/DaliDemoNativeActivity.java b/build/android/app/src/main/java/com/sec/dalidemo/DaliDemoNativeActivity.java
new file mode 100644 (file)
index 0000000..64a7853
--- /dev/null
@@ -0,0 +1,97 @@
+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);
+    }
+}
diff --git a/build/android/app/src/main/java/com/sec/dalidemo/DaliExamplesNativeActivity.java b/build/android/app/src/main/java/com/sec/dalidemo/DaliExamplesNativeActivity.java
new file mode 100644 (file)
index 0000000..a331a47
--- /dev/null
@@ -0,0 +1,5 @@
+package com.sec.dalidemo;
+
+public class DaliExamplesNativeActivity extends DaliDemoNativeActivity {
+}
+
diff --git a/build/android/app/src/main/java/com/sec/dalidemo/DaliTestsNativeActivity.java b/build/android/app/src/main/java/com/sec/dalidemo/DaliTestsNativeActivity.java
new file mode 100644 (file)
index 0000000..09420a7
--- /dev/null
@@ -0,0 +1,4 @@
+package com.sec.dalidemo;
+
+public class DaliTestsNativeActivity extends DaliDemoNativeActivity {
+}
diff --git a/build/android/app/src/main/res/mipmap-hdpi/dali_examples.png b/build/android/app/src/main/res/mipmap-hdpi/dali_examples.png
new file mode 100644 (file)
index 0000000..349b175
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-hdpi/dali_examples.png differ
diff --git a/build/android/app/src/main/res/mipmap-hdpi/dali_launcher.png b/build/android/app/src/main/res/mipmap-hdpi/dali_launcher.png
new file mode 100644 (file)
index 0000000..2ea08ce
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-hdpi/dali_launcher.png differ
diff --git a/build/android/app/src/main/res/mipmap-hdpi/dali_tests.png b/build/android/app/src/main/res/mipmap-hdpi/dali_tests.png
new file mode 100644 (file)
index 0000000..42280e0
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-hdpi/dali_tests.png differ
diff --git a/build/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/build/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..cde69bc
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/build/android/app/src/main/res/mipmap-mdpi/dali_examples.png b/build/android/app/src/main/res/mipmap-mdpi/dali_examples.png
new file mode 100644 (file)
index 0000000..349b175
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-mdpi/dali_examples.png differ
diff --git a/build/android/app/src/main/res/mipmap-mdpi/dali_launcher.png b/build/android/app/src/main/res/mipmap-mdpi/dali_launcher.png
new file mode 100644 (file)
index 0000000..e7100a3
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-mdpi/dali_launcher.png differ
diff --git a/build/android/app/src/main/res/mipmap-mdpi/dali_tests.png b/build/android/app/src/main/res/mipmap-mdpi/dali_tests.png
new file mode 100644 (file)
index 0000000..42280e0
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-mdpi/dali_tests.png differ
diff --git a/build/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/build/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..c133a0c
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/build/android/app/src/main/res/mipmap-xhdpi/dali_examples.png b/build/android/app/src/main/res/mipmap-xhdpi/dali_examples.png
new file mode 100644 (file)
index 0000000..349b175
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-xhdpi/dali_examples.png differ
diff --git a/build/android/app/src/main/res/mipmap-xhdpi/dali_launcher.png b/build/android/app/src/main/res/mipmap-xhdpi/dali_launcher.png
new file mode 100644 (file)
index 0000000..2eb63d4
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-xhdpi/dali_launcher.png differ
diff --git a/build/android/app/src/main/res/mipmap-xhdpi/dali_tests.png b/build/android/app/src/main/res/mipmap-xhdpi/dali_tests.png
new file mode 100644 (file)
index 0000000..42280e0
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-xhdpi/dali_tests.png differ
diff --git a/build/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/build/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..bfa42f0
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/build/android/app/src/main/res/mipmap-xxhdpi/dali_examples.png b/build/android/app/src/main/res/mipmap-xxhdpi/dali_examples.png
new file mode 100644 (file)
index 0000000..349b175
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-xxhdpi/dali_examples.png differ
diff --git a/build/android/app/src/main/res/mipmap-xxhdpi/dali_launcher.png b/build/android/app/src/main/res/mipmap-xxhdpi/dali_launcher.png
new file mode 100644 (file)
index 0000000..6a18f3d
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-xxhdpi/dali_launcher.png differ
diff --git a/build/android/app/src/main/res/mipmap-xxhdpi/dali_tests.png b/build/android/app/src/main/res/mipmap-xxhdpi/dali_tests.png
new file mode 100644 (file)
index 0000000..42280e0
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-xxhdpi/dali_tests.png differ
diff --git a/build/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/build/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..324e72c
Binary files /dev/null and b/build/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/build/android/app/src/main/res/values/strings.xml b/build/android/app/src/main/res/values/strings.xml
new file mode 100644 (file)
index 0000000..e07cdd0
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/build/android/build.gradle b/build/android/build.gradle
new file mode 100644 (file)
index 0000000..5b10372
--- /dev/null
@@ -0,0 +1,26 @@
+// 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
+}
+
+
+
+
+
diff --git a/build/android/build.sh b/build/android/build.sh
new file mode 100755 (executable)
index 0000000..6e0bf9f
--- /dev/null
@@ -0,0 +1,93 @@
+[ -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
+
diff --git a/build/android/dali/.gitignore b/build/android/dali/.gitignore
new file mode 100644 (file)
index 0000000..d5e56bb
--- /dev/null
@@ -0,0 +1,7 @@
+lib
+obj
+dali-core
+dali-adaptor
+dali-toolkit
+dali-demo
+
diff --git a/build/android/dali/build.sh b/build/android/dali/build.sh
new file mode 100755 (executable)
index 0000000..62969f4
--- /dev/null
@@ -0,0 +1,33 @@
+#!/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
+
diff --git a/build/android/dali/build_adaptor.sh b/build/android/dali/build_adaptor.sh
new file mode 100755 (executable)
index 0000000..76ab10e
--- /dev/null
@@ -0,0 +1,27 @@
+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 -
diff --git a/build/android/dali/build_core.sh b/build/android/dali/build_core.sh
new file mode 100755 (executable)
index 0000000..0632405
--- /dev/null
@@ -0,0 +1,27 @@
+
+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 -
diff --git a/build/android/dali/build_demo.sh b/build/android/dali/build_demo.sh
new file mode 100755 (executable)
index 0000000..add4444
--- /dev/null
@@ -0,0 +1,32 @@
+
+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 -
+
diff --git a/build/android/dali/build_toolkit.sh b/build/android/dali/build_toolkit.sh
new file mode 100755 (executable)
index 0000000..3b4f9a9
--- /dev/null
@@ -0,0 +1,33 @@
+
+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 -
diff --git a/build/android/dali/env.sh b/build/android/dali/env.sh
new file mode 100755 (executable)
index 0000000..09f0539
--- /dev/null
@@ -0,0 +1,23 @@
+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
diff --git a/build/android/key.jks b/build/android/key.jks
new file mode 100644 (file)
index 0000000..f2502d9
Binary files /dev/null and b/build/android/key.jks differ
diff --git a/build/android/settings.gradle b/build/android/settings.gradle
new file mode 100644 (file)
index 0000000..573abcb
--- /dev/null
@@ -0,0 +1,2 @@
+include ':app'
+
index a0b83222bd05515610d22756d87e19510903e775..f6d8ad856359981727e90b1e760a55199356f80c 100644 (file)
@@ -17,15 +17,15 @@ SET(DEMO_SHARED ${CMAKE_SOURCE_DIR}/../../shared)
 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} )
@@ -42,7 +42,11 @@ SET(LOCAL_MODELS_DIR ${RESOURCE_DIR}/models)
 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/)
@@ -54,23 +58,36 @@ SET(SHADERS_DIR ${APP_DATA_RES_DIR}/shaders/)
 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")
@@ -121,6 +138,14 @@ FOREACH(flag ${LOCAL_STYLES_LIST})
 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)
index 4e7307061e9f5d11d70f73da44d414ac5b557d4d..ac3c3f50d2d468ec8b74bc6a6ebc120c5beb078f 100644 (file)
@@ -6,10 +6,26 @@ SET(DEMO_SRCS
   ${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})
index 887ce5cb25767d12ca975557fd6f03d36ea301ee..aae2efded35bba70f826a1f62a3d843bb38c8a2c 100644 (file)
@@ -6,10 +6,26 @@ SET(EXAMPLES_REEL_SRCS
   ${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})
index ee0d04f67c4969c5f015cae3f03498fcb85f8f9a..3a55570e616af660bc92c1b4c15027473833a3ff 100644 (file)
@@ -16,7 +16,11 @@ SUBDIRLIST(SUBDIRS ${EXAMPLES_SRC_DIR})
 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)
index 2eb4c531238e142b459aa5aa19c8ff4e339f6a9d..6c69839c7bd18fab3d8a58893c3acfaf63f00457 100644 (file)
@@ -6,10 +6,25 @@ SET(TESTS_REEL_SRCS
   ${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})
index b720769b359f287e3a0500796676945a9698db00..2884a3205330dcaea4490d74b72c9cee670a3c7f 100644 (file)
@@ -27,9 +27,11 @@ using namespace Dali;
 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);
 
index a1358a817d62d4ca212c32c3fd62166d1935614f..f525f07c6a89050ffa8b11e8e0d724d90ab6290f 100644 (file)
@@ -27,9 +27,11 @@ using namespace Dali;
 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" );
 
index 5f515a8e0211cad98cf60cb33ed39463b9ca53b1..49fdd4311ad86cb7597e5947e7f184589e33d06f 100644 (file)
@@ -402,7 +402,7 @@ private:
   float mButtonDelay;
 };
 
-int main(int argc, char **argv)
+int DALI_EXPORT_API main(int argc, char **argv)
 {
   Application application = Application::New( &argc, &argv );
 
index 341436180dbd0fd3c0d8b47d80fcb32995591c73..2678b19e1c1aab540f976f950a1e02941bd71151 100644 (file)
@@ -824,7 +824,7 @@ private:
   bool mIsTouchedActor;
 };
 
-int main(int argc, char **argv)
+int DALI_EXPORT_API main(int argc, char **argv)
 {
   Application application = Application::New( &argc, &argv );
 
index 8fddca71b6d92e82b5cd7e49e12734d97e325726..20ce0839c5c781f29a242f489acafd7a54645bca 100644 (file)
@@ -23,6 +23,7 @@
 
 using namespace Dali;
 using namespace Dali::Toolkit;
+using namespace std;
 
 namespace
 {
@@ -444,7 +445,7 @@ public:
     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;
@@ -612,7 +613,7 @@ private:
 };
 
 
-int main( int argc, char **argv )
+int DALI_EXPORT_API main( int argc, char **argv )
 {
   Application application = Application::New( &argc, &argv );
 
index dd64493bbbe4b76de2ea0c23c0e3b564179652ac..7c856c1f919415340596c8cbda4d5ada78d35a8d 100644 (file)
@@ -210,7 +210,7 @@ private:
   BloomView mBloomView;
 };
 
-int main(int argc, char **argv)
+int DALI_EXPORT_API main(int argc, char **argv)
 {
   Application application = Application::New( &argc, &argv );
 
index fcab8fccb721145012ab42751e3fc412aacd0aa1..52ef117a110898ed31cc83763005faec700c643a 100644 (file)
@@ -19,6 +19,7 @@
 #include "frame-callback.h"
 
 using namespace Dali;
+using namespace std;
 
 FrameCallback::FrameCallback()
 : mActorIdContainer(),
@@ -46,7 +47,7 @@ void FrameCallback::Update( Dali::UpdateProxy& updateProxy, float /* elapsedSeco
     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.
index a28ab95500304068f26990be4cb5338924fad336..2cca96de51655b045ab9a44d9eaac618fccf1477 100644 (file)
@@ -23,6 +23,7 @@
 
 using namespace Dali;
 using namespace Dali::Toolkit;
+using namespace std;
 
 namespace
 {
@@ -322,8 +323,8 @@ private:
 
         // 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 );
         }
index 1bb1411f54ed786872488622ca6a02233cf67b0a..a8e53e5be0a6011114be5fe8437a7c3c28afada4 100644 (file)
@@ -277,7 +277,7 @@ void PageTurnExample::OnKeyEvent(const KeyEvent& event)
 }
 
 // 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 );
index 0b10a8c5ffe9b71c4e8068c7c8b77c30c534ff81..bf5173adea72e2ac6c55eceb297b90e8e7b4280f 100644 (file)
@@ -253,7 +253,7 @@ private:
 
 } // 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 );
index a0256c9f27cba5ebca5232a98e0ae42b0baba2b5..b825388290c7b56400a8598068e5c26b4753ad87 100644 (file)
@@ -475,7 +475,7 @@ private:
     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;
     }
 
index 790d1e27e21dc2ec62194da66cd42fa36ca15876..03b6b804b36f29c0c0771ba170d42cf4b90ca28c 100644 (file)
@@ -114,7 +114,7 @@ bool LoadCubeMapFromKtxFile( const std::string& path, CubeData& cubedata )
   // 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;
   }
@@ -125,6 +125,8 @@ bool LoadCubeMapFromKtxFile( const std::string& path, CubeData& cubedata )
     return false;
   }
 
+  lSize -= imageSizeOffset;
+
   rewind(fp);
 
   if( fseek(fp, imageSizeOffset, SEEK_SET) )
index 04ad1fb8fa3198f4628e5af3502ef508a99fd3b6..51845bb1ff59a712a4226ff22bd3153dfb00408b 100644 (file)
@@ -194,7 +194,7 @@ void RunTest( Application& application )
 }
 
 /** 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 );
 
index 3516e773d433ab14c08839d5efd66cad450a2cc0..45fa17daee7a97cb95b49f298e7da03f1b0f585a 100644 (file)
@@ -96,7 +96,7 @@ void RunTest( Application& application )
 }
 
 /** 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 );
index 78e7db7f04bce569bb7ca4202729714dbbd866ca..89c079dbc1f1dace6290c4c5a5b1ab944e7b6744 100644 (file)
@@ -95,7 +95,7 @@ void RunTest( Application& application )
 }
 
 /** 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 );
 
index c980170c128c55c6eaa457241cf3442f8bbeba53..676a3e13167707d2e7345191a8469efdc094d1f1 100644 (file)
@@ -342,7 +342,7 @@ private:
 };
 
 /** 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 );
 
index b92e2a4412c3e56c9634083f0f7f9903fbde4f36..5964010583a4c9ea66bfa9f2d9cd586196eba273 100644 (file)
@@ -104,7 +104,7 @@ void RunTest( Application& application )
 }
 
 /** 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 );
 
index a9245bd23f53f2f3c4ad88e5abb0baf5b460131d..67ffb684277660c30a10bfc89bef9649a93ec295 100755 (executable)
@@ -57,7 +57,7 @@ CXXFLAGS+=" -D_ARCH_ARM_"
 
 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}
@@ -75,7 +75,7 @@ make %{?jobs:-j%jobs}
 %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}
diff --git a/resources/style/android/animated-gradient-call-active-style.json b/resources/style/android/animated-gradient-call-active-style.json
new file mode 100644 (file)
index 0000000..d73dc38
--- /dev/null
@@ -0,0 +1,76 @@
+{
+  "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"
+        }
+      }
+    }
+  }
+}
diff --git a/resources/style/android/base-theme.json b/resources/style/android/base-theme.json
new file mode 100644 (file)
index 0000000..b477b96
--- /dev/null
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+{
+  "styles":
+  {
+    "ConfirmationPopup":{
+      "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/00_popup_bg.9.png"
+    },
+
+    "CustomPopupStyle":{
+      "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/popup.9.png",
+      "popupBackgroundBorder":[0,4,4,0],
+      "tailUpImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-up.png",
+      "tailDownImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-down.png",
+      "tailLeftImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-left.png",
+      "tailRightImage":"{APPLICATION_RESOURCE_PATH}/images/popup-tail-right.png"
+    },
+
+    "DemoTileBase":
+    {
+      "states":
+      {
+        "NORMAL":
+        {
+          "color":[0.4, 0.6, 0.9, 0.6],
+          "visuals":
+          {
+            "image":
+            {
+              "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture.9.png",
+// TILE_BACKGROUND_ALPHA
+// This shader takes a texture.
+// An alpha discard is performed.
+// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
+              "shader":
+              {
+                "fragmentShader":[
+                  "  varying mediump vec2  vTexCoord;",
+                  "  uniform lowp    vec4  uColor;",
+                  "  uniform sampler2D     sTexture;",
+                  "  uniform mediump vec3  uCustomPosition;",
+                  "",
+                  "  void main()",
+                  "  {",
+                  "    if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )",
+                  "    {",
+                  "      discard;",
+                  "    }",
+                  "",
+                  "    mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );",
+                  "    mediump vec4 color = texture2D( sTexture, wrapTexCoord );",
+                  "    mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;",
+                  "",
+                  "    gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );",
+                  "  }"
+                ]
+              }
+            }
+          }
+        },
+        "FOCUSED":
+        {
+          "color":[0.3, 0.5, 0.8, 0.5],
+          "visuals":
+          {
+            "image":
+            {
+              "url":"{APPLICATION_RESOURCE_PATH}/images/demo-tile-texture-focused.9.png",
+// TILE_BACKGROUND_ALPHA
+// This shader takes a texture.
+// An alpha discard is performed.
+// The shader uses the tiles position within the scroll-view page and the scroll-views rotation position to create a parallax effect.
+              "shader":
+              {
+                "fragmentShader":[
+                  "  varying mediump vec2  vTexCoord;",
+                  "  uniform lowp    vec4  uColor;",
+                  "  uniform sampler2D     sTexture;",
+                  "  uniform mediump vec3  uCustomPosition;",
+                  "",
+                  "  void main()",
+                  "  {",
+                  "    if( texture2D( sTexture, vTexCoord ).a <= 0.0001 )",
+                  "    {",
+                  "      discard;",
+                  "    }",
+                  "",
+                  "    mediump vec2 wrapTexCoord = vec2( ( vTexCoord.x / 4.0 ) + ( uCustomPosition.x / 4.0 ) + ( uCustomPosition.z / 2.0 ), vTexCoord.y / 4.0 );",
+                  "    mediump vec4 color = texture2D( sTexture, wrapTexCoord );",
+                  "    mediump float positionWeight = ( uCustomPosition.y + 0.3 ) * color.r * 2.0;",
+                  "",
+                  "    gl_FragColor = vec4( positionWeight, positionWeight, positionWeight, 0.9 ) * uColor + vec4( uColor.xyz, 0.0 );",
+                  "  }"
+                ]
+              }
+            }
+          }
+        }
+      }
+    },
+    "FocusActor":
+    {
+      "visuals":
+      {
+        "image":
+        {
+          "url":"{APPLICATION_RESOURCE_PATH}/images/tile-focus.9.png"
+        }
+      }
+    },
+    "DemoTileBorder":
+    {
+      "visuals":
+      {
+        "image":
+        {
+          "url":"{APPLICATION_RESOURCE_PATH}/images/item-background.9.png" // TILE_BACKGROUND
+        }
+      }
+    },
+    "TextLabelRosemary":
+    {
+      "fontFamily":"Rosemary"
+    },
+    "TextLabel":
+    {
+      "fontStyle":{"weight":"normal"},
+      "pointSize":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"
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/resources/style/android/basic-light-theme.json b/resources/style/android/basic-light-theme.json
new file mode 100644 (file)
index 0000000..ae863f2
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * 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"
+            }
+        }
+      }
+    }
+  }
+}
diff --git a/resources/style/android/contact-cards-example-theme.json b/resources/style/android/contact-cards-example-theme.json
new file mode 100644 (file)
index 0000000..3f4ea12
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * 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
+    }
+  }
+}
diff --git a/resources/style/android/progress-bar-example-theme.json b/resources/style/android/progress-bar-example-theme.json
new file mode 100644 (file)
index 0000000..971ee7d
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * 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"
+      }
+    }
+  }
+}
diff --git a/resources/style/android/simple-example-theme.json b/resources/style/android/simple-example-theme.json
new file mode 100644 (file)
index 0000000..d2b68e5
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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"
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/resources/style/android/style-example-theme-one.json b/resources/style/android/style-example-theme-one.json
new file mode 100644 (file)
index 0000000..74025d2
--- /dev/null
@@ -0,0 +1,467 @@
+{
+  "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
+            }
+          }
+        }
+      ]
+    }
+  }
+}
diff --git a/resources/style/android/style-example-theme-three.json b/resources/style/android/style-example-theme-three.json
new file mode 100644 (file)
index 0000000..f77d957
--- /dev/null
@@ -0,0 +1,109 @@
+{
+  "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
+            }
+          }
+        }
+      ]
+    }
+  }
+}
diff --git a/resources/style/android/style-example-theme-two.json b/resources/style/android/style-example-theme-two.json
new file mode 100644 (file)
index 0000000..fa8ed33
--- /dev/null
@@ -0,0 +1,235 @@
+{
+  "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
+            }
+          }
+        }
+      ]
+    }
+  }
+}
diff --git a/resources/style/android/text-editor-example-theme.json b/resources/style/android/text-editor-example-theme.json
new file mode 100644 (file)
index 0000000..48470b4
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * 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"
+    }
+  }
+}
diff --git a/resources/style/android/tooltip-example-theme.json b/resources/style/android/tooltip-example-theme.json
new file mode 100644 (file)
index 0000000..74e4158
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * 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 ]
+    }
+  }
+}
index 354338f72bb39789cbffc5fdd482f22da668540e..2969f798a106db4ba5d802c65ef67347cb58c95c 100644 (file)
@@ -19,7 +19,9 @@
 #ifndef DALI_DEMO_STRINGS_H
 #define DALI_DEMO_STRINGS_H
 
+#ifdef INTERNATIONALIZATION_ENABLED
 #include <libintl.h>
+#endif
 
 #ifdef __cplusplus
 extern "C"
index 9be600ded48d32fdcd249d77a58da9f7c8c39242..8fcf8b1d56291402c2dc4fbfaa8225c00ec755c9 100644 (file)
@@ -620,7 +620,7 @@ void DaliTableView::OnPressedAnimationFinished( Dali::Animation& source )
   {
     std::string name = mPressedActor.GetName();
 
-    ExecuteProcess( name );
+    ExecuteProcess( name, mApplication );
 
     mPressedActor.Reset();
   }
diff --git a/shared/execute-process-android.cpp b/shared/execute-process-android.cpp
new file mode 100644 (file)
index 0000000..d042a55
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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();
+  }
+}
index 6b87e5416a3108c873d1e8f5f7cae889f29ea699..aa777718031663f1c3d20e1fd0339d92603b3f5f 100644 (file)
 #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!");
index 3eb89f471c1e8beee37c34ae9d56f04d4ea471c2..8445221625487a84a9077c4e061d0c4f1307e797 100644 (file)
@@ -27,7 +27,7 @@ namespace
 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 );
index d31a4a1eadc67eb21be7e870b69128a64e1ed0cc..c3d11cd5e0e8fa257289a67de5405a2a716d9366 100644 (file)
@@ -20,8 +20,9 @@
 
  // 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
index 18a3fa2e99003c774bf99ce466b3b19c3f12c91d..7abe0640ad548ca5da413acf924c8fdfd3547fd1 100644 (file)
@@ -27,10 +27,11 @@ using namespace Dali;
 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