Friday, January 11, 2008

Small Status Pane

Symbian S60 status pane occupies one-fifth of the screen, which is a lot of space. Programmer can disable it by one of the following methods:
  1. CCoeControl::SetExtentToWholeScreen() (during construction of the CCoeControl). It expands to full screen, but CBA pane is gone and skin background won't work properly.
  2. CEikStatusPane::MakeVisible(EFalse). It hides the status pane, CBA pane remains but the skin background still won't work properly.

The Menu and Web (application) on S60 3rd phone suggest that there should be a standard API which can reduce the status bar but show necessary or critical information. It took me a while to find something useful:
They are same except different in titles and first lines. Based on their suggestion, the simpliest way to reduce the status pane is:
    StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_SMALL );
If you call CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, Rect(), EFalse) after switching the layout, the skin background should work fine in both portrait and landscape mode. Note that in landscape mode, the status pane is already in minimum size. So, SwitchLayoutL might have no effects for landscape.

However, this resource id will only give a blank status pane. If the signal icon is desired, as it's useful when accessing Internet, use R_AVKON_STATUS_PANE_LAYOUT_SMALL_WITH_SIGNAL_PANE. Check out more in the avkon.rsg.


My app with small status pane. Skin background is working. However, it does not display the app title.

If you want to have the same mane pane as the menu, signal + battery + title, use R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT.

Silent the Keytone

This is a summary of post from Forum Nokia: Turning off key sounds programatically. Code can be added to MyProjectAppUi.cpp.

#include <avkon.rsg>

KeySounds()->PushContextL( R_AVKON_SILENT_SKEY_LIST );

To restore, call KeySounds()->PopContext(). One thing noticed, press LSK hear no keytone. When Options menu is displaying, keytone comes back.

This keytone-silent feature should be useful for games, as players might not want to have keytones during a game play but when normal use of the phone. Pressing the key and hearing the beep-beep-beep-beep is kinda annoying. Of course, the sound engines of game might already prevent the keytone beeping.