diff --git a/android/ScratchJr/app/build.gradle b/android/ScratchJr/app/build.gradle index afb92d73..ad2c8fed 100644 --- a/android/ScratchJr/app/build.gradle +++ b/android/ScratchJr/app/build.gradle @@ -6,6 +6,7 @@ android { defaultConfig { applicationId "org.scratchjr.android" + manifestPlaceholders = [disableAnalytics: "false"] } buildTypes { @@ -24,6 +25,7 @@ android { targetSdkVersion 29 versionCode 22 versionName "1.2.11" + manifestPlaceholders = [disableAnalytics: "true"] } } diff --git a/android/ScratchJr/app/src/main/AndroidManifest.xml b/android/ScratchJr/app/src/main/AndroidManifest.xml index 3d3cb6a5..54c23178 100644 --- a/android/ScratchJr/app/src/main/AndroidManifest.xml +++ b/android/ScratchJr/app/src/main/AndroidManifest.xml @@ -18,6 +18,9 @@ android:theme="@style/AppTheme" android:hardwareAccelerated="true" android:resizeableActivity="false"> + + + diff --git a/src/editor/engine/Sprite.js b/src/editor/engine/Sprite.js index 785b428c..91dac562 100755 --- a/src/editor/engine/Sprite.js +++ b/src/editor/engine/Sprite.js @@ -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) { @@ -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 { diff --git a/src/painteditor/Paint.js b/src/painteditor/Paint.js index 0ea01da9..c210ea28 100644 --- a/src/painteditor/Paint.js +++ b/src/painteditor/Paint.js @@ -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');