Commit graph

4906 commits

Author SHA1 Message Date
Andy2
5bc63edeb6 replace Runnable passed to showNotAgainDlgThen() with callbackID, same
scheme as the rest of DlgDelegate.  I'm still using a single ivar for
all dialogs, meaning they can't stack, but except for duplicate
showNotAgainDlgThen calls (where the message can be ignored) it
doesn't seem to be happening.  Asserts are still in place to tell me
if I'm wrong.
2011-08-28 15:38:52 -07:00
Andy2
656110841f cleanup after review of recent changes: remove logging etc. didn't
mean to check in.
2011-08-25 18:48:41 -07:00
Andy2
0a2255a8fe add two recent changes 2011-08-25 18:26:49 -07:00
Andy2
632acfd171 Oops: add new pref color to list restored. 2011-08-25 18:26:34 -07:00
Andy2
5acc2205be add pref to edit color used to draw bonus hints on cells 2011-08-25 18:13:42 -07:00
Andy2
79acccc6bf record, commented out, attempt to send NBS message. sendDataMessage()
crashes internally, and googling finds lots of reports/questions and
no answers.  It appears NBS is broken on Android, at least for CDMA.
Might want to revisit on a newer OS version that the 2.1 I'm running
now.
2011-08-25 06:52:12 -07:00
Andy2
711f12fa9e It's ok to cache listeners but only with the instance whose ivars they
reference: revert prev change but make cache vars non-static.
2011-08-25 05:49:09 -07:00
Andy2
3416ae59a7 use a constant for the DISMISS button. And don't use static
listeners.  They wind up getting called with mixed DlgDelegate.this
values, including one belonging to an Activity that's long-since
stopped and so the wrong ids are getting passed back.
2011-08-24 22:43:54 -07:00
Andy2
5aeac29787 Pass 0 to dlgButtonClicked() for dismiss, as -1 is the value of a
button!  Also assert the heck out of callbackIds to see if Android is
guaranteeing that no two dialogs can be up at once.  I'm counting on
that, and need to know if it's not true.
2011-08-24 21:44:10 -07:00
Andy2
1cd1a849e6 don't put dismiss listeners on every damn dialog! They replace rather
than chaining.
2011-08-24 21:41:35 -07:00
Andy2
5769ae6a31 cleanup: there are two listeners created over and over; better to
store in a class static and reuse.
2011-08-24 18:51:47 -07:00
Andy2
4ac84dde23 change sig of DlgDelegate's dlgButtonClicked() method to include id of
button rather than just boolean.  Add onDismissListener so can tell if
whole thing was backed-out of (since that's a different choice from
the two buttons "text" and "html" used in one case.)  Fix compile
error that slipped by earlier: frequent clean builds required with
java.
2011-08-24 18:22:21 -07:00
Andy2
50c692024b fix crashes when reloading (rare unless android:configChanges removed
from AndroidManifest.xml). Problem was that managed dialogs are
recreated between onStart() and onResume() yet onResume() was where
ivars (specifically m_gi) were set.  Can't just set them in onStart()
because then I'd want to save state them in onStop() which isn't
guaranteed to be called.  So create a function loadGame() and call it
from both, using a flag to prevent its running twice (which flag is
cleared in onPause())
2011-08-24 18:18:17 -07:00
Andy2
3a2af96c24 use new callback-replaced-by-id mechanism to query for html/text
choice.
2011-08-24 06:51:00 -07:00
Andy2
f88697fd3f complete conversion of showConfirmThen, removing old methods and
adding second param to buttonClicked() callback indicating which
button was cancelled.
2011-08-24 06:14:42 -07:00
Andy2
7d0cbcf07f use new showConfirmThen scheme 2011-08-24 06:12:57 -07:00
Andy2
85c38e831f cleanup: null's same as empty onClick handler 2011-08-24 05:40:13 -07:00
Andy2
fbb467af80 convert some more callbacks to ints passed back: GamesList done. 2011-08-23 20:25:59 -07:00
Andy2
05607a15b9 toward a bundleable DlgDelegate: add new interface to replace
OnClickListerners passed on, have clients of DlgDelegate implement it,
and convert one dialog to use it.  Will eventually remove old code.
2011-08-23 19:50:01 -07:00
Andy2
0d85a67700 verify that bundle saving works in DlgDelegate and fix one
disappearing message.  Still need solution for callbacks passed in.
2011-08-23 19:18:45 -07:00
Andy2
7a235ed6b6 put onPrepareDialog() back -- it's required to use DlgDelegate dialogs. 2011-08-23 18:51:48 -07:00
Andy2
7da5b24e0f rewrite DictsActivity to not crash when un- and re-loaded: make
dialogs depend only on bundleable ivars -- ints and strings, not Views
-- and bundle them.  Don't use onPrepareDialog, only onCreateDialog,
and so call removeDialog() every time one's dismissed.  Do some
refactoring to support this.
2011-08-23 18:41:19 -07:00
Andy2
84e61f3b3f remove no-op line 2011-08-22 18:43:42 -07:00
Andy2
953909d0f0 remove logging 2011-08-22 18:40:44 -07:00
Andy2
3537161d3b add change 2011-08-22 18:40:30 -07:00
Andy2
3296cad731 pass bundle into DlgDelegate so state can be saved and restored. Not
doing anything with it yet because any scheme to survive
OS-restoration has to deal with the Runnables I'm saving that can't be
bundled.  Work in progress....
2011-08-22 18:10:22 -07:00
Andy2
7e6daa5797 move role out of players column to where it can be a full line long,
preventing it from increasing the size of the item by line-wrapping.
For now it's outside the View that gets hidden, but that may need to
change.
2011-08-22 07:05:33 -07:00
Andy2
d7a515ca97 display three states of relay connectedness in games list items:
configured, connected but waiting for players, and game-in-play.
2011-08-22 07:03:46 -07:00
Andy2
1ee0dfdd6d set wordlist spinner prompt and include language 2011-08-21 22:13:18 -07:00
Eric House
609f4be8a6 Merge branch 'android_branch' into french_xlation 2011-08-21 21:56:52 -07:00
Eric House
cf6d868bd3 use separate strings for window title and spinner prompt 2011-08-21 18:17:21 -07:00
eehouse@eehouse.org
abe270d45c Merge branch 'android_branch' into french_xlation 2011-08-21 15:03:57 -07:00
Andy2
aeafb9cefa Tweak language for moving wordlists to more clearly refer to storage
locations.
2011-08-21 15:03:41 -07:00
Andy2
bbb73bb2e9 somehow dict deletion got broken (because wasn't adding file
extention); fix.
2011-08-21 15:02:42 -07:00
Andy2
6b8fd222ef Merge branch 'android_branch' into french_xlation
Conflicts:
	xwords4/android/XWords4/res/values/strings.xml
