androidandroid-layoutgoogle-play-consoleandroid-virtual-deviceandroid-gridlayout

GridLayout Horizontally Flipped On Some Devices


While looking at the screenshots of my app on the Google Play Console Pre-launch Report, I noticed something very strange for 2 devices (Google Pixel 8 & Generic Small Desktop (x86)). Here are screenshots from Samsung Galaxy S23 Ultra (which displayed everything as expected) and Google Pixel 8 & Generic Small Desktop (x86):

Samsung Galaxy S23 Ultra: enter image description here Google Pixel 8: enter image description here Generic Small Desktop (x86): enter image description here The important thing to notice is that the Pixel 8 & Small Desktop display the tabs (the Names, Bids, etc. Buttons at the top) & numbers (the Buttons at the bottom, don't worry about the fact that the Galaxy does not have a 0 button, that is by intention) in horizontally (but not vertically) reversed order. Also note that the Small Desktop (which, I am assuming, is using my layout-land) has the buttons on the left rather than the right (they should be on the right, which they are on the physical devices on which I tested). All of these are GridLayout(s), and the order of their elements is flipped horizontally (but not vertically) from what they should be. Why are these 2 devices treating GridLayout differently from other devices?


Solution

  • I think I found the answer. In the <application/> tag of my AndroidManifest.xml file I previously had android:supportsRtl="true", when what I should have had was android:supportsRtl="false". After changing this all the screenshots look as expected, so hopefully this was the problem. I never thought of this property as being related to layout, I thought it only applied to text, but I guess it applies to general layout (like GridLayout) as well. Hopefully this can help others as well. Good Luck!