Commit graph

5139 commits

Author SHA1 Message Date
Eric House
45a6ddf8ec fix jni crash on Nexus 9: give boolean default value
Crash occurs when creating new game: because there's no turn set yet the
jboolean has no set value (whatever was on the stack). Apparently the
java runtime accepts only 1 and 0 for jbooleans.
2016-10-25 08:03:18 -07:00
Eric House
abf4aa4d80 switch to clang
add option, and invoke it, to build jni code with clang rather than gcc.
2016-09-30 11:13:30 -07:00
Eric House
a710bdd46e Merge remote-tracking branch 'maidu2/android_branch' into android_branch 2016-09-28 21:46:17 -07:00
Eric House
123b3007cb get rid of remaining logf calls
This completes moving to using traditional logging. At least to having
each file provide a TAG. Class rather than TAG is passed in, and format
strings are preferred to contatenation, but now adb can work with the
output.
2016-09-28 21:42:16 -07:00
Eric House
59796c59b8 loge -> logex (so loge can be reused) 2016-09-27 19:42:48 -07:00
Eric House
68650ebfea first change toward using traditional TAGs with Log class 2016-09-27 19:35:24 -07:00
Eric House
a6992c373f fix broken notagain alert
I screwed up when converting to using builder.
2016-09-15 21:32:25 -07:00
Eric House
7994c42691 allow board cells to be wider than tall
There are some screen dimensions, especially with dual-pane mode, where
the board is just bit narrower than the screen. Rather than have narrow
white borders, allow the cells to take up the slack. The API takes an
upper bound on the ratio of width to height so things shouldn't get too
odd looking.
2016-09-15 20:37:29 -07:00
Eric House
39c49c3d8d Set AS upgrade gradle 2016-09-15 20:33:20 -07:00
Eric House
809e962765 tweak to intent handling
Change logic to always handle intent when it's safe to commit
transactions rather than when there aren't any pending. This still needs
work.
2016-09-09 05:46:08 -07:00
Eric House
95d147d9c3 add logging; fix NPE
Running into a case where views haven't been added to the layout yet but
I'm searching there for their associated fragments. Fix to NPE stops a
crash, but intents still aren't being handled. I need to try to handle
them later, but am unsure when to start trying.
2016-09-05 20:29:16 -07:00
Eric House
bd2fbdeb88 fix NPE reported by crittercism
Not sure why it's happening, but testing and dropping is a fine fix.
2016-09-05 14:11:06 -07:00
Eric House
5e90ed0073 put tiny bit of padding around the board container 2016-09-04 21:57:58 -07:00
Eric House
7358c1a185 simplify intent dispatch
Too-clever double loop had an no-exit path. Now it's simpler: find a
fragment that can handle the intent, pop all fragments to its right
until it becomes top-most (there may be none), and then give it the
intent. Use of popBackStackImmediate() is required so old fragments are
gone before intent handling wants to create new ones.
2016-09-04 16:49:40 -07:00
Eric House
c0eb827b77 generated files: should have gone with prev commit 2016-09-04 09:42:00 -07:00
Eric House
cdf22ec913 remove dual-pane toast from startup 2016-09-04 09:40:46 -07:00
Eric House
c16fda23af up strings for new release 2016-09-02 21:37:37 -07:00
Eric House
575e64ed25 reverse sort order: newer listed first 2016-09-02 21:32:31 -07:00
Eric House
8a00b1ab47 reorder list when game saved
Since display is now by whose turn it is and how recently there's been a
move in the game, the order can change on every save. So in the listener
for saves, redraw the group the saved game belongs to. The best way to
do this without flicker seems to be to mimic closing then re-expanding
the group, so that's what I'm doing.
2016-09-01 08:16:21 -07:00
Eric House
5a91b2819c cleanup: pass size to constructor 2016-09-01 07:21:13 -07:00
Eric House
4b25d17dbf sort games by whose turn it is, local at top 2016-09-01 07:14:41 -07:00
Eric House
b64bf82278 postpone searching for fragment children
Getting an NPE iterating over fragment/children of dualpane view
because, I think, committing them's been postponed. So add the iteration
as a Runnable to the same postponement mechanism. This may be wrong:
needs to be run for a while to see if it fixes the NPEs I'm seeing (on
opening an intent in the morning after the device has been idle all
night.)
2016-09-01 07:12:27 -07:00
Eric House
adf71c85a5 add turnIsLocal to android db
So we can filter on it determining the display order of games in games
list.
2016-08-31 19:37:56 -07:00
Eric House
a450aceab3 keep list of fragment transactions to run later
An assertion is firing indicating that there's sometimes more than
one. So deal with that: keep an ArrayList.
2016-08-31 19:28:46 -07:00
Eric House
7dcb5f09b1 Merge branch 'android_release' into android_branch 2016-08-30 08:14:48 -07:00
Eric House
cd0de1daa7 ready for interim release
up version strings and make a toast DEBUG-only
2016-08-29 06:33:27 -07:00
Eric House
d7acdc4a93 don't commit fragment transactions until ready
Attempt to fix crashes happening when the occasional fragment
transaction happens before the OS is ready. Keep a boolean indicating
whether we're in that state, and when it's not set create a Runnable to
be run next time it is. Temporary Toast lets me know when it's working.
2016-08-29 06:19:13 -07:00
Eric House
1c9af1bcfc fix assertions: load xml widgets on demand 2016-08-29 06:18:21 -07:00
Eric House
42488232a5 don't commit fragment transactions until ready
Attempt to fix crashes happening when the occasional fragment
transaction happens before the OS is ready. Keep a boolean indicating
whether we're in that state, and when it's not set create a Runnable to
be run next time it is. Temporary Toast lets me know when it's working.
2016-08-26 21:48:52 -07:00
Eric House
4c923ead08 add isLocal param to server_getCurrentTurn
I want to store this information separately in summaries tables so
e.g. games can be displayed sorted by whether it's the local player's
turn.
2016-08-26 06:58:55 -07:00
Eric House
926f069313 fix assertions: load xml widgets on demand 2016-08-25 21:34:33 -07:00
Eric House
f98d8db6ac don't default-uninstall from multiple devices
I'm tired of nuking from devices I didn't realize were attached.
2016-08-25 08:23:51 -07:00
Eric House
eb1e3f01d7 cleanup: use a local variable 2016-08-25 08:22:47 -07:00
Eric House
c7f33a7c8e cleanup: remove logging 2016-08-22 19:15:07 -07:00
Eric House
091854eee3 ignore new file 2016-08-22 19:13:49 -07:00
Eric House
bd3caf25eb re-create list when size limits change
Problem: brain-dead Android code (on 5.1.0 anyway) caches the
SectionIndexer separately from the ListAdapter that implements it, so
when you change the ListAdapter it keeps using the old one for its
SectionIndexer. Solution is to replace the ListView in the layout with a
FrameLayout into which a ListView is inserted at runtime on init and
whenever the data changes.
2016-08-20 13:37:35 -07:00
Eric House
9f2bc23b80 implement setTitle for GamesListDelegate
Was missing and so when other panes went away didn't always replace the
title.
2016-08-20 09:33:48 -07:00
Eric House
f23e44c56d cleanup: use chaining everywhere building alerts 2016-08-19 14:44:37 -07:00
Eric House
78c3d4c0e9 tweak changes text 2016-08-19 14:14:39 -07:00
Eric House
06b6091780 upgrade -Dbg version code too 2016-08-19 12:56:07 -07:00
Eric House
e1dbd8efc7 cleanup and add a bit of logging
I suspect curThis() is no longer needed so will log it for a while.
2016-08-19 12:49:30 -07:00
Eric House
2285502f33 offer to enable dual-pane mode only on upgrade
And do it starting with launches after the changes list has been
shown. Also change "Cancel" on negative button to "Later".
2016-08-19 12:48:15 -07:00
Eric House
495c82baa0 look for and remove '-' in locale
Some versions apparently return "en-us" as the language code when "en"
is expected. Check for and remove anything after a '-'.
2016-08-19 12:28:54 -07:00
Eric House
16b9bab719 up version strings and changes list 2016-08-19 11:58:10 -07:00
Eric House
6cc67b2347 always show toast announcing dual-pane mode
on startup, even for non-debug builds. And move the string into a
resource for localization.
2016-08-19 11:37:24 -07:00
Eric House
ba968b1e36 fix so extra game info shows in dual-pane mode too
onWindowFocusChanged() isn't called when a pane opens, and setting up
that field depended on it. So call from init() too.
2016-08-19 10:57:48 -07:00
Eric House
0bd9667163 cleanup: remove unnecessary attributes 2016-08-19 10:29:12 -07:00
Eric House
41e8df6f19 give any extra space to the board
Measure toolbar before board, and if it's narrower/shorter than we
allowed more that extra space into the rect given the board.
2016-08-19 10:05:31 -07:00
Eric House
ff6e9f0051 specify larger toolbar icons on larger devices
As it was before, and adding for xlarge too. Looks better this way. I
still can't figure out how to make the things center....
2016-08-18 17:38:57 -07:00
Eric House
43fcf21133 get rid of transparent frame around toolbar images 2016-08-18 13:44:03 -07:00