6.7.0 - Alpha - android.graphics.Paint#setColor 支持正常解析 ColorInt/ColorHex/ColorName 等颜色参数
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$data": {
|
||||
"v6.7.0": {
|
||||
"released_date": "2025/06/10",
|
||||
"released_date": "2025/06/15",
|
||||
"feature": [
|
||||
"zip 模块, 用于文件压缩与解压缩操作 (Ref to [Auto.js Pro](https://g.pro.autojs.org/)) (参阅 项目文档 > [Zip](https://docs.autojs6.com/#/zip))",
|
||||
"mediainfo 模块, 用于查看媒体文件的详细信息 (参阅 项目文档 > [媒体信息](https://docs.autojs6.com/#/mediainfo))"
|
||||
@@ -14,6 +14,7 @@
|
||||
"版本历史页面部分系统因字体差别导致统计数据显示不完整的问题"
|
||||
],
|
||||
"improvement": [
|
||||
"android.graphics.Paint#setColor 支持正常解析 ColorInt/ColorHex/ColorName 等颜色参数",
|
||||
"内置模块相关方法实参类型的异常消息增加类型摘要信息"
|
||||
],
|
||||
"dependency": [
|
||||
@@ -634,6 +635,7 @@
|
||||
"notice 模块 (参阅 项目文档 > [消息通知](https://docs.autojs6.com/#/notice))",
|
||||
"s13n 模块 (参阅 项目文档 > [标准化](https://docs.autojs6.com/#/s13n))",
|
||||
"Color 模块 (参阅 项目文档 > [颜色类](https://docs.autojs6.com/#/colorType))",
|
||||
"colors.setColorPaint 方法, 用于设置 android.graphics.Paint 画笔颜色 (参阅 项目文档 > [颜色类](https://docs.autojs6.com/#/colorType?id=m-setpaintcolor))",
|
||||
"前台时保持屏幕常亮功能及设置选项",
|
||||
"额外的文档启动器 (launcher) 便于独立阅读应用文档 (支持在设置中隐藏或显示)"
|
||||
],
|
||||
|
||||
12
app/src/main/java/org/autojs/autojs/core/image/RhinoPaint.kt
Normal file
12
app/src/main/java/org/autojs/autojs/core/image/RhinoPaint.kt
Normal file
@@ -0,0 +1,12 @@
|
||||
package org.autojs.autojs.core.image
|
||||
|
||||
import android.graphics.Paint
|
||||
import org.autojs.autojs.runtime.api.augment.colors.Colors
|
||||
|
||||
class RhinoPaint(paint: Paint) : Paint(paint) {
|
||||
|
||||
override fun setColor(color: Long) = setColor(Colors.toIntRhino(color))
|
||||
|
||||
fun setColor(color: Any?) = setColor(Colors.toIntRhino(color))
|
||||
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
package org.autojs.autojs.engine
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.graphics.Paint
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import org.autojs.autojs.core.image.RhinoPaint
|
||||
import org.autojs.autojs.core.ui.ViewExtras
|
||||
import org.autojs.autojs.engine.module.AssetAndUrlModuleSourceProvider
|
||||
import org.autojs.autojs.extension.AnyExtensions.isJsNullish
|
||||
@@ -207,6 +209,7 @@ open class RhinoJavaScriptEngine(private val scriptRuntime: ScriptRuntime, priva
|
||||
override fun wrapAsJavaObject(cx: Context?, scope: Scriptable, javaObject: Any?, staticType: Class<*>?): Scriptable? {
|
||||
return when (javaObject) {
|
||||
is View -> ViewExtras.getNativeView(scope, /* view = */ javaObject, staticType, runtime)
|
||||
is Paint -> super.wrapAsJavaObject(cx, scope, RhinoPaint(javaObject), staticType)
|
||||
else -> super.wrapAsJavaObject(cx, scope, javaObject, staticType)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#Wed Jun 11 18:10:41 CST 2025
|
||||
BUILD_TIME=1749636641459
|
||||
#Sun Jun 15 14:16:44 CST 2025
|
||||
BUILD_TIME=1749968204434
|
||||
COMPILE_SDK_VERSION=35
|
||||
IMAGE_QUANT_CMAKE_VERSION=3.22.1
|
||||
IMAGE_QUANT_NDK_VERSION=26.1.10909125
|
||||
@@ -19,6 +19,6 @@ RAPID_OCR_OPENCV_MOBILE_LABEL_VERSION=13
|
||||
RAPID_OCR_OPENCV_MOBILE_VERSION=4.5.3
|
||||
TARGET_SDK_VERSION=35
|
||||
TARGET_SDK_VERSION_INRT=29
|
||||
VERSION_BUILD=3292
|
||||
VERSION_BUILD=3293
|
||||
VERSION_NAME=6.7.0 Alpha
|
||||
VSCODE_EXT_REQUIRED_VERSION=1.0.8
|
||||
|
||||
Reference in New Issue
Block a user