sojamo / controlp5

A gui library for processing.org
GNU Lesser General Public License v2.1
490 stars 142 forks source link

Dropdownlist doesn't work in Android mode #48

Closed studioijeoma closed 8 years ago

studioijeoma commented 8 years ago

When I run the dropdown list example in Android mode it throws these warnings and errors:

1. WARNING in /private/var/folders/hg/mmm3m8ys4djd0r_ss4d6y4fc0000gn/T/android7074952142323453289sketch/src/processing/test/controlp5scrollablelist/ControlP5scrollableList.java (at line 43)
    List l = Arrays.asList("a", "b", "c", "d", "e", "f", "g", "h");
    ^^^^
List is a raw type. References to generic type List<E> should be parameterized
----------
2. WARNING in /private/var/folders/hg/mmm3m8ys4djd0r_ss4d6y4fc0000gn/T/android7074952142323453289sketch/src/processing/test/controlp5scrollablelist/ControlP5scrollableList.java (at line 50)
    .addItems(l)
              ^
Type safety: The expression of type List needs unchecked conversion to conform to List<String>
----------
3. ERROR in /private/var/folders/hg/mmm3m8ys4djd0r_ss4d6y4fc0000gn/T/android7074952142323453289sketch/src/processing/test/controlp5scrollablelist/ControlP5scrollableList.java (at line 63)
    println(n, cp5.get(ScrollableList.class, "dropdown").getItem(n));
    ^^^^^^^
The method println(int) in the type PApplet is not applicable for the arguments (int, Map<String,Object>)
----------
4. WARNING in /private/var/folders/hg/mmm3m8ys4djd0r_ss4d6y4fc0000gn/T/android7074952142323453289sketch/src/processing/test/controlp5scrollablelist/ControlP5scrollableList.java (at line 91)
    List l = Arrays.asList("a-1", "b-1", "c-1", "d-1", "e-1", "f-1", "g-1", "h-1", "i-1", "j-1", "k-1");
    ^^^^
List is a raw type. References to generic type List<E> should be parameterized
----------
5. WARNING in /private/var/folders/hg/mmm3m8ys4djd0r_ss4d6y4fc0000gn/T/android7074952142323453289sketch/src/processing/test/controlp5scrollablelist/ControlP5scrollableList.java (at line 92)
    cp5.get(ScrollableList.class, "dropdown").setItems(l);
                                                       ^
Type safety: The expression of type List needs unchecked conversion to conform to List<String>
sojamo commented 8 years ago

the error is caused by the println() call at line 63. The Processing android mode doesn't implement the varargs implementation of println which has been available in Processing core for a while. replace the , with +", "+ to fix the error.

studioijeoma commented 8 years ago

thanks i just opened an issue on processing-android.

sojamo commented 8 years ago

ok, closing the issues.