Commit graph

12159 commits

Author SHA1 Message Date
Eric House
db13370cb8 tweak status string (and name for clarity) 2020-11-02 18:01:23 -08:00
Eric House
a44c08e4cc merge android_translate in 2020-11-02 17:10:51 -08:00
Eric House
4dab5bc3bb make game-event notifications noisy by default
Set importance to HIGH, which is apparently required for sound.
2020-11-02 16:45:56 -08:00
Eric House
c9ce2dda21 show known player's bt mac addr for non-release 2020-11-02 16:15:42 -08:00
Eric House
a0e31d8db8 make qr code bigger 2020-11-02 16:01:10 -08:00
Eric House
26f6bb8b43 cleanup/refactor 2020-11-01 19:33:41 -08:00
Eric House
157332d2cc add pref to disable use of bluetooth
It's buggy enough on some devices that a user might need to disable it.
2020-11-01 19:33:41 -08:00
Eric House
04000ddf7e improve corrupt-game experience
add padding to alert, remove cancel button, clean up warning text, and
confirm delete.
2020-10-29 11:30:12 -07:00
Eric House
b165072bed always drop quarantine count to 0 on close
There are ways I can't record a close, e.g. user swiping app to kill
it. To avoid that leading to a corrupt-game warning, or to failure to
open in background, drop the count to 0 rather then merely decrementing
it when it closes correctly. Assumption is that if it closes ok once
it's ok.
2020-10-29 11:30:12 -07:00
Eric House
0250996009 cleanup 2020-10-29 11:30:12 -07:00
Eric House
a5b98c483c fix removal of unpaired device
Two uses of remove() were passing different info. So pass the other one
from the other use.
2020-10-29 08:40:46 -07:00
Eric House
1019271c94 handle mqtt invites same as others
Invitations over MQTT were handled by different code that always opened
the new game on top of any other open one. Use instead existing code
that puts up a notification instead where appropriate.
2020-10-28 17:11:05 -07:00
Eric House
3fbb2bbd7c fix merge of Brazilian files 2020-10-28 13:56:42 -07:00
Eric House
3e411873c0 Merge branch 'android_translate' into android_branch 2020-10-28 13:40:57 -07:00
Eric House
0cee3c8d60 add systemd service file for relay 2020-10-28 13:32:49 -07:00
Eric House
db366bb515 cleanup 2020-10-28 13:32:49 -07:00
Eric House
a8a8f801f7 tweak string 2020-10-28 13:32:49 -07:00
Eric House
81799d3903 add addrType to comms' main addr when added to channel
I'm fixing android client not showing stats for or allowing to disable
mqtt after it's added automatically to a game that connects
otherwise. Problem was that only the channel got the mqtt address
flag. So now add the flag for any type that's added.
2020-10-28 13:32:49 -07:00
Eric House
88dbc40180 test script: strip extension when making logs dir 2020-10-28 13:32:49 -07:00
Eric House
fa3a33f133 offer to hide new-game buttons immediately
Don't wait for user to tap one of the buttons. Instead notice when
scrolling becomes possible, and offer once per launch until user says
"hide" or clicks the don't-ask-again box.
2020-10-28 13:32:49 -07:00
Eric House
b6955696eb again 2020-10-28 13:32:49 -07:00
Eric House
d65fb80dff don't commit me 2020-10-28 13:32:49 -07:00
Eric House
a5f8b87478 remove dead code 2020-10-28 13:32:49 -07:00
Eric House
d95d1a9f70 changes, part 1 2020-10-28 12:57:12 -07:00
Eric House
0888167db5 remove unused format spec (SMS number no longer known) 2020-10-28 12:03:07 -07:00
Vanessa Regina Andrade dos Santos
1d41eea48d
Translated using Weblate (Portuguese (Brazil))
Currently translated at 26.8% (230 of 858 strings)
2020-10-27 20:26:43 +01:00
Eric House
3d1cefe00b cleanup (no code change) 2020-10-26 14:13:50 -07:00
Eric House
ba99eb0838 avoid crash (maybe on corrupt data?) 2020-10-26 13:04:28 -07:00
Eric House
f1eea13c5e remember last invitee and make default next time 2020-10-26 11:03:22 -07:00
Eric House
712661a6e9 show quarantine count (non-release only)
Looks like I'm occasionally leaking so that the count grows. This will
let me see when something is 1 when it should be 0.
2020-10-26 11:03:22 -07:00
Eric House
9deac8afbb show Known Player name in button
Got tired of it not being clear what the button was going to do
2020-10-25 15:29:49 -07:00
Eric House
f997c88ba4 cleanup bt code 2020-10-25 15:29:46 -07:00
Eric House
5a8ea0b998 change name of string 2020-10-25 11:58:23 -07:00
Eric House
6c9be4a67d remove dead script
replaced by changed to relay2 flask app
2020-10-24 22:27:47 -07:00
Eric House
04eeb8f18f don't crash when number of INVITEMEANS changes
This won't impact shipping code, but if during development I add then
remove a new INVITEMEANS I can crash with AIOOB trying to load by
ordinal. So check first.
2020-10-24 13:13:47 -07:00
Eric House
a61db95266 shrink the QR code
It doesn't need its own alert if it's smaller, and at least a Nexus5's
phone can pick it up this size.
2020-10-24 10:08:11 -07:00
Vanessa Regina Andrade dos Santos
8971cdeebc
Translated using Weblate (Portuguese (Brazil))
Currently translated at 26.8% (230 of 858 strings)
2020-10-24 17:26:42 +02:00
Eric House
5d4fd0e58b don't dispose gi before game
gathering players was failing because disposed gi was pointing at
garbage. I'm lucky it didn't segfault.
2020-10-23 19:03:26 -07:00
Eric House
e7a63c7c0b change mqtt register URL 2020-10-22 22:33:25 -07:00
Eric House
af37fb45f7 Rewrite BT comms to not use a Service
It's simpler this way, and I'm tired of stuff not happening because the
OS chooses not to schedule e.g. an invitation send for minutes. Goal's
to be running BluetoothServerSocket.accept() as much as possible when
there are active BT games in play OR when the game's in the foreground.
If that's happening, sent invitations and moves will be received when
users expect. When there's no traffic and app isn't being brought to
foreground, backoff will ensure I don't try to run accept() too often.

