Circular Battery Indicator
Circular Battery Indicator
Use this in a custom view:
Comment #1: Create script
Comment #2: Dummy Binding
You can also take this script as an inspiration to create circular progressbars for other things.
]]>« Pierre Hébert (Previous Post)
< ![CDATA[
LL.bindClass(“android.graphics.drawable.GradientDrawable”);
LL.bindClass(“android.widget.ProgressBar”);
LL.bindClass(“android.R”);
var d = new GradientDrawable();
d.setShape(GradientDrawable.RING);
d.setUseLevel(true);
d.setColor(0xffff0000);
var batteryProgressBar = new ProgressBar(LL.getContext(),null,R.attr.progressBarStyleHorizontal);
batteryProgressBar.setProgressDrawable(d);
batteryProgressBar.setProgress(LL.getVariables().getInteger(“bat_level”));
return batteryProgressBar;
]]>
< ![CDATA[
item.getView().setProgress($bat_level);
return $bat_level;
]]>