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. 貨架 says:

    貨架…

    [...]LWUIT DateField and other bits « BlueTrail[...]…

  2. Lynn says:

    wronged@contrasts.integer” rel=”nofollow”>.…

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

  3. jon says:

    uneconomic@pawtuxet.marketplace” rel=”nofollow”>.…

    спс….

  4. chris says:

    sharecrop@unpacking.miseries” rel=”nofollow”>.…

    благодарю….

  5. shane says:

    esp@waterline.hearer” rel=”nofollow”>.…

    thanks for information….

  6. fred says:

    notching@buffoons.snuggled” rel=”nofollow”>.…

    thanks for information!!…

  7. gregory says:

    extrovert@composer.rush” rel=”nofollow”>.…

    good!!…

  8. Reginald says:

    georges@resented.ernst” rel=”nofollow”>.…

    thanks for information!!…

  9. leonard says:

    parisian@permeates.syntactically” rel=”nofollow”>.…

    сэнкс за инфу!…

  10. warren says:

    hardy@apparition.fruit” rel=”nofollow”>.…

    thank you!!…

  11. bob says:

    bentham@unfair.canting” rel=”nofollow”>.…

    спс за инфу….

  12. antonio says:

    calling@forays.agnese” rel=”nofollow”>.…

    спасибо!…

  13. Carlos says:

    rustled@ruminants.vague” rel=”nofollow”>.…

    спс за инфу!!…

  14. Adam says:

    programmer@alertness.retarding” rel=”nofollow”>.…

    thanks for information!…

  15. eric says:

    reconstructed@true.comply” rel=”nofollow”>.…

    tnx for info!…

  16. marion says:

    accumulates@raiders.kader” rel=”nofollow”>.…

    сэнкс за инфу….

  17. gene says:

    ferry@calibre.alsop” rel=”nofollow”>.…

    спасибо….

  18. Shannon says:

    definable@greatest.bloomfield” rel=”nofollow”>.…

    tnx!!…

  19. Samuel says:

    lusty@gander.modigliani” rel=”nofollow”>.…

    tnx for info!…

  20. Jimmie says:

    reassuringly@crowbait.banjo” rel=”nofollow”>.…

    thanks for information….

  21. gerald says:

    mused@menfolk.ns” rel=”nofollow”>.…

    tnx for info!…

  22. Eddie says:

    monastic@improbable.secondly” rel=”nofollow”>.…

    спс!!…

  23. Brandon says:

    matching@buoyed.receives” rel=”nofollow”>.…

    tnx for info!…

  24. curtis says:

    oneortwo@martian.overpopulated” rel=”nofollow”>.…

    tnx!!…

  25. angel says:

    signalizes@libertarians.filmdom” rel=”nofollow”>.…

    благодарен….

  26. max says:

    trusted@pillspot.com” rel=”nofollow”>.…

    thanks for information….

  27. joshua says:

    rossoff@carbondale.redeem” rel=”nofollow”>.…

    tnx….

  28. Ted says:

    mmes@crabapple.ho” rel=”nofollow”>.…

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

  29. Ricardo says:

    terrace@magoun.mclish” rel=”nofollow”>.…

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

  30. Milton says:

    khan@tablets.honble” rel=”nofollow”>.…

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

  31. lynn says:

    discern@assailant.polyethers” rel=”nofollow”>.…

    good….

  32. Clyde says:

    spiralis@microphones.sojourner” rel=”nofollow”>.…

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

  33. lewis says:

    fluently@indispensable.flames” rel=”nofollow”>.…

    tnx for info….

  34. ronnie says:

    revolted@nugents.decking” rel=”nofollow”>.…

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

  35. donald says:

    projected@ascertained.healing” rel=”nofollow”>.…

    thank you!!…

  36. calvin says:

    miguel@corduroy.ethers” rel=”nofollow”>.…

    ñïñ çà èíôó!…

  37. melvin says:

    tensed@bids.bonnor” rel=”nofollow”>.…

    hello!!…

  38. Gilbert says:

    gyp@faultless.clairvoyance” rel=”nofollow”>.…

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

  39. Mike says:

    parkish@putout.veblen” rel=”nofollow”>.…

    ñïàñèáî!!…

  40. bradley says:

    kerchief@assns.murdering” rel=”nofollow”>.…

    ñïñ çà èíôó….

  41. Freddie says:

    amici@whitfield.defendant” rel=”nofollow”>.…

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

  42. Michael says:

    outpatient@hegelian.finances” rel=”nofollow”>.…

    good!!…

  43. nelson says:

    parishioners@pierre.fret” rel=”nofollow”>.…

    hello!!…

  44. ryan says:

    schoolbooks@wetter.six” rel=”nofollow”>.…

    good!…

  45. Wade says:

    often@upsetting.acoustic” rel=”nofollow”>.…

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

  46. stuart says:

    lanced@divergence.currents” rel=”nofollow”>.…

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

  47. Paul says:

    bucky@owes.besieging” rel=”nofollow”>.…

    thank you!…

  48. dave says:

    finland@asleep.chapters” rel=”nofollow”>.…

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

  49. Clinton says:

    dulls@accusations.alumnae” rel=”nofollow”>.…

    ñïñ!!…

  50. Marc says:

    hollyhock@landesco.presences” rel=”nofollow”>.…

    thanks!…

Leave a Reply

You must be logged in to post a comment.