Commit graph

9931 commits

Author SHA1 Message Date
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
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
Eric House
f5db80e43f Merge android_translate
merge remote-tracking branch 'weblate/android_translate' into
android_translate
2016-12-30 06:42:14 -08:00
Eric House
7b30a0229a add button to launch BT settings
Let's make it easier to add to the set of available BT devices from the
place where the user sees the need. TODO: update the descriptive text,
but not this release since it'll break existing localizations.
2016-12-30 06:35:45 -08:00
Eric House
74d1967f23 cleanup from code review
Mostly removing TAG where isn't being used in the file, but other tweaks
too, none of which changes executed code.
2016-12-29 21:07:00 -08:00
Eric House
4cdc917cf5 tweak changelog 2016-12-29 17:27:33 -08:00
Eric House
c0784fe8b7 fix crash on Android 2.3
Channel wasn't a thing back then. Catch the ClassNotFound exception and
set the same boolean as when permissions aren't available (in manifest),
which means nothing else tries to run.
2016-12-29 17:17:27 -08:00
Eric House
531f30aae8 cleanup: use import more for new class 2016-12-28 13:52:04 -08:00
Eric House
497567ac2d check items newly imported from contacts
I figure if you just brought it in it's probably to send an invitation
to it, and this is how it worked before the refactoring anyway.
2016-12-27 13:23:39 -08:00
Eric House
0fc528a074 cleanup up logging 2016-12-27 13:22:37 -08:00
Eric House
57c71f4c82 invitations: disable remove when nothing checked
Subclass needs to do this one: overrides tryEnable() to handle its
button-bar buttons.
2016-12-27 11:46:15 -08:00
Eric House
216dc757ad up version strings and changelog for release 2016-12-27 11:17:03 -08:00
Eric House
f989212926 close pending game's board when invite cancelled
Add cancelled notification to invite choices dialog. Look for that in
board delegate and close the game. Makes the inviting experience more
consistent, the goal being that you never look at a game that's missing
players without some intervening dialog preventing you from trying to
play.
2016-12-26 16:06:44 -08:00
Eric House
84e8f0927c invitations cleanup: layout and reinvite
Fix a layout to be centered when one string not displayed. Fix to
pre-check by default the most recent device choice when re-inviting.
2016-12-26 15:21:10 -08:00
Eric House
f9f872695d improve checkbox handling in invite dialogs
Use an array of actual objects rather than indices, and add an equals()
method, so checkbox status can survive changes in the set of available
items and even be reproduced when the objects backing them change (as
happens after a new BT scan finishes.)
2016-12-24 12:51:39 -08:00
Joan Montané
b59d7bc3c9 Translated using Weblate (Catalan)
Currently translated at 70.1% (523 of 746 strings)
2016-12-24 15:44:15 +01:00
Eric House
92029b2443 fix to build with CURSES_ONLY flag 2016-12-22 08:57:54 -08:00
Eric House
e945bde663 Merge branch 'android_branch' into android_translate 2016-12-21 08:29:06 -08:00
Eric House
432b738257 wifi: move setting into build.xml
Control whether wifi direct is enabled from build.xml, a file that's
already different for the two variants. The point here is to do a
release with permissions changes but without having to fix everything
wrong with wifi direct.
2016-12-21 08:25:57 -08:00
Eric House
ecdec9cfd8 build system change for sdk version 23 2016-12-21 07:48:19 -08:00