Genymotion is disabled and splashed when using Image Widget in Flutter(Android Studio) - flutter-layout

GenyMotion is turned off and splashed when using Image Widget in Flutter(Android Studio) when running with real device and Android virtual machine it normally only happens on GenyMotion can someone tell me how to fix it thank
this is my source code
https://github.com/chung19/dicee-flutter.git
Expanded( child: TextButton( onPressed: () { getDiceNumber(); }, child: Image.asset( 'images/dice$rightDiceNumber.png', cacheHeight: 100, cacheWidth: 100, ), ), ),

Update, after using Genymotion version Android 5.1, it works normally

Related

Cypress drag-drop not working for thesecond time

I trying to drag and drop items while I am testing a frontend with Cypress.
I already installed the plugin Cypress-drag-drop from:
https://www.npmjs.com/package/#4tw/cypress-drag-drop
This actually works good, but only for the first time.
When I try to drag and drop a similar selector for the second time it is failing.
I have tried to find the source of this problem but couldn't find it.
Just using the following:
cy.get('[data-test-id="gapMatchFact"]:eq(1)').drag('[data-test-id="gapMatchGap"]:eq(0)') //<-- works perfectly
cy.get('[data-test-id="gapMatchGap"]:eq(0)').drag('[data-test-id="gapMatchFact"]:eq(1)') //<-- doesn't work
Please check the printscreens, I can see that the second try has a lot more tries for moving the object. What could be the reason for this? The FrontEnd is native javascript.
I already tried different drag and drop methods. This even did not work for the first drag and drop.
`cy.get('[data-test-id="gapMatchFact"]').eq(1)
.realMouseDown({ button: 'left', position: 'center' })
.realMouseMove(0, 10, { position: 'center' });
cy.get('[data-test-id="gapMatchFact"]').eq(0)
.realMouseMove(0, 0, { position: 'top' })
.realHover().realMouseUp();`

Bevy text isn't displayed and I don't know why

Hello everyone I am trying write the score in the top left corner of the window but for some reason it is not working. Here is the code I used to spawn the text:
commands
.spawn(TextBundle{
text: Text{value: "Score:".to_string(),
font: assets.load("FiraSans-Bold.ttf"),
style:TextStyle{
font_size:30.0,
color:Color::WHITE,
..Default::default()},..Default::default()},
transform: Transform::from_translation(Vec3::new(-380.0,-380.0,2.0)),
..Default::default()
})
.with(TextTag);
Window is 800 by 800. Any help is appreciated.
You may need to add the CameraUiBundle if you did not yet do it.
commands
.spawn(CameraUiBundle::default())
.spawn(TextBundle{
...
})
.with(TextTag);
You might want to do that in your initial setup system in which you also add the camera.
The Bevy version used when answering was 0.4.
Another reason (in bevy 0.8) might be that there's no default font in bevy (check out this answer)
What you'd need to do would be to download a .ttf file, and then load it when spawning the text.
TextStyle {
font_size: 50.0,
color: Color::WHITE,
font: asset_server.load("your_font.ttf"),
},

Electron JS: Windows frame is visible around BrowserWindow after focus lost

I'm currently working on an Electron JS application.
When running this application there is an animation to "deploy" the window and its reverse animation to close the application. So my frameless BrowserWindow is larger than its content.
One weird behaviour happens when the application loses focus. A frame around the BrowserWindow appears:
This behaviour only occurs when the blur event is raised.
Here is how my window is defined:
mainWindow = new BrowserWindow({ frame: false, thickFrame: false,
width: 1000, height: 450,
icon: path.join(__dirname, 'assets/sharing-2.ico'),
transparent: true, titleBarStyle: 'hidden'});
Note that I don't have this behaviour when running an npm start command from Visual Studio Code but it does after I package my app using electron-packager

Tabular Browser Windows for Atom-Shell?

I'm playing around with the atom-shell and was wondering if anybody has used/written a module for making tubular browser windows?
Currently, it seems, atom-shell opens a completely new window when instantiating a BrowserWindow:
var win = new BrowserWindow({ width: 800, height: 600, show: false });
win.on('closed', function() {
win = null;
});
win.loadUrl('https://github.com');
win.show();
Is there a way of tabularising the window, like in the atom application? Or will I have to write this functionality inside the current BrowserWindow in order to get it to work?
There is no way to create native tabs in Atom Shell. That being said, what #zcbenz suggests is entirely doable with the <WebView> tag, which allows you to safely host arbitrary web content inside Atom Shell.

Native window rendering issue on Samsung Galaxy S3

I am using Skia (prebuilt) to draw in an android native window, that i get from a java surface. The code performs well on every device I could test it on, except for a Samsung Galaxy S3 (with android 4.0.4 on it). The first image is what I should see, and the second what appears on the Galaxy S3:
The jni function that draws the rectangle is:
JNIEXPORT void JNICALL Java_com_test_TestSkia_InitializeWindow(JNIEnv* env, jobject thiz, jobject surface)
{
ANativeWindow* window = ANativeWindow_fromSurface(env, surface);
ANativeWindow_Buffer buffer;
ANativeWindow_lock(window, &buffer, NULL);
SkBitmap bitmap;
bitmap.setConfig(convertPixelFormat(buffer.format), buffer.width, buffer.height);
bitmap.setPixels(buffer.bits);
SkCanvas canvas;
canvas.setBitmapDevice(bitmap);
SkRect rectRed;
rectRed.setXYWH(30,30,400,700);
SkPaint paint;
paint.setColor(SK_ColorRED);
canvas.drawRect(rectRed,paint);
ANativeWindow_unlockAndPost(window);
}
I tested it on the following devices, with no issue:
Sony X8 (android 2.3.7 customized rom)
Samsung Nexus S (android 4.0.4)
Samsung Galaxy Tab 10.1 (android 3.2)
Samsung Galaxy S2 (android 2.3.5)
Emulator (android 4.0.3, same screen size and dpi than the galaxy S3)
I tried calling ANativeWindow_setBuffersGeometry(window,0,0,0) with no luck (anyway, the buffer's dimensions and format after the window lock appear to be ok).
So far, only the Galaxy S3 is giving me troubles, at this point I don't know what to do, I can't even tell if the problem is with the ndk native window api or with skia, or maybe it is related to the galaxy S3 using TouchWiz... any idea would be welcome!
You need to take buffer.stride into account. Your picture clearly shows that you are having buffer.stride != buffer.width
I'm not able to test, but probably the following change is enough:
SkBitmap bitmap;
SkBitmap::Config cfg = convertPixelFormat(buffer.format);
bitmap.setConfig(cfg, buffer.width, buffer.height,
SkBitmap::ComputeBytesPerPixel(cfg) * buffer.stride);

Resources