Skip to content

Commit

Permalink
Merge pull request scratchfoundation#520 from LLK/develop
Browse files Browse the repository at this point in the history
Update master with develop - prep for PBS release
  • Loading branch information
chrisgarrity authored Sep 20, 2021
2 parents 38afcb7 + 1b73e6c commit 46ffaa2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions android/ScratchJr/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ android {

defaultConfig {
applicationId "org.scratchjr.android"
manifestPlaceholders = [disableAnalytics: "false"]
}

buildTypes {
Expand All @@ -24,6 +25,7 @@ android {
targetSdkVersion 29
versionCode 22
versionName "1.2.11"
manifestPlaceholders = [disableAnalytics: "true"]
}
}

Expand Down
3 changes: 3 additions & 0 deletions android/ScratchJr/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
android:theme="@style/AppTheme"
android:hardwareAccelerated="true"
android:resizeableActivity="false">

<meta-data android:name="firebase_analytics_collection_deactivated" android:value="${disableAnalytics}" />

<provider android:name="ShareContentProvider"
android:grantUriPermissions="true"
android:authorities="${applicationId}.ShareContentProvider">
Expand Down
11 changes: 10 additions & 1 deletion src/editor/engine/Sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {newHTML, newDiv, newP, gn,
setCanvasSizeScaledToWindowDocumentHeight,
DEGTOR, getIdFor, setProps, isTablet, isiOS,
isAndroid, fitInRect, scaleMultiplier, setCanvasSize,
globaly, globalx, rgbToHex} from '../../utils/lib';
globaly, globalx, rgbToHex, WINDOW_INNER_HEIGHT} from '../../utils/lib';

export default class Sprite {
constructor (attr, whenDone) {
Expand Down Expand Up @@ -913,6 +913,15 @@ export default class Sprite {
me.unfocusText();
});
} else {
// On iOS if the bottom of the textbox is lower than half of the screen
// the color and font size menu may be covered by the keyboard
// 0.45 is a magic number and we should compare the bottom Y of the textbox VS
// WINDOW_INNER_HEIGHT substract the keyboard height.
if (gn('textbox').offsetTop + gn('textbox').offsetHeight > WINDOW_INNER_HEIGHT * 0.45) {
// scroll up a little more than the textbox height
// to show the color menu and font size menu.
window.scroll(0, gn('textbox').offsetHeight * 1.2);
}
if (isTablet) {
ti.focus();
} else {
Expand Down
4 changes: 3 additions & 1 deletion src/painteditor/Paint.js
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,9 @@ export default class Paint {
cc.onmousedown = Paint.closeCameraMode;
}

static closeCameraMode () {
static closeCameraMode (evt) {
evt.preventDefault();
evt.stopPropagation();
ScratchAudio.sndFX('exittap.wav');
Camera.close();
Paint.selectButton('select');
Expand Down

0 comments on commit 46ffaa2

Please sign in to comment.