I’m trying to set a progressBar in a custom view.

I’m trying to set a progressBar in a custom view.

I set all things necessary but I can’t find out a way to set the horrizontal style (cause here there is not a XML file xD), so it shows me an indeterminate indicator…

Someone could help me??

]]>

14 Commentsto I’m trying to set a progressBar in a custom view.

  1. Anonymous says:

    < ![CDATA[

    Lukas Morawietz already did xD

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Lukas Morawietz if no style style is setted it always shows the spinning wheel

    ]]>

  3. Anonymous says:

    < ![CDATA[

    LL.bindClass(“android.widget.ProgressBar”)


    LL.bindClass(“android.R”);


    return new ProgressBar(LL.getContext(), null, R.attr.progressBarStyleHorizontal);

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Then set a style.


    LL.bindClass(“android.widget.ProgressBar”);


    LL.bindClass(“android.R”)


    var v=new ProgressBar(LL.getContext(),null,R.attr.progressBarStyleHorizontal);

    ]]>

  5. Anonymous says:

    < ![CDATA[

    There are more styles in android.R.attr

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Thanks guys!! Now it works perfectly ^^

    ]]>

  7. Anonymous says:

    < ![CDATA[

    I honestly don’t understand why google+ can’t tell me if someone posted while I was typing…

    ]]>

  8. Anonymous says:

    < ![CDATA[

    It also happened to me several times… I know it’s a nuisance

    ]]>

  9. Anonymous says:

    < ![CDATA[

    I normally try to refresh before/after posting. Google+ lacks a lot of social network’s features.

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Simone Boccuzzi​​ could you please share the whole script for this custom view. I’m not good in scripting, but I will go through it and tweak it to suit my need. 



    Edit: I’m progressing well 😀. I have done my 1st custom view (ProgressBar).



    You can still share your work, it will help improvement.

    ]]>

  11. Anonymous says:

    < ![CDATA[

    TrianguloY​, I have done a simple horizontal progress bar.



    How can I make it circle Progress Bar and how can I format it example the hight, split etc…

    ]]>

  12. Anonymous says:

    < ![CDATA[

    Abdullah Alahdal it is not much different than a simple progressBar…


    i use the setProgress() method with the $bat_level and then a resumed script to refresh the view every 30 sec

    ]]>

  13. Anonymous says:

    < ![CDATA[

    +Simone Boccuzzi (KLR) I’ve done that simple progress bar and my code is below.



    However, now I want to do more customization and format. I need help from where to start.



    //Create Script Starts



    LL.bindClass(“android.view.View”);


    LL.bindClass(“android.widget.ProgressBar”);


    LL.bindClass(“android.R”)



    var context = LL.getContext();



    var myBar = new ProgressBar(context, null,R.attr.progressBarStyleHorizontal);



    return myBar;



    //Create Script Ends





    //Resumed Event.


    var myItem = LL.getEvent().getItem();


    var myId = myItem.getId();


    var myView = myItem.getView();



    var npt = LL.getVariables().getInteger(‘varNextPrayerTime’);



    var mnpt = LL.getVariables().getFloat(‘varMintoNPT’);



    var ml = (npt – Math.floor(Date.now() / 1000)) / 60;



    var mtp = (ml / mnpt) * 100;



    var item=LL.getEvent().getItem();



    if (mtp < 0) {var mtp = 0;}


    myView.setProgress(mtp);

    ]]>

Leave a Reply

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