Commit graph

462 commits

Author SHA1 Message Date
Ben Wheeler
dcd4222b4c Move json stringify and parsing into interface 2020-08-14 12:14:20 -04:00
Ben Wheeler
c301a1090e add generic setAnalyticsPref functions for iOS and Android 2020-08-13 18:24:25 -04:00
chrisgarrity
d6e1a77327
Merge pull request #284 from LLK/issue/274-refactor-os-interface
Split iOS and Android interfaces
2020-08-10 16:08:12 -04:00
Chris Garrity
dd1f48f5e3 Remove dead code for real
removing dead code that was just commented in the previous commit,
2020-08-10 16:07:14 -04:00
Chris Garrity
09c52f370f Android studio changes
Android Studio added some more config files.
2020-08-10 09:22:33 -04:00
Chris Garrity
1420a5947a Split iOS and Android interfaces
Refactor the native interface in preparation for switching iOS to use WKWebview.
* Finally rename the folder for device specific interfaces as `tablet` instead of `iPad`
* Update `import` statements to use the new name
* Create new `iOS.js` and `Android.js` based on previous `iPad/iOS.js` to separate the interfaces
* Add new `OS.js` class to manage the class variables, initialize the device interface delegate methods to the correct interface.
* refactor how  `utils/lib` detects the current platform based on `navigtor.userAgent` based on https://stackoverflow.com/questions/37591279/detect-if-user-is-using-webview-for-android-ios-or-a-regular-browser. previous method relied on the Android interface being loaded or not. It can be difficult to detect the difference between in a browser and in a webview, but for now ScratchJr doesn’t need to worry about running in a browser
2020-08-10 09:11:47 -04:00
chrisgarrity
fc8fdcecf6
Merge pull request #279 from LLK/newblock-analytics
update new_block event
2020-07-09 13:42:43 -04:00
Chris Garrity
0a91deec86 update new_block event 2020-07-07 09:09:14 -04:00
Benjamin Wheeler
dc8990f9ab
Merge pull request #260 from benjiwheeler/analytics
Add more analytics events, and use action as event type
2020-06-24 14:17:45 -04:00
Chris Garrity
6e25da189d Add default templates to repo 2020-06-17 16:30:24 -04:00
chrisgarrity
272780768b
Update CONTRIBUTING.md 2020-06-16 15:33:17 -04:00
chrisgarrity
ffd1172d67
Merge pull request #270 from LLK/fix-ios-import
Fix ios import
2020-05-01 07:42:29 -04:00
Chris Garrity
be9efb1e83 Fix mismatched file types 2020-05-01 07:41:09 -04:00
chrisgarrity
31e9cb5bc2
Merge pull request #264 from chrisgarrity/fix-manifest
Avoid concatenation in AndroidManifest
2020-04-21 09:57:01 -04:00
Chris Garrity
ec9387115f Avoid concatenation in AndroidManifest
Trying to use the extension pattern this way gets an error when uploading the APK to Google Play, so just hard code the extension patters. This won’t work for PBS kids version.
2020-04-21 09:52:42 -04:00
chrisgarrity
fe2ad22efb
Merge pull request #259 from chrisgarrity/content-import-fix
Don’t export as email message, and be less strict about import requirements
2020-04-21 07:53:32 -04:00
Ben Wheeler
abd8a1bb86 added project_editor_open and _close analytics events 2020-04-20 15:18:14 -04:00
Ben Wheeler
2762cdf271 refactor toggleGrid to be clearer, only send analytics in response to user action 2020-04-20 13:40:45 -04:00
Ben Wheeler
caa7aed291 log more events to analytics 2020-04-13 22:18:59 -04:00
Ben Wheeler
9e30b90a17 ios and android log event action as event type 2020-04-13 22:11:09 -04:00
Chris Garrity
1e3d468c33 Don’t export as email message, and be less strict about import requirements
Don’t export as email message. and be less strict about import requirements.

Android intent filters are really only designed to work with standard mimetypes (like ‘image/png’). Even if you can share something with a custom mime type, it’s likely to get lost somewhere along the way, from email, or Gdrive, or Files app etc.

Path matching patterns in intent filter only apply to `file` schemes, `content` scheme is likely to be some generated id in temp storage. `content` filters maintly go by mimetype, but as noted above, a custom mimetype has often gone AWOL. Generic application files are usually downloaded as `application/octet-stream`. Basically we have to trust the user not to try to load some other random file into ScratchJr. The import function will fail and give an error message if they do.

Finally, fix the way we’re sharing ScratchJr files. While the button says ‘Share by Email’ for a long time Android has shown a selection of ways to share the file. However, we were setting the mime type as an email message so the saved file would always try to open in an email client instead of ScratchJr.
2020-04-13 17:07:38 -04:00
chrisgarrity
098b2dc68a
Merge pull request #255 from LLK/require-touchscreen
Require touchscreen in the Android manifest
2020-04-07 15:09:06 -04:00
Chris Garrity
16ee3f9213 Require touchscreen in the Android manifest
Fixes #233
2020-04-07 15:06:08 -04:00
chrisgarrity
bca5f433ae
Merge pull request #206 from beskrovnykh/develop
Fix can't import .sjr
2020-04-07 15:00:10 -04:00
Chris Garrity
9a12f98cf9 Add checks for filetype, skip unnecessary FileIO
This PR was 95% of the way there, and I didn’t want to ask for changes after not getting to review it for so long, so I just made the changes.

