Commit graph

10091 commits

Author SHA1 Message Date
Eric House
f88b438a81 get rid of configChanges altogether
Recent recommendations are not to attempt to handle it myself, so don't
and we'll see how it goes. And unify notions of tablet and enabling
dual-pane: a device that isn't dual-pane should not be using the new
single-activity stuff at all.
2017-04-18 06:47:53 -07:00
Eric House
269fceddf2 cleanup around posting alerts; skip back-stack
Had to disable use of the back-stack for DialogFragments, though that
means I can't prevent duplicates from stacking up (esp. in the
pathological robot-vs-robot case, but also just when I rotate the device
while a "rematch" alert is up.) The problem seems to be in dismiss
actions being handled too late. One easy-to-duplicate case is the
tile-picker. When it's enabled and you commit a turn I post first the
confirmation and then, in response to a "yes", the picker. But the
picker gets added to the stack moments before the confirmation is
removed, and it's the nature of stack removal that everything above
what's being removed gets pulled too. So you never see the
picker. Simply post()ing a runnable to put the picker up later fixes
this one case, but a similar trick doesn't work elsewhere, so I'm
punting until I have time to root-cause the problem.
2017-04-13 08:18:07 -07:00
Eric House
3bff16193a ignore more stuff 2017-04-13 08:05:56 -07:00
Eric House
5bbfd44333 try to dismiss duplicate alerts
Each alert gets a unique name. Add to backstack, and before doing so
look for another with the same name and dismiss it. This works most of
the time, especially to prevent them from piling up with orientation
changes. But in a robot-vs-robot game, and occasionally in a game with
three robots and one not, SCORE alerts stack up. It's the removal that's
failing, not the test for a duplicate, so perhaps I need to somehow wait
for it to succeed before adding the new alert.
2017-04-12 07:37:53 -07:00
Eric House
fdd1e5c148 fix NPE in new logging code 2017-04-10 20:33:25 -07:00
Eric House
cbac691be3 fix crash on old (2.3) devices
Was already using the safe test for wifidirect everywhere else...
2017-04-10 20:32:11 -07:00
Eric House
c774780730 don't display info about disabling when disabled 2017-04-10 06:56:09 -07:00
Eric House
6c5ab3ff1a tweak changelog order 2017-04-08 14:36:30 -07:00
Eric House
f33488f020 fix release builds
Gradle'd changed the name of one of the signing-related tasks.
2017-04-08 14:29:07 -07:00
Eric House
32c264cc16 cleanup: got confused by two separated hide tests 2017-04-08 14:09:34 -07:00
Eric House
0e90286d92 tweak tile-picker alert titles 2017-04-08 13:45:42 -07:00
Eric House
9e66d294a2 tap on pending blank tile brings up picker
It's been annoying to have to move a placed blank to change its
value. No more.
2017-04-08 13:44:59 -07:00
Eric House
832b3adfd2 cleanup; fail safely
Remove or fix some logging; in a case that rarely shows a NPE check
first but only assert on debug builds. Fail silently on release builds.
2017-04-08 13:15:24 -07:00
Eric House
4668beee78 reveal timer start field if timer's enabled
Rotation was hiding it once enabled.
2017-04-08 12:20:20 -07:00
Eric House
5b7559c223 debug-build-only logging of pane order
I'm seeing infrequent switching of panes' ordering when
rotating. Logging them hoping to see if it's in the layout or elsewhere.
2017-04-08 12:11:53 -07:00
Eric House
b07fd2699c remove incorrect assertion
DELETE_DICT Action is expected to flow through child, at least until I
fix to disable deleting a dict while it's open in the dict browser. It
may be confusing but with the assert gone does no harm.
2017-04-08 11:40:54 -07:00
Eric House
1f3d1cbb79 make force-tablet debug pref a three-way
Rather than force/don't, which doesn't let tablets force themselves to
be phones, allow choice between OS default and forcing either way.
2017-04-08 11:04:45 -07:00
Eric House
32140ff4e5 ignore generated files and build files 2017-04-08 11:04:23 -07:00
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