×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    159

    please help,how to use swipe gesture in lwuit for S40

    hello,I am working on S40 using sdk2.0 and lwuit 1.5.so now my requirment is implement swipe gesture on a perticular component.so please send me any exmaple of swipe gesture i am sending snapshoot on which i am to apply gesture http://imgur.com/ba8UoMA . I want to apply on textarea .it shoutd move form left to right or right to left on tuch.i am also sending snapshot as i want http://imgur.com/iBNspLW

  2. #2
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    271

    Re: please help,how to use swipe gesture in lwuit for S40

    I would suggest you to use a Horizontal List with Fixed Centre. Implement a renderer by overriding textArea. The List Model should contain the text(s) of the text area.

  3. #3
    Registered User
    Join Date
    May 2009
    Location
    Guatemala
    Posts
    186

    Re: please help,how to use swipe gesture in lwuit for S40

    If you still want to handle the gestures yourself, basically you would need to create your own GestureHandler and assign it to your form. In your GestureHandler implementation you would need to write the necessary code to handle the "flick" gesture.

    There is an example here: LWUIT Developer's Library: Touch gestures
    -CarlosDL

  4. #4
    Registered User
    Join Date
    May 2013
    Posts
    159

    Re: please help,how to use swipe gesture in lwuit for S40

    please tell me how we can implement mehods on gesture funtion like i want to use flick gesture on any component so how can it is use suggest me please i have no idea about it

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,699

    Re: please help,how to use swipe gesture in lwuit for S40

    You may want to consider reading the documentation linked by Cadlg, and then check GestureHandler, http://developer.nokia.com/Resources...reHandler.html, you will see that it has setFormGestureHandler (as used in the snippet) and setGlobalGestureHandler.
    However what you have is the event, http://developer.nokia.com/Resources...tureEvent.html, which provides getStartX/Y, and that position is what you can use to pick components.

  6. #6
    Registered User
    Join Date
    May 2013
    Posts
    159

    Re: please help,how to use swipe gesture in lwuit for S40

    please guide me that as i mention that i am using lwuit 1.5 so in this jar so i cant improt
    com.nokia.lwuit.GestureHandler; class so please tell me what should i do i am new and guide me for that can i apply new theme with help of resource editor in S40_with_theme so please guide me
    Last edited by vikranttanwar@; 2013-08-08 at 13:00.

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,699

    Re: please help,how to use swipe gesture in lwuit for S40

    You can try extracting the necessary API-s from the Nokia code: http://projects.developer.nokia.com/LWUIT_for_Series_40, as long as it does not tap into native calls the chances are good.

  8. #8
    Registered User
    Join Date
    May 2013
    Posts
    159

    Re: please help,how to use swipe gesture in lwuit for S40

    thnnx i made all my ui in lwuit 1.5. Now i want to use gestures . Are gestures supported in lwuit 1.5? Also please tell me can we apply our own themes in s40 themes jar since it automatically pics an inbuilt theme?
    please guide me also for it. And please tell me all the differences between lwuit1.5 and s40_with_theme
    thanks

  9. #9
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    686

    Re: please help,how to use swipe gesture in lwuit for S40

    If your using standard LWUIT 1.5 and not Nokia lwuit s40 version then you have to use the Nokia gestures classes
    import com.nokia.mid.ui.gestures.GestureEvent;
    import com.nokia.mid.ui.gestures.GestureInteractiveZone;
    import com.nokia.mid.ui.gestures.GestureListener;
    import com.nokia.mid.ui.gestures.GestureRegistrationManager;

    and then register the gesture you want like this
    GestureInteractiveZone gest = new GestureInteractiveZone( GestureInteractiveZone.GESTURE_FLICK );
    GestureRegistrationManager.register((Canvas)(Display.getDisplay(MIDlet).getCurrent()), gest);
    GestureRegistrationManager.setListener((Canvas)(Display.getDisplay(MIDlet).getCurrent()), this);

    Notice that the Display class i'm using here is the LCDUI display and i'm only using it to get the lwuit canvas class implementation which should be the current one on the display.

  10. #10
    Registered User
    Join Date
    May 2013
    Posts
    159

    Re: please help,how to use swipe gesture in lwuit for S40

    thanx shai .but i dont how to implement GestureRegistrationManager class .please give me link an smple exmale for only lwuit1.5.

  11. #11
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    686

    Re: please help,how to use swipe gesture in lwuit for S40

    All you have to do is using the code i gave you below, the imports goes in the top of the class source page.
    You dont have to "import" anything to the project as long as the SDK your testing on is Nokia sdk 2.0 or Asha sdk 1.0

  12. #12
    Registered User
    Join Date
    May 2013
    Posts
    159

    Re: please help,how to use swipe gesture in lwuit for S40

    thanx i will try my best

  13. #13
    Registered User
    Join Date
    May 2013
    Posts
    159

    Re: please help,how to use swipe gesture in lwuit for S40

    @Shai,when i use these
    GestureInteractiveZone gest = new GestureInteractiveZone( GestureInteractiveZone.GESTURE_FLICK );
    GestureRegistrationManager.register((Canvas)(Display.getDisplay(MIDlet).getCurrent()), gest);
    GestureRegistrationManager.setListener((Canvas)(Display.getDisplay(MIDlet).getCurrent()), this)
    Then during register the Gestureinterective Zone control throw an exception.i pass container object as first parameter .my code is given below.
    Code:
    Display.init(this);
    		//Display.getInstance().setForceFullScreen(true);
    		Form form=new Form();
    		form.setScrollable(false);
    		form.getUnselectedStyle().setBgColor(10175989);
    		form.setLayout(new BorderLayout());
    		Container northcon=new Container();
    		int northcomponentHT=form.getPreferredH()*20/100;
    		northcon.setPreferredH(northcomponentHT);
    		Label northlab=new Label("NORTH");
    		northcon.addComponent(northlab);
    		form.addComponent(BorderLayout.NORTH,northcon);
    		Container centercon=new Container();
    		TextArea textarea=new TextArea();
    		int centercomponentHT=form.getPreferredH()*60/100;
    		textarea.setPreferredH(centercomponentHT);
    		textarea.setPreferredW(form.getPreferredW());
    		textarea.setScrollVisible(true);
    		textarea.setEditable(false);
    		textarea.setGrowByContent(true);
    		textarea.setRows(50);
    		
    		//centercon.setScrollable(true);
    		centercon.addComponent(textarea);
    		
    		form.addComponent(BorderLayout.CENTER,centercon);
    		Container southcon=new Container();
    		int southcomponentHT=form.getPreferredH()*20/100;
    		southcon.setPreferredH(southcomponentHT);
    		Label southlab=new Label("SOUTH");
    		southcon.addComponent(southlab);
    		form.addComponent(BorderLayout.SOUTH,southcon);
    		GestureInteractiveZone gest = new GestureInteractiveZone( GestureInteractiveZone.GESTURE_FLICK);
    		GestureRegistrationManager.register(centercon, gest);
    		
    		
    		
    		form.show();
    please help me
    Last edited by vikranttanwar@; 2013-10-26 at 06:32. Reason: correction

Similar Threads

  1. Replies: 3
    Last Post: 2012-10-07, 21:04
  2. Replies: 6
    Last Post: 2012-04-12, 16:37
  3. swipe gesture for tabwidget
    By sindhuks in forum [Archived] Beginning Qt
    Replies: 1
    Last Post: 2011-02-05, 10:04

Posting Permissions

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