You.i Engine
CYIScreenTransition Class Reference

Detailed Description

Performs animated transitions from one application screen to another.

When Start(CYIAbstractScreenViewController *pFromScreen, CYIAbstractScreenViewController *pToScreen) is called from the application:

  1. pFromScreen will animate out as CYIAbstractScreenViewController::Unload() is executed.
  2. An activity indicator will be shown if it was provided in the constructor.
  3. pToScreen will animate in as CYIAbstractScreenViewController::Load() is executed.

Overloading this class provides the ability for the client application to perform other actions when the screen transition starts and ends and when the pFromScreen unload animation is complete.

Allows connection of signals to a listener in order for it to be notified when the screen transition starts and ends, and when the unload animation ends and the load animation starts.

See also

#include <screen/YiScreenTransition.h>

Inheritance diagram for CYIScreenTransition:

Public Member Functions

 CYIScreenTransition (CYIActivityIndicatorViewController *pActivityIndicator, int32_t minActivityIndicatorMs)
virtual ~CYIScreenTransition ()
void Start (CYIAbstractScreenViewController *pFromScreen, CYIAbstractScreenViewController *pToScreen)
void Stop ()
void UnblockLoadingAnimation ()
virtual bool AreUserEventsEnabled ()
void EnableUserEvents ()
void DisableUserEvents ()
virtual bool OnFrameTimeUpdated (std::chrono::microseconds frameTime) override
virtual bool GetDisablesInput () override
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 CYISignalHandler (const CYISignalHandler &rSignalHandler)
virtual ~CYISignalHandler ()
CYISignalHandleroperator= (const CYISignalHandler &rSignalHandler)
void MoveToThread (CYIThread *pThread)
 This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More...
CYIThreadHandle GetThreadAffinity () const
void SetThreadAffinity (const CYIThreadHandle &rThreadAffinity)
virtual bool IsConnected () const
virtual bool IsConnected (const CYISignalBase &rSignal) const
void Disconnect (CYISignalBase &rSignal)
void DisconnectFromAllSignals ()
- Public Member Functions inherited from CYIThread::Listener
 Listener ()
virtual ~Listener ()
virtual void OnThreadStarted (CYIThread *)
virtual void OnThreadTerminated (CYIThread *)
virtual void OnThreadFinished (CYIThread *)
- Public Member Functions inherited from CYITime::UpdateListener
 UpdateListener ()
virtual ~UpdateListener ()

Public Attributes

CYISignal UnloadAnimationCompleted
CYISignal LoadAnimationStarted
CYISignal ScreenTransitionCompleted
CYISignal ScreenTransitionStopped

Protected Member Functions

virtual void OnScreenTransitionStarted ()
virtual void OnScreenTransitionEnded ()
virtual void OnUnloadAnimationComplete ()
CYIAbstractScreenViewControllerGetFromScreen () const
CYIAbstractScreenViewControllerGetToScreen () const

Additional Inherited Members

- Static Public Attributes inherited from CYITime::UpdateListener
static const uint32_t DEFAULT_UPDATE_PRIORITY = 0

Constructor & Destructor Documentation

◆ CYIScreenTransition()

