Commit graph

9708 commits

Author SHA1 Message Date
Eric House
62461d8de0 move toolbar button to left
Put it where it'll be visible/discoverable on more devices since it's a
pretty cool feature now.
2016-08-18 13:10:41 -07:00
Eric House
19a3f40d66 script to swap resources for small-device testing
Setting up an emulator that'll grab {menu,layout}-small resources is a
pain so this script exchanges them with regular resources so that a
subsequent compile will produce something that (when run) will catch
missing resources etc.
2016-08-18 12:38:41 -07:00
Eric House
c4d7626ae1 tweak toolbar layout to fit better 2016-08-18 12:00:18 -07:00
Eric House
2a8ce27ca9 make custom layout better on old android version
tweaks to BoardContainer and Toolbar to better position toolbar and
better hide/show it in tile exchange mode. The bar's still partially
offscreen sometimes on a 2.3.7 emulator but it's usable. Next I need to
try specifying the size of the bar rather than having it derive from the
size of the images it contains.
2016-08-18 11:30:32 -07:00
Eric House
9e81fb53b5 move NotAgainView into scroller for small screens 2016-08-18 10:08:27 -07:00
Eric House
bc98cdc83a don't use newer APIs in custom layout
They crash on 2.3.7 at least, and don't seem to be required anyway. I
think the only reason I need to implement onMeasure() is because
BoardView expects to be called a certain way.
2016-08-16 11:18:18 -07:00
Eric House
fbaaa4e5aa ignore new files 2016-08-16 11:18:02 -07:00
Eric House
6da7c85dbf use custom layout for board/toolbar relationship
Correct or not, this is my solution to the circular problem of how to
choose a vertical or horizontal toolbar before beginning the layout of
the board and toolbar. Adding a new custom container that holds the
board, toolbar(s) and tile exchange buttons and uses the ratio of its
own dimensions to choose which toolbar to show. Also drive toolbar
initialization from the layout process because when started from
BoardDelegate it now tries to install button listeners too early.
2016-08-16 11:01:46 -07:00
Eric House
4857ad6b26 complain when CLASSPATH isn't set for success 2016-08-15 17:29:28 -07:00
Eric House
3b24aab8c3 add new jni call board_containsPt()
for use debugging layouts/orientation changes later
2016-08-15 17:26:10 -07:00
Eric House
0a41471410 use dimen resource for toolbar button size
I need a way to have the buttons be smaller when the view's in a
fragment in dualpane mode. This probably is isn't the fix but it's worth
preserving.
2016-08-15 16:42:09 -07:00
Eric House
fd0bf23915 remove volume-keys-zoom option
Seem sit hasn't worked in a while on newer devices and nobody's
complained. We all pinch to zoom now.
2016-08-15 16:23:24 -07:00
Eric House
d15eab013d remove zoom button and menu
Everybody has multi-touch phones now.
2016-08-15 16:13:01 -07:00
Eric House
ab24140813 cleanup: constants + parallel array => enum
I didn't always know enums could have constructors
2016-08-15 16:01:30 -07:00
Eric House
71ac6062f1 don't enable delete of newly-configured game
Wasn't recording as open a game created then opened via the
configure-first option so the delete menuitem was being left enabled.
2016-08-15 14:14:14 -07:00
Eric House
8fdc2b90ea explain before exiting when dual-pane enabled 2016-08-15 14:03:01 -07:00
Eric House
232f5e1a15 do a builder for okonly alerts too
Might be getting carried away with this, but I like having all common
dialogs built the same way.
2016-08-15 13:55:11 -07:00
Eric House
1a56854d41 more cleanup using setters to replace overloading 2016-08-15 12:38:27 -07:00
Eric House
25823aec74 cleanup: "Then" implies Action 2016-08-15 12:11:17 -07:00
Eric House
c36adeebbd refactor: use builder for notAgain dialogs too 2016-08-15 12:10:36 -07:00
Eric House
7f211c6cb5 more cleanup: replace overloads with builder
There were too many versions of showConfirmThen(). Now there's one
builder with a bunch of optional parameters.
2016-08-15 10:15:35 -07:00
Eric House
ecdd453698 major cleanup: first use of ConfirmThenBuilder 2016-08-15 09:15:39 -07:00
Eric House
bf93189313 cleanup: Map.remove() does a get 2016-08-15 08:25:36 -07:00
Eric House
34b7f9de4d tweak string 2016-08-15 08:18:11 -07:00
Eric House
b17dfc91cc fix to compile! (bad commit) 2016-08-15 08:17:33 -07:00
Eric House
e6cb693c3c launch dict download pane from config as fragment
One of the last to be converted. But missing dict functionality still
needs testing.
2016-08-15 07:59:49 -07:00
Eric House
10a0e33ee4 send cancel if no dict's been chosen
Fix crash when game config opens dict download for result and nothing's
chosen. Was sending Activity.RESULT_OK in that case instead of
RESULT_CANCELED.
2016-08-15 07:19:05 -07:00
Eric House
87150c7d91 replace assertion with logging and dropping event
Until I figure out why I'm see it, as it's getting in the way of other
things.
2016-08-13 17:16:20 -07:00
Eric House
6bdfae23cb add no-args constructors to all fragments
Docs and some logcat crash statements from the OS say I need no-args
constructors for fragments. So rework initialization and use bundling so
parent name doesn't have to be passed into the constructor. Seems to
work, and fixes the crash I was seeing (happened when sending an
invitation via SMS) but requires more testing.
2016-08-13 17:02:18 -07:00
Eric House
94e5b30d94 fix long-tap rematch of open game
Needed to do the usual JNIThread.getRetained() recipe, slightly
modified.
2016-08-12 19:14:23 -07:00
Eric House
80e1f588d0 remove a delegate's alerts when it stops
Fixing a crash when a game offers both to create a rematch and to delete
itself because its opponent has been deleted. Deleting and then hitting
rematch would crash because the rematch alert referred to a dead
game. Now onStop() for delegates removes any pending alerts. In
dual-pane mode only since when there's an activity going away the alerts
go automatically.
2016-08-12 18:06:11 -07:00
Eric House
a7795dd160 remove REMATCH_SUPPORTED build-time option
It's always on now.
2016-08-12 12:25:38 -07:00
Eric House
2220db9dfa cleanup: use consistent terms even in DEBUG build 2016-08-12 12:09:23 -07:00
Eric House
4d1fc6524c cleanup: fold two methods together 2016-08-12 12:07:14 -07:00
Eric House
16d6b7cccc move use of JNIThread's lock into getSummary()
Rather than have callers of getSummary() try JNIThread for the lock, do
that check inside getSummary(), and move it to GameUtils from DBUtils
since it's using higher-level knowledge now.
2016-08-12 11:48:39 -07:00
Eric House
3baeb79a45 cleanup: "message" => either "chat" or "move" 2016-08-12 11:18:56 -07:00
Eric House
1c59f1e002 replace window title when pane goes away
Add new parameterless setTitle() method on delegates, and call it when a
fragment is removed so the new right-most pane can restore a title that
makes sense. So far only board and gameconfig delegates implement this
new method.
2016-08-12 11:00:51 -07:00
Eric House
76a7aeb93c fix dupeGame for dual-pane case
Current GameLock implementation means you can't get a lock for an open
game, so try getting one from an existing JNIThread instance
first. Which is a hack that's start to appear in lots of places.... Also
fix so just in case we are unable to lock a game we drop the rematch
process rather than crash in an assert later. The test case: rematch a
solo game that's currently open in the right pane.
2016-08-12 08:55:54 -07:00
Eric House
16a622d22c cleanup: rename method 2016-08-12 08:50:26 -07:00
Eric House
dfe79a2d97 move game loading into GameLock
Fixed race conditions revealed by dual-pane mode where GameLock could be
instantiated and then attempts made to reference its game (jni calls)
before it had been loaded. So now loading happens inside the same
synchronized methods as opening or creating a game.
2016-08-12 08:33:36 -07:00
Eric House
90e7cbd2ed cleanup: use constants 2016-08-12 08:08:53 -07:00
Eric House
8e399ef9b7 assert from java that jni code has an env
Rare crashes are happening inside the jni, in game_dispose(), when a
game's double-disposed. Adding a jni call to check if the thread about
to do a game_dispose() will fail then asserting its result in java
allows useful stack traces to come via Crittercism. Or should.
2016-08-11 16:42:18 -07:00
Eric House
5d9423f317 fix rematch crash: don't call finish()
There was a race condition between finish() and the popping of fragments
that happens inside dispatchNewIntent(). If dispatchNewIntent() won then
later finish() would pop the GamesListFragment and we'd crash. Ideally
finish() would pass a fragment to finishFragment() which would then do
nothing if that fragment wasn't on the stack. Later....
2016-08-11 16:33:12 -07:00
Eric House
457970b2d2 gtk: the tiniest bit of cleanup
Trying and failing to get just the content area of the tree view to
scroll, whether by putting it in its own container or hooking into the
scrollable interface tree view allegedly supports.
2016-08-10 14:53:44 -07:00
Eric House
06fb4ef0ee improve experience switching dualpane mode
better strings, and explain when pref changed that user must restart for
it to take effect. Actually restarting from inside prefs delegate is
hard enough I'm not doing it for what should be advanced users.
2016-08-10 11:56:05 -07:00
Eric House
01d45df3ae use WeakReference to prevent "leak" of static member 2016-08-10 11:46:38 -07:00
Eric House
bece9183f9 remove restart notification on start 2016-08-10 11:32:23 -07:00
Eric House
43b76d24cc add commented out thread assertion
I want to use ReentrantLock instead of my implementation but I'm
breaking its rule that the thread that locks a lock must be the one to
unlock it. Add commented-out assertion for some later time when I might
want to fix this. No change for now.
2016-08-10 09:42:19 -07:00
Eric House
dddfa2e269 keep INVITE alert up for rematch game
Game created for rematch was coming up unconnected and without
explanation if recipient of invitation hadn't responded. Don't dismiss
the INVITE alert in that case.
2016-08-07 11:54:45 -07:00
Eric House
9909750605 don't show the loading view except the first time 2016-08-06 09:32:13 -07:00