238 void CXnViewAdapter::ConstructL() |
237 void CXnViewAdapter::ConstructL() |
239 { |
238 { |
240 BaseConstructL(); |
239 BaseConstructL(); |
241 |
240 |
242 iTimer = CPeriodic::NewL( CActive::EPriorityIdle ); |
241 iTimer = CPeriodic::NewL( CActive::EPriorityIdle ); |
243 |
242 |
244 iFlags.Set( EIsFirstActivation ); |
|
245 |
|
246 // Base class CAknViewAppUi takes ownership of iViewAdapter |
243 // Base class CAknViewAppUi takes ownership of iViewAdapter |
247 iAppUiAdapter.AddViewL( this ); |
244 iAppUiAdapter.AddViewL( this ); |
248 iAppUiAdapter.SetDefaultViewL( *this ); |
245 iAppUiAdapter.SetDefaultViewL( *this ); |
249 |
246 |
250 iBgManager = CXnBackgroundManager::NewL( iAppUiAdapter.ViewManager(), |
247 iBgManager = CXnBackgroundManager::NewL( iAppUiAdapter.ViewManager(), |
409 { |
406 { |
410 sp->EnableTransparent( ETrue ); |
407 sp->EnableTransparent( ETrue ); |
411 sp->DrawNow(); |
408 sp->DrawNow(); |
412 } |
409 } |
413 |
410 |
414 if ( iFlags.IsSet( EIsFirstActivation ) ) |
411 // Set the active container |
415 { |
412 if ( aCustomMessage == KActivateDefaultView ) |
416 // Set the active container |
413 { |
417 ActivateContainerL( iAppUiAdapter.ViewManager().ActiveViewData() ); |
414 __PRINTS( "*** CXnViewAdapter::DoActivateL - activating default container" ); |
418 |
415 |
419 __TICK( "CXnViewAdapter::DoActivateL - Calling UiActivated" ); |
416 ActivateDefaultContainerL(); |
420 __TIME_MARK( time2 ); |
417 |
421 |
418 iTimer->Cancel(); |
422 iFlags.Clear( EIsFirstActivation ); |
419 iTimer->Start( 1000, 1000, TCallBack( TimerCallback, this ) ); |
423 |
|
424 iAppUiAdapter.UiActivated(); |
|
425 |
|
426 __TIME_ENDMARK( "CXnViewAdapter::DoActivateL - Calling UiActivated", time ); |
|
427 } |
420 } |
428 else |
421 else |
429 { |
422 { |
430 // Set the active container |
423 __PRINTS( "*** CXnViewAdapter::DoActivateL - activating container" ); |
431 if ( aCustomMessage == KActivateDefaultView ) |
424 |
432 { |
425 ActivateContainerL( viewData ); |
433 __PRINTS( "*** CXnViewAdapter::DoActivateL - activating default container" ); |
|
434 |
|
435 ActivateDefaultContainerL(); |
|
436 |
|
437 iTimer->Cancel(); |
|
438 iTimer->Start( 1000, 1000, TCallBack( TimerCallback, this ) ); |
|
439 } |
|
440 else |
|
441 { |
|
442 __PRINTS( "*** CXnViewAdapter::DoActivateL - activating container" ); |
|
443 |
|
444 ActivateContainerL( viewData ); |
|
445 } |
|
446 } |
426 } |
447 |
427 |
448 __TIME_ENDMARK( "CXnViewAdapter::DoActivateL, done", time ); |
428 __TIME_ENDMARK( "CXnViewAdapter::DoActivateL, done", time ); |
449 |
429 |
450 __TICK( "CXnViewAdapter::DoActivateL - HS UI Ready" ); |
430 __TICK( "CXnViewAdapter::DoActivateL - HS UI Ready" ); |
504 // ----------------------------------------------------------------------------- |
484 // ----------------------------------------------------------------------------- |
505 // |
485 // |
506 void CXnViewAdapter::ActivateContainerL( CXnViewData& aContainer, |
486 void CXnViewAdapter::ActivateContainerL( CXnViewData& aContainer, |
507 TBool aEnterEditState ) |
487 TBool aEnterEditState ) |
508 { |
488 { |
509 if ( !iAppUiAdapter.ViewManager().UiStartupPhaseAllDone() ) |
|
510 { |
|
511 return; |
|
512 } |
|
513 |
|
514 if ( iContainer == &aContainer || iFlags.IsSet( EIsDestructionRunning ) ) |
489 if ( iContainer == &aContainer || iFlags.IsSet( EIsDestructionRunning ) ) |
515 { |
490 { |
516 return; |
491 return; |
517 } |
492 } |
518 |
493 |