jni, and when it calls back with it launch the browser directly if
there's only one, otherwise put up a choice list. Currently the list
dismisses after launching the browser once: need to fix that, probably
with a custom View. And need to deal with non-English games, and
maybe add other choices for lookup than dictionary.com.
uses existing stack and undo features to run a WordNotifierInfo over
some number of scoring passes to gather the words seen. Seems to work
as tested from gtk version. Now need to try from android....
use English. (Specifically, they've been played in English until now
and played letters will be reinterpreted in the right language for the
first time.)
AndroidManifest rather than created programatically: only with this
can I get EJECT events to work. Replacement class has static
register/unregister methods which DictsActivity uses.
'commit exchange' button when there's nothing to commit, and get rid
of error message used when committing nothing since it's now
impossible (on Android).
summaries DB list of dicts in the game and a method that queries that.
Pick delete-confirmation message based on the language of dict,
whether there are others in the same language, and whether games are
using that language or that dict.
correctly with having the same dict stored in more than one place.
Added DictAndLoc with members name and loc to support this, and used
in a bunch of places in place of mere strings, including
DictsActivity. Also removed code warning when you're deleting a dict
that's not the last in its lang, which incorrectly warned that the
dict was in use when in fact I can't tell that. The warning "might be
in use" sounds dumb so it's gone for now.
local/pending changes. Fixes bug where you change language, then
choose "download more..." from a player's dict choice spinner and find
on returning to GameConfig that the language has reverted.
it; add boolean, now always passed as false, to code printing names
for game config list of players to include the dictionary. It's
useful for debugging, and I think it'd make a good optional setting,
but nobody else thinks so. Once it's checked in the change can go if
I'm not using it.
dicts passed when opening a game was based on defaults, not read in
from the game data. Oops. So now it's a two-step process: open the
data, read in the game info, generate list of dicts from that, and
open full game with list of dicts. (TODO: optimize by caching game
data across multiple reads.)
version of the list user saw when choosing the index. Fix is to use
same list. Cancel after selecting dict didn't work as the selection
listener had already copied the selected dict name over. Now the
listener leaves that for the Ok button's onclick listener.
one and changing the site that used it to use the other. Not visible
outside of common, but should make it easier to harvest a list of all
words for one move or the entire game.
error message on Android); don't block trade if pending tiles are on
board; instead undo them. There's redo now so there's no need to
confirm, no data loss.
stuff. In java, respond to util_playerScoreHeld() and
util_bonusSquareHeld() by putting up toasts with existing strings.
For util_setInTrade(), fix exchange mode. Add two buttons at bottom
that replace toolbar (and corresponding buttons on menu). Redraw
scoreboard and board with high transparency to make it clear they're
disabled. Still to do: deal with case where ability to switch which
player's tray is visible is enabled.
with ncurses. The goals to make it easier to include watch on pipes
for incoming messages to better model Android -- and to be a bit more
modern. Works for one run of test script but needs more testing to be
turned on.
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.
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.
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.
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.
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.
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())
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.
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....
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.
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.
figure out how to get that so I ignore it and am killed then
relaunched if I have a dict file open on the SD. On relauch, don't
crash. Instead, check if any dicts used by the game is unreachable
and put up an alert with only one choice: Close game. Thought about
using the missing-dicts stuff from GamesList, but this is a special
case that should be seen only when user umounts while a BoardActivity
instance is frontmost.
arrays into the jni, pass the full file paths in in addition to the
byte arrays. This isn't possible with the built-in dicts, but does
work for the downloaded ones (which are usually larger). This checkin
does the mmap and uses memcmp to verify that the bytes are the same as
passed in. Next step is to not pass the bytes when the path will do
and to actually use the mmap'd ptr.
dialog is up. I'm making two fixes, either of which is enough: saving
the rowid across teardown of the activity; and changing the manifest
to not tear down the activity. The reason for the latter is that the
teardown is unnecessary and wasteful. The former's just safer coding.
allow any control over whether the initial state is expanded.)
Getting click to work is a bit of a hack, requiring a callback from
the adapter back to the activity, but it works well on emulator. Need
to test on device then try to shrink the ImageButton.
with calls using formatting -- for consistency and effeciency in the
case where logging is disabled. There should be no discernable
change, though if I got and percent-format specifiers wrong I'll get
runtime exceptions.
Bad. So test if we can post (if the handler's still available) and
drop the request, freeing the thread, if not. (Access to m_handler
should probably be synchronized now that it's getting cleared, but
that's another bug.)
rare crash where class is reloaded (e.g. after long period of non-use)
after being taken down with a dialog in mid-load. The OS tries to put
the dialog back up but the dialog title string ID, passed to
setTitle() in onCreateDialog(), is 0.