Wednesday, 1 February 2023

Android: app area reduced after upgranding gradle to 7.4.0

I'm having a weird issue after I upgrated gradle to version 7.4.0 from 7.0.4.

basically it looks like the "app window" has shrink vertically, so some space appears above the navigation bar and it changes its color as seen below. it seems that the amount of space increases if the device has a taller form factor.

I can reproduce this issue only on devices with api >=26. also is not visible if the device is "short". for example is not visible on a Pixel 2 emulator or nexus 5 but is huge on a pixel 6.

below some visual examples: normal look: ( pixel 3 api 33 emulator)

enter image description here

wrong look: (pixel 3 api 33 emulator)

enter image description here

wrong look: (pixel 3 api 33 emulator with gesture navigation)

enter image description here

wrong look: (physical pixel 6a with gesture navigation) enter image description here

wrong look: (pixel 6 api 26 emulator) enter image description here

the Layout Inspector only shows the correct app area down to the bottom navigation menu, so it looks like the system is adding the extra space. also bottom sheets begin above the added space. so it looks like the app has a maximum aspect ratio and doesn't expand to the whole screen lenght

any idea what's going on?



from Android: app area reduced after upgranding gradle to 7.4.0

Tiny MCE not displaying throbber / progress animation

I have the following code but the throbber / progress animation is not showing as described in the documentation.

The image uploads correctly after a few seconds of inactivity then source input and image dimension fields are populated.

How can I get the little animation while the image is uploading?

<!DOCTYPE html>
<html>
<head>
  <script src="https://cdn.tiny.cloud/1/<api-key>/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
</head>
<body>

  <textarea>
    Welcome to TinyMCE!
  </textarea>

  <script>
  tinymce.init({
    selector: 'textarea',
    plugins: 'image code',
    toolbar: 'undo redo | link image | code',

    file_picker_callback: function(callback, value, meta) {
      
        var input = document.createElement('input');
        input.setAttribute('type', 'file');
        input.setAttribute('accept', 'image/*');
        input.onchange = function() {

            var file = this.files[0];

            // Show progress bar
            tinymce.activeEditor.setProgressState(true);

            // Perform file upload
            var formData = new FormData();
            formData.append('file', file);
            var xhr = new XMLHttpRequest();
            xhr.open('POST', 'upload.php');
            xhr.onload = function() {
                if (xhr.status === 200) {
                    var json = JSON.parse(xhr.responseText);
                    callback(json.location);

                    // Hide progress bar
                    tinymce.activeEditor.setProgressState(false);
                } else {
                    console.error(xhr.statusText);
                }
            };
            xhr.send(formData);
        };
        input.click();
    }
});

</script>
  
</body>
</html>



from Tiny MCE not displaying throbber / progress animation

React Native bluetooth device authentication

I'm trying to communicate with a bluetooth LE device, but have been told I need to "authenticate" before being able to read / write data. The hardware dev has told me that the device sends a key to the recipient, and I need to reply with 12000000000000000000000000. He has tested this successfully with the NRF Connect desktop app (but I need to replicate this in react native).

I've tried sending 12000000000000000000000000 (converted to base64) to the device's notify characteristic as soon as I connect to it using the code below:

const Buffer = require("buffer").Buffer;
const loginString = "12000000000000000000000000";
const hexToBase64 = Buffer.from(loginString).toString("base64");

characteristics[0].writeWithResponse(hexToBase64).then(()=>...)

However, I keep getting "GATT exception from MAC address C7:7A:16:6B:1F:56, with type BleGattOperation{description='CHARACTERISTIC_WRITE'}" even though the code executes properly (no catch error).

I've looked through the react-native-ble-plx docs and still haven't found a solution to my problem, any help would be apreciated!



from React Native bluetooth device authentication