Merge pull request #6316 from SomberNight/202007_fix_android_back_button
android: fix back button not working (main surface loses focus)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user