pythonnative 0.13.1__tar.gz → 0.14.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.13.1/src/pythonnative.egg-info → pythonnative-0.14.0}/PKG-INFO +1 -1
- {pythonnative-0.13.1 → pythonnative-0.14.0}/pyproject.toml +2 -1
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/__init__.py +1 -1
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/native_views/android.py +32 -1
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/native_views/ios.py +26 -1
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/navigation.py +17 -4
- {pythonnative-0.13.1 → pythonnative-0.14.0/src/pythonnative.egg-info}/PKG-INFO +1 -1
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_navigation.py +60 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/LICENSE +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/README.md +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/setup.cfg +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/_ios_log.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/alerts.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/animated.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/cli/__init__.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/cli/pn.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/components.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/element.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/hooks.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/hot_reload.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/layout.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/native_modules/__init__.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/native_modules/camera.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/native_modules/file_system.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/native_modules/location.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/native_modules/notifications.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/native_views/__init__.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/native_views/base.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/platform.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/platform_metrics.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/reconciler.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/screen.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/style.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/build.gradle +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/proguard-rules.pro +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/androidTest/java/com/pythonnative/android_template/ExampleInstrumentedTest.kt +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/AndroidManifest.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/MainActivity.kt +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/Navigator.kt +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/PNVirtualListView.java +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/ScreenFragment.kt +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/drawable/ic_launcher_background.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/layout/activity_main.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/navigation/nav_graph.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/values/colors.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/values/strings.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/values/themes.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/values-night/themes.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/xml/backup_rules.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/main/res/xml/data_extraction_rules.xml +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/app/src/test/java/com/pythonnative/android_template/ExampleUnitTest.kt +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/build.gradle +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.jar +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.properties +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/gradle.properties +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/gradlew +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/gradlew.bat +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/settings.gradle +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_template/AppDelegate.swift +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/AccentColor.colorset/Contents.json +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_template/Assets.xcassets/Contents.json +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_template/Base.lproj/LaunchScreen.storyboard +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_template/Base.lproj/Main.storyboard +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_template/Info.plist +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_template/SceneDelegate.swift +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_template/ViewController.swift +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_template.xcodeproj/project.pbxproj +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_template.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_templateTests/ios_templateTests.swift +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITests.swift +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITestsLaunchTests.swift +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/utils.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative.egg-info/SOURCES.txt +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative.egg-info/dependency_links.txt +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative.egg-info/entry_points.txt +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative.egg-info/requires.txt +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative.egg-info/top_level.txt +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_alert.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_animated.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_cli.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_components.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_element.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_hooks.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_hot_reload.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_ios_log.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_layout.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_metric_hooks.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_native_views.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_new_components.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_platform.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_platform_metrics.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_reconciler.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_ref.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_screen.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_smoke.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_style.py +0 -0
- {pythonnative-0.13.1 → pythonnative-0.14.0}/tests/test_utils.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pythonnative"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.14.0"
|
|
8
8
|
description = "Cross-platform native UI toolkit for Android and iOS"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Owen Carey" }
|
|
@@ -63,6 +63,7 @@ Documentation = "https://docs.pythonnative.com/"
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
|
|
66
|
+
|
|
66
67
|
[tool.setuptools.packages.find]
|
|
67
68
|
where = ["src"]
|
|
68
69
|
|
|
@@ -1116,10 +1116,41 @@ class TabBarHandler(AndroidViewHandler):
|
|
|
1116
1116
|
menu.clear()
|
|
1117
1117
|
for i, item in enumerate(items):
|
|
1118
1118
|
title = item.get("title", item.get("name", ""))
|
|
1119
|
-
menu.add(0, i, i, str(title))
|
|
1119
|
+
menu_item = menu.add(0, i, i, str(title))
|
|
1120
|
+
res_id = self._resolve_icon(item.get("icon"))
|
|
1121
|
+
if res_id:
|
|
1122
|
+
try:
|
|
1123
|
+
menu_item.setIcon(res_id)
|
|
1124
|
+
except Exception:
|
|
1125
|
+
pass
|
|
1120
1126
|
except Exception:
|
|
1121
1127
|
pass
|
|
1122
1128
|
|
|
1129
|
+
def _resolve_icon(self, icon: Any) -> int:
|
|
1130
|
+
"""Resolve a tab icon spec to an `android.R.drawable.*` res id.
|
|
1131
|
+
|
|
1132
|
+
Accepts a bare string (treated as the drawable's field name on
|
|
1133
|
+
``android.R.drawable``) or a dict of the form
|
|
1134
|
+
``{"ios": "...", "android": "ic_menu_home"}``. Returns ``0``
|
|
1135
|
+
when the icon can't be resolved, which the caller treats as
|
|
1136
|
+
"no icon".
|
|
1137
|
+
"""
|
|
1138
|
+
if icon is None:
|
|
1139
|
+
return 0
|
|
1140
|
+
name: Any = None
|
|
1141
|
+
if isinstance(icon, str):
|
|
1142
|
+
name = icon
|
|
1143
|
+
elif isinstance(icon, dict):
|
|
1144
|
+
name = icon.get("android")
|
|
1145
|
+
if not name:
|
|
1146
|
+
return 0
|
|
1147
|
+
try:
|
|
1148
|
+
RDrawable = jclass("android.R$drawable")
|
|
1149
|
+
res_id = getattr(RDrawable, str(name), 0)
|
|
1150
|
+
return int(res_id) if res_id else 0
|
|
1151
|
+
except Exception:
|
|
1152
|
+
return 0
|
|
1153
|
+
|
|
1123
1154
|
def _set_active(self, bnv: Any, active: Any, items: list) -> None:
|
|
1124
1155
|
if active and items:
|
|
1125
1156
|
for i, item in enumerate(items):
|
|
@@ -2345,13 +2345,38 @@ class TabBarHandler(IOSViewHandler):
|
|
|
2345
2345
|
|
|
2346
2346
|
def _set_bar_items(self, tab_bar: Any, items: list) -> None:
|
|
2347
2347
|
UITabBarItem = ObjCClass("UITabBarItem")
|
|
2348
|
+
UIImage = ObjCClass("UIImage")
|
|
2348
2349
|
bar_items = []
|
|
2349
2350
|
for i, item in enumerate(items):
|
|
2350
2351
|
title = item.get("title", item.get("name", ""))
|
|
2351
|
-
|
|
2352
|
+
image = self._resolve_icon(UIImage, item.get("icon"))
|
|
2353
|
+
bar_item = UITabBarItem.alloc().initWithTitle_image_tag_(str(title), image, i)
|
|
2352
2354
|
bar_items.append(bar_item)
|
|
2353
2355
|
tab_bar.setItems_animated_(bar_items, False)
|
|
2354
2356
|
|
|
2357
|
+
def _resolve_icon(self, UIImage: Any, icon: Any) -> Any:
|
|
2358
|
+
"""Resolve a tab icon spec to a UIImage, or return None.
|
|
2359
|
+
|
|
2360
|
+
Accepts a bare string (treated as an SF Symbol name) or a dict
|
|
2361
|
+
of the form ``{"ios": "house.fill", "android": "..."}``. SF
|
|
2362
|
+
Symbols are looked up via ``UIImage.systemImageNamed:``; names
|
|
2363
|
+
that don't resolve produce a text-only tab.
|
|
2364
|
+
"""
|
|
2365
|
+
if icon is None:
|
|
2366
|
+
return None
|
|
2367
|
+
name: Any = None
|
|
2368
|
+
if isinstance(icon, str):
|
|
2369
|
+
name = icon
|
|
2370
|
+
elif isinstance(icon, dict):
|
|
2371
|
+
name = icon.get("ios")
|
|
2372
|
+
if not name:
|
|
2373
|
+
return None
|
|
2374
|
+
try:
|
|
2375
|
+
image = UIImage.systemImageNamed_(str(name))
|
|
2376
|
+
return image if image else None
|
|
2377
|
+
except Exception:
|
|
2378
|
+
return None
|
|
2379
|
+
|
|
2355
2380
|
def _set_active(self, tab_bar: Any, active: Any, items: list) -> None:
|
|
2356
2381
|
if not active or not items:
|
|
2357
2382
|
return
|
|
@@ -570,10 +570,14 @@ def _tab_navigator_impl(screens: Any = None, initial_route: Optional[str] = None
|
|
|
570
570
|
if screen_def is None:
|
|
571
571
|
screen_def = screen_map[screen_list[0].name]
|
|
572
572
|
|
|
573
|
-
tab_items: List[Dict[str,
|
|
573
|
+
tab_items: List[Dict[str, Any]] = []
|
|
574
574
|
for s in screen_list:
|
|
575
575
|
if isinstance(s, _ScreenDef):
|
|
576
|
-
|
|
576
|
+
item: Dict[str, Any] = {"name": s.name, "title": s.options.get("title", s.name)}
|
|
577
|
+
icon = s.options.get("tab_bar_icon")
|
|
578
|
+
if icon is not None:
|
|
579
|
+
item["icon"] = icon
|
|
580
|
+
tab_items.append(item)
|
|
577
581
|
|
|
578
582
|
def on_tab_select(name: str) -> None:
|
|
579
583
|
switch_tab(name)
|
|
@@ -639,8 +643,17 @@ def create_tab_navigator() -> Any:
|
|
|
639
643
|
name: Route name and default tab title.
|
|
640
644
|
component: A `@component` function rendered when this
|
|
641
645
|
tab is active.
|
|
642
|
-
options: Optional per-screen settings
|
|
643
|
-
|
|
646
|
+
options: Optional per-screen settings. Recognized keys:
|
|
647
|
+
|
|
648
|
+
- `title` (str): Tab label.
|
|
649
|
+
- `tab_bar_icon` (str | dict): Native system icon
|
|
650
|
+
identifier. A string is used on every platform; a
|
|
651
|
+
dict like `{"ios": "house.fill", "android":
|
|
652
|
+
"ic_menu_home"}` selects per platform. iOS values
|
|
653
|
+
are resolved via SF Symbols
|
|
654
|
+
(`UIImage.systemImageNamed_`); Android values are
|
|
655
|
+
resolved against `android.R.drawable.<name>`.
|
|
656
|
+
Names that don't resolve fall back to text-only.
|
|
644
657
|
|
|
645
658
|
Returns:
|
|
646
659
|
A `_ScreenDef` consumed by `Navigator(...)`.
|
|
@@ -629,6 +629,66 @@ def test_tab_navigator_renders_native_tab_bar() -> None:
|
|
|
629
629
|
assert callable(tab_bar.props["on_tab_select"])
|
|
630
630
|
|
|
631
631
|
|
|
632
|
+
def test_tab_navigator_forwards_tab_bar_icon() -> None:
|
|
633
|
+
"""`tab_bar_icon` (string or per-platform dict) reaches the TabBar element."""
|
|
634
|
+
Tab = create_tab_navigator()
|
|
635
|
+
|
|
636
|
+
@component
|
|
637
|
+
def ScreenA() -> Element:
|
|
638
|
+
return Element("Text", {"text": "a"}, [])
|
|
639
|
+
|
|
640
|
+
@component
|
|
641
|
+
def ScreenB() -> Element:
|
|
642
|
+
return Element("Text", {"text": "b"}, [])
|
|
643
|
+
|
|
644
|
+
@component
|
|
645
|
+
def ScreenC() -> Element:
|
|
646
|
+
return Element("Text", {"text": "c"}, [])
|
|
647
|
+
|
|
648
|
+
backend = MockBackend()
|
|
649
|
+
rec = Reconciler(backend)
|
|
650
|
+
rec._screen_re_render = lambda: None
|
|
651
|
+
|
|
652
|
+
el = Tab.Navigator(
|
|
653
|
+
Tab.Screen(
|
|
654
|
+
"TabA",
|
|
655
|
+
component=ScreenA,
|
|
656
|
+
options={"title": "Tab A", "tab_bar_icon": "house.fill"},
|
|
657
|
+
),
|
|
658
|
+
Tab.Screen(
|
|
659
|
+
"TabB",
|
|
660
|
+
component=ScreenB,
|
|
661
|
+
options={
|
|
662
|
+
"title": "Tab B",
|
|
663
|
+
"tab_bar_icon": {"ios": "gearshape.fill", "android": "ic_menu_preferences"},
|
|
664
|
+
},
|
|
665
|
+
),
|
|
666
|
+
Tab.Screen("TabC", component=ScreenC, options={"title": "Tab C"}),
|
|
667
|
+
)
|
|
668
|
+
root = rec.mount(el)
|
|
669
|
+
|
|
670
|
+
def find_tab_bar(view: MockView) -> Any:
|
|
671
|
+
if view.type_name == "TabBar":
|
|
672
|
+
return view
|
|
673
|
+
for c in view.children:
|
|
674
|
+
r = find_tab_bar(c)
|
|
675
|
+
if r is not None:
|
|
676
|
+
return r
|
|
677
|
+
return None
|
|
678
|
+
|
|
679
|
+
tab_bar = find_tab_bar(root)
|
|
680
|
+
assert tab_bar is not None
|
|
681
|
+
assert tab_bar.props["items"] == [
|
|
682
|
+
{"name": "TabA", "title": "Tab A", "icon": "house.fill"},
|
|
683
|
+
{
|
|
684
|
+
"name": "TabB",
|
|
685
|
+
"title": "Tab B",
|
|
686
|
+
"icon": {"ios": "gearshape.fill", "android": "ic_menu_preferences"},
|
|
687
|
+
},
|
|
688
|
+
{"name": "TabC", "title": "Tab C"},
|
|
689
|
+
]
|
|
690
|
+
|
|
691
|
+
|
|
632
692
|
def test_tab_navigator_empty_screens() -> None:
|
|
633
693
|
Tab = create_tab_navigator()
|
|
634
694
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/native_modules/notifications.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/build.gradle
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/gradlew
RENAMED
|
File without changes
|
{pythonnative-0.13.1 → pythonnative-0.14.0}/src/pythonnative/templates/android_template/gradlew.bat
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|