void Controller::Impl::ClampVerticalScroll( const Vector2& layoutSize )
{
+ if( LayoutEngine::SINGLE_LINE_BOX == mLayoutEngine.GetLayout() )
+ {
+ // Nothing to do if the text is single line.
+ return;
+ }
+
// Clamp between -space & 0.
if( layoutSize.height > mVisualModel->mControlSize.height )
{
{
}
-void BorderVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void BorderVisual::DoSetProperties( const Property::Map& propertyMap )
{
Property::Value* color = propertyMap.Find( Toolkit::BorderVisual::Property::COLOR, COLOR_NAME );
if( !( color && color->Get(mBorderColor) ) )
virtual ~BorderVisual();
/**
- * @copydoc Visual::Base::DoInitialize
+ * @copydoc Visual::Base::DoSetProperties
*/
- virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+ virtual void DoSetProperties( const Property::Map& propertyMap );
/**
* @copydoc Visual::Base::DoSetOnStage
{
}
-void ColorVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void ColorVisual::DoSetProperties( const Property::Map& propertyMap )
{
Property::Value* color = propertyMap.Find( Toolkit::ColorVisual::Property::MIX_COLOR, COLOR_NAME );
if( !( color && color->Get(mMixColor) ) )
virtual ~ColorVisual();
/**
- * @copydoc Visual::Base::DoInitialize
+ * @copydoc Visual::Base::DoSetProperties
*/
- virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+ virtual void DoSetProperties( const Property::Map& propertyMap );
/**
* @copydoc Visual::Base::DoSetOnStage
{
}
-void GradientVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void GradientVisual::DoSetProperties( const Property::Map& propertyMap )
{
Toolkit::GradientVisual::Units::Type gradientUnits = Toolkit::GradientVisual::Units::OBJECT_BOUNDING_BOX;
virtual ~GradientVisual();
/**
- * @copydoc Visual::Base::DoInitialize
+ * @copydoc Visual::Base::DoSetProperties
*/
- virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+ virtual void DoSetProperties( const Property::Map& propertyMap );
/**
* @copydoc Visual::Base::DoSetOnStage
{
}
-void BatchImageVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void BatchImageVisual::DoSetProperties( const Property::Map& propertyMap )
{
std::string oldImageUrl = mImageUrl;
Property::Value* imageURLValue = propertyMap.Find( Dali::Toolkit::ImageVisual::Property::URL, Dali::Toolkit::Internal::IMAGE_URL_NAME );
mDesiredSize = ImageDimensions( desiredWidth, desiredHeight );
}
-
- // Remove old renderer if exit.
- if( mImpl->mRenderer )
- {
- if( actor ) // Remove old renderer from actor.
- {
- actor.RemoveRenderer( mImpl->mRenderer );
- }
- if( !oldImageUrl.empty() ) // Clean old renderer from cache.
- {
- CleanCache( oldImageUrl );
- }
- }
-
- // If actor is on stage, create new renderer and apply to actor.
- if( actor && actor.OnStage() )
- {
- SetOnStage( actor );
- }
}
void BatchImageVisual::SetSize( const Vector2& size )
~BatchImageVisual();
/**
- * @copydoc Visua::Base::DoInitialize
+ * @copydoc Visua::Base::DoSetProperties
*/
- virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+ virtual void DoSetProperties( const Property::Map& propertyMap );
/**
* @copydoc Visual::Base::DoSetOnStage
{
}
-void ImageVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void ImageVisual::DoSetProperties( const Property::Map& propertyMap )
{
Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
if( imageURLValue )
virtual ~ImageVisual();
/**
- * @copydoc Visual::Base::DoInitialize
+ * @copydoc Visual::Base::DoSetProperties
*/
- virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+ virtual void DoSetProperties( const Property::Map& propertyMap );
/**
* @copydoc Visual::Base::DoSetOnStage
{
}
-void MeshVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void MeshVisual::DoSetProperties( const Property::Map& propertyMap )
{
Property::Value* objectUrl = propertyMap.Find( Toolkit::MeshVisual::Property::OBJECT_URL, OBJECT_URL_NAME );
if( !objectUrl || !objectUrl->Get( mObjectUrl ) )
virtual ~MeshVisual();
/**
- * @copydoc Visual::Base::DoInitialize
+ * @copydoc Visual::Base::DoSetProperties
*/
- virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+ virtual void DoSetProperties( const Property::Map& propertyMap );
/**
* @copydoc Visual::Base::DoSetOnStage
{
}
-void NPatchVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void NPatchVisual::DoSetProperties( const Property::Map& propertyMap )
{
Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
if( imageURLValue )
virtual ~NPatchVisual();
/**
- * @copydoc Visual::Base::DoInitialize
+ * @copydoc Visual::Base::DoSetProperties
*/
- virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+ virtual void DoSetProperties( const Property::Map& propertyMap );
/**
* @copydoc Visual::Base::DoSetOnStage
{
}
-void PrimitiveVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void PrimitiveVisual::DoSetProperties( const Property::Map& propertyMap )
{
//Find out which shape to renderer.
Property::Value* primitiveTypeValue = propertyMap.Find( Toolkit::PrimitiveVisual::Property::SHAPE, PRIMITIVE_SHAPE );
virtual ~PrimitiveVisual();
/**
- * @copydoc Visual::Base::DoInitialize
+ * @copydoc Visual::Base::DoSetProperties
*/
- virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+ virtual void DoSetProperties( const Property::Map& propertyMap );
/**
* @copydoc Visual::Base::DoSetOnStage
}
}
-void SvgVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void SvgVisual::DoSetProperties( const Property::Map& propertyMap )
{
Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
if( imageURLValue )
virtual ~SvgVisual();
/**
- * @copydoc Visual::Base::DoInitialize
+ * @copydoc Visual::Base::DoSetProperties
*/
- virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+ virtual void DoSetProperties( const Property::Map& propertyMap );
/**
* @copydoc Visual::Base::DoSetOnStage
{
}
-void TextVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void TextVisual::DoSetProperties( const Property::Map& propertyMap )
{
- mSelf = actor;
-
for( Property::Map::SizeType index = 0u, count = propertyMap.Count(); index < count; ++index )
{
const KeyValuePair& keyValue = propertyMap.GetKeyValue( index );
void TextVisual::RenderText()
{
+ Actor self = mSelf.GetHandle();
+ if( !self )
+ {
+ // Nothing to do if the handle is not initialized.
+ return;
+ }
+
Actor renderableActor;
if( mRenderer )
const Vector2& scrollOffset = mController->GetScrollPosition();
renderableActor.SetPosition( scrollOffset.x, scrollOffset.y );
- mSelf.Add( renderableActor );
+ self.Add( renderableActor );
}
mRenderableActor = renderableActor;
void TextVisual::SetUpAutoScrolling()
{
+ Actor self = mSelf.GetHandle();
+ if( !self )
+ {
+ // Nothing to do if the handle is not initialized.
+ return;
+ }
+
const Text::ScrollerData* const data = mController->GetAutoScrollData();
if( NULL != data )
mTextScroller->StartScrolling( mRenderableActor,
*data );
- mSelf.Add( mTextScroller->GetScrollingText() );
- mSelf.Add( mTextScroller->GetSourceCamera() );
+ self.Add( mTextScroller->GetScrollingText() );
+ self.Add( mTextScroller->GetSourceCamera() );
}
}
*/
// EXTERNAL INCLUDES
+#include <dali/devel-api/object/weak-handle.h>
#include <dali/public-api/common/intrusive-ptr.h>
// INTERNAL INCLUDES
// from Visual::Base
/**
- * @copydoc Visual::Base::DoInitialize()
+ * @copydoc Visual::Base::DoSetProperties()
*/
- virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+ virtual void DoSetProperties( const Property::Map& propertyMap );
/**
* @copydoc Visual::Base::DoSetOnStage()
private:
Text::ControllerPtr mController; ///< The text's controller.
- Actor mSelf;
+ WeakHandle<Actor> mSelf;
Text::RendererPtr mRenderer;
Text::TextScrollerPtr mTextScroller;
}
}
-void Visual::Base::Initialize( Actor& actor, const Property::Map& propertyMap )
+void Visual::Base::SetProperties( const Property::Map& propertyMap )
{
Property::Value* customShaderValue = propertyMap.Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER );
if( customShaderValue )
}
}
- DoInitialize( actor, propertyMap );
+ DoSetProperties( propertyMap );
}
void Visual::Base::SetName( const std::string& name )
public:
/**
- * Initialisation of the visual, this API should only called by the VisualFactory:
- * request the geometry and shader from the cache, if not available, create and save to the cache for sharing;
- * record the property values.
- *
- * @param[in] actor The Actor the visual is applied to if, empty if the visual has not been applied to any Actor
+ * Setting the properties of the visual, this API should only called by the VisualFactory
* @param[in] propertyMap The properties for the requested Visual object.
*/
- void Initialize( Actor& actor, const Property::Map& propertyMap );
+ void SetProperties( const Property::Map& propertyMap );
/**
* @copydoc Toolkit::Visual::Base::SetName
virtual void DoCreatePropertyMap( Property::Map& map ) const = 0;
/**
- * @brief Called by Initialize() allowing sub classes to respond to the Initialize event
+ * @brief Called by SetProperties() allowing sub classes to set their properties
*
- * @param[in] actor The Actor the visual is applied to if, empty if the visual has not been applied to any Actor
* @param[in] propertyMap The properties for the requested Visual object.
*/
- virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ) {}
+ virtual void DoSetProperties( const Property::Map& propertyMap ) = 0;
protected:
if( visualPtr )
{
- Actor actor;
- visualPtr->Initialize( actor, propertyMap );
+ visualPtr->SetProperties( propertyMap );
}
else
{
{
}
+void WireframeVisual::DoSetProperties( const Property::Map& propertyMap )
+{
+ // no properties supported at the moment
+}
+
void WireframeVisual::DoSetOnStage( Actor& actor )
{
InitializeRenderer();
virtual ~WireframeVisual();
/**
+ * @copydoc Visual::Base::DoSetProperties()
+ */
+ virtual void DoSetProperties( const Property::Map& propertyMap );
+
+ /**
* @copydoc Visual::Base::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 10;
+const unsigned int TOOLKIT_MICRO_VERSION = 11;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-addon
Summary: DALi module for Node.JS
-Version: 1.2.10
+Version: 1.2.11
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
Name: NDalic
Summary: dali wrapper
-Version: 1.0.0
+Version: 1.2.11
Release: 1
Group: uifw/graphic
License: TO_BE_FILLED_IN
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.2.10
+Version: 1.2.11
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-2-Clause and MIT
* This is because from C# we can't wrap the operator BooleanType() function
*/
%extend Dali::BaseHandle {
- bool IsHandleEmpty() const {
+ bool HasBody() const {
+
+ // C++ code. DALi uses Handle <-> Body design pattern.
+ // This function checks the Handle to see if it has a body attached ( possible to have empty handles).
+ // Handles in DALi can be converted into a boolean type
+ // to check if the handle has a valid body attached to it.
+ // Internally checking *$self will checks IntrusivePtr<Dali::RefObject> mObjectHandle in BaseHandle;
if( *$self )
{
return true;
return false;
}
}
+
+ // Check if two handles point to the same body / ref-object.
+ bool IsEqual( const BaseHandle& rhs ) const {
+
+ // C++ code. Check if two handles reference the same implemtion
+ if( *$self == rhs)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
};
/**
*/
%typemap(cscode) Dali::BaseHandle %{
- public static bool operator true(BaseHandle handle)
- {
- if( handle!= null )
- {
- return handle.IsHandleEmpty();
- }
- else
- {
- return false;
- }
- }
- public static bool operator false(BaseHandle handle)
- {
- return handle.IsHandleEmpty();
- }
-%}
+ // Returns the bool value true to indicate that an operand is true and returns false otherwise.
+ public static bool operator true(BaseHandle handle)
+ {
+ // if the C# object is null, return false
+ if( BaseHandle.ReferenceEquals( handle, null ) )
+ {
+ return false;
+ }
+ // returns true if the handle has a body, false otherwise
+ return handle.HasBody();
+ }
+
+ // Returns the bool false to indicate that an operand is false and returns true otherwise.
+ public static bool operator false(BaseHandle handle)
+ {
+ // if the C# object is null, return true
+ if( BaseHandle.ReferenceEquals( handle, null ) )
+ {
+ return true;
+ }
+ return !handle.HasBody();
+ }
+
+ // Explicit conversion from Handle to bool.
+ public static explicit operator bool(BaseHandle handle)
+ {
+ // if the C# object is null, return false
+ if( BaseHandle.ReferenceEquals( handle, null ) )
+ {
+ return false;
+ }
+ // returns true if the handle has a body, false otherwise
+ return handle.HasBody();
+ }
+ // Equality operator
+ public static bool operator == (BaseHandle x, BaseHandle y)
+ {
+ // if the C# objects are the same return true
+ if( BaseHandle.ReferenceEquals( x, y ) )
+ {
+ return true;
+ }
+ if ( !BaseHandle.ReferenceEquals( x, null ) && !BaseHandle.ReferenceEquals( y, null ) )
+ {
+ // drop into native code to see if both handles point to the same body
+ return x.IsEqual( y) ;
+ }
+ return false;
+
+ }
+
+ // Inequality operator. Returns Null if either operand is Null
+ public static bool operator !=(BaseHandle x, BaseHandle y)
+ {
+ return !(x==y);
+ }
+
+ // Logical AND operator for &&
+ // It's possible when doing a && this function (opBitwiseAnd) is never called due
+ // to short circuiting. E.g.
+ // If you perform x && y What actually is called is
+ // BaseHandle.op_False( x ) ? BaseHandle.op_True( x ) : BaseHandle.opTrue( BaseHandle.opBitwiseAnd(x,y) )
+ //
+ public static BaseHandle operator &(BaseHandle x, BaseHandle y)
+ {
+ if( x == y )
+ {
+ return x;
+ }
+ return null;
+ }
+
+ // Logical OR operator for ||
+ // It's possible when doing a || this function (opBitwiseOr) is never called due
+ // to short circuiting. E.g.
+ // If you perform x || y What actually is called is
+ // BaseHandle.op_True( x ) ? BaseHandle.op_True( x ) : BaseHandle.opTrue( BaseHandle.opBitwiseOr(x,y) )
+ public static BaseHandle operator |(BaseHandle x, BaseHandle y)
+ {
+ if ( !BaseHandle.ReferenceEquals( x, null ) || !BaseHandle.ReferenceEquals( y, null ) )
+ {
+ if( x.HasBody() )
+ {
+ return x;
+ }
+ if( y.HasBody() )
+ {
+ return y;
+ }
+ return null;
+ }
+ return null;
+ }
+
+ // Logical ! operator
+ public static bool operator !(BaseHandle x)
+ {
+ // if the C# object is null, return true
+ if( BaseHandle.ReferenceEquals( x, null ) )
+ {
+ return true;
+ }
+ if( x.HasBody() )
+ {
+ return false;
+ }
+ return true;
+ }
+%}
\ No newline at end of file
%define Animation_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName)
%typemap(cscode) NameSpace::ClassName %{
+ public static readonly int PARENT_ORIGIN = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_get();
+ public static readonly int PARENT_ORIGIN_X = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_X_get();
+ public static readonly int PARENT_ORIGIN_Y = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Y_get();
+ public static readonly int PARENT_ORIGIN_Z = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Z_get();
+ public static readonly int ANCHOR_POINT = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_get();
+ public static readonly int ANCHOR_POINT_X = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_X_get();
+ public static readonly int ANCHOR_POINT_Y = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Y_get();
+ public static readonly int ANCHOR_POINT_Z = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Z_get();
+ public static readonly int SIZE = NDalicPINVOKE.Actor_Property_SIZE_get();
+ public static readonly int SIZE_WIDTH = NDalicPINVOKE.Actor_Property_SIZE_WIDTH_get();
+ public static readonly int SIZE_HEIGHT = NDalicPINVOKE.Actor_Property_SIZE_HEIGHT_get();
+ public static readonly int SIZE_DEPTH = NDalicPINVOKE.Actor_Property_SIZE_DEPTH_get();
+ public static readonly int POSITION = NDalicPINVOKE.Actor_Property_POSITION_get();
+ public static readonly int POSITION_X = NDalicPINVOKE.Actor_Property_POSITION_X_get();
+ public static readonly int POSITION_Y = NDalicPINVOKE.Actor_Property_POSITION_Y_get();
+ public static readonly int POSITION_Z = NDalicPINVOKE.Actor_Property_POSITION_Z_get();
+ public static readonly int WORLD_POSITION = NDalicPINVOKE.Actor_Property_WORLD_POSITION_get();
+ public static readonly int WORLD_POSITION_X = NDalicPINVOKE.Actor_Property_WORLD_POSITION_X_get();
+ public static readonly int WORLD_POSITION_Y = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Y_get();
+ public static readonly int WORLD_POSITION_Z = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Z_get();
+ public static readonly int ORIENTATION = NDalicPINVOKE.Actor_Property_ORIENTATION_get();
+ public static readonly int WORLD_ORIENTATION = NDalicPINVOKE.Actor_Property_WORLD_ORIENTATION_get();
+ public static readonly int SCALE = NDalicPINVOKE.Actor_Property_SCALE_get();
+ public static readonly int SCALE_X = NDalicPINVOKE.Actor_Property_SCALE_X_get();
+ public static readonly int SCALE_Y = NDalicPINVOKE.Actor_Property_SCALE_Y_get();
+ public static readonly int SCALE_Z = NDalicPINVOKE.Actor_Property_SCALE_Z_get();
+ public static readonly int WORLD_SCALE = NDalicPINVOKE.Actor_Property_WORLD_SCALE_get();
+ public static readonly int VISIBLE = NDalicPINVOKE.Actor_Property_VISIBLE_get();
+ public static readonly int COLOR = NDalicPINVOKE.Actor_Property_COLOR_get();
+ public static readonly int COLOR_RED = NDalicPINVOKE.Actor_Property_COLOR_RED_get();
+ public static readonly int COLOR_GREEN = NDalicPINVOKE.Actor_Property_COLOR_GREEN_get();
+ public static readonly int COLOR_BLUE = NDalicPINVOKE.Actor_Property_COLOR_BLUE_get();
+ public static readonly int COLOR_ALPHA = NDalicPINVOKE.Actor_Property_COLOR_ALPHA_get();
+ public static readonly int WORLD_COLOR = NDalicPINVOKE.Actor_Property_WORLD_COLOR_get();
+ public static readonly int WORLD_MATRIX = NDalicPINVOKE.Actor_Property_WORLD_MATRIX_get();
+ public static readonly int NAME = NDalicPINVOKE.Actor_Property_NAME_get();
+ public static readonly int SENSITIVE = NDalicPINVOKE.Actor_Property_SENSITIVE_get();
+ public static readonly int LEAVE_REQUIRED = NDalicPINVOKE.Actor_Property_LEAVE_REQUIRED_get();
+ public static readonly int INHERIT_ORIENTATION = NDalicPINVOKE.Actor_Property_INHERIT_ORIENTATION_get();
+ public static readonly int INHERIT_SCALE = NDalicPINVOKE.Actor_Property_INHERIT_SCALE_get();
+ public static readonly int COLOR_MODE = NDalicPINVOKE.Actor_Property_COLOR_MODE_get();
+ public static readonly int POSITION_INHERITANCE = NDalicPINVOKE.Actor_Property_POSITION_INHERITANCE_get();
+ public static readonly int DRAW_MODE = NDalicPINVOKE.Actor_Property_DRAW_MODE_get();
+ public static readonly int SIZE_MODE_FACTOR = NDalicPINVOKE.Actor_Property_SIZE_MODE_FACTOR_get();
+ public static readonly int WIDTH_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_WIDTH_RESIZE_POLICY_get();
+ public static readonly int HEIGHT_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_HEIGHT_RESIZE_POLICY_get();
+ public static readonly int SIZE_SCALE_POLICY = NDalicPINVOKE.Actor_Property_SIZE_SCALE_POLICY_get();
+ public static readonly int WIDTH_FOR_HEIGHT = NDalicPINVOKE.Actor_Property_WIDTH_FOR_HEIGHT_get();
+ public static readonly int HEIGHT_FOR_WIDTH = NDalicPINVOKE.Actor_Property_HEIGHT_FOR_WIDTH_get();
+ public static readonly int PADDING = NDalicPINVOKE.Actor_Property_PADDING_get();
+ public static readonly int MINIMUM_SIZE = NDalicPINVOKE.Actor_Property_MINIMUM_SIZE_get();
+ public static readonly int MAXIMUM_SIZE = NDalicPINVOKE.Actor_Property_MAXIMUM_SIZE_get();
+ public static readonly int INHERIT_POSITION = NDalicPINVOKE.Actor_Property_INHERIT_POSITION_get();
+ public static readonly int CLIPPING_MODE = NDalicPINVOKE.Actor_Property_CLIPPING_MODE_get();
+ public static readonly int BATCH_PARENT = NDalicPINVOKE.Actor_Property_BATCH_PARENT_get();
+
+
/**
* @brief Event arguments that passed via Finished signal
*
}
}
+ public void AnimateBy<T,U>(Actor target, U propertyIndex, T relativeValue)
+ {
+ dynamic var = (object)(propertyIndex);
+ dynamic obj = (object)(relativeValue);
+ AnimateBy(new Property(target, var), new Property.Value(obj));
+ }
+
+ public void AnimateBy<T,U>(Actor target, U propertyIndex, T relativeValue, AlphaFunction alpha)
+ {
+ dynamic var = (object)(propertyIndex);
+ dynamic obj = (object)(relativeValue);
+ AnimateBy(new Property(target, var), new Property.Value(obj), alpha);
+ }
+
+ public void AnimateBy<T,U>(Actor target, U propertyIndex, T relativeValue, TimePeriod period)
+ {
+ dynamic var = (object)(propertyIndex);
+ dynamic obj = (object)(relativeValue);
+ AnimateBy(new Property(target, var), new Property.Value(obj), period);
+ }
+
+ public void AnimateBy<T,U>(Actor target, U propertyIndex, T relativeValue, AlphaFunction alpha, TimePeriod period)
+ {
+ dynamic var = (object)(propertyIndex);
+ dynamic obj = (object)(relativeValue);
+ AnimateBy(new Property(target, var), new Property.Value(obj), alpha, period);
+ }
+
+ public void AnimateTo<T,U>(Actor target, U propertyIndex, T destinationValue)
+ {
+ dynamic var = (object)(propertyIndex);
+ dynamic obj = (object)(destinationValue);
+ AnimateTo(new Property(target, var), new Property.Value(obj));
+ }
+
+ public void AnimateTo<T,U>(Actor target, U propertyIndex, T destinationValue, AlphaFunction alpha)
+ {
+ dynamic var = (object)(propertyIndex);
+ dynamic obj = (object)(destinationValue);
+ AnimateTo(new Property(target, var), new Property.Value(obj), alpha);
+ }
+
+ public void AnimateTo<T,U>(Actor target, U propertyIndex, T destinationValue, TimePeriod period)
+ {
+ dynamic var = (object)(propertyIndex);
+ dynamic obj = (object)(destinationValue);
+ AnimateTo(new Property(target, var), new Property.Value(obj), period);
+ }
+
+ public void AnimateTo<T,U>(Actor target, U propertyIndex, T destinationValue, AlphaFunction alpha, TimePeriod period)
+ {
+ dynamic var = (object)(propertyIndex);
+ dynamic obj = (object)(destinationValue);
+ AnimateTo(new Property(target, var), new Property.Value(obj), alpha, period);
+ }
+
+ public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames)
+ {
+ dynamic var = (object)(propertyIndex);
+ AnimateBetween(new Property(target, var), keyFrames);
+ }
+
+ public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, Animation.Interpolation interpolation)
+ {
+ dynamic var = (object)(propertyIndex);
+ AnimateBetween(new Property(target, var), keyFrames, interpolation);
+ }
+
+ public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, AlphaFunction alpha)
+ {
+ dynamic var = (object)(propertyIndex);
+ AnimateBetween(new Property(target, var), keyFrames, alpha);
+ }
+
+ public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
+ {
+ dynamic var = (object)(propertyIndex);
+ AnimateBetween(new Property(target, var), keyFrames, alpha, interpolation);
+ }
+
+ public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, TimePeriod period)
+ {
+ dynamic var = (object)(propertyIndex);
+ AnimateBetween(new Property(target, var), keyFrames, period);
+ }
+
+ public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
+ {
+ dynamic var = (object)(propertyIndex);
+ AnimateBetween(new Property(target, var), keyFrames, period, interpolation);
+ }
+
+ public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
+ {
+ dynamic var = (object)(propertyIndex);
+ AnimateBetween(new Property(target, var), keyFrames, alpha, period);
+ }
+
+ public void AnimateBetween<U>(Actor target, U propertyIndex, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
+ {
+ dynamic var = (object)(propertyIndex);
+ AnimateBetween(new Property(target, var), keyFrames, alpha, period, interpolation);
+ }
+
%}
%enddef
public void Initialize(object source, AUIApplicationInitEventArgs e)
{
+
+ OperatorTests();
+
Handle handle = new Handle();
int myPropertyIndex = handle.RegisterProperty("myProperty", new Property.Value(10.0f), Property.AccessMode.READ_WRITE);
float myProperty = 0.0f;
Console.WriteLine( " Vector4 r = " + vector4.r + ", g = " + vector4.g + ", b = " + vector4.b + ", a = " + vector4.a );
}
+
+ public void OperatorTests()
+ {
+ Actor actor = new Actor();
+ Actor differentActor = new Actor();
+ Actor actorSame = actor;
+ Actor nullActor = null;
+
+ // test the true operator
+ if ( actor )
+ {
+ Console.WriteLine ("BaseHandle Operator true (actor) : test passed ");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator true (actor): test failed ");
+ }
+
+ Actor parent = actor.GetParent ();
+
+ if ( parent )
+ {
+ Console.WriteLine ("Handle with Empty body :failed ");
+ }
+ else
+ {
+ Console.WriteLine ("Valid with Empty body :passed ");
+ }
+
+ actor.Add( differentActor );
+ // here we test two different C# objects, which on the native side have the same body/ ref-object
+ if ( actor == differentActor.GetParent() )
+ {
+ Console.WriteLine ("actor == differentActor.GetParent() :passed ");
+ }
+ else
+ {
+ Console.WriteLine ("actor == differentActor.GetParent() :failed ");
+ }
+
+ if ( differentActor == differentActor.GetParent() )
+ {
+ Console.WriteLine ("differentActor == differentActor.GetParent() :failed ");
+ }
+ else
+ {
+ Console.WriteLine ("differentActor == differentActor.GetParent() :passed ");
+ }
+
+
+ if ( nullActor )
+ {
+ Console.WriteLine ("BaseHandle Operator true (nullActor) : test failed ");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator true (nullActor): test passed ");
+ }
+
+ // ! operator
+ if ( !actor )
+ {
+ Console.WriteLine ("BaseHandle Operator !(actor) : test failed ");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator !(actor): test passed ");
+ }
+
+ if ( !nullActor )
+ {
+ Console.WriteLine ("BaseHandle Operator !(nullActor) : test passed ");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator !(nullActor): test failed ");
+ }
+
+ // Note: operator false only used inside & operator
+ // test equality operator ==
+ if ( actor == actorSame )
+ {
+ Console.WriteLine ("BaseHandle Operator (actor == actorSame) : test passed");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator (actor == actorSame) : test failed");
+ }
+
+ if ( actor == differentActor )
+ {
+ Console.WriteLine ("BaseHandle Operator (actor == differentActor) : test failed");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator (actor == differentActor) : test passed");
+ }
+
+ if ( actor == nullActor )
+ {
+ Console.WriteLine ("BaseHandle Operator (actor == nullActor) : test failed");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator (actor == nullActor) : test passed");
+ }
+
+ if ( nullActor == nullActor )
+ {
+ Console.WriteLine ("BaseHandle Operator (nullActor == nullActor) : test passed");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator (nullActor == nullActor) : test failed");
+ }
+
+ // test || operator
+ if ( actor || actorSame )
+ {
+ Console.WriteLine ("BaseHandle Operator (actor || actorSame) : test passed");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator (actor || actorSame) : test failed");
+ }
+
+ if ( actor || nullActor )
+ {
+ Console.WriteLine ("BaseHandle Operator (actor || nullActor) : test passed");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator (actor || nullActor) : test failed");
+ }
+
+ if ( nullActor || nullActor )
+ {
+ Console.WriteLine ("BaseHandle Operator (nullActor || nullActor) : test failed");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator (nullActor || nullActor) : test passed");
+ }
+
+
+ // test && operator
+ if ( actor && actorSame )
+ {
+ Console.WriteLine ("BaseHandle Operator (actor && actorSame) : test passed");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator (actor && actorSame) : test failed");
+ }
+
+ if ( actor && nullActor )
+ {
+ Console.WriteLine ("BaseHandle Operator (actor && nullActor) : test failed");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator (actor && nullActor) : test passed");
+ }
+
+ if ( nullActor && nullActor )
+ {
+ Console.WriteLine ("BaseHandle Operator (nullActor && nullActor) : test failed");
+ }
+ else
+ {
+ Console.WriteLine ("BaseHandle Operator (nullActor && nullActor) : test passed");
+ }
+
+ }
+
public void MainLoop()
{
_application.MainLoop ();
private View _topContainer;
private View _bottomContainer;
- private EdenEffect _edenEffect;
+ private FocusEffect _focusEffect;
private string _imagePath;
private ImageView _keyboardFocusIndicator;
HideBottomContainer();
// Also apply Focus animation on Focused item on Poster ScrollContainer
- _postersContainer[_currentPostersContainerID].FocusAnimation(_edenEffect, EdenEffectDirection.BottomToTop);
+ _postersContainer[_currentPostersContainerID].FocusAnimation(_focusEffect, FocusEffectDirection.BottomToTop);
}
}
else if (e.Direction == View.KeyboardFocus.Direction.DOWN)
_menuContainer.SetFocused(true);
// Also apply Focus animation on Focused item on Menu ScrollContainer
- _menuContainer.FocusAnimation(_edenEffect, EdenEffectDirection.TopToBottom);
+ _menuContainer.FocusAnimation(_focusEffect, FocusEffectDirection.TopToBottom);
}
}
else if (e.Direction == View.KeyboardFocus.Direction.LEFT)
}
// Add a shadow seperator image between last Launcher icon and Menu ScrollContainer
- _launcherSeparator = new ImageView(_imagePath + "/eden_launcher_shadow_n.png");
+ _launcherSeparator = new ImageView(_imagePath + "/focus_launcher_shadow_n.png");
_launcherSeparator.Name = "launcherSeparator";
_launcherSeparator.WidthResizePolicy = "USE_NATURAL_SIZE";
_launcherSeparator.HeightResizePolicy = "FILL_TO_PARENT";
_menuContainer.OffsetX = Constants.LauncherWidth;
_menuContainer.Width = _stageSize.width - Constants.LauncherWidth;
_menuContainer.Height = _stageSize.height * Constants.MenuContainerHeightFactor;
- _menuContainer.ShadowBorder = new ImageView(_imagePath + "/eden_launcher_shadow.9.png");
+ _menuContainer.ShadowBorder = new ImageView(_imagePath + "/focus_launcher_shadow.9.png");
_menuContainer.ShadowBorder.Name = "_menuContainer.ShadowBorder";
_menuContainer.ShadowBorder.Size = new Vector3(_menuContainer.ItemSize.width + 40.0f, _menuContainer.ItemSize.height + 50.0f, 0.0f);
_menuContainer.ShadowBorder.Position = new Vector3(0.0f, 5.0f, 0.0f);
keyboardFocusManager.SetFocusIndicatorActor(_keyboardFocusIndicator);
- _edenEffect = new EdenEffect();
+ _focusEffect = new FocusEffect();
// Move Fcous to Bottom Container (Menu ScrollContainer)
ShowBottomContainer();
namespace FirstScreen
{
- public class EdenData
+ public class FocusData
{
- private string _name; // Name used for EdenData object (mainly to differentiate key frame animation )
+ private string _name; // Name used for FocusData object (mainly to differentiate key frame animation )
private string _imageName; // Image File Name (to be loaded from disk) used for ImageView used in key frame animation
private Vector3 _parentOrigin; // ParentOrigin applied to ImageView
private Vector3 _initSize; // InitSize used for key frame animation
private Direction _direction; // Direction used for key frame animation
private ImageView _imageFocus; // ImageView used in key frame animation
- // Initialize EdenData used for key frame animation
- public EdenData(string name, string imageName, Direction direction, Vector3 parentOrigin, Vector3 initSize,
+ // Initialize FocusData used for key frame animation
+ public FocusData(string name, string imageName, Direction direction, Vector3 parentOrigin, Vector3 initSize,
Vector3 targetSize, float keyFrameStart, float keyFrameEnd)
{
_name = name;
_keyFrameEnd = keyFrameEnd;
_direction = direction;
- _imageFocus = new ImageView("./images/edeneffect/" + _imageName); // Desktop
-// _imageFocus = new ImageView("/home/owner/apps_rw/org.tizen.firstscreen/res/images/edeneffect/" + _imageName); // Target
+ _imageFocus = new ImageView("./images/focuseffect/" + _imageName); // Desktop
+// _imageFocus = new ImageView("/home/owner/apps_rw/org.tizen.firstscreen/res/images/focuseffect/" + _imageName); // Target
_imageFocus.ParentOrigin = _parentOrigin;
_imageFocus.AnchorPoint = NDalic.AnchorPointCenter;
Vertical
};
- public Direction EdenDirection
+ public Direction FocusDirection
{
get {return _direction;}
set {_direction = value;}
namespace FirstScreen
{
- public class EdenEffect : IEdenEffect
+ public class FocusEffect : IFocusEffect
{
private float _frameThickness;
- private EdenData[] _edenFocusData; // Each EdenData is used for one key frame animation (total 6 key frame animations needed for EddenEffect)
+ private FocusData[] _focusData; // Each FocusData is used for one key frame animation (total 6 key frame animations needed for EddenEffect)
private Animation _animation; // Animation used to apply all six key frame animations
- public EdenEffect()
+ public FocusEffect()
{
_frameThickness = 10.0f;
float _bottomFrameTime = 0.6f; // complete the halo/bottom animation 60% of the way through
float _sideFrameTime = 0.8f; // Start the side frame animation after the bottom animation and complete at 80% of the way through
float _topFrameTime = 1.0f; // start the top frame animation after the side frame animation and complete at 100% way through
- // Six key frame animations (EdenData objects) needed for EddenEffect
+ // Six key frame animations (FocusData objects) needed for EddenEffect
// Two key frame animations for top horizontal effect
// Two key frame animations for bottom horizontal effect
// Two key frame animations for vertical horizontal effect
- _edenFocusData = new EdenData[6];
+ _focusData = new FocusData[6];
- EdenData edenData = new EdenData("halo", "halo.png", EdenData.Direction.Horizontal, NDalic.ParentOriginTopCenter,
+ FocusData focusData = new FocusData("halo", "halo.png", FocusData.Direction.Horizontal, NDalic.ParentOriginTopCenter,
new Vector3(50,20,0), new Vector3(0.0f, 100.0f , 0.0f), 0.0f, _bottomFrameTime);
- _edenFocusData[0] = edenData;
+ _focusData[0] = focusData;
- edenData = new EdenData("bottom", "horizontalFrame.png", EdenData.Direction.Horizontal, NDalic.ParentOriginTopCenter,
+ focusData = new FocusData("bottom", "horizontalFrame.png", FocusData.Direction.Horizontal, NDalic.ParentOriginTopCenter,
new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f, _frameThickness, 0.0f), 0.0f, _bottomFrameTime);
- _edenFocusData[1] = edenData;
+ _focusData[1] = focusData;
- edenData = new EdenData("left", "verticalFrame.png", EdenData.Direction.Vertical, NDalic.ParentOriginBottomLeft,
+ focusData = new FocusData("left", "verticalFrame.png", FocusData.Direction.Vertical, NDalic.ParentOriginBottomLeft,
new Vector3(0.0f, 0.0f, 0.0f), new Vector3(_frameThickness, 0.0f, 0.0f), _bottomFrameTime, _sideFrameTime);
- _edenFocusData[2] = edenData;
+ _focusData[2] = focusData;
- edenData = new EdenData("right", "verticalFrame.png", EdenData.Direction.Vertical, NDalic.ParentOriginBottomRight,
+ focusData = new FocusData("right", "verticalFrame.png", FocusData.Direction.Vertical, NDalic.ParentOriginBottomRight,
new Vector3(0.0f, 0.0f, 0.0f), new Vector3(_frameThickness, 0.0f, 0.0f), _bottomFrameTime, _sideFrameTime);
- _edenFocusData[3] = edenData;
+ _focusData[3] = focusData;
- edenData = new EdenData("top-left", "horizontalFrame.png", EdenData.Direction.Horizontal, NDalic.ParentOriginBottomLeft,
+ focusData = new FocusData("top-left", "horizontalFrame.png", FocusData.Direction.Horizontal, NDalic.ParentOriginBottomLeft,
new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f ,_frameThickness, 0.0f), _sideFrameTime, _topFrameTime);
- _edenFocusData[4] = edenData;
+ _focusData[4] = focusData;
- edenData = new EdenData("top-right", "horizontalFrame.png", EdenData.Direction.Horizontal, NDalic.ParentOriginBottomRight,
+ focusData = new FocusData("top-right", "horizontalFrame.png", FocusData.Direction.Horizontal, NDalic.ParentOriginBottomRight,
new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f, _frameThickness, 0.0f), _sideFrameTime, _topFrameTime);
- _edenFocusData[5] = edenData;
+ _focusData[5] = focusData;
}
- public void FocusAnimation(View parentItem, Vector3 itemSize, float duration, EdenEffectDirection direction)
+ public void FocusAnimation(View parentItem, Vector3 itemSize, float duration, FocusEffectDirection direction)
{
var itemWidth = itemSize.x + _frameThickness / 2;
var itemHeight = itemSize.y + _frameThickness / 3;
}
_animation = new Animation(duration);
- if (direction == EdenEffectDirection.BottomToTop)
+ if (direction == FocusEffectDirection.BottomToTop)
{
- _edenFocusData[0].ParentOrigin = NDalic.ParentOriginBottomCenter;
- _edenFocusData[1].ParentOrigin = NDalic.ParentOriginBottomCenter;
- _edenFocusData[2].ParentOrigin = NDalic.ParentOriginBottomLeft;
- _edenFocusData[3].ParentOrigin = NDalic.ParentOriginBottomRight;
- _edenFocusData[4].ParentOrigin = NDalic.ParentOriginTopLeft;
- _edenFocusData[5].ParentOrigin = NDalic.ParentOriginTopRight;
+ _focusData[0].ParentOrigin = NDalic.ParentOriginBottomCenter;
+ _focusData[1].ParentOrigin = NDalic.ParentOriginBottomCenter;
+ _focusData[2].ParentOrigin = NDalic.ParentOriginBottomLeft;
+ _focusData[3].ParentOrigin = NDalic.ParentOriginBottomRight;
+ _focusData[4].ParentOrigin = NDalic.ParentOriginTopLeft;
+ _focusData[5].ParentOrigin = NDalic.ParentOriginTopRight;
}
else
{
- _edenFocusData[0].ParentOrigin = NDalic.ParentOriginTopCenter;
- _edenFocusData[1].ParentOrigin = NDalic.ParentOriginTopCenter;
- _edenFocusData[2].ParentOrigin = NDalic.ParentOriginBottomLeft;
- _edenFocusData[3].ParentOrigin = NDalic.ParentOriginBottomRight;
- _edenFocusData[4].ParentOrigin = NDalic.ParentOriginBottomLeft;
- _edenFocusData[5].ParentOrigin = NDalic.ParentOriginBottomRight;
+ _focusData[0].ParentOrigin = NDalic.ParentOriginTopCenter;
+ _focusData[1].ParentOrigin = NDalic.ParentOriginTopCenter;
+ _focusData[2].ParentOrigin = NDalic.ParentOriginBottomLeft;
+ _focusData[3].ParentOrigin = NDalic.ParentOriginBottomRight;
+ _focusData[4].ParentOrigin = NDalic.ParentOriginBottomLeft;
+ _focusData[5].ParentOrigin = NDalic.ParentOriginBottomRight;
}
- foreach (EdenData edenData in _edenFocusData)
+ foreach (FocusData focusData in _focusData)
{
- var currentParent = edenData.ImageItem.GetParent();
+ var currentParent = focusData.ImageItem.GetParent();
// first parent the controls
if (parentItem != currentParent)
{
- parentItem.Add(edenData.ImageItem);
+ parentItem.Add(focusData.ImageItem);
}
- edenData.ImageItem.Size = new Vector3(100.0f,100.0f, 0.0f);
- parentItem.Add(edenData.ImageItem);
+ focusData.ImageItem.Size = new Vector3(100.0f,100.0f, 0.0f);
+ parentItem.Add(focusData.ImageItem);
- Vector3 targetSize = edenData.TargetSize;
- Vector3 initSize = edenData.InitSize;
+ Vector3 targetSize = focusData.TargetSize;
+ Vector3 initSize = focusData.InitSize;
- if (edenData.EdenDirection == EdenData.Direction.Horizontal)
+ if (focusData.FocusDirection == FocusData.Direction.Horizontal)
{
// adjust the width to match the parent
targetSize.x = itemWidth;
}
// half the size for the top frame as we come out from both left / right sides
- if (edenData.Name == "top-right" || edenData.Name == "top-left")
+ if (focusData.Name == "top-right" || focusData.Name == "top-left")
{
targetSize.x = itemWidth - _frameThickness;
}
KeyFrames keyFrames = new KeyFrames();
keyFrames.Add(0.0f, new Property.Value(initSize));
- keyFrames.Add(edenData.KeyFrameStart, new Property.Value(initSize));
- keyFrames.Add(edenData.KeyFrameEnd, new Property.Value(targetSize));
+ keyFrames.Add(focusData.KeyFrameStart, new Property.Value(initSize));
+ keyFrames.Add(focusData.KeyFrameEnd, new Property.Value(targetSize));
// for halo add an extra keyframe to shrink it ( in 20% of time after it has finished)
- if (edenData.Name =="halo")
+ if (focusData.Name =="halo")
{
- keyFrames.Add(edenData.KeyFrameEnd + 0.2f, new Property.Value(initSize));
+ keyFrames.Add(focusData.KeyFrameEnd + 0.2f, new Property.Value(initSize));
}
- _animation.AnimateBetween(new Property(edenData.ImageItem, Actor.Property.SIZE), keyFrames,
+ _animation.AnimateBetween(new Property(focusData.ImageItem, Actor.Property.SIZE), keyFrames,
new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE));
// Simulate the vertical frame growing from the top.
// Vertical items are anchored to the bottom of the parent... so when they grow
// we need to move them to the middle of the parent ( otherwise they stick out the bottom)
- if (edenData.EdenDirection == EdenData.Direction.Vertical)
+ if (focusData.FocusDirection == FocusData.Direction.Vertical)
{
//animate position as well so it looks like animation is coming from bottom
KeyFrames keyFramesV = new KeyFrames();
- if (direction == EdenEffectDirection.BottomToTop)
+ if (direction == FocusEffectDirection.BottomToTop)
{
keyFramesV.Add(0.0f, new Property.Value(0.0f));
- keyFramesV.Add(edenData.KeyFrameStart, new Property.Value(0.0f));
+ keyFramesV.Add(focusData.KeyFrameStart, new Property.Value(0.0f));
}
else
{
keyFramesV.Add(0.0f, new Property.Value(-itemHeight));
- keyFramesV.Add(edenData.KeyFrameStart, new Property.Value(-itemHeight));
+ keyFramesV.Add(focusData.KeyFrameStart, new Property.Value(-itemHeight));
}
- keyFramesV.Add(edenData.KeyFrameEnd, new Property.Value(-itemHeight / 2)); // animate to halfway up the control
+ keyFramesV.Add(focusData.KeyFrameEnd, new Property.Value(-itemHeight / 2)); // animate to halfway up the control
- _animation.AnimateBetween(new Property(edenData.ImageItem, Actor.Property.POSITION_Y), keyFramesV,
+ _animation.AnimateBetween(new Property(focusData.ImageItem, Actor.Property.POSITION_Y), keyFramesV,
new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE));
}
// Simulate the top frame growing from the sides.
- if (edenData.Name == "top-left")
+ if (focusData.Name == "top-left")
{
KeyFrames keyFramesTL = new KeyFrames();
keyFramesTL.Add(0.0f, new Property.Value(0.0f));
- keyFramesTL.Add(edenData.KeyFrameStart, new Property.Value(0.0f));
- keyFramesTL.Add(edenData.KeyFrameEnd, new Property.Value(itemWidth / 2)); // animate to halfway up the control
+ keyFramesTL.Add(focusData.KeyFrameStart, new Property.Value(0.0f));
+ keyFramesTL.Add(focusData.KeyFrameEnd, new Property.Value(itemWidth / 2)); // animate to halfway up the control
// grow these from the left or right
- _animation.AnimateBetween(new Property(edenData.ImageItem, Actor.Property.POSITION_X), keyFramesTL,
+ _animation.AnimateBetween(new Property(focusData.ImageItem, Actor.Property.POSITION_X), keyFramesTL,
new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE));
}
- if (edenData.Name == "top-right")
+ if (focusData.Name == "top-right")
{
KeyFrames keyFramesTR = new KeyFrames();
keyFramesTR.Add(0.0f, new Property.Value(0.0f));
- keyFramesTR.Add(edenData.KeyFrameStart, new Property.Value(0.0f));
- keyFramesTR.Add(edenData.KeyFrameEnd, new Property.Value(-itemWidth / 2)); // animate to halfway up the control
+ keyFramesTR.Add(focusData.KeyFrameStart, new Property.Value(0.0f));
+ keyFramesTR.Add(focusData.KeyFrameEnd, new Property.Value(-itemWidth / 2)); // animate to halfway up the control
// grow these from the left or right
- _animation.AnimateBetween(new Property(edenData.ImageItem, Actor.Property.POSITION_X), keyFramesTR,
+ _animation.AnimateBetween(new Property(focusData.ImageItem, Actor.Property.POSITION_X), keyFramesTR,
new AlphaFunction(AlphaFunction.BuiltinFunction.EASE_OUT_SINE));
}
private void OnAnimationFinished(object source, Animation.FinishedEventArgs e)
{
- foreach (EdenData edenData in _edenFocusData)
+ foreach (FocusData focusData in _focusData)
{
- var currentParent = edenData.ImageItem.GetParent();
+ var currentParent = focusData.ImageItem.GetParent();
if (currentParent)
{
- currentParent.Remove(edenData.ImageItem);
+ currentParent.Remove(focusData.ImageItem);
}
}
}
namespace FirstScreen
{
- public enum EdenEffectDirection
+ public enum FocusEffectDirection
{
TopToBottom,
BottomToTop
};
- public interface IEdenEffect
+ public interface IFocusEffect
{
- void FocusAnimation(View parentItem, Vector3 itemSize, float duration, EdenEffectDirection direction);
+ void FocusAnimation(View parentItem, Vector3 itemSize, float duration, FocusEffectDirection direction);
}
}
}
// Perform EddenEffect animation on Focused Item specified
- public void FocusAnimation(EdenEffect edenEffect, EdenEffectDirection direction)
+ public void FocusAnimation(FocusEffect focusEffect, FocusEffectDirection direction)
{
- edenEffect.FocusAnimation(_itemList[_focusedItem], _itemSize, 1.0f, direction);
+ focusEffect.FocusAnimation(_itemList[_focusedItem], _itemSize, 1.0f, direction);
}
public void SetFocused(bool focused)
_animation = new Animation(1.0f); // 1 second of duration
- _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 180.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.0f, 0.5f));
- _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 0.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.5f, 0.5f));
+ _animation.AnimateTo(_text, Animation.ORIENTATION, new Quaternion( new Radian( new Degree( 180.0f ) ), Vector3.XAXIS ), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.0f, 0.5f));
+
+ _animation.AnimateTo(_text, Animation.ORIENTATION, new Quaternion( new Radian( new Degree( 0.0f ) ), Vector3.XAXIS ), new AlphaFunction(AlphaFunction.BuiltinFunction.LINEAR), new TimePeriod(0.5f, 0.5f));
// Connect the signal callback for animaiton finished signal
_animation.Finished += AnimationFinished;