Commit graph

77 commits

Author SHA1 Message Date
chrisgarrity
bfeec221dc
Merge pull request #527 from yueyuzhao/issue/413-export-all-assets
export all assets when sharing
2021-11-15 16:38:30 -05:00
chrisgarrity
63707a5b77
Revert "Remove unnecessary request for External Storage" 2021-11-08 08:45:28 -05:00
Yueyu
d656f28ca8 add support to handle mp3 sound 2021-10-11 08:15:50 +08:00
Yueyu
d32d2214e7 duplicate library and sample assets 2021-10-11 08:14:34 +08:00
Yueyu
c74319cfe0 register assetLibraryVersion to native 2021-10-09 19:25:14 +08:00
Yueyu
032e7b1d91 Import: don't add library assets to database 2021-10-09 07:22:10 +08:00
Yueyu
4fdfc480fe export: add library assets to zip 2021-10-09 06:55:21 +08:00
Chris Garrity
ad58d579d7 Permit Firebase analytics to be disabled
Set up configuration parameters so that analytics can be completely disabled based on the flavor being built
2021-09-20 21:31:09 +01:00
Yueyu
06bb136699 Android: Fix #494 2021-08-23 18:49:21 +08:00
Chris Garrity
e734ff3cb6 Remove unnecessary request for External Storage
Since we use app internal storage and then a contentProvider, I don't think we need permission for external storage. It's up to the external content provider (e.g. files, drive etc) to have access to the appropriate storage.
2021-08-09 17:55:23 -04:00
chrisgarrity
96ce9b0641
Merge pull request #451 from yueyuzhao/issue/27-camera2
Issue/27 camera2
2021-08-02 10:33:44 -04:00
Yueyu
d8760f6018 rename CameraxView to CameraView & add more comments 2021-08-02 08:18:36 +08:00
Chris Garrity
566f2f9389 Chromebook optimizations
* allow non-touchscreen devices
* force full screen (do not allow resizable windows)
2021-07-19 17:46:22 -04:00
Chris Garrity
0db94d5685 Ignore cal variant
At some point I will clean up the git ignores - they are in almost every directory and that’s ridiculous. But for now make sure to ignore the cal variant if it shows up in the open source directory structure.
2021-06-21 12:52:31 -04:00
Yueyu
8d17a76599 remove old file 2021-06-18 13:21:01 +08:00
Yueyu
29d6a92ee8 Android: upgrade to camera2 2021-06-18 07:28:39 +08:00
Yueyu
7908c8d75f update setAnalyticsPref signature 2021-05-31 06:34:35 +08:00
Yueyu
86665ae8a4 1. iOS: refactor to import in IO.m and comments to Database.m
2. Android: clean up
3. JavaScript: lint code style
2021-04-30 21:20:51 +08:00
Yueyu
0a1907564a clean up 2021-04-28 06:02:36 +08:00
Yueyu
b52045f221 Android: fix newIntent content import 2021-04-09 21:39:38 +08:00
Yueyu
c186305777 Android: fix project name 2021-04-09 13:37:43 +08:00
Yueyu
d77fc04f2d Android: import project in native 2021-04-09 13:17:05 +08:00
Yueyu
0d6918d508 clean up zips before creating a new one 2021-03-22 13:05:58 +08:00
Yueyu
07ce9bf7c8 switch zip to native 2020-11-13 08:11:38 +08:00
Chris Garrity
647fb2cb0c Update versions to match official 2020-09-30 13:09:37 -04:00
Chris Garrity
4826fc0b1e refactor permission request 2020-09-30 09:57:26 -04:00
Ben Wheeler
685389bfbd only call setAnalyticsPref with a valid key, value pair 2020-08-14 13:50:36 -04:00
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
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
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
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
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
Chris Garrity
0a580324bf FIx. debugging 2020-01-16 08:49:59 -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
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
c8f655447a Address comments 2019-10-25 12:27:32 -04:00
Chris Garrity
b965440709 Switch to firebase analytics
* Remove ScratchJrApplication class - it was only being used to initialize the old Google Analytics.
* Change AppUsage (home, school, other, noanswer) from being a prefix on `label` to being a Firebase user property.
* Set the user property when loading the index page - it shouldn’t change for the rest of the session.
2019-10-21 10:48:03 -04:00
Chris Garrity
1be3feb791 ensure ‘switchToFree’ gets run before generating PNGs
The assemble.depends on doens’t seem to ensure that the correct sources are copied to the HTML5 directory
2019-10-18 10:55:27 -04:00
Chris Garrity
63112f4ca8 Add files to gitignore 2019-09-25 13:36:21 +01:00
DD Liu
57bcffea6c Update to gradle 5 and update support dependencies 2019-09-09 16:15:24 -04:00
chrisgarrity
49d8b5a3df Move the parental gate before the share buttons
Change the share flow to have a ‘For Parents’ button that brings up the Parental Gate. Share buttons only become visible after a successful challenge.
2019-04-06 16:44:37 -04:00
Andrey Beskrovnykh
bbba46c143 Add forgotten input stream initialization 2018-11-23 19:21:01 +07:00
Andrey Beskrovnykh
1a2433885d Fix possible backward compatibility issue 2018-11-23 10:50:56 +07:00