[3.0] Add UpdateTopMargin in tizen indicator 51/104251/2 accepted/tizen/3.0/common/20161216.124145 accepted/tizen/3.0/ivi/20161216.085523 accepted/tizen/3.0/mobile/20161216.085118 accepted/tizen/3.0/tv/20161216.085325 accepted/tizen/3.0/wearable/20161216.085428 submit/tizen_3.0/20161213.042157 submit/tizen_3.0/20161216.023434 submit/tizen_3.0/20161216.041228 submit/tizen_3.0/20161216.053358
authortaeyoon <taeyoon0.lee@samsung.com>
Tue, 13 Dec 2016 02:09:07 +0000 (11:09 +0900)
committertaeyoon <taeyoon0.lee@samsung.com>
Tue, 13 Dec 2016 02:23:14 +0000 (11:23 +0900)
Change-Id: Ibe8073696ca7c3a3404a24187ac03e2e7dc72abe

adaptors/tizen/ecore-indicator-impl-tizen.cpp

index cdff69f..2439aac 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -507,7 +507,8 @@ Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientat
   mCurrentSharedFile( 0 ),
   mSharedBufferType( BUFFER_TYPE_SHM ),
   mImpl( NULL ),
-  mBackgroundVisible( false )
+  mBackgroundVisible( false ),
+  mTopMargin( 0 )
 {
   mIndicatorContentActor = Dali::Actor::New();
   mIndicatorContentActor.SetParentOrigin( ParentOrigin::TOP_CENTER );
@@ -654,6 +655,7 @@ void Indicator::SetOpacityMode( Dali::Window::IndicatorBgOpacity mode )
     mIndicatorContentActor.RemoveRenderer( mBackgroundRenderer );
     mBackgroundVisible = false;
   }
+  UpdateTopMargin();
 }
 
 void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate )
@@ -684,6 +686,7 @@ void Indicator::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool
     }
 
     mVisible = visibleMode;
+    UpdateTopMargin();
 
     if( mForegroundRenderer &&
         ( mForegroundRenderer.GetTextures().GetTexture( 0u ) ||
@@ -885,6 +888,7 @@ void Indicator::Resize( int width, int height )
     mIndicatorContentActor.SetSize( mImageWidth, mImageHeight );
     mIndicatorActor.SetSize( mImageWidth, mImageHeight );
     mEventActor.SetSize(mImageWidth, mImageHeight);
+    UpdateTopMargin();
   }
 }
 
@@ -1085,6 +1089,16 @@ void Indicator::UpdateIndicatorImage( Any source )
   Dali::Stage::GetCurrent().KeepRendering( 0.0f );
 }
 
+void Indicator::UpdateTopMargin()
+{
+  int newMargin = (mVisible == Dali::Window::VISIBLE && mOpacityMode == Dali::Window::OPAQUE) ? mImageHeight : 0;
+  if (mTopMargin != newMargin)
+  {
+    mTopMargin = newMargin;
+    mAdaptor->IndicatorSizeChanged( mTopMargin );
+  }
+}
+
 void Indicator::UpdateVisibility()
 {
   if( CheckVisibleState() )