Skip to main content

Animated element between forms

7 replies [Last post]
Anonymous

Hi,

I have been having a look at the Animation and Motion classes, as well
as the Blog post "Motion madness". Now I think I could manage to get an
object animated inside a form, but what I want to do is more difficult
(if not impossible): between the transition of a form to another
(currently an slide transition), we want the whole form to change except
the top navigation bar (think of an scroll bar) which should move to the
opposite direction (i.e. if the old form leaves to the left, the bar
moves to the right).

I understand this is not possible with two LWUIT forms, which occupy
full screen (including the top bar), but what about doing a transition
with whatever components in the rest of the screen, and let the bar
follow its animation method? If possible, how could I do it?

Thanks much,
Arnau

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
saturon

Hi there,

I am not feeling too called, but out of experience it seems that not
too many people in this list feel different.

So from what I learnt is, if you are doing a medium complex application
its best that you keep more or less to design principles of general oo
programming.

Forms are quite lightweight components (I once asked why I cannot add
the same component into different forms, like a header, and got the
answer from Shai that components are very much lightweight). I in fact
have about 23 Forms in my app. General functionality I factored out to a
baseform which my screens extend.

What you have to consider is that when you replace a form, that you
realease all references to that form ant its contents, so that the gc
can remove it once run. This is something you really have to pay
attention to when operating with lots of callbacks, static variables
etc.

So from my experience I would defenetly suggest to use the multiple form
approach because of maintainability, exensibility and more clean design.
I would only use the same form and replace components therein, when its
logical the same screen with a different state.

Would be interested to other opinions,

Rgds Ben

-----Original Message-----
From: Arnau Vàzquez [mailto:arnau.vazquez@genaker.net]
Sent: Freitag, 23. Januar 2009 12:35
To: users@lwuit.dev.java.net
Subject: Re: Animated element between forms

Out of curiosity,

which paradigm would be more performant and resource-sensitive? 1.
Having multiple Forms (say 5-8), each with its components, some of
them the same across screens (e.g. global titles and icons).
2. Having just one Form for the whole app, and use Container.replace(),
removeCommand() and addCommand() to change the parts that are different
between two screens.

I guess the second one would probably produce messy code and extra bugs,

but would it represent some memory or speed improvement?

Thanks
Arnau

En/na Arnau Vàzquez ha escrit:
> Yep, that would do it! :) I love LWUIT so much ^^
>
> Thanks
> Arnau
>
> En/na Shai Almog ha escrit:
>> See: Container.replace()
>>
>> On Jan 21, 2009, at 2:48 PM, Arnau Vàzquez wrote:
>>
>>> Hi,
>>>
>>> I have been having a look at the Animation and Motion classes, as
>>> well as the Blog post "Motion madness". Now I think I could manage
>>> to get an object animated inside a form, but what I want to do is
>>> more difficult (if not impossible): between the transition of a form

>>> to another (currently an slide transition), we want the whole form
>>> to change except the top navigation bar (think of an scroll bar)
>>> which should move to the opposite direction (i.e. if the old form
>>> leaves to the left, the bar moves to the right).
>>>
>>> I understand this is not possible with two LWUIT forms, which occupy
>>> full screen (including the top bar), but what about doing a
>>> transition with whatever components in the rest of the screen, and
>>> let the bar follow its animation method? If possible, how could I do

>>> it?
>>>
>>> Thanks much,
>>> Arnau
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>>>
>>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>>
>>>
>>
>> Shai Almog
>> http://lwuit.blogspot.com/
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Arnau Vàzquez

[att1.html]

saturon

My screens are just very dynamic so it does not make sense to cache them
- the critical think for performance is RMS or networking in my case.
Also I cannot keep them all in memory because of well memory ;)

I do however keep one base "home" screen in memory which does not
change. That said if your fine with the memory consumption caching them
is allright i guess. As always its a tradeoff memory vs. performance

