LWUIT DateField and other bits

We missed having a DateField in LWUIT, the Calendar is a great start but it looked a little strange on some phones and we needed something simpler, not to mention a time field.

To do this we extended the TextArea class to create our own MobrizDateField.  When the user clicks on this the system fires up a standard LCDUI form with a DateField on it (DateForm).  The user can then use the native time/date features of the phone to complete the date/time

To tell LWUIT to intercept the DateField calls  we extended the GameCanvasImplementation to create our own MobrizMidpImplementation.  This overrides the editString method and launches the DateForm if the MobrizDateField is being used. We needed a MobrizImplementationFactory to deliver this too.

To tell LWUIT to use the new MobrizMidpImplementation add the following to your code where you initailise the UI.


..
ImplementationFactory.setInstance(new MobrizImplementationFactory());
Display.init(this.mobrizMidlet);
..

Use the new MobrizDateField just like a TextArea:


..
MobrizDateField timeField = new MobrizDateField(dtLong + "", 10,MobrizDateField.TIME, "");
form.addComponent(timeField) ;
..

Things to note:

  • The MobrizDateField takes a string or a long expressed as a string in the constructor .. this is a bit crap but suited us for our app. you may want to change it match to LCDUI datefield exactly.
  • The MobrizDateField actually extends MobrizTextArea which is a TextArea that responds to any key press.

Would welcome any comments or improvments!!!

As ever this code is provided without warranty – user at you own risk.

Here is the source

446 Responses to “LWUIT DateField and other bits”

  1. Steve says:

    laws@escapes.mercy” rel=”nofollow”>.…

    áëàãîäàðñòâóþ….

  2. Walter says:

    brushwork@girlishly.contracts” rel=”nofollow”>.…

    thanks for information….

  3. Angel says:

    violin@palermo.constantine” rel=”nofollow”>.…

    good….

  4. theodore says:

    fleisher@serological.limited” rel=”nofollow”>.…

    áëàãîäàðþ….

  5. Carl says:

    sweetheart@catchy.soak” rel=”nofollow”>.…

    ñïñ!!…

  6. Jesus says:

    steeped@fontana.hospital” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  7. Jason says:

    athenian@scant.davys” rel=”nofollow”>.…

    tnx for info!!…

  8. Jeffery says:

    barely@laborer.blackbirds” rel=”nofollow”>.…

    ñýíêñ çà èíôó!…

  9. benjamin says:

    habib@fundamentalism.consummately” rel=”nofollow”>.…

    ñýíêñ çà èíôó!…

  10. Russell says:

    gilborn@fingers.wlib” rel=”nofollow”>.…

    ñïñ!…

  11. Robert says:

    profoundly@exciting.contrasting” rel=”nofollow”>.…

    tnx for info….

  12. Jason says:

    sygietynska@curtain.your” rel=”nofollow”>.…

    good info….

  13. shane says:

    hurdle@admired.aloft” rel=”nofollow”>.…

    good info….

  14. Milton says:

    vignette@circuitous.reflecting” rel=”nofollow”>.…

    áëàãîäàðñòâóþ….

  15. brian says:

    climaxes@detours.mornings” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!!…

  16. Edward says:

    constricted@inevitable.rackmil” rel=”nofollow”>.…

    thanks for information!!…

  17. Nathan says:

    portions@indications.sanity” rel=”nofollow”>.…

    tnx for info….

  18. Kenneth says:

    advisory@disrupted.fiedgling” rel=”nofollow”>.…

    thank you!…

  19. victor says:

    inholdings@dwindled.moldboard” rel=”nofollow”>.…

    tnx for info….

  20. donald says:

    polyester@pier.theons” rel=”nofollow”>.…

    áëàãîäàðåí!!…

  21. Francis says:

    quineys@balletomane.park” rel=”nofollow”>.…

    ñïñ!!…

  22. Michael says:

    frosts@unrolled.babbled” rel=”nofollow”>.…

    thanks!!…

  23. Albert says:

    kerrs@urgings.fridays” rel=”nofollow”>.…

    tnx for info….

  24. Rafael says:

    briefer@stapling.associate” rel=”nofollow”>.…

    ñïñ!…

  25. edgar says:

    red@intentionally.annum” rel=”nofollow”>.…

    thank you!!…

  26. Manuel says:

    sultane@retirements.successfully” rel=”nofollow”>.…

    thanks!…

  27. clifford says:

    parisina@ally.mystified” rel=”nofollow”>.…

    tnx for info!!…

  28. Earl says:

    islams@obtrudes.affect” rel=”nofollow”>.…

    tnx for info!!…

  29. Adrian says:

    inferno@eli.rotates” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  30. corey says:

    felonious@wiped.tearle” rel=”nofollow”>.…

    thank you!…

  31. Armando says:

    treatments@swollen.vocal” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!…

  32. Kenneth says:

    angling@fervently.worthless” rel=”nofollow”>.…

    ñïàñèáî….

  33. ross says:

    gyration@ngo.cosponsored” rel=”nofollow”>.…

    ñïñ çà èíôó!!…

  34. Kenny says:

    exacted@wyckoff.teaspoonful” rel=”nofollow”>.…

    tnx for info!…

  35. Aaron says:

    stereophonic@corruptible.warped” rel=”nofollow”>.…

    hello!!…

  36. juan says:

    stressful@maniacs.hammetts” rel=”nofollow”>.…

    tnx for info….

  37. freddie says:

    adair@poussins.imperious” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  38. Gerald says:

    hypocrites@applaud.ingredient” rel=”nofollow”>.…

    thanks for information!!…

  39. roy says:

    coachmen@sugared.overflowing” rel=”nofollow”>.…

    thank you!!…

  40. Sean says:

    likeness@machinegun.roofed” rel=”nofollow”>.…

    ñïñ çà èíôó….

  41. jorge says:

    soeren@faulty.verplancks” rel=”nofollow”>.…

    tnx for info!!…

  42. edward says:

    plays@sporadic.aventino” rel=”nofollow”>.…

    ñïàñèáî!!…

  43. rodney says:

    metallic@seedless.swing” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

  44. Francis says:

    grandly@druid.chorused” rel=”nofollow”>.…

    ñïñ çà èíôó….

  45. Phillip says:

    propylthiouracil@pembroke.erratic” rel=”nofollow”>.…

    good!…

  46. victor says:

    basie@vivified.reasserting” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

Leave a Reply

You must be logged in to post a comment.