2011-08-21 14:35:53 -07:00
Andy2
d1b6bc16cf add the standalone/network icons from GamesList display to the new
games dialog so users get some association going.
2011-08-21 14:30:00 -07:00
Andy2
04834c910b more dictionary->wordlist terminology change: debug-only preference
and download URL.
2011-08-21 14:27:50 -07:00
Andy2
9612b28b1f use goto to avoid having multiple returns. No behavior change. 2011-08-21 14:20:59 -07:00
Andy2
a17ff20db7 clean up background check pref wording to Chris's suggestions 2011-08-21 13:52:51 -07:00
Andy2
a72883ae9a Merge branch 'android_branch' into french_xlation
Conflicts:
	xwords4/android/XWords4/res/values/strings.xml
2011-08-21 12:29:32 -07:00
Andy2
c0dae019d5 use same context menu header, including wordlist name, as for game
list items.
2011-08-21 12:19:58 -07:00
Andy2
5c8afa06ce version string and changelog for beta 33 2011-08-21 12:07:45 -07:00
Andy2
56fd01a05b oops -- missing semicolon. 2011-08-21 12:07:21 -07:00
Andy2
c38e3593fb replace hard-coded placeholder names for optional top-line of games
list item display with real "aa vs. bb vs..." consed up in
GameSummary, and set field to singleline so doesn't wrap when names
get too long.
2011-08-21 11:39:38 -07:00
Andy2
c41af221b7 fix non-debug compile warning 2011-08-21 11:33:23 -07:00
Andy2
47bdec4eda pass context into GameSummary constructor rather than into methods
that need it.  No behavior change.
2011-08-20 21:51:57 -07:00
Andy2
28c78a0a6a dictionary->wordlist 2011-08-20 14:16:38 -07:00
Andy2
659c054696 add new class that listens for SDCard mounted event (could be
generalized for multiple events and map them to multiple notification
callbacks), and use it from DictsActivity to redraw the list when the
SD card comes back online.  While the default android behavior works
for the unmount case (relaunches DictsActivity which correctly draws
only those dicts still available) it needs this change to redraw after
the available set grows.
2011-08-20 11:59:32 -07:00
Andy2
6ca60438a1 no need for onClick listener when onDismiss listener does the same thing 2011-08-19 18:54:21 -07:00
Andy2
8f60ca5af3 Need to show dict-gone-missing dialog when umount from GameConfig too,
so: change loadMakeGame() to return gamePtr rather than take one in,
and to return 0 when any dict no available.  Move dict-gone-missing
dialog into DlgDelegate.  Remove DlgDelegate always adding onDismiss
listener that removes the dialog, and instead add one to the
dict-gone-missing dialog that, like the onClick handler, calls
finish() on the activity.
2011-08-19 18:52:55 -07:00