+ KeyboardFocusManager::Get().FocusedActorEnterKeySignal().Connect( this, &DaliTableView::OnFocusedActorActivated );
+ AccessibilityManager::Get().FocusedActorActivatedSignal().Connect( this, &DaliTableView::OnFocusedActorActivated );
+
+ mFocusContainer = ImageView::New( TILE_FOCUS );
+ mFocusContainer.SetParentOrigin( ParentOrigin::CENTER );
+ mFocusContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mFocusContainer.SetInheritScale( false );
+ mFocusContainer.SetColorMode( USE_OWN_COLOR );
+ mFocusContainer.SetName( "focusActor" );
+ mFocusContainer.OnStageSignal().Connect( this, &DaliTableView::OnStageConnect );
+
+ mFocusInner = ImageView::New( TILE_FOCUS );
+ mFocusInner.SetParentOrigin( ParentOrigin::CENTER );
+ mFocusInner.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mFocusInner.SetInheritScale( false );
+ mFocusInner.SetColorMode( USE_OWN_COLOR );
+ mFocusInner.SetName( "focusActor" );
+ mFocusInner.OnStageSignal().Connect( this, &DaliTableView::OnStageConnect );
+ mFocusContainer.Add( mFocusInner );
+
+ // Setup the keyboard focus highlight.
+ Vector3 startScale( KEYBOARD_FOCUS_START_SCALE, KEYBOARD_FOCUS_START_SCALE, KEYBOARD_FOCUS_START_SCALE );
+ Vector3 endScale( KEYBOARD_FOCUS_END_SCALE, KEYBOARD_FOCUS_END_SCALE, KEYBOARD_FOCUS_END_SCALE );
+ mFocusAnimation = Animation::New( KEYBOARD_FOCUS_ANIMATION_DURATION );
+ mFocusAnimationInner = Animation::New( KEYBOARD_FOCUS_ANIMATION_DURATION );
+
+ mFocusContainer.SetScale( startScale );
+ mFocusInner.SetScale( startScale );
+ mFocusContainer.SetOpacity( 0.0f );
+ mFocusInner.SetOpacity( 0.0f );
+ const float initialFadeDuration = KEYBOARD_FOCUS_ANIMATION_DURATION * KEYBOARD_FOCUS_INITIAL_FADE_PERCENTAGE;
+
+ mFocusAnimation.AnimateTo( Property( mFocusContainer, Actor::Property::COLOR_ALPHA ), KEYBOARD_FOCUS_END_ALPHA, AlphaFunction::LINEAR, TimePeriod( 0.0f, initialFadeDuration ) );
+ mFocusAnimation.AnimateTo( Property( mFocusContainer, Actor::Property::SCALE ), endScale, AlphaFunction::LINEAR, TimePeriod( initialFadeDuration, KEYBOARD_FOCUS_ANIMATION_DURATION - initialFadeDuration ) );
+ mFocusAnimation.AnimateTo( Property( mFocusContainer, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunction::LINEAR, TimePeriod( initialFadeDuration, KEYBOARD_FOCUS_ANIMATION_DURATION - initialFadeDuration ) );
+
+ mFocusAnimationInner.AnimateTo( Property( mFocusInner, Actor::Property::COLOR_ALPHA ), KEYBOARD_FOCUS_END_ALPHA, AlphaFunction::LINEAR, TimePeriod( 0.0f, initialFadeDuration ) );
+ mFocusAnimationInner.AnimateTo( Property( mFocusInner, Actor::Property::SCALE ), endScale, AlphaFunction::LINEAR, TimePeriod( initialFadeDuration, KEYBOARD_FOCUS_ANIMATION_DURATION - initialFadeDuration ) );
+ mFocusAnimationInner.AnimateTo( Property( mFocusInner, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunction::LINEAR, TimePeriod( initialFadeDuration, KEYBOARD_FOCUS_ANIMATION_DURATION - initialFadeDuration ) );
+
+ // Play the animation on the 1st glow object.
+ mFocusAnimation.SetLooping( true );
+ mFocusAnimation.Play();
+ // Stagger the animation on the 2st glow object half way through.
+ mFocusAnimationInner.SetLooping( true );
+ mFocusAnimationInner.PlayFrom( KEYBOARD_FOCUS_ANIMATION_DURATION / 2.0f );
+
+ KeyboardFocusManager::Get().SetFocusIndicatorActor( mFocusContainer );