Add Java CLI for converting Android AVD skins to Codename One#1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private void handleKeyValue(String line) { | ||
| Context ctx = contextStack.peek(); | ||
| if (ctx == null) { | ||
| return; | ||
| } | ||
| OrientationType orientation = findCurrentOrientation(); | ||
| if (orientation == null) { | ||
| return; | ||
| } | ||
| OrientationInfoBuilder builder = builders.computeIfAbsent(orientation, o -> new OrientationInfoBuilder()); | ||
| String[] parts = splitKeyValue(line); | ||
| if (parts == null) { | ||
| return; | ||
| } | ||
| String key = parts[0]; | ||
| String value = parts[1]; | ||
| String ctxName = ctx.name.toLowerCase(Locale.ROOT); | ||
| if (ctxName.contains("image") && key.equalsIgnoreCase("name")) { | ||
| builder.imageName = value; | ||
| } else if (ctxName.contains("display")) { |
There was a problem hiding this comment.
Track the main orientation image instead of the last image seen
While parsing the layout file, imageName is overwritten every time the parser encounters any image block inside an orientation. In typical AVD layouts each orientation declares many images (frame, button highlights, power icons, etc.), so whichever image appears last becomes the one used to build the skin. That often points to a tiny control graphic instead of the full device frame, leaving the generated skin.png unrelated to the display bounds and producing a useless skin. The parser should recognise and keep only the frame image (e.g., by selecting the largest image or by limiting matches to the appropriate section) instead of blindly overwriting imageName for every image block.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_6908b13431648331bc862c2a1db5c9a3