(Indicator) Fixed to support dali application's indicator mode
authorSinjae Lee <sinjae4b.lee@samsung.com>
Wed, 28 May 2014 10:45:43 +0000 (19:45 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 10 Jun 2014 15:42:02 +0000 (16:42 +0100)
[problem] Dali::Application app can not handle the indicator visibility as well
[cause] Indicator image is loaded after app initializing
[solution] When indicator image is loaded, set visible forcely again

adaptors/tizen/internal/application-impl.cpp
adaptors/tizen/internal/common/indicator-impl.cpp
adaptors/tizen/internal/common/indicator-impl.h

index 8b8575c..38bd83a 100644 (file)
@@ -200,6 +200,9 @@ void Application::OnInit()
 
   mInitialized = true;
 
+  // in default, auto hide indicator mode
+  mWindow.ShowIndicator(Dali::Window::AUTO);
+
   Dali::Application application(this);
   mInitSignalV2.Emit( application );
 }
index 4dfe46f..338a1de 100644 (file)
@@ -487,9 +487,9 @@ void Indicator::SetOpacityMode( Dali::Window::IndicatorBgOpacity mode )
   SetBackground();
 }
 
-void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode )
+void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate )
 {
-  if ( visibleMode != mVisible )
+  if ( visibleMode != mVisible || forceUpdate )
   {
     // If we were previously hidden, then we should update the image data before we display the indicator
     if ( mVisible == Dali::Window::INVISIBLE )
@@ -600,7 +600,7 @@ bool Indicator::OnTouched(Dali::Actor indicator, const Dali::TouchEvent& touchEv
       }
     }
     // show indicator when it is invisible
-    else if( !mIsShowing && ( CheckVisibleState() == false || mVisible == Dali::Window::AUTO ) )
+    else if( !mIsShowing && ( CheckVisibleState() == false && mVisible == Dali::Window::AUTO ) )
     {
       switch( touchPoint.state )
       {
@@ -843,6 +843,8 @@ void Indicator::LoadPixmapImage( Ecore_Ipc_Event_Server_Data *epcEvent )
         // set default indicator type (disable the quick panel)
         OnIndicatorTypeChanged( INDICATOR_TYPE_2 );
       }
+
+      SetVisible(mVisible, true);
     }
   }
 }
@@ -887,6 +889,8 @@ void Indicator::LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent )
           // set default indicator type (disable the quick panel)
           OnIndicatorTypeChanged( INDICATOR_TYPE_2 );
         }
+
+        SetVisible(mVisible, true);
       }
     }
   }
@@ -924,6 +928,7 @@ bool Indicator::CopyToBuffer()
     {
       unsigned char *src = mSharedFile->GetAddress();
       size_t size = mImageWidth * mImageHeight * 4;
+
       if( mIndicatorBuffer->UpdatePixels( src, size ) )
       {
         mAdaptor->RequestUpdateOnce();
index 3c550c5..f1a5406 100644 (file)
@@ -203,8 +203,9 @@ public:
   /**
    * Set whether the indicator is visible or not.
    * @param[in] visibleMode visible mode for indicator bar.
+   * @param[in] forceUpdate true if want to change visible mode forcely
    */
-  void SetVisible( Dali::Window::IndicatorVisibleMode visibleMode );
+  void SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate = false );
 
   /**
    * Check whether the indicator is connected to the indicator service.