Commit graph

9967 commits

Author SHA1 Message Date
Eric House
7717272f68 Capitalize the W: Crosswords -> CrossWords
Too much confusion with crossword puzzle apps
2017-04-08 10:08:18 -07:00
Eric House
8ec48bfee8 fix typo 2017-04-08 09:26:09 -07:00
Eric House
ac932758b2 remove unused strings
fix script to search in new location and remove the strings it flags.
2017-04-07 00:58:59 -07:00
Eric House
d9944252f6 cleanup old dialog code
remove some old stuff from pre-dialogfragment dialog handling. What's
left still needs auditing, as I'm not sure whether it can get called.
2017-04-07 00:33:45 -07:00
Eric House
50fe363da9 move notice about new dual-pane feature
Make the default be that it's on, and move the new-feature notice from
app launch to board open, the point where most will see the feature for
the first time. Remove the notify-and-exit thing, which is harder to
make work from the board, instead just posting an alert, if user chooses
to disable, that the setting change takes effect after a restart.
2017-04-07 00:23:37 -07:00
Eric House
b40f938fcb fix dbg variant: remove duplicate from manifest 2017-04-06 21:11:55 -07:00
Eric House
55339b6aaf fix release compile warnings 2017-04-06 07:43:20 -07:00
Eric House
bbae0ab6ed up version strings
Easier to test dualpane upgrade notification with new version in place.

