Commit graph

5672 commits

Author SHA1 Message Date
Eric House
33838e6a14 don't crash when crashlytics didn't get built in correctly 2017-06-27 07:34:04 -07:00
Eric House
d454ffb3e8 up changelog/strings for release 2017-06-22 07:12:51 -07:00
Eric House
4e101862a6 get rid of old standin for missing contact name
Since it's now possible to add a name for an SMS contact added manually,
don't assuming a missing name means it was added manually. Just leave
blank if not provided.
2017-06-21 07:59:22 -07:00
Eric House
e3e7add5a9 fix (I hope) script for harvesting jni sigs
I made these changes a while ago then stashed them. They worked when I
needed them then, and seem to work now, but I haven't verified now so
don't trust 'em too far. :-)
2017-06-20 22:05:39 -07:00
Eric House
a16cc8e648 replace Crittercism with Crashlytics, suckily
Crittercism is dropping free support of FOSS apps, so I'm dropping
it. Unfortunatly integration isn't as clean: so far at least I haven't
figured out how to make it possible for others to build the 'd' variant,
which includes Crashlytics, without their having a Fabric API key.
2017-06-20 21:48:40 -07:00
Eric House
6de5d307b3 add name field to manual sms contacts entry 2017-06-20 19:35:38 -07:00
Eric House
b33df6b222 reset SMSResend timer on new data only
Resetting it on every ACK etc meant it happened forever at the most
frequent interval, at least on devices that have both sides of a game,
which is my usual test setup.
2017-06-20 19:19:03 -07:00
Eric House
e6454070a6 remove an oft-firing assert
It's definitely happening, and disruptive though debug-only. So remove
to be tracked down eventually.
2017-06-20 19:17:23 -07:00
Eric House
e3a8bef3cb add new param
It's not the case that forcing send and showing UI go together.
2017-06-20 07:49:01 -07:00
Eric House
0b2920102b tweak chat layout; use better timestamp format 2017-06-20 07:47:32 -07:00
Eric House
3aefa3a566 don't make sound/notify on standalone game moves
I'm finding the robot move beeps annoying. If others aren't maybe a
preference would be better. We'll see.
2017-06-16 19:24:04 -07:00
Eric House
7f48267397 save non-destructive changes on "Play game" button
In game config, when the play game button's hit and the changes pending don't
"matter" (require reset), apply them. The motiviation is to allow
setting the "disableds" and immediately launching a game via the button,
but I think it's the right thing to do anyway. Needs testing.
2017-06-16 19:18:30 -07:00
Eric House
7bae112077 add timer to resend sms data messages
Deal with occasional droppage of SMS data messages by running a
timer (via AlarmManager) with backoff that resends any pending moves for
games connected via SMS. Successful receipt of SMS data resets the backoff.
2017-06-16 18:56:22 -07:00
Eric House
0b0a50bd5c add timestamp to chat messages, db and display
On send, add current seconds to message. Store and display in android
code. Display layout needs work.
2017-06-10 11:36:45 -07:00
Eric House
59285aa9f4 cleanup 2017-06-06 05:46:27 -07:00
Eric House
f85f7c41be add cmdline options to generate single-abi .so
Part of getting split builds going. I think.
2017-06-06 05:45:31 -07:00
Eric House
41683f95a7 improve activity lifecycle logging 2017-06-05 07:36:47 -07:00
Eric House
5c893127de remove constants from build.gradle
cleanup, iterating over built-in data rather than my hard-coded VARIANTS
and BUILDS arrays, which now go away. Renamed obj- and libs- directories
to better fit the variables the system provides.
2017-06-01 07:41:51 -07:00
Eric House
f49aac71cf get rid of <a> -- sucks in webview 2017-05-31 20:22:13 -07:00
Eric House
c53616fd82 wrap code in if(DEBUG) 2017-05-27 13:26:57 -07:00
Eric House
9644f40659 add ui for disabling comms send and receive
Add DEBUG-builds-only UI at the bottom of GameConfig for turning on the
comms feature dropping outgoing or incoming messages. The idea's to use
this to reproduce and fix stalls. There's a noticable slowdown opening
the GameConfig fragment, but it should all be no-op in a release build.
2017-05-26 07:49:38 -07:00
Eric House
a815c466c9 up strings for new release 2017-05-25 20:13:00 -07:00
Eric House
7164ab92f6 make FirstRunDialog a DialogFragment
It was disappearing when the device rotated. Using the same
XWDialogFragment mechanism as everything else fixes that.
2017-05-25 19:58:04 -07:00
Eric House
b6665a15c4 double-check to avoid crash (by observation)
Chasing a rare play-store-reported JNI crash: test for a null ptr in C
and assert/test in Java.
2017-05-25 07:10:49 -07:00
Eric House
d584c30a43 fix (by inspection) three Play store crashes
One race condition between BT threads; two edge cases around dialog
fragments, where I've left DEBUG build asserts in place.
2017-05-24 21:27:18 -07:00
Eric House
935932f440 don't try to upgrade fdroid builds
Add BuildConfig boolean that's true when a gradle property is passed in
from the fdroid metadata/build file. Test when putting together upgrade
state and omit app info when it's true, same as if from Play store.
2017-05-24 20:16:07 -07:00
Eric House
d58c601bf3 include git revision in assets/ dir (.gitignore it)
Makes it easier to see what's been built into an apk if the file's name
has changed.
2017-05-24 07:09:11 -07:00
Eric House
340a559eb7 don't report fdroid builds as dirty
F-droid build system modifies git-controlled files so no build will ever
be clean. So look for a -P property and if that's set don't use the
--dirty flag when capturing the git revision. Requires a change to the
fdroid metadata to pass that property.
2017-05-24 06:49:09 -07:00
Eric House
222655ba58 get rid of background for expander buttons
In the gameslist view the expander buttons had a visible rectangular
background. Now that's transparent so they look like the rest.
2017-05-23 19:03:29 -07:00
Eric House
3c650ce762 fix xw4d build (shortening more xw4dbg) 2017-05-23 19:03:29 -07:00
Eric House
acf7097fda sign release apks outside of gradle
My sign-inside-gradle is an uncommon trick and unnecessary. Better to
follow the old convention of using jarsigner and zipalign.
2017-05-23 19:03:19 -07:00
Eric House
ef2da21bbe xw4dbg -> xw4d: tired of typing the extra letters
Rename the debug variant and make it work. appID stays the same and so
no longer matches. Gradle allows that.
2017-05-23 06:37:31 -07:00
Eric House
4ad7e171f6 keep db open throughout
Years back what I read said you opened and closed the database around
every query. Now I'm reading differently, that the OS will close it for
you on app shutdown and that it's ok to just leave it open. Trying
that after a few minutes on one device looks ok. Will need to test the
heck out of it, especially on older OS versions, before ship.
2017-05-18 21:20:21 -07:00
Eric House
8a4563e8ee up version strings 2017-05-18 06:53:03 -07:00
Eric House
a834a8170a catch IllegalStateException
Play store reports crashes but stack crawl doesn't tell me where
from. So try catching the exception and on debug builds logging what
dialog is responsible.
2017-05-18 06:37:58 -07:00
Eric House
7f4d8b1a44 remove firing assertion (per Play store)
Looks like clock skew or maybe even a timezone issue (I'm not doing
enough research :-) is causing an assert. Just drop the notification
instead.
2017-05-18 06:19:25 -07:00
Eric House
098de83b04 fix assertion: don't pass bundle as alert param
it's not serializable, and more's the point is already being saved
across rotations in the delegate, so just use that.
2017-05-09 07:02:12 -07:00
Eric House
a6d5f409cb include translations in changelog 2017-05-08 20:47:08 -07:00
Eric House
055f54611d catch NPE Play console reports thrown by OS
No clue why this might be happening, but perhaps catching and dropping
will prevent a bad user experience?
2017-05-07 17:06:26 -07:00
Eric House
c3bfbfb956 up version strings and changelog for release 2017-05-07 16:27:40 -07:00
Eric House
f8077785bc cleanup: remove comments and unnecessary ivar 2017-05-07 16:25:18 -07:00
Eric House
9b88279212 remove need for file
app_name.xml's contents are in generated file, so just use that. Saves a
change on each release.
2017-05-07 16:05:36 -07:00
Eric House
c637fd1eee remove not-again explanation for public rooms
When those became an advanced feature I added a warning for upgrading
players who'd miss them. That was long ago, and the warning was only
supposed to last a release or two.
2017-05-06 21:05:42 -07:00
Eric House
579a7ae5cb change emacs compile-command for java files (generated) 2017-05-06 20:59:17 -07:00
Eric House
3c2d36c5d4 Merge branch 'android_branch' into android_translate 2017-05-05 07:20:36 -07:00
Eric House
309622b592 put back a couple of words -- not dirty! 2017-05-05 06:48:52 -07:00
Eric House
252db56bba update English wordlists to bowdlerized 2017-05-04 22:48:15 -07:00
Eric House
ed781b36b5 remove dismissDialog() and removeDialog()
One's a no-op the one place it was used, and the other's not used at all
2017-05-03 07:10:26 -07:00
Eric House
77a5d9c217 remove onConfigurationChanged(); no longer called
Removing from AndroidManifest meant the overridden method is no longer
called, so remove it and the code it calls.
2017-05-03 07:01:21 -07:00
Eric House
14dd3b4950 remove one-release-only explanation
Stuff explaining change only makes sense the first release after it's
added. So remove.
2017-05-03 06:53:39 -07:00
Eric House
c6d3870365 remove dead file 2017-05-03 06:51:16 -07:00
naofum
41f8072182 Translated using Weblate (Japanese)
Currently translated at 74.4% (549 of 737 strings)
2017-05-02 12:45:40 +02:00
Eric House
8588756556 fix assertion fail
It's legit for makeDialog() to fail when e.g. committing a turn while
board and chat are visible. So remove assertion.
2017-05-01 07:37:18 -07:00
Bernard Massot
2d3c8f799b Translated using Weblate (French)
Currently translated at 89.0% (656 of 737 strings)
2017-04-30 21:44:59 +02:00
Eric House
f18b3c61bf cleanup: get rid of old dialog stuff
showDialog() goes away except for PrefsActivity which can't do
fragments. Move stuff required by PrefsDelegate into it from
DelegateBase since no other subclasses does old-style Dialogs
any more. Remove a bunch of stuff from DlgDelegate, e.g. saving
state, that no longer gets used.
2017-04-27 21:37:48 -07:00
Eric House
a1c92b6957 cleanup from review of changes 2017-04-27 21:37:27 -07:00
Eric House
6caff930e7 Merge branch 'android_branch' into android_translate 2017-04-26 19:18:50 -07:00
Eric House
7a64b6066f Merge branch 'android_translate' of git://git.weblate.org/xwords into android_translate 2017-04-26 19:16:56 -07:00
Eric House
c3f0ed692c more useful log statement 2017-04-26 06:35:48 -07:00
Eric House
6fbb701dbe post from activityResult to avoid transaction error
Was getting crash with "Can not perform this action after
onSaveInstanceState". This lets the back stack get back into shape so it
can put up another alert.
2017-04-25 07:37:12 -07:00
Eric House
52ea395ad6 put invite/wait alert on back stack
Add to DldID the ability to specify whether dialog fragments bearing
that id go on the back stack. Set INVITE alerts (only) to use that
mechanism. Having them on the back stack seems to be required by their
buttons being hacked to not dismiss them, which in turn is required
because I want them to stick around underneath other alerts their
buttons launch.
2017-04-20 22:06:49 -07:00
Eric House
e12c303f0c fix NPE 2017-04-20 07:19:06 -07:00
Eric House
3dd5ac34fd don't [re]show rematch alert on rotation
on onCreate() test for bundle being null, and only in that case put up
the alert. Keeps it from piling up on rotations.
2017-04-19 21:24:00 -07:00
Eric House
97c459d708 fix format exception in logging 2017-04-19 07:15:21 -07:00
Eric House
22e0c9f1b1 fix assertion by running on ui thread
And since all calls to showDialogFragment do that now no need to wrap calls.
2017-04-18 07:48:52 -07:00
Eric House
2453de0128 consolidate dual-pane settings
Get rid of explicit enable-dualpane boolean pref, instead relying on the
three way default/force-phone/force-tablet pref. Offer to change that
rather than the former in BoardDelegate when run on upgrade. Move the
prefs setting from Debug to Appearance since it's "real" now.
2017-04-18 07:26:45 -07:00
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
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
6e5973c55b toward making tile picking work through rotations
Make face-up tile picker util method return void and add mechanism for
passing in selected tiles asynchronously, as has been done recently with
the rest of the once-blocking util callbacks. Works perfectly in the gtk
case. Likely crashes in curses (if picking face-up option is on.) In
java all the callbacks are there but rather than put up a UI we pretend
the user says "pick 'em for me" each time. Putting up a UI is next.
2017-03-09 20:36:14 -08:00
Eric House
70b3aaa263 modify function to be more useful 2017-03-09 19:35:07 -08:00
Eric House
618f9cf20a toward rotation-safe invite dialog
Rewrite the overly-complex invite dialog that's posted when a game opens
and is missing players so that it doesn't crash after an orientation
change. It's still possible to dismiss it yet have the game stay open.
The goal is that a game in that state always has a dialog on top of it
so you don't get confused about e.g. why you don't have tiles, but
there's more work to be done there.

