Display Bug with PhoneTablet_Orientation

alexb

Member
Licensed User
Longtime User
I am using PhoneTablet_Orientation.SetScreenResolutionOrientation(0) or PhoneTablet_Orientation.SetScreenResolutionOrientation(1) to set my tablet to the desired landscape or portrait mode. Unfortunately I see occasionally (1 of 5 times) a display bug after the screen was rotated, a portion of the viewable area in the top or bottom of the screen (alongside the X-Axis) is cut off, about 50 pixels are missing. The 'missing' area is black and doesn't process any touch events etc. either. Of course your APP LOOKS LIKE BROKEN then...:sign0085:

I spent many hours on debugging as I thought it's something in my code but now it turns out that issue does not occur anymore at all if I switch off the 'Buttons Panel' on my Archos tablet!!! This 'Buttons Panel' (Softmenu with Search, Home, Menu and Back buttons) has a width/height of about 50 pixels. In landscape mode it's on the right side, in portrait mode in the bottom of the screen.

I suppose that many users have such a 'Buttons Panel' / SoftMenu on their phones or tablets, so is it possible to have a solution or fix for this problem?

Also: is it programmatically possible to switch off such a 'Buttons Panel' / SoftMenu as a work-around until (hopefully!) a fix for PhoneTablet_Orientation.SetScreenResolutionOrientation is available?

THANKS A LOT!
 

alexb

Member
Licensed User
Longtime User
nfordbscndrd, thanks for your reply and links to other pages that I have studied in the meantime. Actually I am not using any layouts but calculate the position of each view dynamically according to display size/resolution and the presence (on or off) of this 'Buttons Panel' from Archos. Because this is a lot of coding I suspected an error in my own code causing the cut off display.

Pictures and examples are worth more than long talking, I will try to post here something extremely simple that shows the display error.

Thanks,
 

agraham

Expert
Licensed User
Longtime User
I suspect an Archos bug as this "Button Panel" sounds like a non-standard UI "enhancement" done by Archos. I haven't seen it on other Android devices that I have seen. I would stick a Log statement in Activity_Resume for Activity.Width and Activity.Height and see if they vary from normal when the black band is present.
 

alexb

Member
Licensed User
Longtime User
Thanks Agraham, will do this testing as you suggested.

Attached the ultra simple test program which served for taking the screenshots, do not even use PhoneTablet_Orientation but the issues occur after manually rotating forth and back the device from Landscape to Portrait to Landscape.

The original 1024x600 image has a red frame all around the picture. This allows to see better what happens after rotation...

I agree, I suspect as well :sign0148:the Archos Buttons Panel to be the culprit, it's just a really nasty issue because when cropping occurs then anything is affected (not only the background, also other views/buttons etc. in the affected area).
 

alexb

Member
Licensed User
Longtime User
Agraham, I confirm your theory, the values for activity.height after rotation are incorrect, instead of expected 600 only 556 is returned. Of course this explains why the statically set 1024x600 image (or panel) is cropped by 44 pixels, or squeezed when using relative 100%xy values. Question is what is actually causing the wrong activity.width value and whether it can be fixed (by Archos I guess).
 

alexb

Member
Licensed User
Longtime User
Final remark 'root cause'

Agraham, as said in previous thread it is obvious that the values for the activity height are incorrect and this explains all the issues observed.

However I have checked now practically all other Android- and 3rd party apps installed on this Archos device (with button panel on) and many allow rotation change and full screen mode as in the ultra-basic B4A sample app that I uploaded. NONE OF THESE APPS SHOWS THE ISSUE! Seems to me that outside of the B4A world the issue is non-existing.

Could you give it a thought knowing that this is a device/vendor specific issue to some extent at least.

THANK YOU
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Agraham, I confirm your theory, the values for activity.height after rotation are incorrect, instead of expected 600 only 556 is returned. Of course this explains why the statically set 1024x600 image (or panel) is cropped by 44 pixels, or squeezed when using relative 100%xy values. Question is what is actually causing the wrong activity.width value and whether it can be fixed (by Archos I guess).

In my previous post in this thread, I gave a link to another post which says:

