Commit graph

9949 commits

Author SHA1 Message Date
Eric House
49242f78cf more script fixes; move jni code 2017-01-18 07:27:23 -08:00
Eric House
ad5d451ef3 fix image generation 2017-01-18 07:15:08 -08:00
Eric House
451e9e04ab fix path in script 2017-01-18 07:05:18 -08:00
Eric House
612ff0259c move and start processing res .xml files 2017-01-18 07:01:25 -08:00
Eric House
975d114f41 move some gradle files 2017-01-18 06:33:00 -08:00
Eric House
084a45296e invalidate menu when board destroyed; shorten rematch name
GamesList menu was in a bad state after a game closed because hadn't
been rebuilt. It's simplest to invalidate it surgically, when the
BoardDelegate notifies that the board's closed, though doing in in
onWindowFocusChanged() might catch more edge cases. We'll see. I want a
low-risk impact right now.
2017-01-09 07:04:58 -08:00
Eric House
8c680b50f7 fix mystery crash on my phone
but not on emulator running same OS version (or close). And in spite of
an exception being thrown the work being done, hiding a preference,
still succeeds. Whatever.
2017-01-08 14:40:18 -08:00
Eric House
fac8c2b943 resend all pending SMS messages on getting permission
Fixes case where user has received invitations but not allowed SMS then
decides to do so. It's a hack giving Perms23 class knowledge of how to
send moves etc. Instead I should be letting interested parties register
for perms-granted events, but that can happen later, and is less
valueable while SMS is the only "dangerous" permission and the only one
that blocks message sends.
2017-01-08 14:23:23 -08:00
Eric House
f41b77b8ee fix conversion of contacts from old format
JSONObject(<string>, null) clears out any existing entry but doesn't add
a new one. So store missing names as "" instead. Not sure how this
worked when I first tested it....
2017-01-08 13:26:29 -08:00
Eric House
8349ffc126 tweak changelog 2017-01-08 13:02:44 -08:00
Eric House
a0fffb3af6 get rid of SMS enabling on Marshmallow and later
My old asking for permission to turn on/off SMS is confusing and adds no
value when the OS separates out permissions and is confusing. So get rid
of it on Marshmallow and later, always returning true from the old API
and hiding the preference in that case.
2017-01-08 12:58:57 -08:00
Eric House
b0105888d0 sort current turn games with oldest at top 2017-01-07 16:20:15 -08:00
Eric House
449860a880 make Dbg variant's icons upside down
The write-red-on-it thing doesn't work for the notify.png file used in
notifications (I think because I can't find a color Android doesn't
strip out.) So use a rotation transform instead. Users will never see
this anyway.
2017-01-07 14:48:31 -08:00
Eric House
4f30a5be71 Merge remote-tracking branch 'weblate/android_translate' into android_branch 2017-01-07 13:15:16 -08:00
Eric House
e842e1a744 use tryGetPerms to replace a bunch of Perms23 crud -- again 2 2017-01-07 12:55:45 -08:00
Eric House
734549668c use tryGetPerms to replace a bunch of Perms23 crud -- again 2017-01-07 12:45:26 -08:00
Eric House
a453676456 use tryGetPerms to replace a bunch of Perms23 crud
This one required allowing passing in a string rather than a res id.
2017-01-07 12:16:59 -08:00
Eric House
6203012db6 use the utility for contacts permission 2017-01-07 10:55:21 -08:00
Eric House
ee81e3e6cc tweak permissions again
Move connection options READ_PHONE_STATE check from ConnViaViewLayout to
GameConfigDelegate and give it a rationale. Preferences stuff can't do
permissions because it can't override onRequestPermissionsResult (base
activity is of wrong class). Should fix that at some point, either by
moving to preference fragments or with a dummy activity to go over the
top.
2017-01-07 10:21:41 -08:00
Eric House
558a20f2db more tweaks around SMS permission
Explicit "ask again" and "skip" buttons in alert showing rationale;
check/ask for permission before sending invitation via SMS; warn each
time SMS-enabled game is opened without permission but allow it to stay
open and if necessary send an invitation.
2017-01-07 08:38:48 -08:00
Eric House
b898637666 close game that has no way to connect
add "close game" button to warning about lack of comms, and do that on
dismiss too. Nothing good can come from having the thing stay open.