Also added a common superclass for all my DialogFragments. It may be
useful e.g. for having each DelegateBase instance able to track what
dialogs it currently has up, e.g. to have a policy about how many of the
same class can be live. I'm thinking here of how to prevent a
robot-vs-robot game from ending with a stack of 25 move reports. (The
change here is that the old activity.showDialog(int) only allowed one at
a time, and some of my logic takes that for granted.)
2017-03-07 07:48:46 -08:00
Eric House
0980bcfbe5 fix another class cast exception
But this is by inspection and, involving a dialog that is no longer
posted, could probably never occur.
2017-03-07 07:35:16 -08:00
Eric House
9211d6b765 fix class cast exception
Problem with subverting type checking is compile time errors become
runtime...
2017-03-07 07:08:48 -08:00
Eric House
83f7a9cec1 fix dismissal of invite/wait alert
There were multiple places launching it, which in a DialogFragment
world (in the absence of other per-dlg-id controls) means stacked
multiple alerts. And dismissDialog() didn't work. So use a boolean to
prevent more than one being posted and keep a reference to the
DialogFragment behind it in order to be able to call dismiss() on
it. That's the only place I was calling dismissDialog() (other
than the tile-picking stuff which has to be rewritten anyway) so this
little hack is probably ok.

This alert still gets messed up with the screen config changes. Fixing
that is next.
2017-03-01 07:23:50 -08:00
Eric House
5e23d6fc75 remove unused variable 2017-03-01 06:14:35 -08:00
Eric House
b849ad4db3 Merge branch 'android_branch' into rotation_fix 2017-02-27 18:49:57 -08:00
Eric House
d865812002 failing to find an .apk is not an error 2017-02-27 18:31:17 -08:00
Eric House
19a7b7e146 fix assertion: we do handle that case 2017-02-24 09:12:11 -08:00
Eric House
48bd5d7f1d fix posting of dialogfragments from preferences
I can't get preference fragments working in my world (mostly because
nested PreferenceScreens don't open when clicked on and the workarounds
for that are too complex) so next best thing is to fix alerts to work on
top of prefs activity. That involves creating a new transparent activity
that subclasses XWActivity and has a DelegateBase subclass. Launching an
alert is then just a matter of passing DlgState into the new activity
via an Intent, at which point everything Just Works. Button clicks are
returned via an intent as well.
2017-02-24 08:56:31 -08:00
Eric House
70a99b39fb remove dictGone dialog
There's no way to get it invoked. I think that's a bug, but when it
comes back it'll come back in different form.
2017-02-22 22:35:19 -08:00
Eric House
2a4bce4ad1 remove Context ivar from CurGameInfo
It claimed to be Serializable but wasn't: Crash. Now it is.
2017-02-22 22:29:02 -08:00
Eric House
1de838171b make sms enabling alert dialog-fragment-based 2017-02-22 22:11:24 -08:00
Eric House
56dfef828d move launch into PrefsDelegate
Following pattern for most, though may never have dual-pane option.
2017-02-22 07:46:14 -08:00
Eric House
cfd467f7d6 fix class-cast exception 2017-02-21 21:35:35 -08:00
Bernard Massot
c0c2527258 Translated using Weblate (French)
Currently translated at 99.3% (765 of 770 strings)
2017-02-21 12:44:53 +01:00
Eric House
c271202faa make bad phonies alert non-blocking
Continue conversion of alerts that required blocking the JNI thread. Now
board_commitTurn() takes a second boolean indicating whether phonies
found have been approved by user. Common code informs user, and if he
approves client code calls board_commitTurn() again. In case where
turn's lost there's no call to make back, but there's the undesirable
change that if a robot moves next its move will be reported on top of
the turn-lost alert. Ideally new alerts would appear under, not on top
of, those that have not yet been dismissed.
2017-02-20 07:20:19 -08:00
naofum
ba780692e6 Translated using Weblate (Japanese)
Currently translated at 100.0% (770 of 770 strings)
2017-02-19 12:34:43 +01:00
Weblate
380ae5bf1f Merge remote-tracking branch 'origin/android_translate' into android_translate 2017-02-19 06:39:12 +01:00
Eric House
81d428a16d fix crash by adding missing param 2017-02-18 19:20:14 -08:00
Eric House
5f12d1a03b assign faces to blanks asynchronously
Next step in converting util_ methods that required blocking: blank tile
assignment. Now post a query and add a method that the client code can
call when the user's decided. Include enough state (col, row, and
playerNum) so that it's probably pretty safe.
2017-02-18 19:16:32 -08:00
Eric House
ca6edcfc9a make trade and move confirm non-blocking
Probably breaks curses build, but for gtk and Android
turn move and trade confirmation into a two-step process, making
board_commitTurn() non-interactive when called with a second
parameter. The old blocking util methods now return void and it's up to
the client code to interact (on the main thread) then re-call
board_commitTurn() if appropriate.
2017-02-17 08:58:20 -08:00
Eric House
1f2f4506c4 remove unused query option. Less to convert. 2017-02-17 06:30:54 -08:00
Eric House
2a0b21e5e8 make password fetching non-blocking
First attempt to stop blocking the jni thread: instead of returning a
password from a util_ method, have it include enough state that the UI
can return, put up a dialog, and then pass that state and the password
back and have them matched up again. I think this will work for the
remaining blocking Alerts too.
2017-02-17 06:23:44 -08:00
Joan Montané
081fa7b0f3 Translated using Weblate (Catalan)
Currently translated at 92.9% (714 of 768 strings)
2017-02-17 09:44:16 +01:00
Eric House
c088e36113 fix crash; use params
Pass blank-picking params through rather than using instance variables.
2017-02-16 07:59:10 -08:00
Eric House
e631d57e9b convert remaining DelegateBase Alerts
Includes a hack in DBAlert that's required I think because
GameConfigDelegate is launched "for result". onCreateDialog() always
fails after a rotation the first time because GameConfigDelegate isn't
there to have its makeDialog() dispatched to. So it puts up a dummy
alert and then post()s code that is successful in calling makeDialog()
to get an alert from GameConfigDelegate that can replace the
dummy. Nothing shows on the screen on simulator anyway.