-----Original Message-----
From: Arnau Vàzquez [mailto:arnau.vazquez@genaker.net]
Sent: Freitag, 23. Januar 2009 18:28
To: users@lwuit.dev.java.net
Subject: Re: Animated element between forms

Hi saturon, many thanks for the tip.
I agree with you and this is how I am designing my application. I have a
doubt about releasing Forms, though. Do you release them every time they
go out of sight and re-create them again when needed? Does this
introduce any lag (no idea)? I am currently constructing all forms at
startup and don't release them until application exits. I do have less
forms (<10). Is it too wrong?

Thanks again,
Arnau

En/na saturon ha escrit:

Hi there,

I am not feeling too called, but out of experience it seems that not

too many people in this list feel different.

So from what I learnt is, if you are doing a medium complex application

its best that you keep more or less to design principles of general oo

programming.

Forms are quite lightweight components (I once asked why I cannot add

the same component into different forms, like a header, and got the

answer from Shai that components are very much lightweight). I in fact

have about 23 Forms in my app. General functionality I factored out to a

baseform which my screens extend.

What you have to consider is that when you replace a form, that you

realease all references to that form ant its contents, so that the gc

can remove it once run. This is something you really have to pay

attention to when operating with lots of callbacks, static variables

etc.

So from my experience I would defenetly suggest to use the multiple form

approach because of maintainability, exensibility and more clean design.

I would only use the same form and replace components therein, when its

logical the same screen with a different state.

Would be interested to other opinions,

Rgds Ben

-----Original Message-----

From: Arnau Vàzquez [mailto:arnau.vazquez@genaker.net]

Sent: Freitag, 23. Januar 2009 12:35

To: users@lwuit.dev.java.net

Subject: Re: Animated element between forms

Out of curiosity,

which paradigm would be more performant and resource-sensitive? 1.

Having multiple Forms (say 5-8), each with its components, some of

them the same across screens (e.g. global titles and icons).

2. Having just one Form for the whole app, and use Container.replace(),

removeCommand() and addCommand() to change the parts that are different

between two screens.

I guess the second one would probably produce messy code and extra bugs,

but would it represent some memory or speed improvement?

Thanks

Arnau

En/na Arnau Vàzquez ha escrit:

Yep, that would do it! :) I love LWUIT so much ^^

Thanks

Arnau

En/na Shai Almog ha escrit:

See: Container.replace()

On Jan 21, 2009, at 2:48 PM, Arnau Vàzquez wrote:

Hi,

I have been having a look at the Animation and Motion classes, as

well as the Blog post "Motion madness". Now I think I could manage

to get an object animated inside a form, but what I want to do is

more difficult (if not impossible): between the transition of a form

to another (currently an slide transition), we want the whole form

to change except the top navigation bar (think of an scroll bar)

which should move to the opposite direction (i.e. if the old form

leaves to the left, the bar moves to the right).

I understand this is not possible with two LWUIT forms, which occupy

full screen (including the top bar), but what about doing a

transition with whatever components in the rest of the screen, and

let the bar follow its animation method? If possible, how could I do

it?

Thanks much,

Arnau

--------------------------------------------------------------------

-

To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net


For additional commands, e-mail: users-help@lwuit.dev.java.net


Shai Almog

http://lwuit.blogspot.com/

---------------------------------------------------------------------

To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net

For additional commands, e-mail: users-help@lwuit.dev.java.net

---------------------------------------------------------------------

To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net

For additional commands, e-mail: users-help@lwuit.dev.java.net

---------------------------------------------------------------------

To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net

For additional commands, e-mail: users-help@lwuit.dev.java.net

--------------------------------------------------------------------- To
unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net For additional
commands, e-mail: users-help@lwuit.dev.java.net

[att1.html]

Shai Almog

See: Container.replace()

On Jan 21, 2009, at 2:48 PM, Arnau Vàzquez wrote:

