TizenRefApp-9215 [Call UI] Implement RTL mode support 72/146772/1
authorIgor Olshevskyi <i.olshevskyi@samsung.com>
Tue, 29 Aug 2017 12:07:58 +0000 (15:07 +0300)
committerIgor Olshevskyi <i.olshevskyi@samsung.com>
Wed, 30 Aug 2017 09:56:53 +0000 (12:56 +0300)
Change-Id: I0a5ad0216f7c370732413beb5a437f286d5fcfa9

18 files changed:
call-ui/common.h
call-ui/presenters/Instance.cpp
call-ui/presenters/Instance.h
call-ui/presenters/dialogs/AcceptDialog.cpp
call-ui/presenters/dialogs/AcceptDialog.h
call-ui/presenters/misc/CallInfoPresenter.cpp
call-ui/presenters/misc/CallInfoPresenter.h
call-ui/presenters/misc/CallStatusPresenter.cpp
call-ui/presenters/misc/CallStatusPresenter.h
call-ui/presenters/misc/RejectMsgPresenter.cpp
call-ui/presenters/misc/RejectMsgPresenter.h
call-ui/presenters/misc/helpers.cpp
call-ui/presenters/misc/helpers.h
call-ui/presenters/pages/KeypadPage.cpp
call-ui/view/AcceptRejectWidget.cpp
call-ui/view/helpers.cpp
call-ui/view/helpers.h
edc/call_info.edc