The major problem remaining is that blocking alerts in BoardDelegate are
recreated after rotation but the thread that was blocking has been freed
so nothing can be done after the new alert returns. E.g. blank tile
picker will be posted again, user will pick a tile, but the common
code's not in a state to do anything with that choice (which cannot even
be "returned.") Options are to find a way to make the JNIThread survive
the configuration change without unblocking or to rewrite all the common
code to not expect return values from util_ methods.

This commit is not well tested, and diffs don't allow a thorough check
of the conversion of each DlgID type.
2017-02-16 07:25:20 -08:00
Eric House
13adebdc51 support alert onDismiss listener
New way of adding onDismiss listener to DialogFragment-based alerts
required API change to DBAlert and the makeDialog() method.  Fixes
customizing default player name.
2017-02-15 07:28:39 -08:00
Eric House
f5c022bb72 move show(DialogFragment) to XWActivity
First of probably many bugs running new alert changes in
non-dualpane-mode: Activities get to show dialogs too!
2017-02-15 06:44:01 -08:00
Eric House
8e874fa45c fix dispatch of extra actions
Had left out dispatch of "negative" buttons populated from an
ActionPair. Tested for offer to remove redundant new game buttons at
bottom of games list.
2017-02-15 06:37:25 -08:00
Eric House
a526ec6529 new gradle version (recommended by AS) 2017-02-15 06:35:23 -08:00
Eric House
507f6001fa convert another to DialogFragment 2017-02-13 06:09:25 -08:00
Eric House
07da48db73 replace activity.show(dlgID) with fragment-based
For GamesListDelegate only so far, replace calling <activity>.show(int)
to launch an Alert with something producing and showing a
DialogFragment. Replaces passing and saving state inside the
DelegateBase subclass with saving it as part of the fragment's bundle,
and it looks as if a single class will work for nearly all of the alerts
managed by DelegateBase.{onCreateDialog,prepareDialog}(), which will
eventually go away. The beauty is that the implementations of
onCreateDialog and onPrepareDialog remain, but as the body of a new
makeDialog() that's called by the fragment's onCreateView. Less code
changes, but now it's all called every time an alert's created.
2017-02-12 15:33:35 -08:00
Eric House
c66764bd77 make lookup alert fragment-based 2017-02-10 08:41:28 -08:00
Eric House
b69eb30e9c use the recommended pattern for DialogFragment construction
Empty constructors only...
2017-02-10 07:17:53 -08:00
Eric House
8c92f2012e file/class name change 2017-02-10 06:40:56 -08:00
Eric House
92e150bb1e convert confirmThen alert 2017-02-10 06:00:26 -08:00
Eric House
c9bc7b6c49 convert ok-only dialog to fragments 2017-02-10 05:47:17 -08:00
Eric House
a724ef734f add forgotten file 2017-02-10 05:40:18 -08:00
Eric House
e69824ece0 remove Runnable from DlgState
Can't be serializing Runnables, so replace with an Action that's sent
via onPosButton.
2017-02-09 09:08:03 -08:00
Eric House
470ee6eaa4 rebase invite choices alert on fragments
And create a common superclass for alerts coming out of DlgDelegate
2017-02-09 08:14:44 -08:00
Eric House
7c39bf6064 call via activity in common case too 2017-02-09 06:41:38 -08:00
Eric House
939688e3cd change DlgClickNotify methods to return boolean
So dispatching over possible targets can stop when one has handled it.
2017-02-09 06:23:41 -08:00
Eric House
796192380f switch not-again alerts to being fragments
Since associated DlgDelegate instance doesn't survive a rotation, needed
to pipe results through a DlgClickNotify implementation on XWActivity
that then dispatches in the DualpaneDelegate case to all visible
fragments. I hope this turns out to work for all DlgClickNotify
implementations as I switch them over. We'll see.
2017-02-09 06:19:37 -08:00
Eric House
e863cc1a4b experimental on-device log-saving script
Add script that when copied to device and run from 'adb shell' captures
all app and OS logs to file. Next: add code to XWApp.java to copy it
from assets/ and run it on launch.
2017-02-08 07:01:38 -08:00
Eric House
b1f095b56e prevent loading of WiDirService on older android
On 2.3 anyway there's a java.lang.VerifyError trying to load that
class. So wrap the loading in a new class that catches the error and
sets a boolean so subsequent calls don't need it. There are other calls
that could load the class, but they may not be reachable. To be tested.
2017-02-08 06:33:06 -08:00
Eric House
683eb8e14b don't remove alerts in onStop()
Required to fix alerts going away now that orientations are handled by
the OS (which in turn is the preferred way to do things now since not
ALL config changes CAN be handled by the OS.) With this change some
alerts will probably cause crashes during a rotation. Those all need to
be fixed.
2017-02-07 07:04:27 -08:00
Eric House
0e23c191b5 convert About alert to DialogFragment
As a first experiment. Untested on non-dualpane and on older OS
versions.
2017-02-07 07:02:16 -08:00
Eric House
121c35b728 don't expect View to survive a rotation 2017-02-06 19:18:15 -08:00
Eric House
69eee734e2 cleanup: switch on ids rather than test views 2017-02-04 10:28:23 -08:00
Eric House
99664a8360 persist game config state across rotations
Make CurGameInfo serializable, make sure it's updated in onPause, and
then just add it to the bundle. Easy.
2017-02-04 10:12:34 -08:00
Eric House
b050ac5d62 update studylist display when words added
Add listener interface to DBUtils and hook StudyListDelegate into it so
that if a word is added while the list is being displayed the new word
shows up immediately.
2017-02-04 09:40:01 -08:00
Eric House
6eb4a9b09b preserve studylist selection across rotation
As elsewhere, convert to a serializable representation and save it in
instance state.
2017-02-04 09:00:40 -08:00
Eric House
6b565e2fa7 cleanup: remove some logging 2017-02-04 08:53:07 -08:00
Eric House
6270a81bfa config changes to build on different system 2017-02-04 08:12:40 -08:00
Eric House
b0cef99507 preserve wordlist selection and remote info
wordlist browser selection and downloaded info about downloadable
wordlists didn't survive rotation. They do now, the latter as a huge
serialized array. To make selection work I save the keySet() of a
mapping of selected names to the views that represent them. Now the
presence of a key, even if the value is (temporarily) null, signals that
something's selected.
2017-02-02 21:08:22 -08:00
Eric House
3ae2b41ae2 save selected games/groups across rotations 2017-02-01 06:08:33 -08:00
Eric House
ca4b3fd454 fix crash when starting in non-dualpane mode 2017-01-31 21:04:17 -08:00
Eric House
b874d25563 fix iterating over fragments
Old code that didn't rotate properly was meant to associate view IDs
with fragments so I could iterate over them, e.g. to dispatch
intents. To replace that the common superclass of all fragments now
keeps a set of active ones and provides a method that uses that to find
the fragment that owns a view. So I can iterate over fragments based on
the dualcontainer-contained views as before.
2017-01-31 19:46:51 -08:00
Eric House
0fedcf56ab fix remaining fragment view layouts
The layout_width="1" thing is critical!
2017-01-31 08:03:13 -08:00
Eric House
352508b852 start fixing problems with dual-pane
Remove the generated FrameLayout that was breaking restoration after a
config change. Set layout_weight=1 for all fragment root views so they
get half the screen in landscape mode. Remove some code. Problems
remain, first among them that notification intents aren't dispatched correctly.
2017-01-31 07:01:11 -08:00
Eric House
f9cc524028 remove configChanges for MainActivity
Makes it so simply rotating duplicates the grey-screen GamesList problem.
2017-01-28 11:03:33 -08:00
Eric House
afb0c1d3ee disable move when all games already there
When all selected games are starting in the same group and that group is
selected as the move destination, disable the move button.
2017-01-24 07:55:09 -08:00
Eric House
b8e8c176ed don't open group just because added game
A group that's closed stays closed even if a game's added to it. The
change flushed out a bug where the groups cache wasn't being invalided
on a game move, so fix that too.
2017-01-24 06:53:54 -08:00
Bernard Massot
c4e451a768 Translated using Weblate (French)
Currently translated at 99.2% (762 of 768 strings)
2017-01-23 15:44:49 +01:00
Eric House
9cab7d916c fix strings update server file requires
Name file and set internal constant sent to server to use same git rev
string so that the script will correctly identify whether the version I
have is the latest it has available. Fixes server offering to replace
with what I already have.
2017-01-22 16:22:35 -08:00
Eric House
929c4c811b tweak gradle-built apk name 2017-01-22 15:55:31 -08:00
Eric House
83fed4da91 include debug keystore directly
replace symlink silliness ant required with gradle commands to sign
debug builds with the checked-in (local file) debug keystore. Make
it possible for an environment variable to override in case somebody
wants to use his own.
2017-01-22 15:35:02 -08:00
Eric House
15d0f88187 add preference to disable wifi direct
Looks like there are battery drainage issues with the current half-done
implementation, so add option to turn it off. Only takes effect on
restart, and only matters on dbg variant now since it's compile-time
disabled on the main variant.

