Ice Cream Sandwich; android:windowBackground behavior - themes

I'm testing out my application for Android 2.2 on ICS. It work with ICS, but I have a weird problem.
I use a custom theme in my application, and I am using the android:windowBackground property to set a background image. It shows up nicely on Android 2.2-2.3 devices, but on ICS it adds some sort of weird white blending glow effect. It only happens if I set the android:windowBackground property.
This is the content of the windowBackground layout I use;
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="#drawable/tv_big"
android:tileMode="disabled"
android:gravity="center|top" />
If I do not set the android:windowBackground the problem is gone, and my application renders fine. I can't take a screenshot of the problem, because on screenshots the effect is not visible.
Has anyone encountered this problem? If so, what did you do?

Have you tested in other devices?
Maybe,an emulator with lower or higher dpi ?
If it does not show on ScreenShot,it is probably something with the Screen.

Related

Xamarin Forms - physical keyboard dims page when no input control is present

My actual application is using a bluetooth scanner in HID mode and capturing the input on the DispatchKeyEvent of the MainActivity. It works great except that the screens dims to some dark opaque color where it looks like everything is disabled and you have to navigate back to a page with an input control and tap on it to get the screen to go back to normal.
It's not as noticeable in the stock template but in my actual application (Screen shots at bottom) the dimming is very noticeable; it's a blue-gray opaque overlay that really stands out. I have no idea why it's like that. I'd almost just be happy if my actual app dimmed like the default forms sample.
Steps:
Make a Xamarin Forms app from one of the templates.
Change nothing.
Run simulator.
Press a button on your keyboard.
Result:
The screen dims and the soft keyboard does not popup.
Next Steps:
Add an Entry control. < Entry/> will do.
Click on it and the screen brightens back up.
Delete < Entry/>
Press a key on your keyboard and the soft keyboard pops up and the screen doesn't dim again.
What I want:
To know where the dim/overlay color/opacity is set so I can change it.
To not allow the soft keyboard to try and popup at all unless there's an entry field that has focus.
Here's screenshots from the default forms app:
Not Dim:
Dimmed after pressing the keyboard:
My actual test device is a Samsung Galaxy XCover Pro running Android 10.0. I'm working on porting a native Xamarin Android app to Forms so we can run it on iOS as well. I never had this issue with my android app and I'm not sure how to track down what's happening.
Here's a before pic. I've got an Entry field focused.
After scanning a barcode with my bluetooth scanner this happens:
There is NOT any overlay/modal boxview defined in the XAML. The overlay is nothing that I added. Though I seem to have done something to influence the color; I don't see anything in my styles.xml files that would change the color from the default light gray (as shown in the sample Xamrin Forms template).
I can reproduce this with a scanner on the "Welcome to Xamaring Forms!" as well, the screenshots don't really show the change in overlay color; its much more subtle; I really would like to know why in my app the overlay is so much more obvious.
I'm still annoyed it happens at all. But just in case anyone else using a
hardware keyboard as input (or a BT scanner connected as a HID) and you thought you'd be fancy and override one of the default styles and use a pretty green accent color like this: (though stupidOverlayColor has been changed to pink just to make sure I found the issue) - don't do it.
<!-- Base theme applied regardless of API level -->
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorControlHighlight">#color/stupidOverlayColor</item>
</style>
The moral of the story is that "colorControlHighlight" is evil and not to be overridden and used with hardware keyboards, unless you want your app to think the entire screen should get the highlight color after you scan a barcode like this:

Xamarin Image tap gestures are not always recognised

so we are developing an app on cross-platform Xamarin. We are now testing it on Android on a few real devices, and we noticed that wherever we have an image with a Tap Gesture Recognizer the tap does not always work.
We tried increasing the section by increasing the image's size and decreasing the used part of the images, but we still have this issue. Its like some times it just doesn't work, even if you did tap on the image.
How can we fix this?
Edit
We updated to the last pre-release of Xamarin.Forms (2.5.0.121934) and it seems to be fixed. We are going to continue running tests to confirm.
Put a hotspot over it or behind it setting image's input to transparent. Hotspot can be whatever works best for you, transparent boxview, contentview etc. It's sometimes better to use hotspots as you can allow users to tap a bit around the image etc.
We updated to the last pre-release of Xamarin.Forms (2.5.0.121934) and it seems to be fixed.

