android:screenOrientation="portrait" is not working on one Chinese Pad - android-listview

I have made app and set it to have portrait orientation for main <activity> in ActivityManifest.xml. It is portrait on all devices except one Chinese noname pad.
There are other apps that handle orientation on that pad correctly.
I expect that in portrait orientation screen width is less then height.
My 2 questions are:-
What is the best way to set orientation? Do I have to check screen width/height and rotate screen accordingly?
How widespread that orientation bug is?

You may see this answer. That was for a Jellybean bug but the same code may apply for other versions aswell.

ActivityManifest.xml way is good enough.
My buggy noname chinese pad is only device that I seen so far.

Related

Unity SafeArea is inconsistent between different starting rotations

I'm trying to make a script that adjusts the SafeArea of my Canvas when the device is rotated. I've got it almost working and it looks great on-launch, but I'm getting a weird result after rotating that I can't understand: the SafeArea is different depending on whether the app launched in Portrait or Landscape mode.
When I log out the value of Screen.safeArea on an iPhone 12 Pro, for example, I get the following values:
Portrait on launch: (x:0.00, y:102.00, width:1170.00, height:2289.00)
Portrait rotated to Landscape: (x:0.00, y:102.00, width:2532.00, height:927.00)
Landscape on launch: (x:141.00, y:63.00, width:2250.00, height:1107.00)
Landscape rotated to Portrait: (x:141.00, y:63.00, width:888.00, height:2469.00)
The Width/Height values are changing on rotation, which makes sense, but the X/Y offsets are not. Given the particular nature of the iPhone 12, that means there is a big empty space at the top when launching in Portrait and rotating to Landscape but overflowing the notch to the side, and big empty spaces on both sides when launching in Landscape and rotating to Portrait but overflowing the notch to the top.
Is this the expected behavior? I would have thought the "launching in Portrait" and "rotated to Portrait" safeAreas should be the same, right? Is there a way to force-refresh the safeArea or something, to get the proper X/Y values? Or am I misunderstanding how this is supposed to work?
As I mentioned in my comment, I believe this is a bug in the version of Unity you are using. Good news though! According to this bug report, it has been fixed in 2020.1.X, 2018.4.X and 2019.3.X. If you are already in one of these versions, it could be that the bug has returned. If that's the case, I would try one of the alternate versions listed. If no listed versions work, you should report that the bug has regressed.

Flash of white when changing orientation on iOS Safari

What causes the flash of white to the right of a responsive design when changing orientation from portrait to landscape on the iPhone with iOS 6?
Try it on Safari for iOS 6:
Websites like this don't do it: http://html5boilerplate.com
But this one does: http://www.initializr.com
Something to do with re-processing (CPU lag) to fit a wider screen?
It doesn't happen in Chrome for iOS6...
For example, I just removed all img from my own testing site and set the background of <body>, <html> etc. to non-white, but it still happens. This seems to happen with a lot of different websites out there, but others are completely immune to it...
Could it be a problem with someone on the website, or an iOS Safari bug?
Thats because of the elements in the header of http://www.initializr.com/ which (dis)appear when changing orientation. It forces the header to resize and the elements below are pushed down. This causes a repaint of the DOM, that causes the short white flash on iOs.

UIAlertView message too long

I have an alertView that pops up when reachability has detected wifi. I have both english and french translations of this. The problem is the french version's text is a bit longer, and I do have some line breaks in there.
When the text is too long, the alertView changes to a white background with a scrollable text view. Is there any way around this? The strange thing is that this only happens on retina devices (or non-retina when in landscape, but that makes more sense). Non-retina devices show the whole message normally. It seems like retina devices having more landscape shouldn't make this happen.
Help?
Thanks in advance.
First of all retina devices would produce the same results seeing as they have the same amount of screen real-estate. The difference is in pixel density, which means that an object on retina will be the same physical size but will actually be using 4 times the pixels which produces a much clearer and sharper image.
Secondly, there is no way you can avoid this. UIAlertView is a class that Apple allows VERY little customization of, so you may be better off making a custom view and presenting it yourself. This is probably only happening in landscape mode because the alert gets less screen area under these circumstances.
So overall, I would recommend that you either create your own custom pop-up or you trim down the amount of text you're displaying in the alert.

iPhone app 'fake' landscape mode

So after wasting many hours trying to get my app to run in landscape mode by defualt I'm looking for an alternative.
My idea is to create the app in portrait mode but rotate everything by 90 degrees, the player thinks that he is playing the game in landscape mode (when really I've just rotated everything). I recognise it will be a little awkward to develop but I come into all sorts of issues when I try to program for landscape.
My question is, does Apple frown upon this? Could they reject my app for any reason or is this safe to do? Are there any issues I should be aware of?
Advice/articles/help all appreciated.
I do not allow landscape mode in my applications and none of them have been rejected. Sometimes an application does not benefit from being in landscape mode.
EDIT: The same also goes for portrait mode. If your app makes sense only in one orientation or the other, Apple will not reject you.
There is a key you can put into your Info.plist to make it start in landscape (see here). Or have you already tried that?
There are reportedly immersive full screen Open GL games that hide the status bar and do this. Note that you will still need to detect and handle landscape-left and landscape-right rotations or your app might appear upside-down.
Just set an affine transform on your top-level view, and be careful to always use the correct coordinate system.

UIWebView font is thinner in portrait than landscape

My app contains a UIWebView. When the app rotates from portrait to landscape or back, the font weight appears to slightly change. Both bold text and regular text get slightly bolder in landscape, and slightly thinner in portrait.
This does not appear to be the case in Safari, only in my app. Here is an example image, taken as a screenshot on the iPad. I have rotated and cropped an example section.
alt text http://dl.swankdb.com/font-change-example.png
I have the following CSS configured, but it seems to prevent the drastic font size change, not the subtle weight change that I am observing:
html {
-webkit-text-size-adjust: none; /* Prevent font scaling in landscape */
}
Can anyone explain this? The simulator does not do it -- but my iPad, iPhone 3GS and iPhone 4 all have it. I've also received reports from customers that it happens to them, so I know it's not in my head!
I've seen this in Safari itself too with a web app I'm putting together. After a day or so of head scratching, and deconstructing the CSS used by the iPad User Guide, I found that
-webkit-transform: translate3d(0,0,0);
does the trick. Googling around it looks like this enables hardware acceleration of rendering which leads to far more consistent results in portrait and landscape orientations.
Well after spending a rediculous amount of time trying to figure this out I have found a solution:
Use this:
html {
-webkit-font-smoothing: none;
}
The reason for this is that only one mode can make use of the subpixels in the display, because they are arranged in a certain direction. The other mode will display the font with greyscaled anti-aliasing and appear slightly different.