> Hi,
>
> I have been having a look at the Animation and Motion classes, as
> well as the Blog post "Motion madness". Now I think I could manage
> to get an object animated inside a form, but what I want to do is
> more difficult (if not impossible): between the transition of a
> form to another (currently an slide transition), we want the whole
> form to change except the top navigation bar (think of an scroll
> bar) which should move to the opposite direction (i.e. if the old
> form leaves to the left, the bar moves to the right).
>
> I understand this is not possible with two LWUIT forms, which
> occupy full screen (including the top bar), but what about doing a
> transition with whatever components in the rest of the screen, and
> let the bar follow its animation method? If possible, how could I
> do it?
>
> Thanks much,
> Arnau
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

Shai Almog
http://lwuit.blogspot.com/

[att1.html]

Arnau Vàzquez

Yep, that would do it! :) I love LWUIT so much ^^

Thanks
Arnau

En/na Shai Almog ha escrit:
> See: Container.replace()
>
> On Jan 21, 2009, at 2:48 PM, Arnau Vàzquez wrote:
>
>> Hi,
>>
>> I have been having a look at the Animation and Motion classes, as
>> well as the Blog post "Motion madness". Now I think I could manage to
>> get an object animated inside a form, but what I want to do is more
>> difficult (if not impossible): between the transition of a form to
>> another (currently an slide transition), we want the whole form to
>> change except the top navigation bar (think of an scroll bar) which
>> should move to the opposite direction (i.e. if the old form leaves to
>> the left, the bar moves to the right).
>>
>> I understand this is not possible with two LWUIT forms, which occupy
>> full screen (including the top bar), but what about doing a
>> transition with whatever components in the rest of the screen, and
>> let the bar follow its animation method? If possible, how could I do it?
>>
>> Thanks much,
>> Arnau
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>>
>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>
>>
>
> Shai Almog
> http://lwuit.blogspot.com/
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Arnau Vàzquez

Out of curiosity,

which paradigm would be more performant and resource-sensitive?
1. Having multiple Forms (say 5-8), each with its components, some of
them the same across screens (e.g. global titles and icons).
2. Having just one Form for the whole app, and use Container.replace(),
removeCommand() and addCommand() to change the parts that are different
between two screens.

I guess the second one would probably produce messy code and extra bugs,
but would it represent some memory or speed improvement?

Thanks
Arnau

En/na Arnau Vàzquez ha escrit:
> Yep, that would do it! :) I love LWUIT so much ^^
>
> Thanks
> Arnau
>
> En/na Shai Almog ha escrit:
>> See: Container.replace()
>>
>> On Jan 21, 2009, at 2:48 PM, Arnau Vàzquez wrote:
>>
>>> Hi,
>>>
>>> I have been having a look at the Animation and Motion classes, as
>>> well as the Blog post "Motion madness". Now I think I could manage
>>> to get an object animated inside a form, but what I want to do is
>>> more difficult (if not impossible): between the transition of a form
>>> to another (currently an slide transition), we want the whole form
>>> to change except the top navigation bar (think of an scroll bar)
>>> which should move to the opposite direction (i.e. if the old form
>>> leaves to the left, the bar moves to the right).
>>>
>>> I understand this is not possible with two LWUIT forms, which occupy
>>> full screen (including the top bar), but what about doing a
>>> transition with whatever components in the rest of the screen, and
>>> let the bar follow its animation method? If possible, how could I do
>>> it?
>>>
>>> Thanks much,
>>> Arnau
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
>>>
>>> For additional commands, e-mail: users-help@lwuit.dev.java.net
>>>
>>>
>>
>> Shai Almog
>> http://lwuit.blogspot.com/
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

pakmee
Offline
Joined: 2008-09-01

I think you should probably just have a factory to take care of returning the appropriate forms when needed. Having 1 form would be good but like you said it would be very messy. Most phones are pretty quick nowadays. Don't create everything on the go, just use a factory and return the form only when its needed.