Commit graph

9535 commits

Author SHA1 Message Date
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
Eric House
6fcd340e07 add some commented-out logging 2016-07-25 15:44:22 -07:00
Eric House
2faf9c5334 bug: update lastturn timestamp for single-player games too 2016-07-25 08:38:24 -07:00
Eric House
53e40be2e3 add lastMoveTime to summary table (gtk version) 2016-07-25 08:28:37 -07:00
Eric House
dd779597d8 remove compile-time option for thumbnails: they're not going away 2016-07-23 16:25:06 -07:00
Eric House
a1de8cdd01 disable reset for options menu too (same as delete) 2016-07-22 16:35:46 -07:00
Eric House
7a865f279b disable reset context menu too when game selected 2016-07-22 16:26:37 -07:00
Eric House
4d24fd38f5 disable delete context menuitem when game open 2016-07-22 16:11:27 -07:00
Eric House
cfbd06927a fix long-tap menus in dual-pane mode
The DualpaneDelegate needed to handle (delegate) the necessary
methods.
2016-07-22 16:11:01 -07:00
Eric House
2105c43987 fix problems recently introduced to GameConfig 2016-07-22 16:10:45 -07:00
Eric House
d6b4070905 hang onto DelegateBase instance until replaced via an onStart() call.
They're often needed when the fragment isn't frontmost, i.e. when
onPause() has been called. My caching instances fix is feeling a bit
fragile, but I think it's better than nothing. Alternative is probably
to go with DialogFragments, a big change that might not be easy to
make work back to oldest Android.
2016-07-22 16:10:23 -07:00
Eric House
7634c425ef stop referring to this in AlertDialog buttons
There's a problem in dual-pane mode where activites outlive
DelegateBase instances that are tied to fragments. AlertDialogs, being
bound to the MainActivity, can sometimes outlive the delegates that
create them, meaning the 'this' referred to from closures bound to
onClick() handlers can come to be invalid (e.g. referencing a removed
fragment). So add a global registry of current DelegateBase instances
by class, and from onClick() handlers fetch and use the current
instance instead of the 'this' that's bound.
2016-07-22 16:09:36 -07:00
Eric House
aef95ae498 dispatch onActivityResult() from DualpaneDelegate
Inviting didn't work because it's done by a separate activity whose
onActivityResult() was dropped because DualpaneDelegate was the
recipient. That now handles it by asking MainActivity to sent it to a
contained Delegate. Currently will go only to the top (rightmost) one.
2016-07-21 08:47:03 -07:00
Eric House
176820aac9 start game later so UI's ready
Was opening game in init(), but in dual-pane case there's no
onWindowFocusChanged() call from which to check state, so open it
instead from onResume(), at which point things are already in place to
handle callbacks immediately. That is, post() will work.
2016-07-21 08:41:21 -07:00
Eric House
0ea181687e add constant controlling id logging 2016-07-21 07:05:35 -07:00
Eric House
a8b2c09491 fix startFragmentForResult
use s/getTargetFragment(), but there's still the hack of capturing
state in setResult() and then invoking fragment.onActivityResult()
blindly the next time the backstack is popped.
2016-07-21 07:03:44 -07:00
Eric House
c57b5a232f cleanup: chat delegate no longer "returns" a result 2016-07-20 09:30:01 -07:00
Eric House
5b4e04bc5a fix fragment exception launching after dict download
create queue of Runnables to be run only when Delegate is
visible (onResume() has been called and onPause() hasn't.)  When
missing dict finishes downloading, rather than immediately opening its
game, post a Runnable to do it that will be run only after the main
activity is ready to have fragment transactions committing again.
2016-07-20 08:58:34 -07:00
Eric House
d3bd8047b1 cleanup 2016-07-20 08:51:31 -07:00
Eric House
c0bef59aad don't hide commit-trade menuitem when not player's turn 2016-07-20 07:25:12 -07:00
Eric House
5dee7080a0 fix so when left pane launches a fragment it replaces the right
Required passing parent into constructors so it's available for
matching against the left pane later.
2016-07-19 17:38:50 -07:00
Eric House
2b58072524 cleanup: don't test for what can't happen 2016-07-19 17:35:20 -07:00
Eric House
d6ffd4dc25 get game lock and ptr from jnithread if available
When the game's already opened references must be obtained this
way. This may not be necessary however once game config is opened on
top of games list instead of on top of the game as it should be.
2016-07-19 09:30:08 -07:00
Eric House
98e3cd4281 remove unused code 2016-07-19 09:27:08 -07:00
Eric House
9a1a4f989f ignore new files 2016-07-18 13:26:14 -07:00
Eric House
e2a3e622af generate project.properties file
For some reason the 'clean-debug' cycle stopped working because the
file was nuked then not regenerated. Rather than figure out why, just
add a target to generate it every time.
2016-07-18 13:25:55 -07:00