TizenRefApp-8613 [RTL] Wrong scroll direction in Task Manager 79/156479/3 submit/tizen_4.0/20171108.092711
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 18 Oct 2017 12:08:02 +0000 (15:08 +0300)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 18 Oct 2017 12:41:02 +0000 (15:41 +0300)
Change-Id: I654d08f805d73c5b24758c2c615486502bf235e7
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
src/App/inc/App.h
src/App/src/App.cpp

index 20a312e..072f547 100644 (file)
@@ -44,6 +44,8 @@ namespace TaskMngr {
                        App(App &) = delete;
                        App &operator=(App &) = delete;
 
+                       void updateCharacterOrientation();
+
                        // App cbs:
                        bool onCreate();
                        void onTerminate();
index 265e0c6..a6a327f 100644 (file)
@@ -22,6 +22,8 @@
 #include "MainController.h"
 
 #include <efl_extension.h>
+#include <utils_i18n.h>
+#include <system_settings.h>
 
 using namespace TaskMngr;
 
@@ -86,6 +88,27 @@ int App::start(int argc, char *argv[])
        return ui_app_main(argc, argv, &cbs, this);
 }
 
+void App::updateCharacterOrientation()
+{
+       char *lang = nullptr;
+       system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &lang);
+       if (lang) {
+               LOG("Language: ", lang);
+               elm_language_set(lang);
+               i18n_ulocale_layout_type_e layout = I18N_ULOCALE_LAYOUT_UNKNOWN;
+               if (i18n_ulocale_get_character_orientation(lang, &layout) == I18N_ERROR_NONE) {
+                       if (layout == I18N_ULOCALE_LAYOUT_LTR) {
+                               elm_config_mirrored_set(false);
+                       } else if (layout == I18N_ULOCALE_LAYOUT_RTL) {
+                               elm_config_mirrored_set(true);
+                       } else {
+                               LOG_ERROR("Unsupported character orientation type: ", layout);
+                       }
+               }
+               free(lang);
+       }
+}
+
 bool App::onCreate()
 {
        TRACE;
@@ -99,6 +122,7 @@ bool App::onCreate()
        elm_app_base_scale_set(1.3);
        elm_config_accel_preference_set("3d");
        ecore_animator_frametime_set(1 / maxFps);
+       updateCharacterOrientation();
 
        m_pWindow = new Window;
        m_pWindow->show();
@@ -145,6 +169,7 @@ void App::onControl(app_control_h app_control)
 void App::onLanguageChanged(app_event_info_h appEvent)
 {
        TRACE;
+       updateCharacterOrientation();
 }
 
 void App::onLowBattery(app_event_info_h appEvent)