static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Value;
static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value;
static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
+static const unsigned int COLOR_GALLERY_BG = Color32<31,31,31>::Value;
static const Rectangle RECT_DETAILS_CONTORL_LABEL (20, 0, 200, 48);
ImageViewerForm::ImageViewerForm(void)
: __initializeDisplayModeCurrent(APPCONTROL_MODE_NORMAL)
-, __pHeader(null)
+, __pLabel(null)
, __pFooter(null)
, __pScrollPanel(null)
, __pDetail_Label(null)
ImageViewerForm::Initialize()
{
AppLogDebug("ENTER");
+
+
+ result r = Form::Construct(IDL_FORM_IMAGE_VIEWER);
+
__pPresentationModel = ImageViewerPresentationModel::GetInstance();
if (__pPresentationModel->GetFileCount() > 0)
__initializeDisplayModeCurrent = APPCONTROL_MODE_NORMAL;
}
- result r = Form::Construct(IDL_FORM_IMAGE_VIEWER);
-
if (filePath == EMPTY_SPACE)
{
MessageBox messageBox;
ImageViewerForm::OnInitializing(void)
{
AppLogDebug("ENTER");
+ result r = E_SUCCESS;
SetFormBackEventListener(this);
__pPresentationModel->AddListener(this);
+ __pLabel = dynamic_cast<Label*>(GetControl(L"IDC_LABEL_INFO"));
+
+ if(__pLabel == null)
+ {
+ return E_FAILURE;
+ }
+ __pLabel->SetBackgroundColor(COLOR_HEADER_CONTORL_PANEL);
+ SetControlAlwaysOnTop(*__pLabel,true);
+
+ int allCount = __pPresentationModel->GetFileCount();
+ int index = 1 ;
+ String displayText;
+ displayText.Append(index);
+ displayText.Append("/");
+ displayText.Append(allCount);
+
+ __pLabel->SetText(displayText);
+
CreateGallery();
InitializeDisplay(__initializeDisplayModeCurrent);
InitializePanelDetail();
__pTimer->Construct(*this);
__pTimer->Start(1);
}
- result r = SetActionBarsTranslucent(FORM_ACTION_BAR_INDICATOR, true);
+
AddOrientationEventListener(*this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
Rectangle clientRect = GetClientAreaBounds();
Rectangle rect = GetBounds();
- __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
+ __pGallery->SetBounds(Rectangle(0, clientRect.y, rect.width, rect.height));
__pPlayButton->SetBounds(Rectangle(clientRect.width / 2 - W_PLAY_BUTTON / 2,
clientRect.height / 2 - W_PLAY_BUTTON / 2, W_PLAY_BUTTON, H_PLAY_BUTTON));
ImageViewerForm::InitializeDisplay(AppControlMode status)
{
AppLogDebug("ENTER");
- String strItemText;
- String strItemIdxText;
- __pHeader = GetHeader();
- __pHeader->AddActionEventListener(*this);
+ String strItemIdxText;
__pFooter = GetFooter();
__pFooter->AddActionEventListener(*this);
__pFooter->RemoveAllItems();
- GetHeaderString(0, strItemText, strItemIdxText);
+ GetLabelText(0, strItemIdxText);
Rectangle rect = GetClientAreaBounds();
- __pHeader->SetTitleText(strItemText);
- __pHeader->SetDescriptionText(strItemIdxText);
+
if (status == APPCONTROL_MODE_NORMAL)
{
}
void
-ImageViewerForm::GetHeaderString(int index, String &fileName, String &page)
+ImageViewerForm::GetLabelText(int index, String &page)
{
AppLogDebug("ENTER");
int allCount = __pPresentationModel->GetFileCount();
String pStr = __pPresentationModel->GetFilePathAt(index);
- fileName = __pPresentationModel->GetFileName(pStr);
page.Format(FORMAT_BUFFER_SIZE, L"%d/%d", index + 1, allCount);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
filePath = __pPresentationModel->GetFilePathAt(currentIndex);
__pPresentationModel->RequestImage(filePath);
- GetHeaderString(__pGallery->GetCurrentItemIndex(), strItemText, strItemIdxText);
- __pHeader->SetTitleText(strItemText);
- __pHeader->SetDescriptionText(strItemIdxText);
+ GetLabelText(__pGallery->GetCurrentItemIndex(), strItemIdxText);
if (__visible == true)
{
Rectangle rect = GetBounds();
__pGallery = new (std::nothrow) Gallery();
- __pGallery->Construct(Rectangle(0, -clientRect.y, rect.width, rect.height));
+ __pGallery->Construct(Rectangle(0, clientRect.y, rect.width, rect.height));
__pGallery->SetName(L"GalleryControl");
__pGallery->SetItemProvider(*this);
__pGallery->AddGalleryEventListener(*this);
+ __pGallery->SetBackgroundColor(COLOR_GALLERY_BG);
AddControl(*__pGallery);
__pGallery->SetTextOfEmptyGallery(ResourceManager::GetString(L"IDS_COM_BODY_LOADING"));
}
Rectangle clientRect = GetClientAreaBounds();
- result r = __pScrollPanel->Construct(Rectangle(0, 0, clientRect.width, clientRect.height));
+ result r = __pScrollPanel->Construct(Rectangle(0, 0, clientRect.width, clientRect.height - __pLabel->GetHeight()));
if (r != E_SUCCESS)
{
AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
AppLogDebug("ENTER");
Rectangle clientRect = GetClientAreaBounds();
- __pScrollPanel->SetBounds(0, 0, clientRect.width, clientRect.height);
+ __pScrollPanel->SetBounds(0,__pLabel->GetHeight(), clientRect.width, clientRect.height - __pLabel->GetHeight());
int currentIndex = __pGallery->GetCurrentItemIndex();
String strFilePath = __pPresentationModel->GetFilePathAt(currentIndex);
AppLogDebug("ENTER index(%d) filePath(%ls)", index, filePath.GetPointer());
__pPresentationModel->RequestImage(filePath);
- String strItemText;
String strItemIdxText;
- GetHeaderString(__pGallery->GetCurrentItemIndex(), strItemText, strItemIdxText);
- __pHeader->SetTitleText(strItemText);
- __pHeader->SetDescriptionText(strItemIdxText);
+ GetLabelText(__pGallery->GetCurrentItemIndex(), strItemIdxText);
+ __pLabel->SetText(strItemIdxText);
if (__visible == true)
{
__pPlayButton->SetShowState(false);
}
- SetActionBarsVisible(FORM_ACTION_BAR_INDICATOR | FORM_ACTION_BAR_HEADER | FORM_ACTION_BAR_FOOTER, false);
+ SetActionBarsVisible( FORM_ACTION_BAR_FOOTER, false);
+ __pLabel->SetShowState(false);
__visible = false;
}
else
__pPlayButton->SetShowState(true);
}
- SetActionBarsVisible(FORM_ACTION_BAR_INDICATOR | FORM_ACTION_BAR_HEADER | FORM_ACTION_BAR_FOOTER, true);
+ SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
+ __pLabel->SetShowState(true);
__visible = true;
__pPlayButton->SetPosition(__pPlayButton->GetPosition().x, __pPlayButton->GetPosition().y - 1);
Rectangle clientRect = GetClientAreaBounds();
Rectangle rect = GetBounds();
- __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
+ __pGallery->SetBounds(Rectangle(0, clientRect.y, rect.width, rect.height));
Invalidate(true);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
PowerManager::KeepScreenOnState(true, false);
if (__visible == true)
{
- SetActionBarsVisible(FORM_ACTION_BAR_INDICATOR | FORM_ACTION_BAR_HEADER | FORM_ACTION_BAR_FOOTER, false);
+ SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, false);
+ __pLabel->SetShowState(false);
int index = __pGallery->GetCurrentItemIndex();
String filePath = __pPresentationModel->GetFilePathAt(index);
if (__visible == false)
{
- SetActionBarsVisible(FORM_ACTION_BAR_INDICATOR | FORM_ACTION_BAR_HEADER | FORM_ACTION_BAR_FOOTER, true);
-
+ SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
+ __pLabel->SetShowState(true);
String filePath = __pPresentationModel->GetFilePathAt(index);
ContentType contentType = ContentManagerUtil::CheckContentType(filePath);
if (contentType == CONTENT_TYPE_VIDEO)
__visible = true;
}
- String strItemText;
String strItemIdxText;
- GetHeaderString(index, strItemText, strItemIdxText);
- __pHeader->SetTitleText(strItemText);
- __pHeader->SetDescriptionText(strItemIdxText);
+ GetLabelText(index, strItemIdxText);
+ __pLabel->SetText(strItemIdxText);
+
Rectangle clientRect = GetClientAreaBounds();
Rectangle rect = GetBounds();
Rectangle clientRect = GetClientAreaBounds();
Rectangle rect = GetBounds();
- __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
- __pScrollPanel->SetBounds(Rectangle(0, 0, clientRect.width, clientRect.height));
+ __pGallery->SetBounds(Rectangle(0, clientRect.y, rect.width, rect.height));
+ __pScrollPanel->SetBounds(Rectangle(0, __pLabel->GetHeight(), clientRect.width, clientRect.height - __pLabel->GetHeight()));
__pPlayButton->SetBounds(Rectangle(clientRect.width / 2 - 80, clientRect.height / 2 - 80, 160, 160));
if (previousSceneId == IDSCN_IMAGE_NAME_EDITOR && currentSceneId == IDSCN_IMAGE_VIEWER)
{
SetDetailInfo();
- String strItemText(EMPTY_SPACE);
String strItemIdxText(EMPTY_SPACE);
- GetHeaderString(__pGallery->GetCurrentItemIndex(), strItemText, strItemIdxText);
- __pHeader->SetTitleText(strItemText);
- __pHeader->SetDescriptionText(strItemIdxText);
+ GetLabelText(__pGallery->GetCurrentItemIndex(), strItemIdxText);
+ __pLabel->SetText(strItemIdxText);
Invalidate(true);
}
__pGallery->SetCurrentItemIndex(currentIndex);
}
- String strItemText(EMPTY_SPACE);
String strItemIdxText(EMPTY_SPACE);
__pGallery->UpdateGallery();
String filePath = __pPresentationModel->GetFilePathAt(currentIndex);
__pPresentationModel->RequestImage(filePath);
- GetHeaderString(currentIndex, strItemText, strItemIdxText);
- __pHeader->SetTitleText(strItemText);
- __pHeader->SetDescriptionText(strItemIdxText);
+ GetLabelText(currentIndex,strItemIdxText);
+ __pLabel->SetText(strItemIdxText);
if (__visible == true)
{