| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 593fee4 commit d7ac93b
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,7 +79,7 @@ class _PNButtonHandler(NSObject): # type: ignore[valid-type] | |||
| 79 | 79 | _callback: Optional[Callable[[], None]] = None | |
| 80 | 80 | ||
| 81 | 81 | @objc_method | |
| 82 | - def onTap_(self, sender: Any) -> None: | ||
| 82 | + def onTap_(self, sender: object) -> None: | ||
| 83 | 83 | try: | |
| 84 | 84 | callback = self._callback | |
| 85 | 85 | if callback is not None: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,9 +72,26 @@ def __init__(self) -> None: | |||
| 72 | 72 | ||
| 73 | 73 | def add_view(self, view: Any) -> None: | |
| 74 | 74 | self.views.append(view) | |
| 75 | - # Ensure view is a subview of scrollview | ||
| 76 | - if view.native_instance not in self.native_instance.subviews: | ||
| 75 | + # Add as subview and size child to fill scroll view by default so content is visible | ||
| 76 | + try: | ||
| 77 | 77 | self.native_instance.addSubview_(view.native_instance) | |
| 78 | + except Exception: | ||
| 79 | + pass | ||
| 80 | + # Default layout: if the child has no size yet, size it to fill the scroll view | ||
| 81 | + # and enable flexible width/height. If the child is already sized explicitly, | ||
| 82 | + # leave it unchanged. | ||
| 83 | + try: | ||
| 84 | + frame = getattr(view.native_instance, "frame") | ||
| 85 | + size = getattr(frame, "size", None) | ||
| 86 | + width = getattr(size, "width", 0) if size is not None else 0 | ||
| 87 | + height = getattr(size, "height", 0) if size is not None else 0 | ||
| 88 | + if width <= 0 or height <= 0: | ||
| 89 | + bounds = self.native_instance.bounds | ||
| 90 | + view.native_instance.setFrame_(bounds) | ||
| 91 | + # UIViewAutoresizingFlexibleWidth (2) | UIViewAutoresizingFlexibleHeight (16) | ||
| 92 | + view.native_instance.setAutoresizingMask_(2 | 16) | ||
| 93 | + except Exception: | ||
| 94 | + pass | ||
| 78 | 95 | ||
| 79 | 96 | @staticmethod | |
| 80 | 97 | def wrap(view: Any) -> "ScrollView": | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,12 +6,12 @@ plugins { | |||
| 6 | 6 | ||
| 7 | 7 | android { | |
| 8 | 8 | namespace 'com.pythonnative.android_template' | |
| 9 | - compileSdk 33 | ||
| 9 | + compileSdk 34 | ||
| 10 | 10 | ||
| 11 | 11 | defaultConfig { | |
| 12 | 12 | applicationId "com.pythonnative.android_template" | |
| 13 | 13 | minSdk 24 | |
| 14 | - targetSdk 33 | ||
| 14 | + targetSdk 34 | ||
| 15 | 15 | versionCode 1 | |
| 16 | 16 | versionName "1.0" | |
| 17 | 17 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | <argument | |
| 17 | 17 | android:name="args_json" | |
| 18 | 18 | app:argType="string" | |
| 19 | - android:nullable="true" /> | ||
| 19 | + app:nullable="true" /> | ||
| 20 | 20 | </fragment> | |
| 21 | 21 | ||
| 22 | 22 | </navigation> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. | |
| 2 | 2 | plugins { | |
| 3 | - id 'com.android.application' version '8.0.2' apply false | ||
| 4 | - id 'com.android.library' version '8.0.2' apply false | ||
| 5 | - id 'org.jetbrains.kotlin.android' version '1.8.20' apply false | ||
| 3 | + id 'com.android.application' version '8.2.2' apply false | ||
| 4 | + id 'com.android.library' version '8.2.2' apply false | ||
| 5 | + id 'org.jetbrains.kotlin.android' version '1.9.22' apply false | ||
| 6 | 6 | id 'com.chaquo.python' version '14.0.2' apply false | |
| 7 | 7 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | #Mon Jun 19 11:09:16 PDT 2023 | |
| 2 | 2 | distributionBase=GRADLE_USER_HOME | |
| 3 | 3 | distributionPath=wrapper/dists | |
| 4 | - distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip | ||
| 4 | + distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip | ||
| 5 | 5 | zipStoreBase=GRADLE_USER_HOME | |
| 6 | 6 | zipStorePath=wrapper/dists | |
| Back | FazBrowse Home | New Git URL |
0 commit comments