Eventually the "close" should turn into "edit" and launch GameConfig on
the game with the comms selector up, but that's hard, as currently the
launch only happens from GamesList and is via
startActivityForResult. Might be easiest to close and send an intent to
GamesList to cause it to launch GameConfig that way. Not for this release.
2017-01-07 07:44:53 -08:00
Eric House
8bf65622b5 fix crash duplicating no-address network game
An edge case, but: doing "new from" on a game without any connection
types crashed because of an assertion in comms that assumed
addr_setType() was being called on zero-initialized flags, which
shouldn't have been a requirement. Pulled that as well as java code that
added RELAY-type connectivity to any game that had none. If a game has
none, leave it that way.
2017-01-07 07:41:38 -08:00
Eric House
86e7142687 split DlgDelegate interface in three
replace dlgButtonClicked() with separate methods for positive and
negative buttons and alert dismissal. I was making too many mistakes
because the old method was getting called twice (e.g. for negative and
then dismissal) and I hadn't needed to differentiate until adding that
new Action. There should be no behavior change with this, but it's
pervasive and replaces some spaghetti.
2017-01-06 07:07:17 -08:00
Andreas Kleinert
6bce7ea64d Translated using Weblate (German)
Currently translated at 8.5% (64 of 746 strings)
2017-01-05 21:44:57 +01:00
Eric House
dc7ed9bfb2 use new utility method 2017-01-05 07:42:21 -08:00
Eric House
46f69607c5 log class in XWFragment lifecycle methods 2017-01-05 07:39:06 -08:00
Eric House
d661f1d050 add another perms request/rationale 2017-01-04 07:10:45 -08:00
Eric House
7c033ccdf1 warn when unpermitted choice made
Let OS ask for STORAGE when user chooses Downloads dict storage option,
but do nothing if it's not granted. Existing code asks again when the
actual move is to done.
2017-01-04 06:46:44 -08:00
Eric House
2eaa3b82e7 inval dicts availability cache when permission changes
Along with cacheing what dicts are where cache the state of STORAGE
permission when the cache was made. If it's changed, invalidate the
cache.
2017-01-03 21:24:42 -08:00
Eric House
b505de5833 don't crash when STORAGE taken away mid-game
If an game's open that uses a wordlist kept in Downloads and permission
is revoked, close cleanly. On re-opening the user will be prompted by
existing code to download again. (Note: not prompted to turn STORAGE
permission back on. It would't be easy to detect that case, and I'm not
spending time helping people who are perverse.)
2017-01-03 21:15:08 -08:00
Eric House
9349e06747 perms: new utility to manage request flow
Add new static method that takes a request, rationale and Action, offers
the rationale if required and then, if user hasn't cancelled, asks for
permission. Eventually the Action is issued with either POSITIVE or
NEGATIVE. Use this to ask for STORAGE when downloading upgrades and
moving wordlists to the downloads area.
2017-01-03 07:25:12 -08:00
Eric House
4f2c67c331 up copyright for new year!!! 2017-01-03 07:11:06 -08:00
Eric House
59c80f8277 add special title to permissions rationale alerts 2016-12-31 16:27:17 -08:00
Eric House
8c7e1646fa get permission before downloading
Trying to download an update, and likely a wordlist, fails if STORAGE
permission isn't acquired first.
2016-12-31 15:56:24 -08:00
Eric House
503ea46ca5 fix crash rematching SMS without PHONE permission
You need PHONE permission to start and play an SMS game but not to have
started it in response to an invitation. But to rematch you need it. So
ask, including offering a rationale that differs depending on whether
there's a way for the game to communicate once SMS is removed.
2016-12-31 15:05:39 -08:00
Eric House
a24b3396b3 save rematch info across orientation changes
(and the os restarting us because a permission was changed while we're in
background.)
2016-12-31 14:31:20 -08:00
Eric House
6a363dbbd7 up revision number; new release required 2016-12-31 14:21:32 -08:00
Eric House
4990d31eda fix assertion on emulator 2016-12-31 14:21:00 -08:00
Eric House
f88ac1a9d0 another changelog tweak 2016-12-30 20:38:24 -08:00
Eric House
5260c3de90 catch -dbg build up with SDK 23 2016-12-30 20:12:23 -08:00
Eric House
250f4b0139 get rid of raw-string toast error messages
They were hacks for debugging SMS early on, probably infrequently
seen. Instead post messages. BUT: they aren't being received because of
how listeners get cleared in onPause(). Needs to be fixed, but there's
no harm in having them dangle for now.
2016-12-30 20:11:02 -08:00
Eric House
62aabc8cbc replace %{d,s} in german strings 2016-12-30 19:44:41 -08:00
Eric House
04a39f9251 force re-layout of board when toolbar populated
Sometimes when a new game is created the board winds up with the toolbar
drawn over the tray. That's because when it was laid out the game wasn't
running yet and so none of the toolbar buttons was enabled, giving the
toolbar a height of 0. So now the first time the updated toolbar reports
that at least one button is enabled we force the board to lay itself out
again.
2016-12-30 13:53:18 -08:00
Eric House
f488e727f8 fix invitations!
Little hack to dismiss a game when the invitations dialog was cancelled
broke invitations altogether. Revert that change, and simply check on
getting focus whether all players are present; if they're not, put up
the "invite or wait" dialog. This is a big change, but in 10 minutes of
testing I can't get the wrong thing to happen.
2016-12-30 13:09:51 -08:00
Eric House
ee042ff3cd better test for GSM phone
This one doesn't think a wifi-only tablet can send SMS messages.
2016-12-30 11:40:15 -08:00
Eric House
e5166a62e8 tweak string 2016-12-30 11:02:04 -08:00
Eric House
39828bfaf8 fix problems with localized files
Remove strings that no longer exist in English, add missing "other"
quantities in Japanese (taking a guess from context that it's ok to use
generic counters), and in a couple of languages fix typos in format
specifiers that would have caused crashes.
2016-12-30 11:01:51 -08:00
Eric House
fea31e9e3b fix script checking localized strings
It wasn't even checking all languages. Now it does, lets you specify
which ones if a subset's desired, and differentiates between sets of
format specifiers mismatching in a way that'll cause a
crash (e.g. expecting int in one and string in another) and just having
some missing.
2016-12-30 09:57:33 -08:00
Eric House
83fbbdc3ee fix compile-time warning
Flag has a different name in clang. Debug-only, so no risk.
2016-12-30 06:49:52 -08:00
Eric House
096fff1f4c Merge branch 'android_translate' into android_release 2016-12-30 06:49:06 -08:00