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. KYLE says:

    stop smoking phlegm

    Buy_drugs without prescription…

  2. AUSTIN says:

    negative thyroid test

    Buy_no prescription…

  3. BYRON says:

    what foods anorexia eat

    Buy_drugs without prescription…

  4. JOEY says:

    atkins diet first week foods

    Buy_without prescription…

  5. GUY says:

    fungi amazing facts

    Buy_drugs without prescription…

  6. LUKE says:

    dog hives and what causes them

    Buy_drugs without prescription…

  7. CLIFTON says:

    nexium pepsin ac

    Buy_generic drugs…

  8. ENRIQUE says:

    liquid tylenol and dogs

    Buy_without prescription…

  9. FRED says:

    terry abbot

    Buy_generic drugs…

  10. TERRENCE says:

    menopause thyroid cancer

    Buy_without prescription…

  11. ARTURO says:

    macon georgia drug court

    Buy_without prescription…

  12. CHARLES says:

    food allergy and adenoids

    Buy_without prescription…

  13. STANLEY says:

    green@mountain.coffee.cafe.club” rel=”nofollow”>…

    Buygeneric meds…

  14. JOHN says:

    protonix@experience.buy” rel=”nofollow”>…

    Buygeneric meds…

  15. RAMON says:

    children@prozac.buy” rel=”nofollow”>…

    Buywithout prescription…

  16. TIMOTHY says:

    augmentin@duo.buy” rel=”nofollow”>…

    Buygeneric pills…

  17. HUGH says:

    avodart@and.rogane” rel=”nofollow”>.

    Buydrugs without prescription…

  18. LOUIS says:

    rogaine@foam.canada” rel=”nofollow”>.

    Buyno prescription…

  19. BRETT says:

    indications@for.use.of.atrovent” rel=”nofollow”>…

    Buygeneric meds…

Leave a Reply

You must be logged in to post a comment.