×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    2

    LWUIT: softkeys blink after adding/removing actions dynamically

    Hello,

    could you please help me to resolve the issue we faced using LWUIT on full-touch devices.

    Sometimes I need to update command actions dynamically after form is shown. For examle, if some screen element is in focus I need to add/remove extra options in menu.

    Adding/removing commands cources softkeys (Icon1 and Icon2) blink. Is it a known issue? How can I resolve it?

    Please find code example below:
    There is a from with two buttons, first button - append new action command; second button - remove action command.

    Code:
    import com.sun.lwuit.Button;
    import com.sun.lwuit.Command;
    import com.sun.lwuit.Form;
    import com.sun.lwuit.events.ActionEvent;
    import com.sun.lwuit.events.ActionListener;
    
    
    public class MForm extends Form{
    	private static final int START_IND = 1;
    	private static final int END_IND = 12; 
    	private int counter = START_IND;
    	public MForm() {
    		initComponents();
    		updCommands();
    		addCommandListener(new ActionListener() {
    			public void actionPerformed(ActionEvent arg0) {
    				Command cmd = arg0.getCommand();
    				if(cmd != null){
    					out("command action: "+cmd);
    				}
    			}
    		});
    		show();
    	}
    	private void initComponents(){
    		Button btn = new Button("add cmd");
    		btn.addActionListener(new ActionListener() {
    			public void actionPerformed(ActionEvent arg0) {
    				updCommands();
    			}
    		});
    		addComponent(btn);
    		
    		Button btn1 = new Button("Del cmd");
    		btn1.addActionListener(new ActionListener() {
    			public void actionPerformed(ActionEvent arg0) {
    				delCmd();
    			}
    		});
    		addComponent(btn1);
    	}
    	
    	
    	private void initCommands(){
    		counter = START_IND;
    		for(int i = 0; i < counter;++i){
    			addCommand(new Command(""+i));
    		}
    		
    		out("initCommands(): "+getCommandCount());
    	}
    	private void updCommands(){
    		if(counter <= END_IND){
    			++counter;
    			addCommand(new Command(""+getCommandCount()));
    			out("added: "+getCommandCount());
    		} else {
    			removeAllCommands();
    			initCommands();
    			out("removing all");
    		}
    		out("updCommands(): "+getCommandCount());
    	}
    	private void delCmd(){
    		removeCommand(getCommand(getCommandCount()-1));
    		counter--;
    		out("delCmd: "+ getCommandCount());
    	}
    	private void out(String str) {
    		System.out.println("LOG:" + str);
    	}
    }

  2. #2
    Nokia Developer Expert
    Join Date
    May 2012
    Location
    Espoo
    Posts
    224

    Re: LWUIT: softkeys blink after adding/removing actions dynamically

    Hi mkolegan,

    Seems you already filed a ticket in LWUIT project. I informed about this issue to RnD team. Thanks for reporting.

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    2

    Re: LWUIT: softkeys blink after adding/removing actions dynamically

    Hi! Thank you for your help.
    Additional info that could be important: this issue is also reproduced if I move from one screen to another. And it is also reproduced in LWUIT Demo midlet when I move from one screen to another.

Similar Threads

  1. Softkeys chages on Listbox Dynamically
    By sriramadasu in forum Symbian
    Replies: 5
    Last Post: 2009-01-12, 11:32
  2. S60V3 Dynamically adding and removing fonts
    By Starchaser in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-01-08, 20:46
  3. Change the text of softkeys at dynamically
    By jainybhai in forum Symbian
    Replies: 1
    Last Post: 2005-08-26, 03:47
  4. Changing the softkeys of WaitDialog dynamically
    By profoundwhispers in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-08-11, 04:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×