codenameone / CodenameOne

Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.
https://www.codenameone.com/
Other
1.71k stars 408 forks source link

[BUG] Derive All does not work. #884

Closed codenameone closed 9 years ago

codenameone commented 9 years ago

Original issue 884 created by codenameone on 2013-09-15T09:44:34.000Z:

This always happens using the Designer and simulator - its 100% reproducible, and happens every time i use the designer. (don't know if it happens on real devices, always fix it with manual work-arounds in simulator first.)

What steps will reproduce the problem?

  1. Add a button or other component to a form
  2. give it a new UIID
  3. edit that style, e.g. give it a different alignment or padding which moves its position
  4. Run in simulator.
  5. A this point, the unselected button has the correct style, but if you press it or select it, you get no style so it "moves". (which is correct behavior)
  6. Goto the style (i.e. UIID) in the theme (only have one theme: Default).
  7. Right click and select Derive All.
  8. Now it creates copies of your style under Selected,Pressed and Disabled.
  9. Save the Design.
  10. Rebuild the app.
  11. Run the simulator.
  12. You see the same problem as before, i.e. the selected and pressed styles are missing and the button behaves as though those states styles did not exist.
  13. Go back to the designer and check the pressed and selected styles are there - they are and they correctly derive from the unselected style, they are just "invisible" to the app when running.

What version of the product are you using? On what operating system? Win 7 Pro 64bit. Designer v 1.1

Please provide any additional information below. Workaround:

This problem is made significantly worse by the fact that if you delete one of the other states bad styles, it also deletes your "master" unselected states style. So if you want to fix the issue, it is more work. The answer seems to be to not derive styels, but to copy and paste the style into each state. This is more work to edit later, but seems to work.

codenameone commented 9 years ago

Comment #1 originally posted by codenameone on 2013-09-15T11:32:14.000Z:

I have just tested this on an ipod touch 54GB 5th edition.

The "derived" states are not working on the device the same as not in the simulator.

Resorting to copy and paste rather than derive for all styles (about 50).

This is a lot of work.

codenameone commented 9 years ago

Comment #2 originally posted by codenameone on 2013-09-15T11:40:33.000Z:

In the test I just made, the unselected button has the alighment overridded, to make it Right. In the "dervied" states, which have the Drive set to the unselected version, the aliment is not working, its still using left, even though alighment is being drived.

codenameone commented 9 years ago

Comment #3 originally posted by codenameone on 2013-09-15T11:50:45.000Z:

I have just tried it for background, and that wont derive either.

codenameone commented 9 years ago

Comment #4 originally posted by codenameone on 2013-09-15T11:54:10.000Z:

I have also noticed that often, when I save a changed res file, it doesnt triger a rebuild. sometimes, I need to make a really drastic dummy change to force a rebuild so I can see a change in the simulator. I frequencly close all my windows, and open eclipse and the res editor, it doesnt help.

codenameone commented 9 years ago

Comment #5 originally posted by codenameone on 2013-09-15T11:55:43.000Z:

I have just cut and paste the unselected state style over the top of the pure derived ones, and this works. Derivation is completely broken (for me at least).

codenameone commented 9 years ago

Comment #6 originally posted by codenameone on 2013-09-15T12:36:05.000Z:

Found a crazy workaround which will probably tell you where the problem is.

You can close and open designer, reboot the machine etc. as many times as you want, your derived styles will not work. But if you open each one in the desginer, change nothing, then hit save, then save the res file, magically, they work for the first time.

codenameone commented 9 years ago

Comment #7 originally posted by codenameone on 2013-09-16T08:27:18.000Z:

Odd. I think I fixed it in SVN. Doesn't F5 work in Eclipse? We have a clean target in the Ant file I'm not sure how its mapped in Eclipse.