Also add discovery machine state to ConnState printout, stop running the
machine over and over (likely the battery problem), but add ability to
restart it triggered by the ConnState's "reconnect" button.

Also start persisting the most recently seen set of peers. If service
discovery and not connecting is the problem having these available to
try to connect to on startup might help.
2017-01-22 14:51:21 -08:00
Eric House
b96d44393a add and use boolToStr
Just to make log messages a bit more helpful. Should be no behavior
change, and no change in code generated in release builds.
2017-01-22 14:15:29 -08:00
Eric House
4a93281a2d enable wifidirect in xw4dbg variant
As it was before.... Also log rather than assert a common widir packet
forwarding error.
2017-01-20 07:56:03 -08:00
naofum
704661180d Translated using Weblate (Japanese)
Currently translated at 100.0% (768 of 768 strings)
2017-01-20 15:05:05 +01:00
Eric House
2053b234fa print less during builds 2017-01-19 19:05:10 -08:00
Eric House
eb13ea4291 add the upside-down icons for -dbg flavor 2017-01-19 08:36:27 -08:00
Eric House
9c142dd6e7 add cleanNDK task and separate jnilib dirs
Build different jni code (into different obj and libs directories) for
the different release/debug and xw4/xw4dbg combinations. This works when
only one build is done, but when doing two some later task tries to put
both multiple same-named libraries into the .apk and so fails. I still
think it's worth adding this to keep from using the wrong binary, but
that needs to be fixed.

