pythonnative 0.17.0__tar.gz → 0.18.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pythonnative-0.17.0/src/pythonnative.egg-info → pythonnative-0.18.0}/PKG-INFO +3 -1
- {pythonnative-0.17.0 → pythonnative-0.18.0}/README.md +2 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/pyproject.toml +3 -1
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/__init__.py +53 -2
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/animated.py +33 -7
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/components.py +547 -10
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/layout.py +35 -1
- pythonnative-0.18.0/src/pythonnative/native_modules/__init__.py +79 -0
- pythonnative-0.18.0/src/pythonnative/native_modules/app_state.py +94 -0
- pythonnative-0.18.0/src/pythonnative/native_modules/battery.py +139 -0
- pythonnative-0.18.0/src/pythonnative/native_modules/biometrics.py +156 -0
- pythonnative-0.18.0/src/pythonnative/native_modules/clipboard.py +142 -0
- pythonnative-0.18.0/src/pythonnative/native_modules/haptics.py +180 -0
- pythonnative-0.18.0/src/pythonnative/native_modules/linking.py +179 -0
- pythonnative-0.18.0/src/pythonnative/native_modules/net_info.py +151 -0
- pythonnative-0.18.0/src/pythonnative/native_modules/permissions.py +200 -0
- pythonnative-0.18.0/src/pythonnative/native_modules/secure_store.py +193 -0
- pythonnative-0.18.0/src/pythonnative/native_modules/share.py +155 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/native_views/android.py +1068 -30
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/native_views/ios.py +1019 -32
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/navigation.py +57 -2
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/reconciler.py +38 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/screen.py +52 -3
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/storage.py +23 -14
- {pythonnative-0.17.0 → pythonnative-0.18.0/src/pythonnative.egg-info}/PKG-INFO +3 -1
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative.egg-info/SOURCES.txt +12 -0
- pythonnative-0.18.0/tests/test_extended_components.py +296 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_layout.py +80 -0
- pythonnative-0.18.0/tests/test_native_modules.py +268 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_reconciler.py +39 -0
- pythonnative-0.17.0/src/pythonnative/native_modules/__init__.py +0 -25
- {pythonnative-0.17.0 → pythonnative-0.18.0}/LICENSE +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/setup.cfg +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/_ios_log.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/alerts.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/cli/__init__.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/cli/pn.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/element.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/hooks.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/hot_reload.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/native_modules/camera.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/native_modules/file_system.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/native_modules/location.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/native_modules/notifications.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/native_views/__init__.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/native_views/base.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/net.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/platform.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/platform_metrics.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/runtime.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/sdk/__init__.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/sdk/_components.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/style.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/build.gradle +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/proguard-rules.pro +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/androidTest/java/com/pythonnative/android_template/ExampleInstrumentedTest.kt +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/AndroidManifest.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/MainActivity.kt +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/Navigator.kt +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/PNVirtualListView.java +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/ScreenFragment.kt +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/drawable/ic_launcher_background.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/layout/activity_main.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/navigation/nav_graph.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/values/colors.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/values/strings.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/values/themes.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/values-night/themes.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/xml/backup_rules.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/main/res/xml/data_extraction_rules.xml +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/app/src/test/java/com/pythonnative/android_template/ExampleUnitTest.kt +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/build.gradle +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.jar +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.properties +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/gradle.properties +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/gradlew +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/gradlew.bat +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/android_template/settings.gradle +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_template/AppDelegate.swift +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/AccentColor.colorset/Contents.json +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/Contents.json +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_template/Base.lproj/LaunchScreen.storyboard +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_template/Base.lproj/Main.storyboard +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_template/Info.plist +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_template/SceneDelegate.swift +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_template/ViewController.swift +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_template.xcodeproj/project.pbxproj +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_template.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_templateTests/ios_templateTests.swift +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITests.swift +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITestsLaunchTests.swift +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative/utils.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative.egg-info/dependency_links.txt +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative.egg-info/entry_points.txt +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative.egg-info/requires.txt +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/src/pythonnative.egg-info/top_level.txt +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_alert.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_animated.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_async_hooks.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_cli.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_components.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_element.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_hooks.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_hot_reload.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_ios_log.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_metric_hooks.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_native_views.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_navigation.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_net.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_new_components.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_platform.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_platform_metrics.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_ref.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_runtime.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_screen.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_sdk.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_smoke.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_storage.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_style.py +0 -0
- {pythonnative-0.17.0 → pythonnative-0.18.0}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythonnative
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.18.0
|
|
4
4
|
Summary: Cross-platform native UI toolkit for Android and iOS
|
|
5
5
|
Author: Owen Carey
|
|
6
6
|
License: MIT License
|
|
@@ -97,6 +97,8 @@ PythonNative is a cross-platform toolkit for building native Android and iOS app
|
|
|
97
97
|
## Features
|
|
98
98
|
|
|
99
99
|
- **Declarative UI:** Describe *what* your UI should look like with element functions (`Text`, `Button`, `Column`, `Row`, etc.). PythonNative creates and updates native views automatically.
|
|
100
|
+
- **Rich component library:** 25+ built-in components backed by real native widgets — `TextInput`, `Image` / `ImageBackground`, `ScrollView`, `FlatList` / `SectionList`, `Modal`, `Pressable` / `TouchableOpacity`, `Switch` / `Checkbox`, `Slider`, `SegmentedControl`, `Picker`, `DatePicker`, `ProgressBar` / `ActivityIndicator`, `WebView`, and more.
|
|
101
|
+
- **Device APIs:** Cross-platform modules for `Camera`, `Location`, `FileSystem`, `Notifications`, `Clipboard`, `Share`, `Linking`, `Permissions`, `AppState`, `NetInfo`, `SecureStore`, `Battery`, `Haptics` / `Vibration`, and `Biometrics` — plus reactive `use_app_state` and `use_net_info` hooks.
|
|
100
102
|
- **Hooks and function components:** Manage state with `use_state`, side effects with `use_effect`, and navigation with `use_navigation`, all through one consistent pattern.
|
|
101
103
|
- **Typed `style` prop:** Pass all visual and layout properties through a single `style` dict, fully described by the `pn.Style` `TypedDict` and the ergonomic `pn.style(...)` helper for IDE autocomplete and static checking. Compose reusable styles with `StyleSheet`.
|
|
102
104
|
- **Cross-platform flexbox engine:** A pure-Python, Yoga-style layout engine computes frames once and applies them to native views, so `flex`, `padding`, `aspect_ratio`, and `position: "absolute"` produce the same geometry on Android and iOS.
|
|
@@ -31,6 +31,8 @@ PythonNative is a cross-platform toolkit for building native Android and iOS app
|
|
|
31
31
|
## Features
|
|
32
32
|
|
|
33
33
|
- **Declarative UI:** Describe *what* your UI should look like with element functions (`Text`, `Button`, `Column`, `Row`, etc.). PythonNative creates and updates native views automatically.
|
|
34
|
+
- **Rich component library:** 25+ built-in components backed by real native widgets — `TextInput`, `Image` / `ImageBackground`, `ScrollView`, `FlatList` / `SectionList`, `Modal`, `Pressable` / `TouchableOpacity`, `Switch` / `Checkbox`, `Slider`, `SegmentedControl`, `Picker`, `DatePicker`, `ProgressBar` / `ActivityIndicator`, `WebView`, and more.
|
|
35
|
+
- **Device APIs:** Cross-platform modules for `Camera`, `Location`, `FileSystem`, `Notifications`, `Clipboard`, `Share`, `Linking`, `Permissions`, `AppState`, `NetInfo`, `SecureStore`, `Battery`, `Haptics` / `Vibration`, and `Biometrics` — plus reactive `use_app_state` and `use_net_info` hooks.
|
|
34
36
|
- **Hooks and function components:** Manage state with `use_state`, side effects with `use_effect`, and navigation with `use_navigation`, all through one consistent pattern.
|
|
35
37
|
- **Typed `style` prop:** Pass all visual and layout properties through a single `style` dict, fully described by the `pn.Style` `TypedDict` and the ergonomic `pn.style(...)` helper for IDE autocomplete and static checking. Compose reusable styles with `StyleSheet`.
|
|
36
38
|
- **Cross-platform flexbox engine:** A pure-Python, Yoga-style layout engine computes frames once and applies them to native views, so `flex`, `padding`, `aspect_ratio`, and `position: "absolute"` produce the same geometry on Android and iOS.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pythonnative"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.18.0"
|
|
8
8
|
description = "Cross-platform native UI toolkit for Android and iOS"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Owen Carey" }
|
|
@@ -69,6 +69,8 @@ Documentation = "https://docs.pythonnative.com/"
|
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
|
|
72
|
+
|
|
73
|
+
|
|
72
74
|
[tool.setuptools.packages.find]
|
|
73
75
|
where = ["src"]
|
|
74
76
|
|
|
@@ -51,7 +51,7 @@ Example:
|
|
|
51
51
|
```
|
|
52
52
|
"""
|
|
53
53
|
|
|
54
|
-
__version__ = "0.
|
|
54
|
+
__version__ = "0.18.0"
|
|
55
55
|
|
|
56
56
|
from . import runtime, sdk
|
|
57
57
|
from .alerts import Alert
|
|
@@ -61,11 +61,17 @@ from .components import (
|
|
|
61
61
|
ActivityIndicatorProps,
|
|
62
62
|
Button,
|
|
63
63
|
ButtonProps,
|
|
64
|
+
Checkbox,
|
|
65
|
+
CheckboxProps,
|
|
64
66
|
Column,
|
|
67
|
+
DatePicker,
|
|
68
|
+
DatePickerProps,
|
|
65
69
|
ErrorBoundary,
|
|
66
70
|
FlatList,
|
|
67
71
|
Fragment,
|
|
68
72
|
Image,
|
|
73
|
+
ImageBackground,
|
|
74
|
+
ImageBackgroundProps,
|
|
69
75
|
ImageProps,
|
|
70
76
|
KeyboardAvoidingView,
|
|
71
77
|
KeyboardAvoidingViewProps,
|
|
@@ -84,6 +90,8 @@ from .components import (
|
|
|
84
90
|
ScrollView,
|
|
85
91
|
ScrollViewProps,
|
|
86
92
|
SectionList,
|
|
93
|
+
SegmentedControl,
|
|
94
|
+
SegmentedControlProps,
|
|
87
95
|
Slider,
|
|
88
96
|
SliderProps,
|
|
89
97
|
Spacer,
|
|
@@ -96,6 +104,8 @@ from .components import (
|
|
|
96
104
|
TextInput,
|
|
97
105
|
TextInputProps,
|
|
98
106
|
TextProps,
|
|
107
|
+
TouchableOpacity,
|
|
108
|
+
TouchableOpacityProps,
|
|
99
109
|
View,
|
|
100
110
|
ViewProps,
|
|
101
111
|
WebView,
|
|
@@ -126,7 +136,25 @@ from .hooks import (
|
|
|
126
136
|
use_state,
|
|
127
137
|
use_window_dimensions,
|
|
128
138
|
)
|
|
129
|
-
from .native_modules import
|
|
139
|
+
from .native_modules import (
|
|
140
|
+
AppState,
|
|
141
|
+
Battery,
|
|
142
|
+
Biometrics,
|
|
143
|
+
Camera,
|
|
144
|
+
Clipboard,
|
|
145
|
+
FileSystem,
|
|
146
|
+
Haptics,
|
|
147
|
+
Linking,
|
|
148
|
+
Location,
|
|
149
|
+
NetInfo,
|
|
150
|
+
Notifications,
|
|
151
|
+
Permissions,
|
|
152
|
+
SecureStore,
|
|
153
|
+
Share,
|
|
154
|
+
Vibration,
|
|
155
|
+
use_app_state,
|
|
156
|
+
use_net_info,
|
|
157
|
+
)
|
|
130
158
|
from .navigation import (
|
|
131
159
|
NavigationContainer,
|
|
132
160
|
create_drawer_navigator,
|
|
@@ -178,11 +206,14 @@ __all__ = [
|
|
|
178
206
|
# Components
|
|
179
207
|
"ActivityIndicator",
|
|
180
208
|
"Button",
|
|
209
|
+
"Checkbox",
|
|
181
210
|
"Column",
|
|
211
|
+
"DatePicker",
|
|
182
212
|
"ErrorBoundary",
|
|
183
213
|
"FlatList",
|
|
184
214
|
"Fragment",
|
|
185
215
|
"Image",
|
|
216
|
+
"ImageBackground",
|
|
186
217
|
"KeyboardAvoidingView",
|
|
187
218
|
"Modal",
|
|
188
219
|
"Picker",
|
|
@@ -193,17 +224,22 @@ __all__ = [
|
|
|
193
224
|
"SafeAreaView",
|
|
194
225
|
"ScrollView",
|
|
195
226
|
"SectionList",
|
|
227
|
+
"SegmentedControl",
|
|
196
228
|
"Slider",
|
|
197
229
|
"Spacer",
|
|
198
230
|
"StatusBar",
|
|
199
231
|
"Switch",
|
|
200
232
|
"Text",
|
|
201
233
|
"TextInput",
|
|
234
|
+
"TouchableOpacity",
|
|
202
235
|
"View",
|
|
203
236
|
"WebView",
|
|
204
237
|
# Built-in Props dataclasses
|
|
205
238
|
"ActivityIndicatorProps",
|
|
206
239
|
"ButtonProps",
|
|
240
|
+
"CheckboxProps",
|
|
241
|
+
"DatePickerProps",
|
|
242
|
+
"ImageBackgroundProps",
|
|
207
243
|
"ImageProps",
|
|
208
244
|
"KeyboardAvoidingViewProps",
|
|
209
245
|
"ModalProps",
|
|
@@ -212,12 +248,14 @@ __all__ = [
|
|
|
212
248
|
"ProgressBarProps",
|
|
213
249
|
"SafeAreaViewProps",
|
|
214
250
|
"ScrollViewProps",
|
|
251
|
+
"SegmentedControlProps",
|
|
215
252
|
"SliderProps",
|
|
216
253
|
"SpacerProps",
|
|
217
254
|
"StatusBarProps",
|
|
218
255
|
"SwitchProps",
|
|
219
256
|
"TextInputProps",
|
|
220
257
|
"TextProps",
|
|
258
|
+
"TouchableOpacityProps",
|
|
221
259
|
"ViewProps",
|
|
222
260
|
"WebViewProps",
|
|
223
261
|
# Core
|
|
@@ -286,10 +324,23 @@ __all__ = [
|
|
|
286
324
|
# Imperative
|
|
287
325
|
"Alert",
|
|
288
326
|
# Native modules
|
|
327
|
+
"AppState",
|
|
328
|
+
"Battery",
|
|
329
|
+
"Biometrics",
|
|
289
330
|
"Camera",
|
|
331
|
+
"Clipboard",
|
|
290
332
|
"FileSystem",
|
|
333
|
+
"Haptics",
|
|
334
|
+
"Linking",
|
|
291
335
|
"Location",
|
|
336
|
+
"NetInfo",
|
|
292
337
|
"Notifications",
|
|
338
|
+
"Permissions",
|
|
339
|
+
"SecureStore",
|
|
340
|
+
"Share",
|
|
341
|
+
"Vibration",
|
|
342
|
+
"use_app_state",
|
|
343
|
+
"use_net_info",
|
|
293
344
|
# Networking + persistence
|
|
294
345
|
"AsyncStorage",
|
|
295
346
|
"fetch",
|
|
@@ -62,6 +62,12 @@ from .style import StyleProp, resolve_style
|
|
|
62
62
|
_TARGET_FPS = 60.0
|
|
63
63
|
_FRAME_DT = 1.0 / _TARGET_FPS
|
|
64
64
|
|
|
65
|
+
# Upper bound on how much wall-clock time the animation loop will try to
|
|
66
|
+
# catch up on in a single iteration after thread starvation. At 60 fps
|
|
67
|
+
# this is ~333 ms of simulated motion; further drift is dropped to keep
|
|
68
|
+
# the loop responsive.
|
|
69
|
+
_MAX_CATCHUP_FRAMES = 20
|
|
70
|
+
|
|
65
71
|
_EASINGS: Dict[str, Callable[[float], float]] = {
|
|
66
72
|
"linear": lambda t: t,
|
|
67
73
|
"ease_in": lambda t: t * t,
|
|
@@ -199,6 +205,20 @@ class _AnimationManager:
|
|
|
199
205
|
|
|
200
206
|
def _loop(self) -> None:
|
|
201
207
|
last = time.monotonic()
|
|
208
|
+
# Clamping the per-tick dt is important for numerical stability:
|
|
209
|
+
# an underdamped spring with a 0.3 s step explodes immediately,
|
|
210
|
+
# and on iOS/Android the animation thread can be starved for
|
|
211
|
+
# several frames during render bursts. We integrate physics on a
|
|
212
|
+
# clamped dt (max 2 target frames) and sub-step when wall-clock
|
|
213
|
+
# has advanced more than that, so the perceived motion still
|
|
214
|
+
# tracks real time at most a couple of frames behind. After an
|
|
215
|
+
# extreme starvation (e.g. the app was backgrounded for seconds)
|
|
216
|
+
# we cap the catch-up at ``_MAX_CATCHUP_FRAMES`` worth of
|
|
217
|
+
# physics; any further wall-clock drift is dropped on the floor,
|
|
218
|
+
# which keeps the loop responsive instead of spinning forward
|
|
219
|
+
# through hundreds of substeps.
|
|
220
|
+
max_step = _FRAME_DT * 2.0
|
|
221
|
+
max_catchup = _FRAME_DT * _MAX_CATCHUP_FRAMES
|
|
202
222
|
while not self._stopped:
|
|
203
223
|
now = time.monotonic()
|
|
204
224
|
dt = now - last
|
|
@@ -209,13 +229,19 @@ class _AnimationManager:
|
|
|
209
229
|
time.sleep(0.05)
|
|
210
230
|
last = time.monotonic()
|
|
211
231
|
continue
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
232
|
+
remaining = min(dt, max_catchup)
|
|
233
|
+
while remaining > 0.0:
|
|
234
|
+
step = remaining if remaining <= max_step else max_step
|
|
235
|
+
remaining -= step
|
|
236
|
+
for anim in active:
|
|
237
|
+
if getattr(anim, "_completed", False):
|
|
238
|
+
continue
|
|
239
|
+
try:
|
|
240
|
+
finished = anim.advance(step)
|
|
241
|
+
except Exception:
|
|
242
|
+
finished = True
|
|
243
|
+
if finished:
|
|
244
|
+
self.remove(anim)
|
|
219
245
|
time.sleep(_FRAME_DT)
|
|
220
246
|
|
|
221
247
|
|