Nov 23

S60 3rd edition phones comes with different screen size (unlike thre previous editions that has fixed size screen or has a compatibility screen mode), so you must make your code resizeable, and some series 60 phones can have their orientation changed (by twisting the phone).

In your AppUI class, add HandleResourceChangeL method:

void CS60BibleAppUi::HandleResourceChangeL(TInt aType)
{
     CAknAppUi::HandleResourceChangeL( aType );
     if ( aType == KEikDynamicLayoutVariantSwitch )
     {
         /*call sizechanged on all views*/
         iSettingView->SizeChanged();
         iKeyBindingView->SizeChanged();
     }
}


If the view displays a list, the SizeChanged method should adjust the list size:


void CKeyBindingView::SizeChanged()
{
if (iSettingList) {
iSettingList->SetRect(ClientRect());
}
}

The Container also needs to know about the resource change (changes in screen size/orientation):

#ifdef __SERIES60_30__
void CS60BibleMainContainer::HandleResourceChange(TInt aType)
{
CCoeControl::HandleResourceChange(aType);
if ( aType == KEikDynamicLayoutVariantSwitch ) {
TRect rect;
/*if your apps support full screen, then use EApplicationWindow else just use EMainPane*/
if (iFullScreen) {
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow , rect);
} else {
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
}
/*In app case, the model needs to be updated*/
iDocument->Model()->SetArea(rect);
iDocument->Model()->ClearVerseList();
iDocument->Model()->FillVerse();
/*Set rectangle*/
SetRect(rect);
}
}
#endif

Done, your app should now be able to resize properly. If you use your own drawing routine, then you must adjust your code (dont use absolute coordinates). You can also use new S60v3 features, such as SVG, but it will make your code nor portable to the previous Symbian version.

Topics: General |

Comments