cleanNDK just nukes all the directories. Easier than invoking build-ndk
clean...
2017-01-19 08:10:16 -08:00
Eric House
43e8c3ea64 fix release script errors and that running it finds 2017-01-19 06:22:24 -08:00
Eric House
f5ebee89da fix duplicate permissions
Merging of AndroidManifest.xml files meant the dbg flavor was getting
its C2D_MESSAGE permission and the main flavor's, which on recent OS
versions meant it couldn't be installed. Use substitution from gradle to
fix.
2017-01-19 06:22:12 -08:00
Eric House
995da3a0b2 remove last from old directories 2017-01-18 19:44:17 -08:00
Eric House
ea3a8b4034 include relay hostname in debug conn status 2017-01-18 19:30:03 -08:00
Eric House
22ca219347 Merge branch 'android_json' into android_branch
Accidentally did a bunch of gradle work on the wrong branch, but it's a
trivial merge as I hadn't done anything else with it yet.
2017-01-18 19:25:58 -08:00
Eric House
8ade997e8c remove the rest of XWords4-dbg 2017-01-18 19:24:59 -08:00
Eric House
9eed2ca608 auto-update emacs compile-command to use gradle 2017-01-18 19:22:32 -08:00
Eric House
1f5ffaa712 more cleanup. Get Crittercism stuff compiling. 2017-01-18 19:03:36 -08:00
Eric House
0d1e22fc83 move wordlists and other assets over 2017-01-18 08:47:33 -08:00
Eric House
aaf153006e move and incorporate localized strings
This will require a reconfig on the weblate side!
2017-01-18 08:44:23 -08:00