' The emulator does not include the onscreen system menu of the Archos 70
' which is 40 pixels wide down the right side of the screen in landscape.
' I don't know if other 7" devices have anything like this, but here is
' an adjustment for the A70...
followed by code showing how I adjusted for it.

I'm not sure why you are saying that the activity.width value is wrong. It is supposed to be different from screen.width to adjust for differences in actual available screen space on different devices due to such things as the soft device menu keys.

If your device's screen width is 600, then activity.width is supposed to be 556 to allow for the system menu layout.

BTW, I have an Archos 70-250G. The layout adjustments I make in the code referenced above works fine going from the emulator (with no menu keys) to the A70 (with menu keys).
 
Last edited:

ScarBelly

Member
Licensed User
Longtime User
Just an FYI
I haven't yet tried any fixes but I am experiencing the very same problem with an Archos 43. It is 480x854 pixels. I have my two variants set to the same size and it works great on the emulator but loses a strip the first and each time the device is rotated.
I'm a noob so I've been searching for a solution.
 

frasier

Member
Licensed User
Longtime User
I have the same issue with my Archos 7 IT device and the software based softkeys. Here an example which hopefully makes the situation some more clear:

The first time when the app started in landscape mode the activity size is 760 x 423 pixels. So far everything is correct becuase the softkey panel is on the right side with a width of 40 pixel and the status and title bar have a height of 57 pixel.

After switching to protrait mode the activity size is 440 x 743 pixels. This is not correct because the softkey panel is now on the bottom side and has a height of 40 pixels. The status and title bar still have the height of 57 pixel. Thus, the correct activity size should be 480 x 703. The problem is that the softkey panel height has been substracted from the activity width instead of the height.

Then when I switch back from portrait to landscape mode the activity size is 800 x 383. Now, the sofftmenu width has been subtracted from the height instead of the width. This is also not correct.

However, the actual issue is that the activity width and height is different after changing the orientation on an Archos 7 IT device. Can please somebody look into this or give me an idea how to solve this problem?
 

frasier

Member
Licensed User
Longtime User
I have the latest firmware on the device. Here another example:

When I create in eclipse a default android project and add a simple button within the LinearLayout with layout_width=fill_parent and layout_height=wrap_content everything works fine on my Archos 7 IT device. Even if I change the orientation the button still have the correct width.

In B4A I have created an empty project as well and I have added the following lines of code in the Activity_Create Sub:

B4X:
myButton.Initialize("")
myButton.Text = "Click Me"
Activity.AddView(myButton,0,0,-1,-2)

myButton is a variable declared in globals sub

When I run the app on my Archos I have this bug with the screen orientation. First time, when I start the app the orientiation in landscape mode is correct and it looks like as in my eclipse project. The button width is 760 pixels. (800 pixels - 40 pixels for the softmenu on the right) When I change the orientation to portrait mode 40 pixels has been cutted of from the button width. (the softmenu is here on the bottom) Then, when I change the orientation back to landscape mode the button width is now 800 pixel (40 additional pixels) and the softmenu overlaps with the button.

Because the app made with eclipse does everything correct I don't think it is a device specific bug. It would be also interesting to know whether other archos 7 it users have the same problem. I would be glad if someone can help.
 

agraham

Expert
Licensed User
Longtime User
add a simple button within the LinearLayout
Basic4android doesn't use LinearLayout as the basis for its Activity ViewGroup but uses its own BALayout which will behave differently. BALayout is more like AbsoluteLayout in that it lets you specify view locations as pixel values. As far as I can see BALayout sets its own size according to values reported by the OS so if the size is wrong then it does look like an OS bug. I guess LinearLayout does things differently.
 

frasier

Member
Licensed User
Longtime User
Thank you for the anwser. Is there a posibility to get the real activity size excluding the softmenu size? or does anyone has some kind of workaround for this problem?
 

frasier

Member
Licensed User
Longtime User
Excatly, the problem is that Activity.Width and Activity.Height have the wrong values after changing the orientation on my archos 7 internet tablet and it seems that has something to do with the softmenu which is software based on the archos 7it.
On my phone and and another tablet it works as it should.
 
Top