Thanks for submitting!
2020-04-07 14:56:26 -04:00
chrisgarrity
3c80bb2f81
Merge pull request #247 from yueyuzhao/dev-fix-ios-whole-window-scroll
iOS: disable UIWebView scroll to fix #243
2020-04-02 09:58:30 -04:00
chrisgarrity
a50e7943fa
Merge pull request #249 from LLK/document-analytics
Improve setup documentation and ergonomics
2020-04-01 09:16:31 -04:00
Donald
d56ff035b0 fix library not scrolling 2020-03-31 07:40:26 +08:00
Chris Garrity
20e0303b68 Address comments
Use correct (and consisten) capitalization for ‘Xcode’.

Clarify that Firebase generates config files.
2020-03-30 11:27:15 -04:00
Chris Garrity
7f1f966984 Improve Analytics setup documentation
Added instructions to the README for how to get the google services configuration files for analytics. Removed (and ignored in future) the empty config files. Note: empty folders are ignored in git, so added an empty file `.exist` to the android folder so that it will be there as a place to hold the actual google services file.

Finally added the xCode scheme for the app that you need for newer versions of xCode.
2020-03-24 17:39:06 -04:00
Donald
9bb886e9a8 iOS: disable UIWebView scroll to fix #243 2020-03-24 21:00:09 +08:00
chrisgarrity
09fbe4cfed
Merge pull request #242 from LLK/fix-window-scroll-217
Change touchmove handling in editor to prevent scrolling whole window on iOS
2020-03-23 15:28:34 -04:00
Benjamin Wheeler
3b8301e16b
Merge pull request #244 from benjiwheeler/readme-steps-ios-android
In README, reorganized android and ios setup steps
2020-03-23 12:24:24 -04:00
Ben Wheeler
67043fdb54 reorganized android and ios setup steps 2020-03-23 12:14:24 -04:00
Chris Garrity
b4fdd3c775 Change touchmove handling in editor to prevent scrolling whole window on iOS
Fixes #217

Testing:
- verify still works on Android
- check anywhere that could scroll:
  - character or backdrop library
  - projects in lobby
  - help documentation
  - blocks pallette
  -
2020-03-10 11:57:17 -04:00
chrisgarrity
c1a025dd97
Merge pull request #236 from LLK/fix-debugging
Fix debugging
2020-01-16 08:55:51 -05:00
Chris Garrity
0a580324bf FIx. debugging 2020-01-16 08:49:59 -05:00
chrisgarrity
ceb4f2ad7f
Merge pull request #234 from LLK/fix-scale
Fix Android scaling
2020-01-15 16:20:41 -05:00
Chris Garrity
f6dbdd4fe7 Fix Android scaling
On some newer android devices the screen tranform matrix already includes the current scale. i.e. the matrix looks like:
```
{
    a: scaleX,
    b: 0,
    c: 0,
    d: scaleY,
    e: offsetX,
    f: offsetY
}
```
where both `scaleX`, and `scaleY` are the current zoom. On other devices the scale is always `1`, and we need to apply our own scaling.

I also added the code to automatically allow webview debgging if the buildType is debuggable.  Also, note that you can switch which line is commented out in bundle-compile.sh to get unobfuscated javascript.
2020-01-15 08:42:11 -05:00
chrisgarrity
4347cac225
Merge pull request #229 from LLK/translations
Update translations
2019-10-31 14:48:52 -04:00
Chris Garrity
e95a3b27e8 Update translations 2019-10-31 14:47:53 -04:00
chrisgarrity
e925c1beab
Merge pull request #227 from LLK/revert-ios-scroll
revert ios scroll fix
2019-10-31 13:14:57 -04:00
Chris Garrity
8914c15493 revert ios scroll fix
The ‘fix’ for the ios scrolling bug prevented scrolling of the library. Things need to be refactored.
2019-10-31 13:04:37 -04:00
chrisgarrity
64c5575bda
Merge pull request #224 from LLK/revert-android-paint
Revert paint change for android
2019-10-31 08:08:24 -04:00
Chris Garrity
abc78daca6 Revert paint change for android
This didn’t fix the paint issue, just changed which kind of devices see the problem. Reverted the change to work for cheaper, regular density tablets.
2019-10-31 07:48:58 -04:00
chrisgarrity
a5686e9111
Merge pull request #221 from LLK/ios-scroll-bug
Fixes the iOS scrolling problem
2019-10-25 16:24:59 -04:00
Chris Garrity
d71df52d6b Don’t allow overscroll
The iOS change seems to have a side effect on Android of adding  an“Edge Effect” to the web view whenever dragging a block. (Edge effects are the grey curved shadow that appears at the top or bottom of a container when you overscroll. When you drag a block they appear at the top or bottom of the screen)

Adding the `android:overScrollMode=“never”` attribute to the webview means the edge effect doesn’t appear.
2019-10-25 16:19:41 -04:00
Chris Garrity
d97d075959 Check in empty Firebase configuration 2019-10-25 15:30:38 -04:00
Chris Garrity
5a5e5bdf12 remove duplicate ontouchmove 2019-10-25 13:49:31 -04:00
Chris Garrity
c4ea194df7 Fix scrolling while dragging
This is the fix from Paula for #217

based on the firebase-analytics branch, so only merge after that PR (or cherry pick this commit)
2019-10-25 12:46:11 -04:00