Resolve N_SE-35977 issue. 2.1_release accepted/tizen_2.1/20130425.023448 submit/tizen_2.1/20130424.224005
authorSungWan Kim <sw0726.kim@samsung.com>
Tue, 23 Apr 2013 11:36:56 +0000 (20:36 +0900)
committerSungWan Kim <sw0726.kim@samsung.com>
Tue, 23 Apr 2013 11:36:56 +0000 (20:36 +0900)
Change-Id: I720e4b8fec53cc6b012a9b85e65d5186698e617a
Signed-off-by: SungWan Kim <sw0726.kim@samsung.com>
inc/ClResourceManager.h
src/ClDayPanel.cpp
src/ClResourceManager.cpp

index 12ec199..87e62bf 100644 (file)
@@ -33,6 +33,7 @@ public:
        static Tizen::Locales::DateTimeFormatter* CreateDateFormatterN(Tizen::Locales::DateTimeStyle dateStyle);
        static Tizen::Locales::DateTimeFormatter* CreateDateTimeFormatterN(Tizen::Locales::DateTimeStyle dateStyle);
        static Tizen::Locales::DateTimeFormatter* CreateTimeFormatterN(void);
+       static Tizen::Base::String GetAmPmString(bool am);
        static Tizen::Graphics::Bitmap* GetBitmapN(const Tizen::Base::String& bitmapPath, bool isAbsolute = false);
        static Tizen::Graphics::Bitmap* GetBlankBitmap(void);
        static Tizen::Base::String GetString(const Tizen::Base::String& stringId);
@@ -57,6 +58,7 @@ private:
 private:
        Tizen::App::AppResource* __pAppResource;
        Tizen::Graphics::Bitmap* __pBlankBitmap;
+       Tizen::Locales::DateTimeFormatter* __pAmPmFormatter;
        Tizen::Locales::DateTimeFormatter* __pMonthFormatter;
        Tizen::Locales::DateTimeFormatter* __pWeekFormatter;
        Tizen::Locales::DateTimeFormatter* __pWeekShortFormatter;
index 0b5538e..557b6e2 100644 (file)
@@ -972,14 +972,16 @@ DayEventPanel::InitializeTimeLine(void)
        }
 
        __pLabelAm = new (std::nothrow) Label();
-       __pLabelAm->Construct(Rectangle(X_TIME_LINE_AMPM, 0, W_TIME_LINE_AMPM, H_TIME_LINE_AMPM), L"AM");
+       __pLabelAm->Construct(Rectangle(X_TIME_LINE_AMPM, 0, W_TIME_LINE_AMPM, H_TIME_LINE_AMPM),
+                                               ResourceManager::GetAmPmString(true));
        __pLabelAm->SetTextConfig(FONT_SIZE_TIME_LINE_AMPM, LABEL_TEXT_STYLE_NORMAL);
        __pLabelAm->SetTextColor(Color(COLOR_TIME_LINE_AMPM));
        __pPanelDayEvents->AddControl(__pLabelAm);
        __pLabelAm->SetShowState(__is24HourEnabled == false);
 
        __pLabelPm = new (std::nothrow) Label();
-       __pLabelPm->Construct(Rectangle(X_TIME_LINE_AMPM, H_EVENT_LIST_ITEM * AMPM_TIME_COUNT + H_TIME_LINE_NUMBER / 2, W_TIME_LINE_AMPM, H_TIME_LINE_AMPM), L"PM");
+       __pLabelPm->Construct(Rectangle(X_TIME_LINE_AMPM, H_EVENT_LIST_ITEM * AMPM_TIME_COUNT + H_TIME_LINE_NUMBER / 2, W_TIME_LINE_AMPM, H_TIME_LINE_AMPM),
+                                               ResourceManager::GetAmPmString(false));
        __pLabelPm->SetTextConfig(FONT_SIZE_TIME_LINE_AMPM, LABEL_TEXT_STYLE_NORMAL);
        __pLabelPm->SetTextColor(Color(COLOR_TIME_LINE_AMPM));
        __pPanelDayEvents->AddControl(__pLabelPm);
index bd44c8b..7151670 100644 (file)
@@ -105,16 +105,20 @@ ResourceManager* ResourceManager::__pInstance = null;
 ResourceManager::ResourceManager(void)
        : __pAppResource(null)
        , __pBlankBitmap(null)
+       , __pAmPmFormatter(null)
        , __pMonthFormatter(null)
        , __pWeekFormatter(null)
+       , __pWeekShortFormatter(null)
 {
 }
 
 ResourceManager::~ResourceManager(void)
 {
        delete __pBlankBitmap;
+       delete __pAmPmFormatter;
        delete __pMonthFormatter;
        delete __pWeekFormatter;
+       delete __pWeekShortFormatter;
 }
 
 DateTimeFormatter*
@@ -228,6 +232,27 @@ ResourceManager::CreateTimeFormatterN(void)
        return pTimeFormatter;
 }
 
+String
+ResourceManager::GetAmPmString(bool am)
+{
+       TryReturn(GetInstance() != null, String(), "[E_FAILURE] Unable to get resource instance.");
+
+       String str;
+       if (am == true)
+       {
+               DateTime date;
+               date.SetValue(1900, 1, 1, 1);
+               GetInstance()->__pAmPmFormatter->Format(date, str);
+       }
+       else
+       {
+               DateTime date;
+               date.SetValue(1900, 1, 1, 13);
+               GetInstance()->__pAmPmFormatter->Format(date, str);
+       }
+       return str;
+}
+
 Bitmap*
 ResourceManager::GetBitmapN(const String& bitmapPath, bool isAbsolute)
 {
@@ -374,6 +399,8 @@ ResourceManager::Construct(void)
        __pAppResource = UiApp::GetInstance()->GetAppResource();
        TryReturn(__pAppResource != null, E_FAILURE, "[E_FAILURE] Unable to get app resource.");
 
+       __pAmPmFormatter = DateTimeFormatter::CreateTimeFormatterN(DATE_TIME_STYLE_NONE);
+       __pAmPmFormatter->ApplyPattern(L"a");
        __pMonthFormatter = DateTimeFormatter::CreateDateFormatterN(DATE_TIME_STYLE_NONE);
        __pMonthFormatter->ApplyPattern(L"MMMM");
        __pWeekFormatter = DateTimeFormatter::CreateDateFormatterN(DATE_TIME_STYLE_NONE);