Commit graph

9560 commits

Author SHA1 Message Date
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
Eric House
3140df2f37 wrap loading and loaded views in FrameLayout
This to prevent the game list item from resizing (and so reflowing the
whole list) when it's reloading game info. Better would be to set a
timer and only show the reloading view if it seems likely to take a
minute.
2016-08-06 09:27:11 -07:00
Eric House
c2305dafff let android studio "optimize imports" 2016-08-05 22:16:04 -07:00
Eric House
b9bb1e2684 cleanup: use new board_drawSnapshot on existing game 2016-08-05 22:04:30 -07:00
Eric House
bf7a38da08 copy more state into board being used for snapshot 2016-08-05 21:19:49 -07:00
Eric House
a275730824 gtk: fix crash when hit rematch button
Not all games have a draw context. Check!
2016-08-05 18:37:35 -07:00
Eric House
012b015f82 gtk: save games list window size and position 2016-08-05 18:31:17 -07:00
Eric House
25723bbb0f put main games window in a scrolling container 2016-08-05 12:02:05 -07:00
Eric House
8b142e4a56 use new board_drawSnapshot() from android
BoardCanvas wouldn't render anything without an associated dict via
dictChanged()
2016-08-05 11:51:47 -07:00
Eric House
7f513313b0 fix crash loading new game before snapshot exists 2016-08-05 10:37:42 -07:00
Eric House
0c6283ea63 add board_drawSnapshot
Toward something that should work with android: pass a potentially
unique draw context into new method that creates a new board just for
the draw and makes its scoreboard and tray disappear.
2016-08-05 10:23:39 -07:00
Eric House
3c0a128266 produce, store and display actual snapshot
Done in a way that won't work for Android just to try out the gtk
way. Tweaks and reuses the existing draw context and board, which is
precisely what the android version can't easily do.
2016-08-05 09:42:55 -07:00
Eric House
aeee2d801a toward snapshots in gtk version
Add new "snap" blob to db and pixbuf column to games display table, and
add code to store and retrieve from db. What's stored now is a
hard-coded file, so next up is generating an actual snapshot from the
game.
2016-08-05 08:29:25 -07:00
Eric House
b4393d5965 fix cursor-hiliting of player in scoreboard 2016-08-04 16:13:54 -07:00
Eric House
df6c1e0d3a make beginDraw return a boolean so can abort
When a gtk3 window's shutting down it appears we can't get a cairo_t*
for it. This change makes it possible to turn that fact into aborting
the whole draw operation.
2016-08-04 15:12:05 -07:00
Eric House
3c7af0023e fix curses drawtable fallback 2016-08-04 14:16:52 -07:00
Eric House
80f894b869 fix remaining gtk dialogs 2016-08-04 12:43:33 -07:00
Eric House
66e26c1489 hook up draw signal
Whenver we get the draw signal, invalidate the whole board and draw
it. This is resulting in a lot of wasted effort that might be mitigated
if I figured out how to get the invalid region out of the cairo_t*
that's passed in, but this is a test app and my machine's pleny fast. So
go with it for now.
2016-08-04 11:41:43 -07:00
Eric House
33f904fa1e provide no-op implementations of new draw methods 2016-08-04 07:07:52 -07:00
Eric House
aad97c7c23 grab the GameLock in synchronized code
I'm seeing unreproducible crashes trying to double-dispose jni game
instances and think it's a race condition involving JNIThread. Forcing
it to hold the lock in the constructor, access to which is synchronized,
is an improvement and may well fix it.
2016-08-04 06:48:39 -07:00
Eric House
d2edbaff37 log more about jni thread mapping 2016-08-04 06:46:34 -07:00
Eric House
1892d24317 get all layouts from the same place 2016-08-03 17:56:38 -07:00
Eric House
9521b71be9 fix remtext rendering 2016-08-03 17:35:44 -07:00
Eric House
670f0034af fix a bunch of color setting 2016-08-03 16:54:45 -07:00
Eric House
eb6fb508bf fix crash dragging tiles
Add new begin() and end() methods around all drawing and get/destroy
cairo context there.
2016-08-03 15:50:17 -07:00
Eric House
b57e50a255 snapshot toward building with gtk3
Board renders, but only when touched. Tray and scoreboard skipped for
now. Lots of changed still to go, and some asserts added where I didn't
want to stop to solve a compile problem.
2016-08-03 15:19:12 -07:00
Eric House
2ade75158b gtk: update constants 2016-08-03 08:20:05 -07:00
Eric House
799e89fdc1 gtk: use accessors instead of peeking at structs 2016-08-03 08:09:47 -07:00
Eric House
cb97ceab82 oops: don't show upgrade changelist on every boot 2016-08-03 07:24:16 -07:00
Eric House
bd8e829a06 replace deprecated gtk symbols (lightly tested) 2016-08-03 07:11:02 -07:00
Eric House
2ff7582688 enforce and follow new gtk header rules 2016-08-03 06:15:49 -07:00
Eric House
08269c8962 offer to turn on dual-pane mode for upgraders
When a device is a tablet and not a first-time install, put up an offer
to enable dual-pane mode. Change confirm-alerts to include
do-not-show-again box, and use that. Add menu item, hidden when not in
dual-pane mode, to turn it back off. Exit app after posting a
notification and a toast on changing that preference so it'll take
effect.
2016-08-02 21:49:17 -07:00
Eric House
f56869b9ea cleanup; synchronize calling start()
Hash comparison is clearly working, so no need to keep the whole data
array any longer.
2016-08-02 11:59:57 -07:00
Eric House
98eeb60f24 move sound notification preference
It's about robot games too now so move out of network into general prefs.
2016-08-02 11:30:33 -07:00
Eric House
e1cac237ab fix gradle build: remove thumbnail stuff 2016-07-30 17:48:47 -07:00
Eric House
141fb29c81 fix occasional NPE
I can't reproduce it, but occasionally fail to get Loc info for a
wordlist while opening. Drop the open rather than crash.
2016-07-29 08:17:31 -07:00
Eric House
fa7de741eb fix NPE: PrefsActivity needs to delegate onStart() too 2016-07-29 08:03:14 -07:00
Eric House
5fc6ae5591 only log what's there 2016-07-29 08:02:00 -07:00
Eric House
ec96a00b46 remove compile-time enabling of chat: it's not coming out 2016-07-29 07:32:50 -07:00
Eric House
36f127fb18 log fragment IDs for now while still debugging this stuff 2016-07-29 07:20:14 -07:00
Eric House
e4c7b7ab40 handle intents on startup via a post()
When app's launched via a move-made intent that will lead to opening
the board, let the GamesList fragment get fully in place before
opening the board. To open two at the same time confuses my fragment
code (OS kills it with a fatal exception.)
2016-07-29 07:19:54 -07:00
Eric House
2b3ddcb431 cleanup thread->env mapping code 2016-07-28 08:52:11 -07:00
Eric House
39cafc2dcf remove unused imports and be explicit that LinearLayout.LayoutParams are being passed to FrameLayout instance. 2016-07-27 15:06:49 -07:00
Eric House
524a288999 change adb utility scripts so they work with more than just one set of apps. 2016-07-26 22:08:29 -07:00
Eric House
d6dd851349 fix NPE: ringtone can be null on older OS 2016-07-26 11:49:08 -07:00
Eric House
73fdb4a578 open chat later, via post(new Runnable())
When during onResume() of BoardDelegate we notice an undisplayed chat
message, don't add add a Chat fragment because (perhaps due to a bug
in my code) it'll come up blank. Instead use post() to open it via a
Runnable() that'll run after onResume() and the rest of current
fragment setup have completed.
2016-07-26 09:34:32 -07:00
Eric House
bc9b8466f5 check for existing JNIThread first
When loading gamelistitems in dual-pane mode there will often be an
open game. Don't hold up the whole process by first waiting 1 second
to get a lock that's unavailable. Instead check if there's a JNIThread
instance available and if so use its lock to get the summary. Required
fixing JNIThread to not crash trying to save when released too early.
2016-07-26 07:44:21 -07:00
Eric House
272f8a3960 don't bother saving if no data loaded yet
Fixes, or at least makes extremely unlikely, race condition where one
thread makes use of an existing JNIThread instance then releases it
before the thread that created it has had a chance to call configure()
to actually load the game.
2016-07-26 07:27:13 -07:00
Eric House
9d95630654 make capture of thumbnail part of save
Problem was that changes to games didn't show up in the thumbnail
until the game was closed. Simply using existing snapshot didn't work
because it changes the board layout in order to "draw" to
ThumbnailCanvas and that change isn't easily reversed. So copy
existing code to open a new JNI object with just-saved game data
and use it to create a thumbnail bitmap.
2016-07-25 15:57:48 -07:00