WinJs: Ignore Font scaling from Windows

I've developed a WinJs app for the Surface pro 4. The app Runs in fullscreen and is layoutet with the screen resolution of 2736x1824 (surface resolution).
Now when i start the App on the surface the DPI scaling comes into play and messes up my Layout.
Is there a way to disable the scaling for the app?
I've tried:
Windows.UI.ViewManagement.ApplicationViewScaling.trySetDisableLayoutScaling(true);
but that doesn't seem to work.
Actually, making your app layout only for one resolution, especially for such a big resolution is not really great idea since the app can run on device with, for example 1920x1080 resolution where even with DPI scaling disabled your layout will be messed up.
So I recommend making the app layout responsive so it will look right on every resolution.
Not sure if you're still looking at this issue but I've found that the code that you see all over the place is actually XBox only (Link To Docs)
And the Microsoft Devs have been saying for a while that it's a user based setting and they don't plan on allowing you to ds(Forum Link)
You can detect the scaling value though with ResolutionScale (docsLink)
Windows.Graphics.Display.DisplayInformation.getForCurrentView().resolutionScale
Here's a link to a sample that detects it and adjusts.
So what you can do (and what I did) was where needed I used css scale to adjust the system to fit. Most of my app is responsive so it didn't matter, but if you use an iFrame and set it to be 1000px wide with this scale factor it will actually be 1400px or even 1800px wide and totally cut off..
I have listeners setup for the resize events and just adjust as needed.
Hope that helps!
-Dennis

Background images rendering problems on wp7

In my WP7 app i'm having problems with background images rendering badly. It looks like the images are rendered using 8-bit colors, and in general looks ugly. They're .png. Heres a screenshot of how it looks in the app:
screenshot
Does anyone know what causes this and how it can be fixed?
Have you tried to enabled 32bit colour?
To do this, open up your WMAppManifest.xml and in the App element add BitsPerPixel="32"
<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2009/deployment" AppPlatformVersion="7.1">
<App BitsPerPixel="32" xmlns="" ProductID="{25aef417-
Not sure if this will resolve the issue, but the fact your using a .png image and only having 16bit colour could be related.
DO NOT "enable 32 bit color". Many devices have only 16 bit LCD, so they'll still have the issues - you'll just not know about them.
If you really need smooth gradients, use predithered backgrounds, eg. http://nerdplusart.com/photoshop-action-for-windows-phone-7-dithering However it's still not flowing with the of Windows Phone.
The true solution is to change your design to solid, primary colors. This is the choice user have made buying WP device and you should respect it.

Fonts are rendering differently across apple devices. So frustrating

I am hoping some of you css wizards might have run into the problem I'm about to describe.
I've created css3 buttons for a clients website, in order to replace their current image buttons. The buttons happen to be a light font face on a dark value background (white text on a red background).
On OSX and iOS, the quartz rendering engine kind of freaks out about this, and anti-aliases the font to death. Bold become really really really bold.
The strange thing is, I develop on a Mac, and cannot replicate the rendering problem the client is having across multiple devices. I've made sure I only have system fonts enabled, that my font smoothing is set the same, etc...
I found an article that suggested a fix for webkit based browsers here, and have seperated the text from it's background in order to give just the text an opacity value.
Still, no dice. Anyone have idea what could be the problem here?
Sample image:
I've encountered bolding issues with web fonts on webkit based browsers. I used the following CSS property to remedy it:
-webkit-font-smoothing: antialiased;
Seems like a better solution than messing with opacity to fix font weights... which really just feels like a hack.

Resources