class GalleryApp
: public Tizen::App::UiApp
, public Tizen::App::IAppControlProviderEventListener
+ , public Tizen::System::IDeviceEventListener
, public Tizen::System::ISettingEventListener
{
public:
virtual void OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId,
const Tizen::Base::String* pUriScheme, const Tizen::Base::String* pDataType,
const Tizen::Base::Collection::IMap* pArgs);
+
+ virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);
+
virtual void OnSettingChanged(Tizen::Base::String& key);
void SetFrameEnabled(bool enabled);
extern const wchar_t* IDB_LIST_EXPAND_OPENED;
extern const wchar_t* IDB_LIST_EXPAND_OPENED_PRESS;
+extern const wchar_t* DEVICE_STORAGE_CARD_MOUNTED;
+extern const wchar_t* DEVICE_STORAGE_CARD_UNMOUNTED;
+
static const unsigned int CUSTOM_COLOR_GREY = Tizen::Graphics::Color32<124,124,124>::Value;
static const unsigned int CUSTOM_COLOR_TRANSPARENT = Tizen::Graphics::Color32<0,0,0>::Value;
static const unsigned int CUSTOM_BACKGROUND_COLOR_LISTVIEW = Tizen::Graphics::Color32<236,240,242>::Value;
pSelectedBitmap->Construct(canvas, canvas.GetBounds());
pIconListview->Construct(*pBitmap, null, pSelectedBitmap);
delete pSelectedBitmap;
- pSelectedBitmap = null;
}
}
else
pMainFrame->Construct();
AddFrame(*pMainFrame);
+ DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
SettingInfo::AddSettingEventListener(*this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
void
+GalleryApp::OnDeviceStateChanged(DeviceType deviceType, const Tizen::Base::String& state)
+{
+ AppLogDebug("ENTER");
+ if (deviceType == DEVICE_TYPE_STORAGE_CARD
+ && (state == DEVICE_STORAGE_CARD_MOUNTED || state == DEVICE_STORAGE_CARD_UNMOUNTED))
+ {
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+
+ Scene* pScene = pSceneManager->GetCurrentScene();
+ AppAssert(pSceneManager);
+
+ BasePanel* pBasePanel = dynamic_cast<BasePanel*>(pScene->GetPanel());
+ BaseForm* pBaseForm = dynamic_cast<BaseForm*>(pScene->GetForm());
+
+ if(pBasePanel != null )
+ {
+ pBasePanel->OnUpdateContentList();
+ }
+ else
+ {
+ if (pBaseForm != null)
+ {
+ pBaseForm->OnUpdateContentList();
+ }
+ }
+ }
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+}
+
+void
GalleryApp::OnSettingChanged(String& key)
{
AppLogDebug("ENTER");
const wchar_t* IDB_LIST_EXPAND_CLOSED_PRESS = L"00_list_expand_closed_press.png";
const wchar_t* IDB_LIST_EXPAND_OPENED = L"00_circle_button_Expand_open.png";
const wchar_t* IDB_LIST_EXPAND_OPENED_PRESS = L"00_list_expand_opened_press.png";
+
+const wchar_t* DEVICE_STORAGE_CARD_MOUNTED = L"Mounted";
+const wchar_t* DEVICE_STORAGE_CARD_UNMOUNTED = L"Unmounted";