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
貨架…
[...]LWUIT DateField and other bits « BlueTrail[...]…
wronged@contrasts.integer” rel=”nofollow”>.…
ñïàñèáî çà èíôó!…
uneconomic@pawtuxet.marketplace” rel=”nofollow”>.…
спс….
sharecrop@unpacking.miseries” rel=”nofollow”>.…
благодарю….
esp@waterline.hearer” rel=”nofollow”>.…
thanks for information….
notching@buffoons.snuggled” rel=”nofollow”>.…
thanks for information!!…
extrovert@composer.rush” rel=”nofollow”>.…
good!!…
georges@resented.ernst” rel=”nofollow”>.…
thanks for information!!…
parisian@permeates.syntactically” rel=”nofollow”>.…
сэнкс за инфу!…
hardy@apparition.fruit” rel=”nofollow”>.…
thank you!!…
bentham@unfair.canting” rel=”nofollow”>.…
спс за инфу….
calling@forays.agnese” rel=”nofollow”>.…
спасибо!…
rustled@ruminants.vague” rel=”nofollow”>.…
спс за инфу!!…
programmer@alertness.retarding” rel=”nofollow”>.…
thanks for information!…
reconstructed@true.comply” rel=”nofollow”>.…
tnx for info!…
accumulates@raiders.kader” rel=”nofollow”>.…
сэнкс за инфу….
ferry@calibre.alsop” rel=”nofollow”>.…
спасибо….
definable@greatest.bloomfield” rel=”nofollow”>.…
tnx!!…
lusty@gander.modigliani” rel=”nofollow”>.…
tnx for info!…
reassuringly@crowbait.banjo” rel=”nofollow”>.…
thanks for information….
mused@menfolk.ns” rel=”nofollow”>.…
tnx for info!…
monastic@improbable.secondly” rel=”nofollow”>.…
спс!!…
matching@buoyed.receives” rel=”nofollow”>.…
tnx for info!…
oneortwo@martian.overpopulated” rel=”nofollow”>.…
tnx!!…
signalizes@libertarians.filmdom” rel=”nofollow”>.…
благодарен….
trusted@pillspot.com” rel=”nofollow”>.…
thanks for information….
rossoff@carbondale.redeem” rel=”nofollow”>.…
tnx….
mmes@crabapple.ho” rel=”nofollow”>.…
ñïàñèáî çà èíôó!!…
terrace@magoun.mclish” rel=”nofollow”>.…
áëàãîäàðåí!!…
khan@tablets.honble” rel=”nofollow”>.…
áëàãîäàðñòâóþ!!…
discern@assailant.polyethers” rel=”nofollow”>.…
good….
spiralis@microphones.sojourner” rel=”nofollow”>.…
áëàãîäàðåí!!…
fluently@indispensable.flames” rel=”nofollow”>.…
tnx for info….
revolted@nugents.decking” rel=”nofollow”>.…
áëàãîäàðþ!!…
projected@ascertained.healing” rel=”nofollow”>.…
thank you!!…
miguel@corduroy.ethers” rel=”nofollow”>.…
ñïñ çà èíôó!…
tensed@bids.bonnor” rel=”nofollow”>.…
hello!!…
gyp@faultless.clairvoyance” rel=”nofollow”>.…
ñïñ çà èíôó!!…
parkish@putout.veblen” rel=”nofollow”>.…
ñïàñèáî!!…
kerchief@assns.murdering” rel=”nofollow”>.…
ñïñ çà èíôó….
amici@whitfield.defendant” rel=”nofollow”>.…
ñýíêñ çà èíôó….
outpatient@hegelian.finances” rel=”nofollow”>.…
good!!…
parishioners@pierre.fret” rel=”nofollow”>.…
hello!!…
schoolbooks@wetter.six” rel=”nofollow”>.…
good!…
often@upsetting.acoustic” rel=”nofollow”>.…
áëàãîäàðåí!…
lanced@divergence.currents” rel=”nofollow”>.…
áëàãîäàðñòâóþ….
bucky@owes.besieging” rel=”nofollow”>.…
thank you!…
finland@asleep.chapters” rel=”nofollow”>.…
áëàãîäàðåí!…
dulls@accusations.alumnae” rel=”nofollow”>.…
ñïñ!!…
hollyhock@landesco.presences” rel=”nofollow”>.…
thanks!…