index c5fcfd13f77c0130cab2736e8a29f69afb3e11a6..f3bf02adc2a21e502fbe68459dee33e61fc351ad 100644 (file)
@@ -38,6 +38,7 @@ namespace callui {
        using namespace ucl;
 
        constexpr SmartEvent WIN_POWER_KEY_UP_EVENT {"callui,powerkey,up"};
+       constexpr SmartEvent WIN_LANGUAGE_CHANGED {"callui,language,changed"};
 
        namespace util {
 
index 2a5b842d36c224d8f520a4be0a7893575e33f372..6ab95b66ba7417d55c2dc74ef493ab2511c7cfdb 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "call-ui/resources.h"
 #include "call-ui/presenters/types.h"
+#include "call-ui/view/helpers.h"
 #include "common.h"
 
 namespace callui { namespace { namespace impl {
@@ -152,6 +153,8 @@ namespace callui {
                                m_context->exitApp();
                        }
                }
+
+               updateAppLanguage(false);
        }
 
        Result Instance::setupTheme()
@@ -236,23 +239,44 @@ namespace callui {
                m_context->exitApp();
        }
 
+
        void Instance::onSysEvent(const SysEvent sysEvent)
        {
                switch(sysEvent) {
                case SysEvent::LANGUAGE_CHANGED:
+               {
                        ILOG("SysEvent::LANGUAGE_CHANGED");
-                       {
-                               char *locale = NULL;
-                               system_settings_get_value_string(
-                                               SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
-                               elm_language_set(locale);
-                               free(locale);
-                       }
+                       FAIL_RETURN_VOID(updateAppLanguage(),
+                                       "updateAppLanguage() failed!");
                        break;
+               }
                default:
                        ILOG("sysEvent: %d", sysEvent);
                        break;
                }
        }
 
+       Result Instance::updateAppLanguage(bool needNotify)
+       {
+               char *locale = NULL;
+               system_settings_get_value_string(
+                               SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE,
+                               &locale);
+               elm_language_set(locale);
+
+               Result res = isLTRCharacterOrientation(locale);
+               if (res == RES_FAIL) {
+                       ELOG("isLTRCharacterOrientation() failed!");
+               } else {
+                       utils::setMirroredMode(res == RES_OK ? false : true);
+               }
+               free(locale);
+
+               if (needNotify) {
+                       m_win->callEvent(WIN_LANGUAGE_CHANGED, nullptr);
+               }
+
+               return res;
+       }
+
 }
index ca3f4a2920873b4c4bbc624f43e89c89045cd185..ac094e1b88c83560a3768635b9ebb7ff78682df7 100644 (file)
@@ -61,6 +61,8 @@ namespace callui {
                Eina_Bool processPowerKeyUpEvent();
                void onPowerKeyHoldTimeout(ucl::Timeout *sender);
 
+               ucl::Result updateAppLanguage(bool needNotify = true);
+
        private:
                ucl::SysEventProvider &m_sysEventProvider;
                ucl::IInstanceContext *m_context;
index 2bbffa9bebd8bd4bb639117359dfe269640092ad..af607e20cb446d4d775ff0e05099bc7663f2c086 100644 (file)
@@ -85,6 +85,7 @@ namespace callui {
 
        AcceptDialog::~AcceptDialog()
        {
+               unsetLanguageChangeCallback();
        }
 
        Result AcceptDialog::prepare(ElmWidget &parent)
@@ -100,6 +101,8 @@ namespace callui {
 
                m_selfRef = asShared(*this);
 
+               setLanguageChangeCallback();
+
                addDeactivatorException(this);
                broadcastDeactivate();
 
@@ -240,6 +243,25 @@ namespace callui {
                return RES_OK;
        }
 
+       void AcceptDialog::setLanguageChangeCallback()
+       {
+               getWindow().addEventHandler(WIN_LANGUAGE_CHANGED, WEAK_DELEGATE(
+                               AcceptDialog::onLanguageChanged, asWeak(*this)));
+       }
+
+       void AcceptDialog::unsetLanguageChangeCallback()
+       {
+               getWindow().delEventHandler(WIN_LANGUAGE_CHANGED, WEAK_DELEGATE(
+                               AcceptDialog::onLanguageChanged, asWeak(*this)));
+       }
+
+       void AcceptDialog::onLanguageChanged(Widget &widget, void *eventInfo)
+       {
+               if (m_genlist) {
+                       elm_genlist_realized_items_update(*m_genlist);
+               }
+       }
+
        void AcceptDialog::handleEvent(Event event)
        {
                const auto keepAliver = asShared(*this);
index c89c3ed3aa5e11b973cb3dbd727a75e7d0e94f0a..c1627d3cc4e89abe050d6c3e8f06fde09c661ba6 100644 (file)
@@ -73,6 +73,10 @@ namespace callui {
                ucl::Result addGenlistTextItem(Event event);
                ucl::Result addGenlistBottomItem();
 
+               void setLanguageChangeCallback();
+               void unsetLanguageChangeCallback();
+               void onLanguageChanged(ucl::Widget &widget, void *eventInfo);
+
                void handleEvent(Event event);
                bool dispatchEvent(Event event);
 
index 1dba75fd88679f0fef6d613ce0184069c77a9f22..b8176e8cdf56fb694761134c1549774e89868f8c 100644 (file)
@@ -149,6 +149,7 @@ namespace callui {
 
        CallInfoPresenter::~CallInfoPresenter()
        {
+               unsetLanguageChangeCallback();
        }
 
        Result CallInfoPresenter::prepare(GuiPresenter &parent,
@@ -167,9 +168,28 @@ namespace callui {
 
                FAIL_RETURN(update(), "update() failed!");
 
+               setLanguageChangeCallback();
+
                return RES_OK;
        }
 
+       void CallInfoPresenter::setLanguageChangeCallback()
+       {
+               getWindow().addEventHandler(WIN_LANGUAGE_CHANGED, WEAK_DELEGATE(
+                               CallInfoPresenter::onLanguageChanged, asWeak(*this)));
+       }
+
+       void CallInfoPresenter::unsetLanguageChangeCallback()
+       {
+               getWindow().delEventHandler(WIN_LANGUAGE_CHANGED, WEAK_DELEGATE(
+                               CallInfoPresenter::onLanguageChanged, asWeak(*this)));
+       }
+
+       void CallInfoPresenter::onLanguageChanged(Widget &widget, void *eventInfo)
+       {
+               update();
+       }
+
        Result CallInfoPresenter::createWidget(ElmWidget &parent)
        {
                m_widget = Layout::Builder().
@@ -245,7 +265,9 @@ namespace callui {
 
                IContactInfoSCRef contactInfo = callInfo->getContactInfo();
                if (contactInfo) {
-                       return callInfo->getPhoneNumber();
+                       return encloseBidirectionalText(std::move(
+                                       callInfo->getPhoneNumber()),
+                                       BidiTextEncoseType::LRM);
                }
                return "";
        }
@@ -258,11 +280,20 @@ namespace callui {
                }
                if (m_activeCallInfo && m_heldCallInfo) {
                        auto displStr = m_activeCallInfo->getPhoneNumber();
+                       if (displStr.empty()) {
+                               displStr = encloseBidirectionalText(std::move(displStr),
+                                               BidiTextEncoseType::LRM);
+                       }
                        auto contactInfo = m_activeCallInfo->getContactInfo();
                        if (contactInfo) {
                                const auto contName = contactInfo->getName();
                                if (!contName.empty()) {
                                        displStr = contName;
+                                       if (contactInfo->getNameSourceType() ==
+                                                       ContactNameSourceType::NUMBER) {
+                                               displStr = encloseBidirectionalText(std::move(displStr),
+                                                               BidiTextEncoseType::LRM);
+                                       }
                                }
                        }
                        if (displStr.empty()) {
@@ -476,6 +507,11 @@ namespace callui {
                auto contactInfo = callInfo->getContactInfo();
                if (contactInfo) {
                        mainTxt = contactInfo->getName();
+                       if (contactInfo->getNameSourceType() ==
+                                       ContactNameSourceType::NUMBER) {
+                               mainTxt = encloseBidirectionalText(std::move(mainTxt),
+                                               BidiTextEncoseType::LRM);
+                       }
                }
 
                if (mainTxt.empty()) {
@@ -640,8 +676,10 @@ namespace callui {
                FAIL_RETURN(updateMainTxt(), "diplayMainTxt() failed!");
 
                if (m_needModifyCallStatus) {
-                       if (const auto parent = m_parent.lock())
-                       return createCallStatus(*parent);
+                       m_needModifyCallStatus = false;
+                       if (const auto parent = m_parent.lock()) {
+                               return createCallStatus(*parent);
+                       }
                }
 
                return RES_OK;
index da8c5cd2c8f00a90618cd79747dcdb83caf99c9b..bc9a32a4f496c194ead262db2f9fc0f29394f017 100644 (file)
@@ -89,6 +89,10 @@ namespace callui {
 
                void displayMainTxt(const ICallInfoSCRef &info, const std::string &text);
 
+               void setLanguageChangeCallback();
+               void unsetLanguageChangeCallback();
+               void onLanguageChanged(ucl::Widget &widget, void *eventInfo);
+
                // Screen Reader
                ucl::Result setMainTxtAccessObject(const std::string &text);
                ucl::Result setSubTxtAccessObject(const std::string &text);
index eb4eb9d8fc3a4db4e94c914f086ec47900e3db33..8b80a6b51ee9d5d06325fa236505f582160d0e3f 100644 (file)
@@ -29,8 +29,7 @@ namespace callui { namespace { namespace impl {
 
        constexpr EdjePart PART_TXT_TEXT_INFO {"text_info"};
 
-       constexpr EdjeSignal SIGN_DOT_RTL {"default:RTL"};
-       constexpr EdjeSignal SIGN_DOT_LTR {"default:LTR"};
+       constexpr EdjeSignal SIGN_DOT_ANIMATE {"animate"};
        constexpr EdjeSignal SIGN_RESET {"reset"};
 
        constexpr EdjePart PART_AO_STATUS {"ao_text_info"};
@@ -115,6 +114,8 @@ namespace callui {
 
        CallStatusPresenter::~CallStatusPresenter()
        {
+               unsetLanguageChangeCallback();
+
                m_ly.reset();
                if (m_timer) {
                        ecore_timer_del(m_timer);
@@ -127,6 +128,8 @@ namespace callui {
                FAIL_RETURN(GuiPresenter::prepare(parent, PF_PASSIVE),
                                "Presenter::prepare() failed!");
 
+               setLanguageChangeCallback();
+
                m_ly->emit(impl::SIGN_RESET, impl::SIGN_SRC_DOT);
                m_ly->setText("", impl::PART_TXT_TEXT_INFO);
                createStatusTxtAo();
@@ -144,12 +147,46 @@ namespace callui {
                return RES_OK;
        }
 
+       void CallStatusPresenter::setLanguageChangeCallback()
+       {
+               getWindow().addEventHandler(WIN_LANGUAGE_CHANGED, WEAK_DELEGATE(
+                               CallStatusPresenter::onLanguageChanged, asWeak(*this)));
+       }
+
+       void CallStatusPresenter::unsetLanguageChangeCallback()
+       {
+               getWindow().delEventHandler(WIN_LANGUAGE_CHANGED, WEAK_DELEGATE(
+                               CallStatusPresenter::onLanguageChanged, asWeak(*this)));
+       }
+
+       void CallStatusPresenter::onLanguageChanged(Widget &widget, void *eventInfo)
+       {
+               Result res = RES_FAIL;
+               switch (m_mode) {
+               case CallMode::INCOMING:
+                       res = processIncomingMode();
+                       break;
+               case CallMode::OUTGOING:
+                       res = processOutgoingMode();
+                       break;
+               case CallMode::DURING:
+                       res = processDuringMode();
+                       break;
+               case CallMode::END:
+                       res = processEndMode();
+                       break;
+               default:
+                       ELOG("Unknown mode");
+                       break;
+               }
+               LOG_RETURN_VOID(res, "Failed");
+
+       }
+
        Result CallStatusPresenter::processIncomingMode()
        {
                m_ly->setText(STR_INCOMING_CALL, impl::PART_TXT_TEXT_INFO);
-
-               // TODO: need add logic for RTL mode in the future
-               m_ly->emit(impl::SIGN_DOT_LTR, impl::SIGN_SRC_DOT);
+               m_ly->emit(impl::SIGN_DOT_ANIMATE, impl::SIGN_SRC_DOT);
 
                return RES_OK;
        }
@@ -157,9 +194,7 @@ namespace callui {
        Result CallStatusPresenter::processOutgoingMode()
        {
                m_ly->setText(STR_DIALING_CALL, impl::PART_TXT_TEXT_INFO);
-
-               // TODO: need add logic for RTL mode in the future
-               m_ly->emit(impl::SIGN_DOT_LTR, impl::SIGN_SRC_DOT);
+               m_ly->emit(impl::SIGN_DOT_ANIMATE, impl::SIGN_SRC_DOT);
 
                return RES_OK;
        }
index a95b82ed2faf6d636e76ffbe6bb44c01631b264b..c1ea4eba83599381e757125b8bc49ddc25fa9f0a 100644 (file)
@@ -72,6 +72,10 @@ namespace callui {
                Eina_Bool onCallDurationTimerCb();
                Eina_Bool onBlinkingTimerCb();
 
+               void setLanguageChangeCallback();
+               void unsetLanguageChangeCallback();
+               void onLanguageChanged(ucl::Widget &widget, void *eventInfo);
+
                // Screen Reader
                ucl::Result createStatusTxtAo();
 
index c6a14c830d004de83e0f41246eceeb2b6d981f90..64c5b3c315e2a587cbb00367f13cff134dd0f46a 100644 (file)
@@ -148,6 +148,8 @@ namespace callui {
 
        RejectMsgPresenter::~RejectMsgPresenter()
        {
+               unsetLanguageChangeCallback();
+
                if (m_widget) {
                        sendActivate(*m_widget);
                }
@@ -174,6 +176,8 @@ namespace callui {
                FAIL_RETURN(createAtspiHighlightHelper(),
                                "createScreenReaderRoute() failed!");
 
+               setLanguageChangeCallback();
+
                deactivateBy(m_widget.get());
 
                parent.addDeactivatorSource(*m_widget);
@@ -299,6 +303,25 @@ namespace callui {
                return RES_OK;
        }
 
+       void RejectMsgPresenter::setLanguageChangeCallback()
+       {
+               getWindow().addEventHandler(WIN_LANGUAGE_CHANGED, WEAK_DELEGATE(
+                               RejectMsgPresenter::onLanguageChanged, asWeak(*this)));
+       }
+
+       void RejectMsgPresenter::unsetLanguageChangeCallback()
+       {
+               getWindow().delEventHandler(WIN_LANGUAGE_CHANGED, WEAK_DELEGATE(
+                               RejectMsgPresenter::onLanguageChanged, asWeak(*this)));
+       }
+
+       void RejectMsgPresenter::onLanguageChanged(Widget &widget, void *eventInfo)
+       {
+               if (m_genlist) {
+                       elm_genlist_realized_items_update(*m_genlist);
+               }
+       }
+
        Result RejectMsgPresenter::createGenlist()
        {
                // Genlist scroller Layout
index bd6b95261da38a16669ca59af7b1b53a6b05e23a..ba754c8213adbd73647b03150b21f3023d6aed85 100644 (file)
@@ -107,6 +107,10 @@ namespace callui {
 
                void onBackKey(Evas_Object *obj, void *eventInfo);
 
+               void setLanguageChangeCallback();
+               void unsetLanguageChangeCallback();
+               void onLanguageChanged(ucl::Widget &widget, void *eventInfo);
+
                // Screen Reader
                ucl::Result createAtspiHighlightHelper();
                void registerGenlistAtspiGestureCallbacks();
index 9867516a4e1b7ab4e72ef1023366055ee51d8730..ccf81f83989da91bd98dc89fd852ce5354c31d27 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include <utils_i18n_ulocale.h>
+
 #include "ucl/gui/Window.h"
 
 #include "common.h"
@@ -25,6 +27,11 @@ namespace callui { namespace { namespace himpl {
        const TString STR_HH_MM_SS_TIME{"%02d:%02d:%02d"};
        const TString STR_MM_SS_TIME{"%02d:%02d"};
 
+       constexpr const char *BIDI_TXT_LRM = "\u200E";
+       constexpr const char *BIDI_TXT_RLM = "\u200F";
+       constexpr const char *BIDI_TXT_LRM_RLM = "\u200E\u200F";
+       constexpr const char *BIDI_TXT_RLM_LRM = "\u200F\u200E";
+
 }}}
 
 namespace callui {
@@ -81,4 +88,75 @@ namespace callui {
                }
        }
 
+       std::string encloseBidirectionalText(const std::string &txt, BidiTextEncoseType type)
+       {
+               switch (type) {
+               case BidiTextEncoseType::LRM:
+                       return himpl::BIDI_TXT_LRM + txt + himpl::BIDI_TXT_LRM;
+               case BidiTextEncoseType::RLM:
+                       return himpl::BIDI_TXT_RLM + txt + himpl::BIDI_TXT_RLM;
+               case BidiTextEncoseType::LRM_RLM:
+                       return himpl::BIDI_TXT_LRM_RLM + txt + himpl::BIDI_TXT_RLM_LRM;
+               case BidiTextEncoseType::RLM_LRM:
+                       return himpl::BIDI_TXT_RLM_LRM + txt + himpl::BIDI_TXT_LRM_RLM;
+               default:
+                       ELOG("Invalid type");
+                       return txt;
+               }
+               return txt;
+       }
+
+       std::string encloseBidirectionalText(std::string &&txt, BidiTextEncoseType type)
+       {
+               switch (type) {
+               case BidiTextEncoseType::LRM:
+                       txt.insert(0, himpl::BIDI_TXT_LRM);
+                       txt.append(himpl::BIDI_TXT_LRM);
+                       break;
+               case BidiTextEncoseType::RLM:
+                       txt.insert(0, himpl::BIDI_TXT_RLM);
+                       txt.append(himpl::BIDI_TXT_RLM);
+                       break;
+               case BidiTextEncoseType::LRM_RLM:
+                       txt.insert(0, himpl::BIDI_TXT_LRM_RLM);
+                       txt.append(himpl::BIDI_TXT_RLM_LRM);
+                       break;
+               case BidiTextEncoseType::RLM_LRM:
+                       txt.insert(0, himpl::BIDI_TXT_RLM_LRM);
+                       txt.append(himpl::BIDI_TXT_LRM_RLM);
+                       break;
+               default:
+                       ELOG("Invalid type");
+                       break;
+               }
+               return std::move(txt);
+       }
+
+       Result isLTRCharacterOrientation(const std::string &lang)
+       {
+               if (lang.empty()) {
+                       LOG_RETURN(RES_INVALID_ARGUMENTS, "lang is empty");
+               }
+
+               i18n_ulocale_layout_type_e layout = I18N_ULOCALE_LAYOUT_UNKNOWN;
+               int ret = i18n_ulocale_get_character_orientation(lang.c_str(),
+                               &layout);
+               if (ret != I18N_ERROR_NONE) {
+                       LOG_RETURN(RES_FAIL,
+                                       "i18n_ulocale_get_character_orientation() failed!");
+               }
+
+               switch (layout) {
+               case I18N_ULOCALE_LAYOUT_LTR:
+                       return RES_OK;
+               case I18N_ULOCALE_LAYOUT_RTL:
+                       return RES_FALSE;
+               default:
+                       LOG_RETURN(RES_FAIL,
+                                       "Unsupported character orientation type [%d]",
+                                       layout);
+               }
+               return RES_OK;
+       }
 }
+
index 7686b278e34041515d10e1c48a8339fdf3361d28..6ff05bfbf9f744fc29dd280cda6d9c798888913f 100644 (file)
 
 namespace callui {
 
+       enum class BidiTextEncoseType {
+               LRM,
+               RLM,
+               LRM_RLM,
+               RLM_LRM
+       };
+
        constexpr ucl::SmartEvent INSTANCE_PAUSED {"callui,instance,paused"};
        constexpr ucl::SmartEvent INSTANCE_RESUMED {"callui,instance,resumed"};
 
        void setInstancePaused(ucl::Window &win, bool value);
        bool isInstancePaused(const ucl::Window &win);
 
-       void replaceSubstringInString(std::string &str,
-                       const std::string &from, const std::string &to);
-
        ucl::TString getCallDuration(const struct tm &time);
 
        void tryUpdateCallDurationTime(
                        struct tm &curTime, struct tm &compTime,
                        ucl::EdjeWidget &widget, const ucl::EdjePart &part);
 
+       void replaceSubstringInString(std::string &str,
+                       const std::string &from, const std::string &to);
+
+       ucl::Result isLTRCharacterOrientation(const std::string &lang);
+
+       std::string encloseBidirectionalText(const std::string &txt, BidiTextEncoseType type);
+
+       std::string encloseBidirectionalText(std::string &&txt, BidiTextEncoseType type);
 }
 
 #endif // __CALL_UI_PRESENTERS_MISC_HELPERS_H__
index f397dbed5c06bb7bfc6798c156d6930becf5d428..a967e861abfd047739d6b0b6c67ffa00c8bfd704 100644 (file)
@@ -273,6 +273,10 @@ namespace callui {
                        LOG_RETURN(RES_FAIL, "Layout::build() failed!");
                }
 
+               // RTL support
+               elm_object_mirrored_automatic_set(*m_widget, EINA_FALSE);
+               elm_object_mirrored_set(*m_widget, false);
+
                setDeactivatorSink(m_widget);
 
                return RES_OK;
@@ -332,6 +336,10 @@ namespace callui {
                                buttonSRef->addEventHandler(BTN_CLICKED,
                                                WEAK_DELEGATE(KeypadPage::onBtnClicked,
                                                                asWeak(*this)));
+
+                               // RTL support
+                               elm_object_mirrored_automatic_set(*buttonSRef, EINA_FALSE);
+                               elm_object_mirrored_set(*buttonSRef, false);
                        }
 
                        // Screen Reader
index ab059f4ea6f21934730a681dec1f6d09e9a3b435..5e94849e251acbd1020a34dd15b674254c7c4894 100644 (file)
@@ -16,8 +16,9 @@
 
 #include "call-ui/view/AcceptRejectWidget.h"
 
-#include "common.h"
 #include "call-ui/resources.h"
+#include "helpers.h"
+#include "common.h"
 
 #define CU_COL_TRANSPARENT  0, 0, 0, 0
 #define CU_COL_WHITE        255, 255, 255, 255
@@ -659,12 +660,24 @@ namespace callui {
 
                Evas_Coord x;
                m_rejIcon->getGeometry(&x, nullptr, nullptr, nullptr);
-               int dx = x - impl::REJ_ICON_RIGHT_PAD_X;
 
-               int animTrace = impl::ACC_REJ_ICON_HIDE_THRESHOLD_W - dx;
-               if (animTrace <= 0) {
-                       DLOG("No need to add transition");
-                       return;
+               // RTL support
+               int dx = 0;
+               int animTrace = 0;
+               if (utils::getMirroredMode()) {
+                       dx = impl::ACC_ICON_RIGHT_PAD_X - x;
+                       animTrace = dx - impl::ACC_REJ_ICON_HIDE_THRESHOLD_W;
+                       if (animTrace >= 0) {
+                               DLOG("No need to add transition");
+                               return;
+                       }
+               } else {
+                       dx = x - impl::REJ_ICON_RIGHT_PAD_X;
+                       animTrace = impl::ACC_REJ_ICON_HIDE_THRESHOLD_W - dx;
+                       if (animTrace <= 0) {
+                               DLOG("No need to add transition");
+                               return;
+                       }
                }
 
                m_rejIconTr = elm_transit_add();
@@ -716,11 +729,22 @@ namespace callui {
 
                Evas_Coord x;
                m_rejIcon->getGeometry(&x, nullptr, nullptr, nullptr);
-               int dx = impl::REJ_ICON_RIGHT_PAD_X - x;
 
-               if (dx >= 0) {
-                       DLOG("No need to add transition");
-                       return;
+
+               // RTL support
+               int dx = 0;
+               if (utils::getMirroredMode()) {
+                       dx = impl::ACC_ICON_RIGHT_PAD_X - x;
+                       if (dx <= 0) {
+                               DLOG("No need to add transition");
+                               return;
+                       }
+               } else {
+                       dx = impl::REJ_ICON_RIGHT_PAD_X - x;
+                       if (dx >= 0) {
+                               DLOG("No need to add transition");
+                               return;
+                       }
                }
 
                m_rejIconTr = elm_transit_add();
@@ -800,13 +824,26 @@ namespace callui {
 
                Evas_Coord x;
                m_accIcon->getGeometry(&x, nullptr, nullptr, nullptr);
-               int dx = impl::ACC_ICON_RIGHT_PAD_X - x;
 
-               int animTrace = dx - impl::ACC_REJ_ICON_HIDE_THRESHOLD_W;
-               if (animTrace >= 0) {
-                       DLOG("No need to add transition");
-                       return;
+               // RTL support
+               int dx = 0;
+               int animTrace = 0;
+               if (utils::getMirroredMode()) {
+                       dx = x - impl::REJ_ICON_RIGHT_PAD_X;
+                       animTrace = impl::ACC_REJ_ICON_HIDE_THRESHOLD_W - dx;
+                       if (animTrace <= 0) {
+                               DLOG("No need to add transition");
+                               return;
+                       }
+               } else {
+                       dx = impl::ACC_ICON_RIGHT_PAD_X - x;
+                       animTrace = dx - impl::ACC_REJ_ICON_HIDE_THRESHOLD_W;
+                       if (animTrace >= 0) {
+                               DLOG("No need to add transition");
+                               return;
+                       }
                }
+
                m_accIconTr = elm_transit_add();
                elm_transit_effect_translation_add(m_accIconTr, 0, 0, animTrace, 0);
                elm_transit_object_add(m_accIconTr, *m_accIcon);
@@ -824,11 +861,21 @@ namespace callui {
 
                Evas_Coord x;
                m_accIcon->getGeometry(&x, nullptr, nullptr, nullptr);
-               int dx = impl::ACC_ICON_RIGHT_PAD_X - x;
 
-               if (dx <= 0) {
-                       DLOG("No need to add transition");
-                       return;
+               // RTL support
+               int dx = 0;
+               if (utils::getMirroredMode()) {
+                       dx = impl::REJ_ICON_RIGHT_PAD_X - x;
+                       if (dx >= 0) {
+                               DLOG("No need to add transition");
+                               return;
+                       }
+               } else {
+                       dx = impl::ACC_ICON_RIGHT_PAD_X - x;
+                       if (dx <= 0) {
+                               DLOG("No need to add transition");
+                               return;
+                       }
                }
 
                m_accIconTr = elm_transit_add();
index e4f931decf09f649f2a8d5ffc58903dfa08018f3..dcc89516ac472af4f2f878fc8fe5995f22b4b2b0 100644 (file)
@@ -154,6 +154,16 @@ namespace callui { namespace utils {
                elm_access_object_unregister(ao);
        }
 
+       void setMirroredMode(bool isMirroredMode)
+       {
+               elm_config_mirrored_set(isMirroredMode);
+       }
+
+       bool getMirroredMode()
+       {
+               return elm_config_mirrored_get();
+       }
+
 }}
 
 namespace callui {
index 8c4fe6e0b20e53d10769bb0af9c22d1a30c2d7b1..30769ab979c55608d9c051e13f6c60dcc14e097f 100644 (file)
@@ -48,6 +48,10 @@ namespace callui { namespace utils {
 
        void destroyAccessObject(ucl::ElmWidget &ao);
 
+       void setMirroredMode(bool isMirroredMode);
+
+       bool getMirroredMode();
+
 }}
 
 namespace callui {
index 86dc549fd43a83b334966732971b03c97e13ad64..f6b7e3900617177cdcbff6e5b56401255d854958 100644 (file)
@@ -46,7 +46,7 @@ styles {
 }
 
 
-#define CU_DOT(_name, _ltr_offset, _rtl_offset) \
+#define CU_DOT(_name, _ltr_offset) \
        image { _name; \
                scale; \
                desc { "default"; \
@@ -79,32 +79,6 @@ styles {
                        color_class: AO0311D; \
                        visible: 1; \
                } \
-               desc { "default_rtl"; \
-                       inherit: "default"; \
-                       align: 1.0 0.5; \
-                       rel1 { relative: 0.0 0.0; offset: _rtl_offset 0; to: "text_info"; } \
-                       rel2 { relative: 0.0 1.0; offset: _rtl_offset 0; to: "text_info"; } \
-               } \
-               desc { "rtl_on"; \
-                       inherit: "default_rtl"; \
-                       color_class: AO031; \
-                       visible: 1; \
-               } \
-               desc { "rtl_off"; \
-                       inherit: "default_rtl"; \
-                       color_class: AO031D; \
-                       visible: 1; \
-               } \
-               desc { "rtl_on_photo"; \
-                       inherit: "default_rtl"; \
-                       color_class: AO0311; \
-                       visible: 1; \
-               } \
-               desc { "rtl_off_photo"; \
-                       inherit: "default_rtl"; \
-                       color_class: AO0311D; \
-                       visible: 1; \
-               } \
        }
 
 group { "elm/layout/callui/call_info";
@@ -188,12 +162,6 @@ group { "elm/layout/callui/call_info";
                                max: 191 32;
                                rel2 { relative: 0.0 1.0; offset: -17 0; to_x: "right.pad"; to_y: "top.pad"; }
                        }
-                       desc { "incom_rtl";
-                               inherit: "default";
-                               min: 191 32;
-                               max: 191 32;
-                               rel1 { relative: 1.0 1.0; offset: 17 0; to_x: "left.pad"; to_y: "top.pad"; }
-                       }
                }
                textblock { "text_info";
                        nomouse;
@@ -215,9 +183,9 @@ group { "elm/layout/callui/call_info";
                                }
                        }
                }
-               CU_DOT("dot.first", 3, -3)
-               CU_DOT("dot.second", 9, -9)
-               CU_DOT("dot.third", 15, -15)
+               CU_DOT("dot.first", 3)
+               CU_DOT("dot.second", 9)
+               CU_DOT("dot.third", 15)
 
                rect { "ao_text_info";
                        mouse;
@@ -446,80 +414,6 @@ group { "elm/layout/callui/call_info";
                                        set_int(blink_dot_timer, timer(0.5, "do_blinking", count+1));
                                }
                        }
-                       public do_blinking_rtl(count, part_state) {
-                               if (count%6 == 0) {
-                                       if (get_int(b_set_photo) == 1) {
-                                               set_state(PART:"dot.first", "rtl_on_photo", 0.0);
-                                               set_state(PART:"dot.second", "rtl_off_photo", 0.0);
-                                               set_state(PART:"dot.third", "rtl_off_photo", 0.0);
-                                       } else {
-                                               set_state(PART:"dot.first", "rtl_on", 0.0);
-                                               set_state(PART:"dot.second", "rtl_off", 0.0);
-                                               set_state(PART:"dot.third", "rtl_off", 0.0);
-                                       }
-                                       set_int(blink_dot_timer, timer(0.5, "do_blinking_rtl", count+1));
-                               }
-                               else if (count%6 == 1) {
-                                       if (get_int(b_set_photo) == 1) {
-                                               set_state(PART:"dot.first", "rtl_on_photo", 0.0);
-                                               set_state(PART:"dot.second", "rtl_on_photo", 0.0);
-                                               set_state(PART:"dot.third", "rtl_off_photo", 0.0);
-                                       } else {
-                                               set_state(PART:"dot.first", "rtl_on", 0.0);
-                                               set_state(PART:"dot.second", "rtl_on", 0.0);
-                                               set_state(PART:"dot.third", "rtl_off", 0.0);
-                                       }
-                                       set_int(blink_dot_timer, timer(0.5, "do_blinking_rtl", count+1));
-                               }
-                               else if (count%6 == 2) {
-                                       if (get_int(b_set_photo) == 1) {
-                                               set_state(PART:"dot.first", "rtl_on_photo", 0.0);
-                                               set_state(PART:"dot.second", "rtl_on_photo", 0.0);
-                                               set_state(PART:"dot.third", "rtl_on_photo", 0.0);
-                                       } else {
-                                               set_state(PART:"dot.first", "rtl_on", 0.0);
-                                               set_state(PART:"dot.second", "rtl_on", 0.0);
-                                               set_state(PART:"dot.third", "rtl_on", 0.0);
-                                       }
-                                       set_int(blink_dot_timer, timer(0.5, "do_blinking_rtl", count+1));
-                               }
-                               else if (count%6 == 3) {
-                                       if (get_int(b_set_photo) == 1) {
-                                               set_state(PART:"dot.first", "rtl_off_photo", 0.0);
-                                               set_state(PART:"dot.second", "rtl_on_photo", 0.0);
-                                               set_state(PART:"dot.third", "rtl_on_photo", 0.0);
-                                       } else {
-                                               set_state(PART:"dot.first", "rtl_off", 0.0);
-                                               set_state(PART:"dot.second", "rtl_on", 0.0);
-                                               set_state(PART:"dot.third", "rtl_on", 0.0);
-                                       }
-                                       set_int(blink_dot_timer, timer(0.5, "do_blinking_rtl", count+1));
-                               }
-                               else if (count%6 == 4) {
-                                       if (get_int(b_set_photo) == 1) {
-                                               set_state(PART:"dot.first", "rtl_off_photo", 0.0);
-                                               set_state(PART:"dot.second", "rtl_off_photo", 0.0);
-                                               set_state(PART:"dot.third", "rtl_on_photo", 0.0);
-                                       } else {
-                                               set_state(PART:"dot.first", "rtl_off", 0.0);
-                                               set_state(PART:"dot.second", "rtl_off", 0.0);
-                                               set_state(PART:"dot.third", "rtl_on", 0.0);
-                                       }
-                                       set_int(blink_dot_timer, timer(0.5, "do_blinking_rtl", count+1));
-                               }
-                               else if (count%6 == 5) {
-                                       if (get_int(b_set_photo) == 1) {
-                                               set_state(PART:"dot.first", "rtl_off_photo", 0.0);
-                                               set_state(PART:"dot.second", "rtl_off_photo", 0.0);
-                                               set_state(PART:"dot.third", "rtl_off_photo", 0.0);
-                                       } else {
-                                               set_state(PART:"dot.first", "rtl_off", 0.0);
-                                               set_state(PART:"dot.second", "rtl_off", 0.0);
-                                               set_state(PART:"dot.third", "rtl_off", 0.0);
-                                       }
-                                       set_int(blink_dot_timer, timer(0.5, "do_blinking_rtl", count+1));
-                               }
-                       }
                }
                program {
                        signal: "reset";
@@ -544,15 +438,7 @@ group { "elm/layout/callui/call_info";
                        }
                }
                program {
-                       signal: "default:RTL";
-                       source: "dot";
-                       script {
-                               set_state(PART:"zone.text_info", "incom_rtl", 0.0);
-                               set_int(blink_dot_timer, timer(0.1, "do_blinking_rtl", 0));
-                       }
-               }
-               program {
-                       signal: "default:LTR";
+                       signal: "animate";
                        source: "dot";
                        script {
                                set_state(PART:"zone.text_info", "incom", 0.0);