Android Question Undo manager (ctd')

DPaul

Active Member
Licensed User
Longtime User
Hi,

Still struggling with the undomanager, probably because of the wording that is used to explain how it works.
Installed undomanager class: ok
Installed random acces lib : ok

Then it says in the only "tutorial" i can find:
"Using this class is simple. You just need to call AddState whenever there is a new state. UndoManager will compare it to the current top state and will discard duplicate states."

Whenever there is a new state of what ? With one click, the user can change the "state" of 5 buttons, 2 panels and 4 variables.(e.g.)
- Do i have to create a " type undodata (text, color, visible, enabled...etc)" for every different kind of object that changes state (i.e. panel, button, string, integer)?
-How can they possibly all fit into this one "Dim ud as undodata" ?
A little more documentation on the subject may do wonders :)
thx,
Paul
 

DPaul

Active Member
Licensed User
Longtime User
Upvote 0

DPaul

Active Member
Licensed User
Longtime User
You can add as many fields as you like to the UndoData type.

Erel,

That, I figured out already.
What i don't understand is what i have to do to accomodate eg. 5 buttons.
5 different ud s ?: ud1 as undodata type, ud2 as ... etc ??

And then ud1.visible = button1.visible, ud1.enabled = but...etc.

like that ?
Because if i have to spell everything out, i cannot see how it is going to save me coding time.

I need only one undo level and no redo...

thx,
paul
 
Upvote 0

DPaul

Active Member
Licensed User
Longtime User
Then you should probably don't need to use UndoManager.

Ok, then i will experiment with another idea. Better than making a shadow backup view for everyting.
Maybe combine it with a failsafe solution in case of battery power failure...
Paul
 
Upvote 0
Top