From a1c92b6957cb6907169ec43bd5bba498ab5aa06d Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 27 Apr 2017 07:34:28 -0700 Subject: [PATCH] cleanup from review of changes --- xwords4/android/app/src/main/assets/changes.html | 1 + .../org/eehouse/android/xw4/BoardDelegate.java | 7 ------- .../main/java/org/eehouse/android/xw4/DBAlert.java | 2 +- .../java/org/eehouse/android/xw4/DelegateBase.java | 12 ++---------- .../eehouse/android/xw4/DictBrowseDelegate.java | 2 +- .../org/eehouse/android/xw4/GamesListDelegate.java | 14 -------------- .../java/org/eehouse/android/xw4/HostActivity.java | 10 ++-------- .../org/eehouse/android/xw4/SMSInviteDelegate.java | 2 +- 8 files changed, 8 insertions(+), 42 deletions(-) diff --git a/xwords4/android/app/src/main/assets/changes.html b/xwords4/android/app/src/main/assets/changes.html index eb5c2a542..72b26e3ac 100644 --- a/xwords4/android/app/src/main/assets/changes.html +++ b/xwords4/android/app/src/main/assets/changes.html @@ -38,6 +38,7 @@ work anyway.)
  • Don't open a closed group when moving games to it
  • Fix occasional crash
  • +
  • Switch from ant to gradle (dev. detail)
  • (The full changelog diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java index 5bba257ea..1d3f53a47 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java @@ -83,15 +83,8 @@ public class BoardDelegate extends DelegateBase NFCUtils.NFCActor { private static final String TAG = BoardDelegate.class.getSimpleName(); - public static final String INTENT_KEY_CHAT = "chat"; - private static final int SCREEN_ON_TIME = 10 * 60 * 1000; // 10 mins - private static final String DLG_TITLE = "DLG_TITLE"; - private static final String DLG_TITLESTR = "DLG_TITLESTR"; - private static final String DLG_BYTES = "DLG_BYTES"; - private static final String ROOM = "ROOM"; - private static final String PWDNAME = "PWDNAME"; private static final String SAVE_MYSIS = TAG + "/MYSIS"; private Activity m_activity; diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DBAlert.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DBAlert.java index 94ad546a7..b8e308127 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DBAlert.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DBAlert.java @@ -50,7 +50,7 @@ public class DBAlert extends XWDialogFragment { if ( null != obj && !(obj instanceof Serializable) ) { Log.d( TAG, "OOPS: %s not Serializable", obj.getClass().getName() ); - // Assert.fail(); + Assert.assertFalse( BuildConfig.DEBUG ); } } } 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 22fa58dbd..1efda71e1 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 @@ -100,6 +100,7 @@ public class DelegateBase implements DlgClickNotify, protected void onCreateContextMenu( ContextMenu menu, View view, ContextMenuInfo menuInfo ) {} protected boolean onContextItemSelected( MenuItem item ) { return false; } + protected void onStop() {} protected void onDestroy() {} protected void onWindowFocusChanged( boolean hasFocus ) {} protected boolean handleBackPressed() { return false; } @@ -156,16 +157,6 @@ public class DelegateBase implements DlgClickNotify, XWService.setListener( null ); } - protected void onStop() - { - // Alerts disappear on their own if not in dualpane mode - if ( false - && m_activity instanceof MainActivity - && ((MainActivity)m_activity).inDPMode() ) { - DlgDelegate.closeAlerts( m_activity, this ); - } - } - protected DelegateBase curThis() { DelegateBase result = null; @@ -433,6 +424,7 @@ public class DelegateBase implements DlgClickNotify, { DlgID dlgID = alert.getDlgID(); Log.d( TAG, "makeDialog(): not handling %s", dlgID.toString() ); + Assert.assertFalse( BuildConfig.DEBUG ); return null; } diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictBrowseDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictBrowseDelegate.java index 000b1e2c8..9bdb8fb39 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictBrowseDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictBrowseDelegate.java @@ -312,7 +312,7 @@ public class DictBrowseDelegate extends DelegateBase finish(); break; default: - Assert.assertTrue( !BuildConfig.DEBUG ); + Assert.assertFalse( BuildConfig.DEBUG ); } return handled; } diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java index eb4315735..83dabe748 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java @@ -929,20 +929,6 @@ public class GamesListDelegate extends ListDelegateBase .setEnabled( 0 <= m_mySIS.groupSelItem ); } - @Override - protected void prepareDialog( DlgID dlgID, Dialog dialog ) - { - Assert.fail(); - /* - AlertDialog ad = (AlertDialog)dialog; - switch( dlgID ) { - case CHANGE_GROUP: - ad.getButton( AlertDialog.BUTTON_POSITIVE ).setEnabled( false ); - break; - } - */ - } - @Override protected void init( Bundle savedInstanceState ) { diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/HostActivity.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/HostActivity.java index 5bff99313..c50923579 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/HostActivity.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/HostActivity.java @@ -1,7 +1,6 @@ /* -*- compile-command: "find-and-gradle.sh installXw4Debug"; -*- */ /* - * Copyright 2009-2010 by Eric House (xwords@eehouse.org). All - * rights reserved. + * Copyright 2017 by Eric House (xwords@eehouse.org). All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -21,16 +20,11 @@ package org.eehouse.android.xw4; import android.os.Bundle; -import android.app.Activity; -import android.content.Intent; public class HostActivity extends XWActivity { - private HostDelegate m_dlgt; @Override public void onCreate( Bundle sis ) { - m_dlgt = new HostDelegate( this, sis ); - super.onCreate( sis, m_dlgt ); + super.onCreate( sis, new HostDelegate( this, sis ) ); } - } diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/SMSInviteDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/SMSInviteDelegate.java index 27a0421a2..a037e9e15 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/SMSInviteDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/SMSInviteDelegate.java @@ -125,7 +125,7 @@ public class SMSInviteDelegate extends InviteDelegate { if ( Activity.RESULT_CANCELED != resultCode && data != null ) { switch ( requestCode ) { case GET_CONTACT: - post ( new Runnable() { + post( new Runnable() { @Override public void run() { addPhoneNumbers( data );