From: Denis Dolzhenko Date: Wed, 18 Oct 2017 12:08:02 +0000 (+0300) Subject: TizenRefApp-8613 [RTL] Wrong scroll direction in Task Manager X-Git-Tag: submit/tizen_4.0/20171108.092711^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F79%2F156479%2F3;p=profile%2Fwearable%2Fapps%2Fnative%2Ftaskmanager.git TizenRefApp-8613 [RTL] Wrong scroll direction in Task Manager Change-Id: I654d08f805d73c5b24758c2c615486502bf235e7 Signed-off-by: Denis Dolzhenko --- diff --git a/src/App/inc/App.h b/src/App/inc/App.h index 20a312e..072f547 100644 --- a/src/App/inc/App.h +++ b/src/App/inc/App.h @@ -44,6 +44,8 @@ namespace TaskMngr { App(App &) = delete; App &operator=(App &) = delete; + void updateCharacterOrientation(); + // App cbs: bool onCreate(); void onTerminate(); diff --git a/src/App/src/App.cpp b/src/App/src/App.cpp index 265e0c6..a6a327f 100644 --- a/src/App/src/App.cpp +++ b/src/App/src/App.cpp @@ -22,6 +22,8 @@ #include "MainController.h" #include +#include +#include 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)