Browse Source
android: fix back button not working (main surface loses focus)
fixes #6276
bip39-recovery
SomberNight
5 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
2 changed files with
14 additions and
1 deletions
-
contrib/android/Dockerfile
-
electrum/gui/kivy/main_window.py
|
|
@ -151,6 +151,7 @@ RUN cd /opt \ |
|
|
|
&& cd buildozer \ |
|
|
|
&& git remote add sombernight https://github.com/SomberNight/buildozer \ |
|
|
|
&& git fetch --all \ |
|
|
|
# commit: kivy/buildozer "1.2.0" tag |
|
|
|
&& git checkout "94cfcb8d591c11d6ad0e11f129b08c1e27a161c5^{commit}" \ |
|
|
|
&& python3 -m pip install --user -e . |
|
|
|
|
|
|
@ -160,7 +161,8 @@ RUN cd /opt \ |
|
|
|
&& cd python-for-android \ |
|
|
|
&& git remote add sombernight https://github.com/SomberNight/python-for-android \ |
|
|
|
&& git fetch --all \ |
|
|
|
&& git checkout "257cfacbdd523af0b5b6bb5b2ba64ab7a5c82d58^{commit}" \ |
|
|
|
# commit: from branch sombernight/electrum_20200703 |
|
|
|
&& git checkout "0dd2ce87a8f380d20505ca5dc1e2d2357b4a08fc^{commit}" \ |
|
|
|
&& python3 -m pip install --user -e . |
|
|
|
|
|
|
|
# build env vars |
|
|
|
|
|
@ -849,6 +849,17 @@ class ElectrumWindow(App): |
|
|
|
return |
|
|
|
self.use_change = self.wallet.use_change |
|
|
|
self.electrum_config.save_last_wallet(wallet) |
|
|
|
self.request_focus_for_main_view() |
|
|
|
|
|
|
|
def request_focus_for_main_view(self): |
|
|
|
if platform != 'android': |
|
|
|
return |
|
|
|
# The main view of the activity might be not have focus |
|
|
|
# in which case e.g. the OS "back" button would not work. |
|
|
|
# see #6276 (specifically "method 2" and "method 3") |
|
|
|
from jnius import autoclass |
|
|
|
PythonActivity = autoclass('org.kivy.android.PythonActivity') |
|
|
|
PythonActivity.requestFocusForMainView() |
|
|
|
|
|
|
|
def update_status(self, *dt): |
|
|
|
if not self.wallet: |
|
|
|