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??
]]>
< ![CDATA[
http://developer.android.com/reference/android/widget/ProgressBar.html#setIndeterminate(boolean)
]]>
< ![CDATA[
Lukas Morawietz already did xD
]]>
< ![CDATA[
Lukas Morawietz if no style style is setted it always shows the spinning wheel
]]>
< ![CDATA[
LL.bindClass(“android.widget.ProgressBar”)
LL.bindClass(“android.R”);
return new ProgressBar(LL.getContext(), null, R.attr.progressBarStyleHorizontal);
]]>
< ![CDATA[
Then set a style.
LL.bindClass(“android.widget.ProgressBar”);
LL.bindClass(“android.R”)
var v=new ProgressBar(LL.getContext(),null,R.attr.progressBarStyleHorizontal);
]]>
< ![CDATA[
There are more styles in android.R.attr
]]>
< ![CDATA[
Thanks guys!! Now it works perfectly ^^
]]>
< ![CDATA[
I honestly don’t understand why google+ can’t tell me if someone posted while I was typing…
]]>
< ![CDATA[
It also happened to me several times… I know it’s a nuisance
]]>
< ![CDATA[
I normally try to refresh before/after posting. Google+ lacks a lot of social network’s features.
]]>
< ![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.
]]>
< ![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…
]]>
< ![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
]]>
< ![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);
]]>