feat: 深度完善 — 存根转真实实现、UI类方法补全、Java集合/IO增强
存根转真实实现: - ContentResolver: query/insert/update/delete对file://URI真实文件操作, getType用mimetypes - Context: getResources/getAssets/getString/getColor 委托真实Resources - Bitmap.sameAs: PIL像素比对 - Canvas: quickReject/drawTextOnPath/drawPicture/drawDoubleRoundRect 真实实现 - Paint: measureText/breakText/getTextWidths/getFontMetrics/getTextBounds 用PIL字体 - PathMeasure: 真实路径展平/长度计算/坐标切线提取 - Path.op/Region.op: 布尔运算 - Camera: 3D变换矩阵计算 - SystemClock.setCurrentTimeMillis: date -s命令 - Environment.isExternalStorageRemovable: /proc/mounts检查 - Process.myUid: os.getuid() - PowerManager.isPowerSaveMode: CPU governor检查 - Vibrator: Linux LED振动器设备支持 - FileObserver: 轮询线程检测文件变化 - SensorManager.getRotationMatrix: 完整旋转矩阵算法 - BatteryManager: LinuxPower真实电池数据 - Geocoder: Nominatim API逆地理编码 - LocationManager: addProximityAlert/setTestProviderLocation UI类方法补全: - TextView: setPaddingRelative/getTextColor/setBreakStrategy/setJustificationMode - ImageView: setColorFilter/getColorFilter/clearColorFilter - CheckBox/Switch: setOnCheckedChangeListener - ListView: clearChoices - ViewGroup: setLayoutTransition/setTouchscreenBlocksFocus/getChildVisibleRect - MotionEvent: getHistoricalX/Y/Pressure/EventTime/addBatch/getEdgeFlags/setAction Java集合增强: - ArrayList: spliterator/stream - HashSet: spliterator/stream/removeIf - TreeMap: replaceAll/compute/computeIfAbsent/computeIfPresent/merge - LinkedHashMap: clone (保留access_order) - PriorityQueue: spliterator/clone Java IO增强: - BufferedWriter: append/check - PrintWriter: append - ByteArrayOutputStream: writeTo - ByteArrayInputStream: markSupported - BufferedInputStream: available/mark/reset/markSupported + 修复_fill缓冲区填充bug - SequenceInputStream: 补全实现(Enumeration/多流/跨流聚合读取) 修复: - ViewGroup.addView: 合并重复定义为智能参数分派 - view_ext.ViewGroup: 继承view.ViewGroup - view_ext.KeyEvent: 继承view.KeyEvent - hardware_sensor_ext.SensorManager: 继承hardware.SensorManager - app_fragment: 使用java.lang.IllegalStateException - content_intent.Intent: setData/getScheme正确从Uri提取scheme - __init__.py: 补全Fragment/KeyEvent/MotionEvent/TrafficStats/RecyclerView/TreeMap/Vibrator等导出 统计: 221模块, 3662类, 30952方法, 182302行
This commit is contained in:
1 parent
39b1da37c9
commit
4235f8692c
13 files changed
+2248
-163
No files matched your search
@@ -14,6 +14,8 @@ from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
|
||||
from .._core import Stub, AndroidOnlyError
|
||||
from ..java.lang import RuntimeException
|
||||
from .view import KeyEvent as _BaseKeyEvent
|
||||
from .view import ViewGroup as _BaseViewGroup
|
||||
from .view import View as _BaseView
|
||||
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════
|
||||
@@ -700,8 +702,8 @@ class ViewParent(Stub):
|
||||
# ViewGroup (扩展)
|
||||
# ═══════════════════════════════════════════════════════════════
|
||||
|
||||
class ViewGroup(Stub):
|
||||
"""ViewGroup — 视图组扩展"""
|
||||
class ViewGroup(_BaseViewGroup):
|
||||
"""ViewGroup — 视图组扩展 (继承 view.ViewGroup 的所有方法)"""
|
||||
|
||||
CLIP_TO_PADDING_MASK = 0
|
||||
FOCUS_AFTER = 1
|
||||
@@ -782,15 +784,19 @@ class ViewGroup(Stub):
|
||||
f"margins=({self.leftMargin},{self.topMargin},"
|
||||
f"{self.rightMargin},{self.bottomMargin}))")
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._children: List[Any] = []
|
||||
self._clip_children = True
|
||||
self._clip_to_padding = True
|
||||
def __init__(self, context=None):
|
||||
super().__init__(context)
|
||||
if not hasattr(self, '_children'):
|
||||
self._children: List[Any] = []
|
||||
if not hasattr(self, '_clip_children'):
|
||||
self._clip_children = True
|
||||
if not hasattr(self, '_clip_to_padding'):
|
||||
self._clip_to_padding = True
|
||||
self._layout_mode = self.LAYOUT_MODE_CLIP_BOUNDS
|
||||
self._persistent_caching = self.PERSISTENT_NO_CACHE
|
||||
self._touch_mode = False
|
||||
self._motion_event_splitting = True
|
||||
if not hasattr(self, '_motion_event_splitting'):
|
||||
self._motion_event_splitting = True
|
||||
self._transient_child: Optional[Any] = None
|
||||
self._add_stateset_focus = False
|
||||
self._child_drawable_state: Optional[Any] = None
|
||||
|
||||
Reference in new issue
Block a user