FWIW, BTLE seems to offer a better way to do this (to have an app be
responsive to incoming invitations when it hasn't run in the foreground
in a while), but it requires users to accept FINE_LOCATION
permission. I'm hoping I can make this work to avoid asking for that
permission.
2020-10-21 21:10:09 -07:00
Vanessa Regina Andrade dos Santos
30b42fcedf
Translated using Weblate (Portuguese (Brazil))
Currently translated at 23.7% (204 of 858 strings)
2020-10-22 04:26:41 +02:00
Vanessa Regina Andrade dos Santos
21f22bbb3d
Translated using Weblate (Portuguese (Brazil))
Currently translated at 22.4% (193 of 858 strings)
2020-10-16 05:26:40 +02:00
Vanessa Regina Andrade dos Santos
c01bd4e8d0
Translated using Weblate (Portuguese (Brazil))
Currently translated at 18.9% (163 of 858 strings)
2020-10-14 22:26:39 +02:00
Vanessa Regina Andrade dos Santos
2f6019f4c2
Translated using Weblate (Portuguese (Brazil))
Currently translated at 18.4% (158 of 858 strings)
2020-10-13 01:26:38 +02:00
Vanessa Regina Andrade dos Santos
c7282603f5
Translated using Weblate (Portuguese (Brazil))
Currently translated at 17.8% (153 of 858 strings)
2020-10-10 04:26:41 +02:00
Eric House
8240f753ca bluetooth tweaks
Add a single method to provide candidate devices; don't bother passing
bogus BT MAC addrs; let instance belonging to background-user start
communicating again when user becomes foreground.
2020-10-07 19:39:51 -07:00
Eric House
284e7eb85a fix broken device deletion; refresh time-last-seen
I was comparing the wrong strings and so broke deleting known BT
devices. And wanted to see how often since I'd seen them updated, though
every 10 seconds is still 10 seconds.
2020-10-07 19:06:33 -07:00
Vanessa Regina Andrade dos Santos
07ad779306
Added translation using Weblate (Portuguese (Brazil)) 2020-10-08 03:26:35 +02:00
Eric House
af7f776118 don't post RemoteDeleted Alert more than once 2020-10-07 17:06:18 -07:00
Eric House
a95e761024 fix NPE
I hope. Happens when there's a duplicate delete-deleted-game alert, and
trying to close the view a second time may also be a problem.
2020-10-07 11:29:04 -07:00
Eric House
fef7d2d544 Prune unpaired devs; accept uncatagorized devs
Some devices unpair themselves and needed to stop being listed so user'd
know to fix. And my Nexus 5x is neither a PHONE nor a COMPUTER per BT,
so accept a larger range of BT classes when scanning.
2020-10-06 11:43:21 -07:00
Eric House
a9409f8cca beginnings of script to filter logcat 2020-10-06 10:06:13 -07:00
Eric House
94a709423a improve UI around invites and offering QR code 2020-10-05 18:22:28 -07:00
Eric House
8957b3ff53 remove unused constant 2020-10-05 08:34:28 -07:00
ssantos
c316be6adb
Translated using Weblate (Portuguese)
Currently translated at 40.6% (349 of 858 strings)
2020-10-05 14:12:21 +02:00
Eric House
4f17c64301 close InviteChoicesAlert when game connects
That'll happen if QR code is used in its current location.
2020-10-04 21:47:12 -07:00
Eric House
359e1d12d1 add qrcode for invite to invite-how alert
Need to find the right place for it, explain it, and get rid of the
alert it's part of when the invite is accepted.
2020-10-04 21:47:09 -07:00
ssantos
bb6afba214
Translated using Weblate (Portuguese)
Currently translated at 40.6% (349 of 858 strings)
2020-10-02 23:40:58 +02:00
Eric House
6ae1ec9f81 use a grid for kp dialog layout 2020-10-01 14:44:18 -07:00
Eric House
9f1f1aeee7 only harvest when closing game 2020-10-01 13:39:02 -07:00
Eric House
377bb36c73 cleanup 2020-10-01 13:38:07 -07:00
Eric House
bae7f8a641 add delete button 2020-10-01 11:51:50 -07:00
Eric House
6c5d1b082f start on a gtk dialog displaying/editing knowns 2020-09-30 20:38:44 -07:00
Eric House
21483cf861 add missing file 2020-09-30 20:38:44 -07:00
Eric House
f90d76329b use semaphore to protect known players data
Requires adding a common method called by platform code on creating a
new dutil ctxt.
2020-09-30 17:21:18 -07:00
Eric House
479ec4ef44 tweak 2020-09-30 16:38:34 -07:00
Eric House
27b14ac201 tweaks to server-side script 2020-09-30 15:49:07 -07:00
Eric House
797ba0ba8c make the checked icon solid, and white in middle
Looks like crap when translucent and you see through it
2020-09-30 15:30:09 -07:00
Eric House
fb2a2aa6bb add missing string to fix build 2020-09-30 10:51:26 -07:00
Eric House
31fed09e12 make checkmark translucent rather than replace type
Got tired of losing information about what type of game it was once
selected. Now the sel checkmark is translucent and on top.
2020-09-30 10:33:15 -07:00
Eric House
dbde9c87ae list known player in invite info where known
(for mqtt only)
2020-09-30 10:10:43 -07:00
Eric House
2bfeedceb3 change strings for release 2020-09-30 07:24:22 -07:00
Eric House
3af6d0671c make long-tap on wordlist entry copy it to clipboard 2020-09-29 17:03:44 -07:00
Eric House
2b56b1f8b2 cleanup 2020-09-29 16:06:59 -07:00
Eric House
2a973b6968 make radio buttons in invite alert bigger
Trying to get closer to the size they were in AlertDialog
2020-09-29 15:42:32 -07:00
Eric House
f98759881c use separate new-game scheme for debug app 2020-09-29 14:47:53 -07:00
Eric House
24df7bb694 update bad-url script to offer to launch CrossWords
Working around a bug in Android 11 that broke invitation http urls
getting passed to CrossWords. They always launch the backstop script on
eehouse.org. So modify that script to include a link that will pass the
invitation params to CrossWords via a proprietary scheme it already
registers for. No change to app required!
2020-09-29 13:28:54 -07:00
Eric House
65102c2114 fix test that allowed deleting new-games group 2020-09-29 08:16:46 -07:00
Eric House
148286313f don't try to sort a null array! 2020-09-29 07:54:39 -07:00
ssantos
8d518bba1c
Translated using Weblate (Portuguese)
Currently translated at 40.6% (349 of 858 strings)
2020-09-29 16:40:57 +02:00
Eric House
eb728e4368 fix crash: don't go beyond last edge
An obscure pattern from a user caught this one, but the test should have
been there all along.
2020-09-28 19:18:09 -07:00
Eric House
e9ec30206d add debug-only field tracking place in iterator 2020-09-28 19:18:04 -07:00
Eric House
0f7d924a8e accept dicts with full paths (linux) 2020-09-28 16:12:24 -07:00
Eric House
2f849efe2a make tap on whole line toggle expander 2020-09-28 13:05:24 -07:00
Eric House
574e50f235 keep players in sorted order
Sorting in common/ is hard because there's not locale-aware sort
available. Java should do the right thing so do it there.
2020-09-28 12:23:48 -07:00
Eric House
0c7e9836e2 cleanup 2020-09-28 11:48:26 -07:00
Eric House
7b097ea67d Don't allow duplicates when renaming 2020-09-28 11:17:51 -07:00
Eric House
ba9164641a Toward more generic naming/use of Renamer
Not quite done
2020-09-28 09:32:46 -07:00
Eric House
8406d9e551 implement Known Player renaming
Used existing GameNamer which now needs to be made more general.
2020-09-28 08:59:39 -07:00
Eric House
3d078d0894 don't show KP menuitem when there are none 2020-09-28 08:16:48 -07:00
Eric House
aff75053ac implement deleting known players 2020-09-27 20:52:56 -07:00
Eric House
9e78e47954 fix so non-drag movement stops timer to show words
The last change meant the test whether to show the words under the
pen-down cell would pass when it shouldn't because a drag to an occupied
location didn't register as movement. Change so movement counts to stop
the timer even if it wouldn't change the drag-target's location.
2020-09-27 17:32:23 -07:00
Eric House
80160d740f null-terminate words buffer 2020-09-27 14:23:39 -07:00
Eric House
7fe249ad8d Don't allow drag of tile to place it can't be
Rather than have a tile revert to its original location if it's dropped
where it can't be (on an occupied tile or outside the board), put it in
the last place it could have been. Do that by only updating cur when
it's to a legal location, and then relocating to cur when drag ends.
2020-09-27 13:44:21 -07:00
Eric House
fda432468a UI tweak 2020-09-26 21:26:01 -07:00
Eric House
dd177b96c5 tweaks and cleanup 2020-09-26 21:17:55 -07:00
Eric House
810030125b when inviting show means, not knowns, by default
If you've bypassed the quick-start game it's probably because you want
to play somebody not yet in the Known Players list. So don't start out
with that list as how you'll invite.
2020-09-26 20:40:19 -07:00
Eric House
af3eee42df start with expanders minimized 2020-09-26 20:35:02 -07:00
Eric House
9bc73b8bfc add known players browser
There's lots to do, but it shows what's know about each one and has
unimplemented UI for changing names and deleting.
2020-09-26 19:22:03 -07:00
Eric House
9b12f60dbf Don't use EditWClear; fix spinner size 2020-09-26 11:00:11 -07:00
Eric House
b0c1c5ac1b don't deref ptr after free(); cleanup 2020-09-26 11:00:11 -07:00
Eric House
fad252d8c0 use created stamp to decide between conflicting addresses
Not at all tested, but now the game's timestamp is kept and passed in to
where it can be used to determine, e.g., which of two Bluetooth device
names to keep for a given opponent.
2020-09-26 09:48:35 -07:00
Eric House
c4b55385a3 add creation timestamp to game struct
Address resolution will want to know which address is older. Game
creation is a good enough proxy for that, so add it in a cross-platform
way.
2020-09-26 09:48:35 -07:00
Eric House
d17ac7ea0b rename gamesdb public functions (linux only) 2020-09-26 09:48:35 -07:00
Eric House
f0f2a598e0 make up new name rather than drop new player 2020-09-26 09:48:35 -07:00
Eric House
a054762323 use EditWClear for new quick-game-with-know alert 2020-09-26 09:48:35 -07:00
Eric House
c17dc91672 add not-again explanation of quick-connect alert 2020-09-26 09:48:35 -07:00
Eric House
982f238b9d disable the robot button in invites for now 2020-09-26 09:48:35 -07:00
Eric House
49909c84d6 make known-player stuff conditional
and ifdefs to C and BuildConfig flag to java so the feature can be
hidden in release builds until it's ready.
2020-09-26 09:48:35 -07:00
Eric House
b3fa1edda5 missing file 2020-09-26 09:48:35 -07:00
Eric House
8fa92ad00e provide choice to invite known players
Add second type of option to the current list of "InviteMeans", so you
can configure a game then skip sending email if the player's address is
known.
2020-09-26 09:48:35 -07:00
Eric House
fc05612b74 rough implementation of creating and inviting a known player
Followed the way rematch works. Which is gross. Eventually the two
paths (invitee and rematch) should be unified with rematch getting a lot
simpler.)
2020-09-26 09:48:35 -07:00
Eric House
b8c588e02c add new jni methods (untested) 2020-09-26 09:48:35 -07:00
Eric House
11266ece5b gtk known-player invitation works 2020-09-26 09:48:35 -07:00
Eric House
736c9f3503 harvest players on open; save and make available
Got as far as having gtk client display list of previously harvested
known players to be invited. Their addresses, or at least mqtt ids are
saved. Next is to actually invite one.
2020-09-26 09:48:35 -07:00
Eric House
187323192f Test for game type before calling resend_all
I have a case where app crashed on launch due to the assert that resend_all()
wasn't being called on a standalone game. That happened because somehow
the game's android-side db entry showed pending packets to send, though the
game type was correct. Fix is to check for game type also, but also to add
a test so comms won't get invoked with a null ptr on release builds.
2020-09-26 09:43:48 -07:00
Eric House
d8d894da46 put groupless games into "recovered" group
At least one device was mysteriously losing games. They were winding up
with a group ID for a non-existant group. Now on startup I look for such
games and assign them to a new "recovered games" group. We'll see how
common this is before deciding whether it's a good enough
solution. Another perhaps better solution would be to display all games,
ordered by groups, rather than displaying all known groups and their
games.
2020-09-25 18:02:17 -07:00
Eric House
f4e4dfacb6 up strings for new release 2020-09-23 12:41:40 -07:00
Eric House
471a85e7ef use html entities instead of curly quotes
Fixes problem on older phones
2020-09-23 12:22:24 -07:00
Eric House
24125aad0c disable ill-timed not-again hint
On new installs it happens at the wrong time. So get rid of it for now.
2020-09-23 12:12:27 -07:00
Eric House
43c1e13563 remove dead code 2020-09-23 12:01:17 -07:00
Eric House
00c2052af8 add creation time to set displayable in gamelistitem
I'm storing the create time in the DB on Android so don't need to add it
to CurGameInfo right away.
2020-09-23 11:58:43 -07:00
Eric House
8072a0c629 write 0 where flags will be
unused for now.
2020-09-22 10:56:06 -07:00
Eric House
4183d4362c shrink game-type icons so they look ok as alert title icons
On a small-screen (?) emulator (Nexus 5 1080x1920) the icons in the
new-game alerts are huge. Setting their size to 32x32 instead of 120x120
seems to fix this. Haven't tested on more than two devices, on one of
which they were ok before and still are.
2020-09-22 10:52:19 -07:00
Eric House
774a05f8dc in log script, print sender as well as addressee 2020-09-19 22:52:21 -07:00
Eric House
608b4010a0 move user-vis strings (resIDs) into enum 2020-09-16 22:41:53 -07:00
Eric House
9e2ef3a698 rewrite not-installed php script in py 2020-09-15 12:27:41 -07:00
Eric House
ca64d69cef accept invites with https scheme
Will switch to sending them in a few months
2020-09-15 08:01:05 -07:00
Eric House
584c9e2332 use same ID for all upgrade notifications
Don't want them stacking up
2020-09-14 21:37:15 -07:00
Eric House
38ae14296c Pass message to SMS app same as to email
Doing away with letting user build a local phone list (left over from
the NBS case where it made sense.) Just launch the default SMS app with
the message and let 'em choose a recipient. Hard to test, but works on
two of two phones so far.
2020-09-14 21:21:17 -07:00
Eric House
9be9caae54 don't show the dup-invite alert
It's coming up too often, sometimes several times in a row so that all
must be dismissed. Until I can detect which result from explicit user
action (tapping a URL) rather than duplicated delivery over MQTT and
bluetooth, this is better.
2020-09-14 21:12:35 -07:00
Eric House
755b9e4c1f re-register when variant changes
useful only for testing releases
2020-09-14 12:03:58 -07:00
Eric House
d4ae2e1f06 up version strings and changelog 2020-09-14 09:58:35 -07:00
Eric House
534612be85 catch exception using BT as second user 2020-09-14 09:58:35 -07:00
Eric House
1e9cc5d325 remove redundant key/value pair 2020-09-14 09:10:25 -07:00
Eric House
4b6f4047fb add tmp key to backstop model names
I'm using model names to detect duplicates, but there are enough that
may not suffice. So add a new random per-device ID to be used only until
the dupes are resolved.
2020-09-14 08:36:59 -07:00
Eric House
e4594f36e0 generate new mqtt devid when server reports dupe
Thanks to my use of unseeded() rand() early on to generate mqtt device
IDs, a handful of devices are using the same devIDs. The server notices
this and passes a new response which triggers generating a new id that
should be unique (rand() being seeded earlier now.) Testing says the
games that are left behind with the old devid will limp along thanks to
their relay connection while newer games will be better.
2020-09-13 15:06:08 -07:00
Eric House
4e7055d629 test for null
Was seeing null client in logs. Though NPE was caught and harmless
there's no point in having it thrown.
2020-09-13 15:06:03 -07:00
Eric House
3f6e1a8721 no-code-change cleanup: star next to type not name 2020-09-13 14:34:47 -07:00
Eric House
36cc6cc9d6 fix two bits never being set 2020-09-12 21:23:02 -07:00
Eric House
c6d3759373 test to avoid NPE 2020-09-12 15:53:45 -07:00
Eric House
a5387be742 Change download dir prefs name and add hint
Not sure this even belongs here, but that decision will wait until BYOD
is online and I have to figure out how people will distribute custom
wordlists.
2020-09-11 14:03:17 -07:00
Eric House
aa8364cd3f add full git rev for non-release builds 2020-09-11 14:00:46 -07:00
Dimitry Barré
c949033ad6
Translated using Weblate (English)
Currently translated at 100.0% (858 of 858 strings)
2020-09-11 17:36:08 +02:00
Eric House
74bb463f1f add systemd service file for relay 2020-09-10 15:33:50 -07:00
Eric House
cf3c8fc862 cleanup 2020-09-10 15:33:50 -07:00
Hosted Weblate
1a775043d6 Update translation files
Updated by "Cleanup translation files" hook in Weblate.

Translation: Crosswords/Android
Translate-URL: https://hosted.weblate.org/projects/xwords/android/
2020-09-10 15:33:50 -07:00
Eric House
1d2cdd74fc tweak string 2020-09-10 15:33:06 -07:00
Eric House
e26fd23df1 add addrType to comms' main addr when added to channel
I'm fixing android client not showing stats for or allowing to disable
mqtt after it's added automatically to a game that connects
otherwise. Problem was that only the channel got the mqtt address
flag. So now add the flag for any type that's added.
2020-09-10 15:11:22 -07:00
Eric House
80b7097eee test script: strip extension when making logs dir 2020-09-10 11:13:30 -07:00