We can create nearly everything by script and I understand that Widgets are not possible, but what about dektops?

We can create nearly everything by script and I understand that Widgets are not possible, but what about dektops?

For the eventhandler: Can we edit General events & actions?

]]>

17 Commentsto We can create nearly everything by script and I understand that Widgets are not possible, but what about dektops?

  1. Anonymous says:

    < ![CDATA[

    This update really gave me a lot if ideas. Next one:



    We have alert, confirm and prompt. Can we have some sort of Listview? A popup list of predefined items from which the user can choose one?

    ]]>

  2. Anonymous says:

    < ![CDATA[

    That would be sooo cool!

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Regarding the last thing: I think this is actually already implemented, but not available in scripts. Example given the Add item menu is something like that.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Yes, using the AlertDialog.Builder class. Something like:


    var builder = new AlertDialog.Builder(LL.getContext());


    builder.setItems([“Item A”, “Item B”, “Item C”], listener);


    builder.create().show();



    First, you need to setup listener this way:


    var listener = new DialogInterface.OnClickListener({


      onClick: function(dialog, which) {


        your stuff here


      }


    });



    I have still some issues with global config editing. It requires some special handling.

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Problem here is: setItems requires a charsequence to be passed, and it neither accepts an array (like u coded) nor a string.

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Ok, so let’s create a CharSequence array 🙂



    var a = java.lang.reflect.Array.newInstance(java.lang.CharSequence, 3);


    a[0] = “item A”;


    a[1] = “item B”;


    a[2] = “item C”;



    (sorry, I can’t test this at the moment)

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Wow Everything is possible…


    Clap clap clap for your script engine, it’s woaw!

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Not mine, all credit goes to Rhino and Android.

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Keep getting and java is not defined error. I think direct calls aren’t workong at all ATM, I always have to bind the classes before.

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Got it working now!



    LL.bindClass(“android.app.AlertDialog”); LL.bindClass(“java.lang.CharSequence”); LL.bindClass(“java.lang.reflect.Array”); LL.bindClass(“android.content.DialogInterface”);


    var builder = new AlertDialog.Builder(LL.getContext());



    var listener = new DialogInterface.OnClickListener({


      onClick: function(dialog, which) {


       // your stuff here


      }


    });



    var a = Array.newInstance(CharSequence, 3);


    a[0] = “item A”;


    a[1] = “item B”;


    a[2] = “item C”;


    builder.setItems(a, listener);


    builder.create().show();

    ]]>

  11. Anonymous says:

    < ![CDATA[

    My bad! An simple Array works also. No need to create a CharSequence. It was the listener which wasn’t working.

    ]]>

  12. Anonymous says:

    < ![CDATA[

    If I do :


    onClick: function(dialogInterface, itemId) {


    alert(itemList[itemId]);


    }


    (where itemList is the array with itemA, itemB, itemC,etc….)



    I get (on the alert command) an error : it flash : Cannot display “itemB” in this context….

    ]]>

  13. Anonymous says:

    < ![CDATA[

    Use:



    onClick: function(dialogInterface, itemId) {


    setTimeout(function(){alert(itemList[itemId]);},0);


    }



    I discovered that also already.

    ]]>

  14. Anonymous says:

    < ![CDATA[

    Waw… Weird…

    ]]>

  15. Anonymous says:

    < ![CDATA[

    Your code don’t work with me…

    ]]>

  16. Anonymous says:

    < ![CDATA[

    oh yes wait a second i’ll edit it.

    ]]>

  17. Anonymous says:

    < ![CDATA[

    Works well, thanks!

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *