牙叔教程 简单易懂
"ui"; importClass(android.graphics.Color); importClass(android.content.res.ColorStateList); /* -------------------------------------------------------------------------- */ let color = "#9c27b0"; ui.layout( <vertical margin="50"> <horizontal> <progressbar id="progressbar00" margin="10" /> <progressbar id="progressbar01" margin="10" /> <progressbar id="progressbar02" margin="10" /> <progressbar indeterminateTint="{{color}}" margin="10" /> </horizontal> <progressbar id="progressbar1" indeterminate="true" style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal" /> <progressbar id="progressbar2" indeterminate="true" style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal" /> <text id="progressbar3Value" textColor="black" textSize="22sp" margin="8" text="0" /> <progressbar id="progressbar3" progress="0" style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal" /> <seekbar id="progressbar4" progress="0" max="100" /> </vertical> ); ui.progressbar00.setIndeterminateTintList(ColorStateList.valueOf(Color.parseColor("#ff0000"))); ui.progressbar01.setIndeterminateTintList(ColorStateList.valueOf(Color.parseColor("#00ff00"))); ui.progressbar02.setIndeterminateTintList(ColorStateList.valueOf(Color.parseColor("#0000ff"))); ui.progressbar4.setProgressTintList(ColorStateList.valueOf(Color.parseColor(color))); ui.progressbar4.setThumbTintList(ColorStateList.valueOf(Color.parseColor(color))); ui.progressbar2 .getIndeterminateDrawable() .setColorFilter(Color.parseColor(color), android.graphics.PorterDuff.Mode.SRC_ATOP); let num = 0; let intervalId = setInterval(() => { ui.progressbar3.setProgress(num); ui.progressbar3Value.setText(num + ""); ui.progressbar4.setProgress(num); num++; if (num > 100) { clearInterval(intervalId); } }, 30);
环境
手机: Mi 11 Pro
Android版本: 12
Autojs版本: 9.1.5
名人名言
思路是最重要的, 其他的百度, bing, stackoverflow, github, 安卓文档, autojs文档, 最后才是群里问问
--- 牙叔教程
声明
部分内容来自网络
本教程仅用于学习, 禁止用于其他用途