And remove version code from manifest, since it's duplicated in build.gradle.
2017-04-06 07:39:30 -07:00
Eric House
966c48bd57 fix build (forgot new file) 2017-03-28 21:45:03 -07:00
Eric House
c496cf5a1f include room name in games list when pending
I can't send a manual invitation without that information
2017-03-28 07:10:45 -07:00
Eric House
e7d4e93d12 Use Log.? instead of DbgUtils.log? everywhere
Too much trouble switching modes between work and home :-)
2017-03-28 06:54:42 -07:00
Eric House
059bf82392 redo invite/wait alert after invitation sent
Needs to show different text and buttons, so now that it isn't getting
dismissed and rebuilt every time a button's pressed force that process
manually the time it's required.
2017-03-27 07:20:32 -07:00
Eric House
a5d0d02faf pass Context fix NotSerializableException
Backgrounding with Wait/Invite alert up mean serializing something that
included a Context. Fix to pass it instead into methods that need it.
2017-03-27 07:16:13 -07:00
Eric House
e7a2657a91 override onResume not onStart to fix NPE
When game's resumed (brought from background) and Wait alert is up
onStart() is called before getDialog() has a non-null value to
return. onResume() is the place to modify the dialog.
2017-03-27 07:07:05 -07:00
Eric House
58e5145296 another try: make AlertDialog not exit from buttons
Rewrote Wait/Invite alert to use new functionality that allows it to set
its AlertDialog buttons to not exit when tapped. Turns out things are
much simpler when I don't have to hook into all the places my dialog
might need to be put up again.
2017-03-24 19:58:28 -07:00
Eric House
265818725c improve (fix?) invite/wait dialog
Override onCancel() in order to finish when the alert's closed via the
back button. Count the number of alerts and when it drops to 0 (when all
the alerts launched from the invite/wait dialog are gone) put the
invite/wait up again.
2017-03-23 08:45:47 -07:00
Eric House
d9a4783e32 fix NPE
On Nexus 5x rotation with Invite/Wait alert up confuses things, and
eventually gets a NPE. This fixes that, but I still need to fix the
other.
2017-03-21 20:56:37 -07:00
Eric House
26d96136d8 do away with different picker layout for land
Five columns works on both orientation. Six doesn't in landscape. The OS
doesn't let the alerts get all that much wider in that orientation.
2017-03-21 20:44:31 -07:00
Eric House
94a3b22266 rotation hack: dismiss alert before replacing it
I can't figure out how to prevent rotation from duplicating the wait
alert, and don't have the ability to have makeDialog() return null, so
when that happens -- when a second is being created -- dismiss the first
first. And clean up some callbacks made unnecessary by onDismiss().
2017-03-21 20:44:30 -07:00
Eric House
e3c0419e91 fix so unconnected game is never without an alert up
Try to track in local saved state enough, including a count of
sub-alerts the main Invite alert has put up, whether when something's
dismissed the alert should go back up or the game should be
closed (which is the right thing to do when the back button's pressed.)
Hack: setting a variable to null in onSaveInstanceState() then testing
it in an onDismiss() call that happens as part of rotation avoids an
exception when rotation the phone.
2017-03-21 20:44:02 -07:00
Eric House
0467121d3a move saved-state variables into Serializable POJO 2017-03-17 07:30:05 -07:00
Eric House
1ed30c79d0 fix crashing move-games alert
Move most state that needs to be saved in Bundle into a single
Serializable class so adding new is easier. Add to that the current
selected group so we don't crash when nothing's been set. (I think in
the move to DialogFragments I lost the code that would have disabled the
Move button. That's back.)
2017-03-16 21:14:53 -07:00
Eric House
19bfcfc3a2 call super.onSaveInstanceState() last
Move call to end of derived class' method. This may very well be the
solution to a bunch of random crashes logging
"java.lang.IllegalStateException: Can not perform this action after
onSaveInstanceState". Chief suspect is the change in XWActivity.java,
but I'm making it everywhere for consistency's sake: it's a good habit
to get into.
2017-03-15 19:38:57 -07:00
Eric House
df8ebaec06 use six-button bar for landscape orientation 2017-03-15 19:35:49 -07:00
Eric House
006bf2e387 hide pick-face-up checkbox for networked games
And tweak game-config layout
2017-03-15 07:25:54 -07:00
Eric House
4c9c5b3418 tweak picker; fix no-tiles-left case
Minor changes to strings and code for tile picker, and fix bug where
server.c was asking for 0 tiles (because none are left in pool.)
2017-03-15 07:12:40 -07:00
Eric House
364eec3c5c tweak picker layout 2017-03-14 19:55:49 -07:00
Eric House
fc438a4bcf tweaks to tile picker
Fix to auto-exit for blank- but not tray-picking and to not show Del
button for blank case (dumb since we're exiting anyway.)
2017-03-14 19:47:45 -07:00
Eric House
58fc0e9b81 snapshot on the way to working tile picker
New classes implement custom alert and its view, where most of the logic
for putting up one button per tile, hiding and showing buttons based on
what's left, etc. lives. Rough, but works well until rotated, when gets
redrawn without spaces for the buttons that could come back.
2017-03-14 07:23:30 -07:00
Eric House
a804983b8e fix makeIntArray to work for non-32-bit array sources 2017-03-13 19:32:20 -07:00
Eric House
aa4d7e3d97 remove blocking alert stuff
The crazy hack to get around Android's lack of modal dialogs is at long
last gone. Remove semaphore and code that uses it. Will leave the
background thread in place, at least for now, as removing it would be a
huge change.
2017-03-10 08:48:37 -08:00
Eric House
1cd863b877 fix assertion around out-of-order tile assignment
Got a crash opening games where tile pick was on and first player was a
robot. Cause: non-robot player's tiles were being assigned before the
robot's, and the move stack didn't like the out-of-order assignments.
Now we assign tiles in order as before, but pause each time we find a
non-robot that needs to pick its own.
2017-03-09 21:40:19 -08:00
Eric House
6e5973c55b toward making tile picking work through rotations
Make face-up tile picker util method return void and add mechanism for
passing in selected tiles asynchronously, as has been done recently with
the rest of the once-blocking util callbacks. Works perfectly in the gtk
case. Likely crashes in curses (if picking face-up option is on.) In
java all the callbacks are there but rather than put up a UI we pretend
the user says "pick 'em for me" each time. Putting up a UI is next.
2017-03-09 20:36:14 -08:00
Eric House
70b3aaa263 modify function to be more useful 2017-03-09 19:35:07 -08:00
Eric House
618f9cf20a toward rotation-safe invite dialog
Rewrite the overly-complex invite dialog that's posted when a game opens
and is missing players so that it doesn't crash after an orientation
change. It's still possible to dismiss it yet have the game stay open.
The goal is that a game in that state always has a dialog on top of it
so you don't get confused about e.g. why you don't have tiles, but
there's more work to be done there.

Also added a common superclass for all my DialogFragments. It may be
useful e.g. for having each DelegateBase instance able to track what
dialogs it currently has up, e.g. to have a policy about how many of the
same class can be live. I'm thinking here of how to prevent a
robot-vs-robot game from ending with a stack of 25 move reports. (The
change here is that the old activity.showDialog(int) only allowed one at
a time, and some of my logic takes that for granted.)
2017-03-07 07:48:46 -08:00
Eric House
0980bcfbe5 fix another class cast exception
But this is by inspection and, involving a dialog that is no longer
posted, could probably never occur.
2017-03-07 07:35:16 -08:00
Eric House
9211d6b765 fix class cast exception
Problem with subverting type checking is compile time errors become
runtime...
2017-03-07 07:08:48 -08:00
Eric House
83f7a9cec1 fix dismissal of invite/wait alert
There were multiple places launching it, which in a DialogFragment
world (in the absence of other per-dlg-id controls) means stacked
multiple alerts. And dismissDialog() didn't work. So use a boolean to
prevent more than one being posted and keep a reference to the
DialogFragment behind it in order to be able to call dismiss() on
it. That's the only place I was calling dismissDialog() (other
than the tile-picking stuff which has to be rewritten anyway) so this
little hack is probably ok.

This alert still gets messed up with the screen config changes. Fixing
that is next.
2017-03-01 07:23:50 -08:00
Eric House
5e23d6fc75 remove unused variable 2017-03-01 06:14:35 -08:00
Eric House
05d583a324 fix timers: don't clear in snapshot case
Back in August I "fixed" timers running after the board was cleared but
didn't realize that util contexts were shared by snapshot
boards. Clearing those timers when the board's destroyed was stopping
timers for a visible board as well. So I added a boolean indicating
whether to clear timers. Ref counting or similar would be better, but a
lot of work given the concept isn't really in the common/ code at
all (outside of dicts...)
2017-02-27 20:20:25 -08:00
Eric House
b849ad4db3 Merge branch 'android_branch' into rotation_fix 2017-02-27 18:49:57 -08:00
Eric House
d865812002 failing to find an .apk is not an error 2017-02-27 18:31:17 -08:00
Eric House
19a7b7e146 fix assertion: we do handle that case 2017-02-24 09:12:11 -08:00
Eric House
48bd5d7f1d fix posting of dialogfragments from preferences
I can't get preference fragments working in my world (mostly because
nested PreferenceScreens don't open when clicked on and the workarounds
for that are too complex) so next best thing is to fix alerts to work on
top of prefs activity. That involves creating a new transparent activity
that subclasses XWActivity and has a DelegateBase subclass. Launching an
alert is then just a matter of passing DlgState into the new activity
via an Intent, at which point everything Just Works. Button clicks are
returned via an intent as well.
2017-02-24 08:56:31 -08:00
Eric House
ff99e89e9d fix compiler warning 2017-02-22 22:39:32 -08:00
Eric House
70a99b39fb remove dictGone dialog
There's no way to get it invoked. I think that's a bug, but when it
comes back it'll come back in different form.
2017-02-22 22:35:19 -08:00
Eric House
2a4bce4ad1 remove Context ivar from CurGameInfo
It claimed to be Serializable but wasn't: Crash. Now it is.
2017-02-22 22:29:02 -08:00
Eric House
1de838171b make sms enabling alert dialog-fragment-based 2017-02-22 22:11:24 -08:00
Eric House
56dfef828d move launch into PrefsDelegate
Following pattern for most, though may never have dual-pane option.
2017-02-22 07:46:14 -08:00
Eric House
cfd467f7d6 fix class-cast exception 2017-02-21 21:35:35 -08:00