wwu-pi / md2-framework

MD2 – Model-driven Mobile Development
Apache License 2.0
14 stars 10 forks source link

Required Android layout attributes not set during generation #10

Closed svetlin closed 5 years ago

svetlin commented 11 years ago

The required Android layout attributes layout_width and layout_height are not being set for a FlowLayoutPane with a Spacer during generation. Example:

package com.example.md2.sessiontest.views 
    FlowLayoutPane sessionListPane (vertical ) { 
        Label titleAbbreviation { text "Abbreviation" } 
        TextInput abbreviation 
        Label titleLabel { text "Title" } 
        TextInput title 
        Spacer
     }

The generated code for the Spacer is: <TextView /> The app crashes with:

10-11 16:40:37.401: E/AndroidRuntime(429): FATAL EXCEPTION: main
10-11 16:40:37.401: E/AndroidRuntime(429): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.md2.sessiontest.android/com.activenetwork.md2.sessiontest.android.controller.SessionListPaneActivity}: java.lang.RuntimeException: Binary XML file line #38: You must supply a layout_width attribute.

This requires manual fixing the generated code in order for the Android application to build and run.

Also, the graphical layout editor in Eclipse complains that

"sessionListPane" does not set the required layout_height attribute:
 (1) Set to "wrap_content"
 (2) Set to "match_parent"

(but the app builds and runs)

riegerchris commented 5 years ago

Android generator has been rebuild from scratch. Cleaning up open issues.