fix: 系统性修复类继承冲突 + 补全36+缺失导出

类继承冲突修复 (7个文件, 8组冲突):
- view_ext.py: 16个类继承view.py基础版本 (ViewOutlineProvider, ViewPropertyAnimator, ViewTreeObserver, ViewConfiguration, ViewParent, WindowInsets, Display, DragEvent, GestureDetector, ScaleGestureDetector, SoundEffectConstants, Surface, SurfaceView, TextureView, VelocityTracker, WindowInsetsController)
- hardware_sensor_ext.py: 3个类继承hardware.py (Sensor, SensorEvent, SensorEventListener)
- app_fragment.py: 3个类继承app.py (Fragment, FragmentManager, FragmentTransaction)
- content_intent.py: 3个类继承content.py/app.py (Intent, PendingIntent, IntentFilter)
- widget_ext.py: 29个类继承widget.py (18个单继承+11个多继承, 修复super()链)
- os_power.py: 2个类继承os.py (BatteryManager, PowerManager)
- net_ext.py: 12个类继承net.py (11个单继承+1个多继承)

__all__导出补全 (36个类):
- java.net: InterfaceAddress
- android.database: MatrixCursor, SQLiteStatement
- android.view: GestureDetector, ScaleGestureDetector, SurfaceHolder, Surface, SurfaceView, TextureView, ViewOutlineProvider, WindowManager, Window, LayoutInflater, Menu, MenuItem, ContextMenu, Display, DisplayMetrics
- android.graphics: Region, PathMeasure, NinePatch, Picture, PictureDrawable, Camera, PorterDuff, PorterDuffXfermode, Shader, LinearGradient, RadialGradient, SweepGradient, BitmapShader, ComposeShader, CornerPathEffect, DashPathEffect, PathDashPathEffect, SumPathEffect
- android.widget: LinearLayout, FrameLayout, RelativeLayout, TableLayout, TableRow, BaseAdapter, ArrayAdapter, SimpleAdapter, CursorAdapter, ImageButton, ToggleButton, RadioButton, SeekBar, RatingBar, ViewSwitcher, TextSwitcher, ImageSwitcher, SearchView, NumberPicker, Chronometer, TabHost, TabWidget, ViewAnimator, ZoomControls, DigitalClock, AnalogClock

统计: 221模块, 3666类, 31005方法, 183629行
This commit is contained in:
shuiyu1123 committed 2026-06-25 01:24:00 +00:00
1 parent fbb8263b13
commit 97d8b277d5
8 files changed
+205 -105

No files matched your search

