feat: 大幅增强原生行为 — 修复P0 Bug + 补全核心API

P0 Bug 修复:
- Canvas.drawBitmap 重复定义导致重载丢失 → 合并为*args重载
- String.hashCode() 不可达的第二return → 修复为单return
- File.compareTo() 调用不存在的__cmp__ → 改为显式比较
- HashMap.remove() 逻辑错误 → 区分单参(返回旧值)/双参(返回boolean)

P1 核心行为增强:
- Handler: sendMessage/sendMessageDelayed 现在真正入队异步执行
- Looper: loop() 实现真正的消息循环(按when时间取出到期消息)
- AsyncTask: execute() 在后台线程池执行,完成后主线程回调
- Bundle: 新增12个数组类型put/get方法
- Math.round: 改为Java语义(floor(a+0.5))而非Python银行家舍入
- Thread: currentThread()缓存对象, 新增join/getState/getId/getPriority
- String: 新增strip/repeat/isBlank/lines/subSequence/getChars/chars/formatted/translateEscapes

P2 缺失API补全:
- 新增21个Java标准Exception类 (NullPointerException等)
- View: 新增39个事件处理/监听器/位置尺寸方法
- Activity: 新增33个生命周期/权限/UI方法
- Context: 新增22个文件流/权限/资源/主题方法
- Canvas: 支持 Canvas(Bitmap) 构造函数重载
- __init__.py: __all__ 补全Exception体系和Activity类
This commit is contained in:
shuiyu1123 committed 2026-06-24 15:04:17 +00:00
1 parent 4645015004
commit 8c3bd3c415
9 files changed
+1017 -52

No files matched your search

+13 -1
View File
@@ -378,7 +378,7 @@ __all__ = [
"AccessibilityNodeInfo", "AccessibilityService",
"AccessibilityServiceInfo",
"Account", "AccountManager",
"ActivityManager",
"Activity", "ActivityManager",
"AlphaAnimation",
"Animation",
"Animator", "ValueAnimator", "ObjectAnimator", "AnimatorSet",
@@ -512,6 +512,18 @@ __all__ = [
"String", "StringBuilder", "StringBuffer",
"Integer", "Math", "System", "Thread",
"BigInteger", "BigDecimal",
# Java Exception 体系
"Throwable", "Exception", "RuntimeException", "Error",
"NullPointerException", "IllegalArgumentException", "IllegalStateException",
"IndexOutOfBoundsException", "ArrayIndexOutOfBoundsException",
"StringIndexOutOfBoundsException", "ClassCastException",
"UnsupportedOperationException", "ArithmeticException",
"NumberFormatException", "SecurityException",
"ConcurrentModificationException", "NegativeArraySizeException",
"NoSuchFieldException", "NoSuchMethodException", "InterruptedException",
"CloneNotSupportedException", "IllegalMonitorStateException",
"IllegalThreadStateException", "EnumConstantNotPresentException",
"TypeNotPresentException",
"SimpleDateFormat", "DecimalFormat",
"LocalDateTime", "LocalDate", "LocalTime", "Instant", "Duration", "Period",
"ChronoUnit", "ChronoField", "DayOfWeek", "Month", "ZoneId", "ZoneOffset",