Browse Source

Merge pull request #6316 from SomberNight/202007_fix_android_back_button

android: fix back button not working (main surface loses focus)
bip39-recovery
ThomasV 5 years ago
committed by GitHub
parent
commit
d49fcf19d8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      contrib/android/Dockerfile
  2. 11
      electrum/gui/kivy/main_window.py

4
contrib/android/Dockerfile

@ -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

11
electrum/gui/kivy/main_window.py

@ -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:

Loading…
Cancel
Save