From f18a957ed500865a9d80ca9f7379062e6cda7c1a Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 8 Jan 2019 13:55:55 -0800 Subject: [PATCH] kill progress when owner view goes away BT Invite progress was sticking around when Board left because it wasn't foreground. --- .../main/java/org/eehouse/android/xw4/DelegateBase.java | 1 + .../main/java/org/eehouse/android/xw4/DlgDelegate.java | 5 +++++ .../main/java/org/eehouse/android/xw4/InviteDelegate.java | 8 +------- .../java/org/eehouse/android/xw4/WiDirInviteDelegate.java | 6 ++++++ xwords4/android/app/src/main/res/values/strings.xml | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java index 0900cb3cd..c5b4cf300 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java @@ -159,6 +159,7 @@ public class DelegateBase implements DlgClickNotify, { m_isVisible = false; XWServiceHelper.setListener( null ); + m_dlgDelegate.onPausing(); } protected DelegateBase curThis() diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegate.java index 09bba0785..2d2238ee1 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegate.java @@ -326,6 +326,11 @@ public class DlgDelegate { m_handler = new Handler(); } + void onPausing() + { + stopProgress(); + } + private void showOKOnlyDialogThen( String msg, Action action, Object[] params, int titleId ) { diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InviteDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InviteDelegate.java index deabdb008..a6e8be4ac 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InviteDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/InviteDelegate.java @@ -171,13 +171,7 @@ abstract class InviteDelegate extends ListDelegateBase } } - protected void onBarButtonClicked( int id ) - { - Assert.fail(); // subclass must implement - } - - // Subclasses can do something here - protected void addToButtonBar( FrameLayout container ) {} + abstract void onBarButtonClicked( int id ); //////////////////////////////////////// // View.OnClickListener diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/WiDirInviteDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/WiDirInviteDelegate.java index eaff78b08..0a9c6418c 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/WiDirInviteDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/WiDirInviteDelegate.java @@ -77,6 +77,12 @@ public class WiDirInviteDelegate extends InviteDelegate WiDirService.unregisterDevSetListener( this ); } + protected void onBarButtonClicked( int id ) + { + // not implemented yet as there's no bar button + Assert.assertFalse( BuildConfig.DEBUG ); + } + @Override protected void onChildAdded( View child, InviterItem data ) { diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index c7f91bc9f..bdcb737ac 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -1835,7 +1835,7 @@ Rescan - Connecting... + Connecting… Sending invitation to CrossWords on %1$s Waiting for connection[s]