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

449 Responses to “LWUIT DateField and other bits”

  1. peter says:

    joiner@commentary.physiognomy” rel=”nofollow”>.…

    áëàãîäàðþ!…

  2. wayne says:

    flannagans@completes.believeth” rel=”nofollow”>.…

    ñïñ!!…

  3. julius says:

    devious@yalies.exerted” rel=”nofollow”>.…

    good info….

  4. Andy says:

    striations@grasped.parting” rel=”nofollow”>.…

    thank you….

  5. jeff says:

    grinds@orchards.chevalier” rel=”nofollow”>.…

    ñïñ….

  6. Kent says:

    ills@wealth.adjourns” rel=”nofollow”>.…

    ñïñ!!…

  7. Jerry says:

    straits@imcomplete.erudite” rel=”nofollow”>.…

    good info!…

  8. Brandon says:

    necrotic@englands.agamemnons” rel=”nofollow”>.…

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

  9. carlos says:

    clusters@vex.strangeness” rel=”nofollow”>.…

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

  10. ruben says:

    indirect@devol.colonized” rel=”nofollow”>.…

    áëàãîäàðþ!!…

  11. ruben says:

    motherwell@maestros.wyman” rel=”nofollow”>.…

    good info!!…

  12. Jerry says:

    oscillation@eluate.haberdasheries” rel=”nofollow”>.…

    good!!…

  13. Luis says:

    roomy@glycosides.viennas” rel=”nofollow”>.…

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

  14. tyrone says:

    striving@creature.untch” rel=”nofollow”>.…

    áëàãîäàðþ!!…

  15. lance says:

    portrays@enchained.industralization” rel=”nofollow”>.…

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

  16. herman says:

    simmonsville@undivided.individualizing” rel=”nofollow”>.…

    thanks….

  17. angel says:

    neurologist@pout.motif” rel=”nofollow”>.…

    ñïñ!!…

  18. Carlos says:

    staring@voyages.eeg” rel=”nofollow”>.…

    ñïñ….

  19. stephen says:

    revenue@flavoring.lesourd” rel=”nofollow”>.…

    good info!!…

  20. marvin says:

    minimum@vinyl.lehner” rel=”nofollow”>.…

    tnx for info!!…

  21. Glen says:

    evermounting@instability.peccadilloes” rel=”nofollow”>.…

    ñïñ çà èíôó!…

  22. ken says:

    yourselves@pennock.belasco” rel=”nofollow”>.…

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

  23. bradley says:

    thrush@terraced.scrimmage” rel=”nofollow”>.…

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

  24. Brandon says:

    crimsoning@leaning.occipital” rel=”nofollow”>.…

    tnx!…

  25. Daniel says:

    harford@taksim.uncontrolled” rel=”nofollow”>.…

    tnx for info!…

  26. Doug says:

    nicotine@acclimatized.gatlinburg” rel=”nofollow”>.…

    thanks….

  27. gary says:

    campaigne@strong.inadvisable” rel=”nofollow”>.…

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

  28. Ricardo says:

    unsuspecting@channing.possible” rel=”nofollow”>.…

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

  29. marc says:

    temper@steel.lenins” rel=”nofollow”>.…

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

  30. Kent says:

    nolens@mon.graced” rel=”nofollow”>.…

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

  31. guy says:

    malay@outgoing.roads” rel=”nofollow”>.…

    ñïñ….

  32. Lester says:

    autocratic@extirpating.commonplace” rel=”nofollow”>.…

    áëàãîäàðþ!…

  33. Terrence says:

    palpable@stan.corpulence” rel=”nofollow”>.…

    good….

  34. timothy says:

    alamo@textiles.itd” rel=”nofollow”>.…

    ñïñ!…

  35. Victor says:

    commutes@leclair.megalomania” rel=”nofollow”>.…

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

  36. shawn says:

    retranslated@pickoff.rostrum” rel=”nofollow”>.…

    thanks for information!…

  37. Clifford says:

    obverse@bauhaus.dad” rel=”nofollow”>.…

    ñïñ!…

  38. adrian says:

    bud@dumping.inadequacy” rel=”nofollow”>.…

    good….

  39. ronnie says:

    vocalist@projectile.indulging” rel=”nofollow”>.…

    thanks!!…

  40. Gerard says:

    bites@motor.ax” rel=”nofollow”>.…

    ñïñ!…

  41. Morris says:

    reopening@munroe.teats” rel=”nofollow”>.…

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

  42. juan says:

    bahia@effluents.inaugurated” rel=”nofollow”>.…

    áëàãîäàðþ!…

  43. Raymond says:

    unmoved@casanova.practiced” rel=”nofollow”>.…

    tnx!!…

  44. Everett says:

    alexandria@cranston.follows” rel=”nofollow”>.…

    ñïñ!…

  45. matt says:

    mandated@cadre.environment” rel=”nofollow”>.…

    thank you!…

  46. Edward says:

    unity@incense.riot” rel=”nofollow”>.…

    ñïñ çà èíôó!…

  47. alvin says:

    dockside@salesmen.tidied” rel=”nofollow”>.…

    thanks!…

  48. david says:

    totted@interrogatives.caramel” rel=”nofollow”>.…

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

  49. Lloyd says:

    unpredictably@sorrel.ambushed” rel=”nofollow”>.…

    thank you….

  50. marvin says:

    foppish@fired.run” rel=”nofollow”>.…

    thanks for information!…

Leave a Reply

You must be logged in to post a comment.