CYIScreenTransition::CYIScreenTransition ( CYIActivityIndicatorViewController pActivityIndicator,
int32_t  minActivityIndicatorMs 

The pActivityIndicator will run for minActivityIndicatorMs milliseconds.

If no activity indicator is needed, call CYIScreenTransition(nullptr, 0).

◆ ~CYIScreenTransition()

virtual CYIScreenTransition::~CYIScreenTransition ( )

Member Function Documentation

◆ AreUserEventsEnabled()

virtual bool CYIScreenTransition::AreUserEventsEnabled ( )

Returns true if action, key, and trackpad events have been enabled for this screen transition. Default is false.

See also

◆ DisableUserEvents()

void CYIScreenTransition::DisableUserEvents ( )

Action, key, and trackpad events will be ignored during screen transition. This is the default behaviour.

See also

◆ EnableUserEvents()

void CYIScreenTransition::EnableUserEvents ( )

Action, key, and trackpad events will be processed during screen transition. Default value is disabled.

See also

◆ GetDisablesInput()

virtual bool CYIScreenTransition::GetDisablesInput ( )

Override and return true if this listener blocks user input. The default implementation returns false.

Reimplemented from CYITime::UpdateListener.

◆ GetFromScreen()

CYIAbstractScreenViewController* CYIScreenTransition::GetFromScreen ( ) const

Returns pFromScreen that was specified in Start().

◆ GetToScreen()

CYIAbstractScreenViewController* CYIScreenTransition::GetToScreen ( ) const

Returns pToScreen that was specified in Start().

◆ OnFrameTimeUpdated()

virtual bool CYIScreenTransition::OnFrameTimeUpdated ( std::chrono::microseconds  frameTime)

Implement this function to receive frame time update notifications. Return true if you want to keep receiving notifications. Return false if you want the listener to unregister.

Implements CYITime::UpdateListener.

◆ OnScreenTransitionEnded()

virtual void CYIScreenTransition::OnScreenTransitionEnded ( )

Called when the screen transition has been ended by Stop().

◆ OnScreenTransitionStarted()

virtual void CYIScreenTransition::OnScreenTransitionStarted ( )

Called when the screen transition has been initiated by Start().

◆ OnUnloadAnimationComplete()

virtual void CYIScreenTransition::OnUnloadAnimationComplete ( )

Called when the unload animation has completed.

The base class method must be called when this is overridden.

◆ Start()

void CYIScreenTransition::Start ( CYIAbstractScreenViewController pFromScreen,
CYIAbstractScreenViewController pToScreen 

Initiates the unloading animation on the pFromScreen.

When this animation completes, the loading animation on the pToScreen will start.

If pActivityIndicator set in the constructor is not nullptr, the activity indicator animation will start after the pFromScreen unloading animation completes. The indicator will loop for at least minActivityIndicatorMs and will continue looping until UnblockLoadingAnimation() is emitted. Once UnblockLoadingAnimation() is emitted the activity indicator will be dismissed and the load animation for pToScreen will start.

If UnblockLoadingAnimation() is emitted before the unload of pFromScreen completes the activity inidicator will not be shown.

◆ Stop()

void CYIScreenTransition::Stop ( )

Stops the transition. The begin animation will play for pFromScreen specified in Start.

Calling this method before Start() has no effect.
The stop will not occur until after UnloadAnimationCompleted() is emitted.

◆ UnblockLoadingAnimation()

void CYIScreenTransition::UnblockLoadingAnimation ( )

Stops the activity indicator, if provided, and continues to the loading animation of pToScreen specified in Start().

Calling this method before Start() has no effect.
The unblock will not take effect until after UnloadAnimationCompleted() is emitted.

Member Data Documentation

◆ LoadAnimationStarted

CYISignal CYIScreenTransition::LoadAnimationStarted

Emitted immediately before the load animation starts playing for the pToScreen specified in Start().

◆ ScreenTransitionCompleted

CYISignal CYIScreenTransition::ScreenTransitionCompleted

Emitted when the transition to the pToScreen specified in Start() has completed.

◆ ScreenTransitionStopped

CYISignal CYIScreenTransition::ScreenTransitionStopped

Emitted when the transition back to the pFromScreen specified in Start() has completed afer Stop() has been called on an active transition. This signal is emitted instead of ScreenTransitionCompleted().

◆ UnloadAnimationCompleted

CYISignal CYIScreenTransition::UnloadAnimationCompleted

Emitted when the unload animation has finished playing for the pFromScreen specified in Start().

If pFromScreen is nullptr the signal will be emitted in the Start() method.

The documentation for this class was generated from the following file: