User Tools

Site Tools


script_circular_battery_indicator

====== About the script ====== * Purpose : This script show a round battery bar * Author : F43nd1r * Current Version : 1.0 * Link: https://plus.google.com/+LukasMorawietz/posts/ZMet1uZi3eM ====== Changelog ====== * Version 1.0 (28/6/2016): initial release in wiki ====== How to use the script ====== * Create a custom view. * Set first script in the "Create" event * Set second script in "Dummy" binding ====== Issues and Hints ====== //please report all bugs in the g+ community!// ====== Create Script ====== <sxh javascript;>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; </sxh> ====== Dummy Binding ====== <sxh javascript;>item.getView().setProgress($bat_level); return $bat_level </sxh>

script_circular_battery_indicator.txt · Last modified: 2016/06/28 12:56 by f43nd1r