| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 94a437f commit b55edd4
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,8 @@ def on_create(self): | |||
| 12 | 12 | # list_view = pn.ListView(self.native_instance, list_data) | |
| 13 | 13 | # stack_view.add_view(list_view) | |
| 14 | 14 | button = pn.Button(self.native_instance, "Button") | |
| 15 | - button.set_on_click(lambda: print("Button was clicked!")) | ||
| 15 | + button.set_on_click(lambda: self.navigate_to("")) | ||
| 16 | + # button.set_on_click(lambda: print("Button was clicked!")) | ||
| 16 | 17 | stack_view.add_view(button) | |
| 17 | 18 | self.set_root_view(stack_view) | |
| 18 | 19 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,9 +8,8 @@ def __init__(self, native_instance): | |||
| 8 | 8 | def on_create(self): | |
| 9 | 9 | super().on_create() | |
| 10 | 10 | stack_view = pn.StackView(self.native_instance) | |
| 11 | - button = pn.Button(self.native_instance, "Button") | ||
| 12 | - button.set_on_click(lambda: print("Button was clicked!")) | ||
| 13 | - stack_view.add_view(button) | ||
| 11 | + label = pn.Label(self.native_instance, "Second page!") | ||
| 12 | + stack_view.add_view(label) | ||
| 14 | 13 | self.set_root_view(stack_view) | |
| 15 | 14 | ||
| 16 | 15 | def on_start(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,8 +133,9 @@ def on_restore_instance_state(self) -> None: | |||
| 133 | 133 | print("Android on_restore_instance_state() called") | |
| 134 | 134 | ||
| 135 | 135 | def navigate_to(self, page) -> None: | |
| 136 | - IntentClass = jclass("android.content.Intent") | ||
| 137 | - intent = IntentClass(self.native_instance, page.native_class) | ||
| 136 | + # intent = jclass("android.content.Intent")(self.native_instance, page.native_class) | ||
| 137 | + intent = jclass("android.content.Intent")(self.native_instance, | ||
| 138 | + jclass("com.pythonnative.pythonnative.SecondActivity")) | ||
| 138 | 139 | self.native_instance.startActivity(intent) | |
| 139 | 140 | ||
| 140 | 141 | else: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments