Fix for N_SE-44622
authorAbhismita Ghosh <g.abhismita@samsung.com>
Thu, 4 Jul 2013 10:36:55 +0000 (19:36 +0900)
committerAbhismita Ghosh <g.abhismita@samsung.com>
Thu, 4 Jul 2013 10:36:55 +0000 (19:36 +0900)
Change-Id: Ic1c677813421bcce586804472ac34fb8d610ccba

inc/VpVideoPlayerForm.h
src/VpVideoPlayerForm.cpp

index bb5735c..3146a19 100755 (executable)
@@ -40,6 +40,7 @@ class VideoPlayerForm
        , public Tizen::Media::IAudioRouteEventListener
        , public Tizen::Ui::IActionEventListener
        , public Tizen::Ui::IAdjustmentEventListener
+       , public Tizen::Ui::IKeyEventListener
        , public Tizen::Ui::IOrientationEventListener
        , public Tizen::Ui::ITouchEventListener
        , public Tizen::Ui::Controls::IFormBackEventListener
@@ -78,6 +79,10 @@ public:
 
        virtual void OnAdjustmentValueChanged(const Tizen::Ui::Control& source, int adjustment);
 
+       virtual void OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode){}
+       virtual void OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode);
+       virtual void OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode){}
+
        virtual void OnOrientationChanged(const Tizen::Ui::Control& source,     Tizen::Ui::OrientationStatus orientationStatus);
 
        virtual void OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition,
index d2abb18..2015f54 100644 (file)
@@ -187,6 +187,7 @@ VideoPlayerForm::SetScreenMode(const ScreenMode mode, bool destroyOverlay)
                                __pOverlayPanel = new (std::nothrow) OverlayPanel();
                                r = __pOverlayPanel->Construct(rect);
                                TryCatch(r == E_SUCCESS, , "__pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
+                               __pOverlayPanel->SetFocusable(false);
 
                                r = AddControl(__pOverlayPanel);
                                TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
@@ -222,6 +223,7 @@ VideoPlayerForm::SetScreenMode(const ScreenMode mode, bool destroyOverlay)
                                __pOverlayPanel = new (std::nothrow) OverlayPanel();
                                r = __pOverlayPanel->Construct(rect);
                                TryCatch(r == E_SUCCESS, , "__pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
+                               __pOverlayPanel->SetFocusable(false);
 
                                r = AddControl(__pOverlayPanel);
                                TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
@@ -287,6 +289,7 @@ VideoPlayerForm::SetScreenMode(const ScreenMode mode, bool destroyOverlay)
                                __pOverlayPanel = new (std::nothrow) OverlayPanel();
                                r = __pOverlayPanel->Construct(rect);
                                TryCatch(r == E_SUCCESS, , "__pOverlayPanel->Construct() failed:%s", GetErrorMessage(r));
+                               __pOverlayPanel->SetFocusable(false);
 
                                r = AddControl(__pOverlayPanel);
                                TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
@@ -326,6 +329,7 @@ VideoPlayerForm::OnInitializing(void)
 
        AddOrientationEventListener(*this);
        AddTouchEventListener(*this);
+       AddKeyEventListener(*this);
 
        __pAudioRouteManager = AudioRouteManager::GetInstance();
        __pAudioRouteManager->SetAudioRouteEventListener(this);
@@ -1247,6 +1251,22 @@ VideoPlayerForm::OnAdjustmentValueChanged(const Control& source, int adjustment)
 }
 
 void
+VideoPlayerForm::OnKeyReleased(const Control& source, KeyCode keyCode)
+{
+       AppLogDebug("OnKeyReleased Control : %ls, KeyCode : %d", source.GetName().GetPointer(), keyCode);
+
+       if (source.GetName() == L"IDL_MAIN_FORM" && __isControlVisibleState == false)
+       {
+               ShowControl(true);
+
+               if (__pUiControlTimer != null)
+               {
+                       __pUiControlTimer->Start(SHOW_CONTROL_DURATION);
+               }
+       }
+}
+
+void
 VideoPlayerForm::UpdateProgressBar(const int currentPlayTime)
 {
        TryReturnVoid(__pSlider, "__pSlider is null");
@@ -1361,6 +1381,8 @@ VideoPlayerForm::SetRepeatButtonImage(int repeatValue)
 
        delete pRepeatBitmap;
        delete pRepeatPressBitmap;
+
+       Invalidate(true);
 }
 
 void
@@ -1426,6 +1448,8 @@ VideoPlayerForm::SetScreenModeButtonImage(void)
        default:
                break;
        }
+
+       Invalidate(true);
 }
 
 void
@@ -1507,6 +1531,7 @@ VideoPlayerForm::ShowControl(bool setShow)
                __pHeader->SetShowState(false);
                __pFunctionPanel->SetShowState(false);
                __pControllerPanel->SetShowState(false);
+               SetFocus();
 
                if (__pShareContextMenu != null)
                {