+48 -32
View File
@@ -16,14 +16,30 @@ from ..java.lang import RuntimeException
from .view import KeyEvent as _BaseKeyEvent
from .view import ViewGroup as _BaseViewGroup
from .view import View as _BaseView
from .view import ViewOutlineProvider as _BaseViewOutlineProvider
from .view import ViewPropertyAnimator as _BaseViewPropertyAnimator
from .view import ViewTreeObserver as _BaseViewTreeObserver
from .view import ViewConfiguration as _BaseViewConfiguration
from .view import ViewParent as _BaseViewParent
from .view import WindowInsets as _BaseWindowInsets
from .view import Display as _BaseDisplay
from .view import DragEvent as _BaseDragEvent
from .view import GestureDetector as _BaseGestureDetector
from .view import ScaleGestureDetector as _BaseScaleGestureDetector
from .view import SoundEffectConstants as _BaseSoundEffectConstants
from .view import Surface as _BaseSurface
from .view import SurfaceView as _BaseSurfaceView
from .view import TextureView as _BaseTextureView
from .view import VelocityTracker as _BaseVelocityTracker
from .view import WindowInsetsController as _BaseWindowInsetsController
# ═══════════════════════════════════════════════════════════════
# ViewOutlineProvider
# ═══════════════════════════════════════════════════════════════
class ViewOutlineProvider(Stub):
"""ViewOutlineProvider — 视图轮廓提供者"""
class ViewOutlineProvider(_BaseViewOutlineProvider):
"""ViewOutlineProvider — 视图轮廓提供者 (继承 view.ViewOutlineProvider 的所有方法)"""
BACKGROUND = None
BOUNDS = None
@@ -102,8 +118,8 @@ class Outline(Stub):
# ViewPropertyAnimator
# ═══════════════════════════════════════════════════════════════
class ViewPropertyAnimator(Stub):
"""ViewPropertyAnimator — 视图属性动画器"""
class ViewPropertyAnimator(_BaseViewPropertyAnimator):
"""ViewPropertyAnimator — 视图属性动画器 (继承 view.ViewPropertyAnimator 的所有方法)"""
def __init__(self, view: Any = None):
super().__init__()
@@ -384,8 +400,8 @@ class ViewStructure(Stub):
# ViewTreeObserver
# ═══════════════════════════════════════════════════════════════
class ViewTreeObserver(Stub):
"""ViewTreeObserver — 视图树观察者"""
class ViewTreeObserver(_BaseViewTreeObserver):
"""ViewTreeObserver — 视图树观察者 (继承 view.ViewTreeObserver 的所有方法)"""
def __init__(self):
super().__init__()
@@ -532,8 +548,8 @@ class ViewDebug(Stub):
# ViewConfiguration
# ═══════════════════════════════════════════════════════════════
class ViewConfiguration(Stub):
"""ViewConfiguration — 视图配置"""
class ViewConfiguration(_BaseViewConfiguration):
"""ViewConfiguration — 视图配置 (继承 view.ViewConfiguration 的所有方法)"""
def __init__(self):
super().__init__()
@@ -618,8 +634,8 @@ class ViewConfiguration(Stub):
# ViewParent (扩展)
# ═══════════════════════════════════════════════════════════════
class ViewParent(Stub):
"""ViewParent — 视图父容器接口扩展"""
class ViewParent(_BaseViewParent):
"""ViewParent — 视图父容器接口扩展 (继承 view.ViewParent 的所有方法)"""
def requestLayout(self) -> None:
pass
@@ -954,8 +970,8 @@ class ViewOverlay(Stub):
# WindowInsets / DisplayCutout / Display
# ═══════════════════════════════════════════════════════════════
class WindowInsets(Stub):
"""WindowInsets — 窗口插入区域"""
class WindowInsets(_BaseWindowInsets):
"""WindowInsets — 窗口插入区域 (继承 view.WindowInsets 的所有方法)"""
def __init__(self):
super().__init__()
@@ -1087,8 +1103,8 @@ class DisplayCutout(Stub):
return f"DisplayCutout(safe={self._safe_insets})"
class Display(Stub):
"""Display — 屏幕显示信息"""
class Display(_BaseDisplay):
"""Display — 屏幕显示信息 (继承 view.Display 的所有方法)"""
DEFAULT_DISPLAY = 0
FLAG_PRESENTATION = 1
@@ -1430,8 +1446,8 @@ WINDOW_INSETS_ANIMATION_TYPE_TRANSLATION = 2
WINDOW_INSETS_ANIMATION_TYPE_ALPHA_AND_TRANSLATION = 3
class DragEvent(Stub):
"""DragEvent — 拖放事件"""
class DragEvent(_BaseDragEvent):
"""DragEvent — 拖放事件 (继承 view.DragEvent 的所有方法)"""
ACTION_DRAG_STARTED = DRAG_EVENT_ACTION_DRAG_STARTED
ACTION_DRAG_ENTERED = DRAG_EVENT_ACTION_DRAG_ENTERED
@@ -1474,8 +1490,8 @@ class DragEvent(Stub):
return f"DragEvent(action={actions.get(self._action, 'UNKNOWN')})"
class GestureDetector(Stub):
"""GestureDetector — 手势检测器"""
class GestureDetector(_BaseGestureDetector):
"""GestureDetector — 手势检测器 (继承 view.GestureDetector 的所有方法)"""
class SimpleOnGestureListener(Stub):
"""GestureDetector.SimpleOnGestureListener — 简单手势监听器"""
@@ -2090,8 +2106,8 @@ class ContextMenu(Menu):
# ScaleGestureDetector / SoundEffectConstants / Surface / etc.
# ═══════════════════════════════════════════════════════════════
class ScaleGestureDetector(Stub):
"""ScaleGestureDetector — 缩放手势检测器"""
class ScaleGestureDetector(_BaseScaleGestureDetector):
"""ScaleGestureDetector — 缩放手势检测器 (继承 view.ScaleGestureDetector 的所有方法)"""
class SimpleOnScaleGestureListener(Stub):
def onScale(self, detector: "ScaleGestureDetector") -> bool:
@@ -2171,8 +2187,8 @@ class ScaleGestureDetector(Stub):
f"inProgress={self._in_progress})")
class SoundEffectConstants(Stub):
"""SoundEffectConstants — 音效常量"""
class SoundEffectConstants(_BaseSoundEffectConstants):
"""SoundEffectConstants — 音效常量 (继承 view.SoundEffectConstants 的所有方法)"""
CLICK = 0
NAVIGATION_UP = 1
@@ -2189,8 +2205,8 @@ class SoundEffectConstants(Stub):
return SoundEffectConstants.NAVIGATION_UP
class Surface(Stub):
"""Surface — 表面"""
class Surface(_BaseSurface):
"""Surface — 表面 (继承 view.Surface 的所有方法)"""
ROTATION_0 = 0
ROTATION_90 = 1
@@ -2263,8 +2279,8 @@ class SurfaceControl(Stub):
return f"SurfaceControl(layer={self._layer}, visible={self._visible})"
class SurfaceView(Stub):
"""SurfaceView — 表面视图扩展"""
class SurfaceView(_BaseSurfaceView):
"""SurfaceView — 表面视图扩展 (继承 view.SurfaceView 的所有方法)"""
def __init__(self, context: Any = None):
super().__init__()
@@ -2291,8 +2307,8 @@ class SurfaceView(Stub):
return "SurfaceView()"
class TextureView(Stub):
"""TextureView — 纹理视图"""
class TextureView(_BaseTextureView):
"""TextureView — 纹理视图扩展 (继承 view.TextureView 的所有方法)"""
def __init__(self, context: Any = None):
super().__init__()
@@ -2335,8 +2351,8 @@ class TouchDelegate(Stub):
return f"TouchDelegate(delegate={self._delegate_view})"
class VelocityTracker(Stub):
"""VelocityTracker — 速度追踪器"""
class VelocityTracker(_BaseVelocityTracker):
"""VelocityTracker — 速度追踪器 (继承 view.VelocityTracker 的所有方法)"""
def __init__(self, strategy: str = ""):
super().__init__()
@@ -2452,8 +2468,8 @@ class WindowInsetsAnimation(Stub):
f"fraction={self._interpolated_fraction})")
class WindowInsetsController(Stub):
"""WindowInsetsController — 窗口插入控制器"""
class WindowInsetsController(_BaseWindowInsetsController):
"""WindowInsetsController — 窗口插入控制器 (继承 view.WindowInsetsController 的所有方法)"""
APPEARANCE_OPAQUE_STATUS_BARS = 1
APPEARANCE_OPAQUE_NAVIGATION_BARS = 2