Page 1 of 1

Landscape display with Android 8

Posted: Tue Jan 22, 2019 5:05 am
by v8dave
I've managed to rotate the display so that Android comes up in Landscape but the touch does not rotate. Touching the right centre of the display appears at the bottom centre.

I set the following property in /device/rockchip/rk3399/device.mk

ro.sf.hwrotation=90

It was 0 for portrait mode.

Anyone know how to get the touch to also rotate? It should have been automatic and taken care of by the OS but doesn't seem to be. On the Nano PC T3 Plus that I also use, this works fine.

Re: Landscape display with Android 8

Posted: Mon Jan 28, 2019 1:50 am
by v8dave
It's a brand new installation using the SD card after I write this to the eMMC memory so it should work straight off.

I did find some info about an issue with this on older Android versions but you'd think that 8.1 would have the patch to fix this. Looking at the drivers, there is code to rotate the touch so not sure why it is not working here.

Re: Landscape display with Android 8

Posted: Thu Jan 31, 2019 7:53 am
by v8dave
I managed to fix this temporarily until I can work out how to do this without hard coding it.

I edited InputReader.cpp to hard code the display to landscape. I have no need for portrait at all.

I also managed to enable screen/sleep off without resorting to putting the device into debug mode but enabling the debugging.

Re: Landscape display with Android 8

Posted: Wed May 08, 2019 7:03 am
by Daitaro
Where did you find inputreader.cpp?

Thank you!

Re: Landscape display with Android 8

Posted: Wed May 08, 2019 7:08 am
by v8dave
Daitaro wrote:
Where did you find inputreader.cpp?


In the Android kernel source for the RK3399.

Do a search for it from the root of the source tree.

Re: Landscape display with Android 8

Posted: Wed May 08, 2019 9:00 am
by Daitaro
Yeah it took a while, but I did find it after remembering that feature.

Which line did you edit to hardcode landscape?

Re: Landscape display with Android 8

Posted: Wed May 08, 2019 9:26 am
by v8dave
Daitaro wrote:
Yeah it took a while, but I did find it after remembering that feature.

Which line did you edit to hardcode landscape?


It's in the actual Android framework but you already found it.

I added the following line of code after the comment TEST in 2 places.

Code starts at line 190

Code: Select all

static void rotateDelta(int32_t orientation, float* deltaX, float* deltaY) {
    float temp;
//
// TEST
//
    orientation = DISPLAY_ORIENTATION_90;

    switch (orientation) {
    case DISPLAY_ORIENTATION_90:
        temp = *deltaX;
        *deltaX = *deltaY;
        *deltaY = -temp;
        break;

    case DISPLAY_ORIENTATION_180:
        *deltaX = -*deltaX;
        *deltaY = -*deltaY;
        break;

    case DISPLAY_ORIENTATION_270:
        temp = *deltaX;
        *deltaX = -*deltaY;
        *deltaY = temp;
        break;
    }
}


Code starts at line 3754

Code: Select all

        if (mDeviceMode == DEVICE_MODE_DIRECT || mDeviceMode == DEVICE_MODE_POINTER) {
            // Convert rotated viewport to natural surface coordinates.
            int32_t naturalLogicalWidth, naturalLogicalHeight;
            int32_t naturalPhysicalWidth, naturalPhysicalHeight;
            int32_t naturalPhysicalLeft, naturalPhysicalTop;
            int32_t naturalDeviceWidth, naturalDeviceHeight;
//
// TEST
//
       mViewport.orientation = DISPLAY_ORIENTATION_90;

            switch (mViewport.orientation) {
            case DISPLAY_ORIENTATION_90:
                naturalLogicalWidth = mViewport.logicalBottom - mViewport.logicalTop;

Re: Landscape display with Android 8

Posted: Thu May 09, 2019 8:46 am
by Tiemichael
@v8dave: Thank you for sharing!
I just modified my InputReader.cpp according to the previous post, and I see the screen as expected in Landscape mode, but the touchscreen being in Portrait mode.
In post #1 you mentioned the same issue, how did you resolve this?

Surprisingly without the changes in InputReader.cpp both Screen and Touscreen are 'aligned', but some applications seem to demand Portait-mode which does not fit to my screen.

Same like you, I only need Landscape mode.

Thanks!

Re: Landscape display with Android 8

Posted: Thu May 09, 2019 9:16 am
by v8dave
The changes to InputReader.cpp will fix the touch screen for Landscape more. It's not the ideal way but seems to be the only way I could get it to work in Landscape mode.

There is also a setting somewhere in the XML files that tell the system it should only offer Landscape mode only. Can't recall exactly where though.

Re: Landscape display with Android 8

Posted: Thu May 09, 2019 9:21 am
by Tiemichael
Thanks for the fast reply!
Will find it ...

Re: Landscape display with Android 8

Posted: Sun May 12, 2019 1:51 pm
by Tiemichael
I understand that changes in InputReader.cpp only influence the touch-screen.

The screen rotation can be disabled in 'frameworks/base/core/res/res/values/config.xml' by "<bool name="config_forceDefaultOrientation">true</bool>" **) and "<bool name="config_supportAutoRotation">false</bool>" .
**) : Flag indicating that this device does not rotate and will always remain in its default orientation. Activities that desire to run in a non-compatible orientation will be run from an emulated display within the physical display.

My device can also tell apps that it only supports landscape mode by deleting 'frameworks/native/data/etc/android.hardware.screen.portrait.xml'.

Now all my screens are in landscape mode, with the touchscreen aligned but for some apps and views of the contents is cut off:
(https://imgur.com/rOgFqBE)
The Notification bar seems to have the right width, app 2/3 of the screen are cut off, there is also no touch recorded at this 'black' area.

Any idea how to fix this?

Re: Landscape display with Android 8

Posted: Mon Oct 14, 2019 10:16 pm
by fezziwig
Thank's for this fast replys guys... :)

Re: Landscape display with Android 8

Posted: Wed Jan 15, 2020 7:52 am
by johnsmith101
Thanks for your replies authorityapk.com tubemate get-mobdro.com

Re: Landscape display with Android 8

Posted: Tue Sep 15, 2020 5:21 am
by Daitaro
Tiemichael wrote:

Now all my screens are in landscape mode, with the touchscreen aligned but for some apps and views of the contents is cut off:
(https://imgur.com/rOgFqBE)
The Notification bar seems to have the right width, app 2/3 of the screen are cut off, there is also no touch recorded at this 'black' area.

Any idea how to fix this?



Did you ever find a solution to this?

Re: Landscape display with Android 8

Posted: Wed Mar 17, 2021 12:08 pm
by Briggs
Daitaro wrote:
Tiemichael wrote:

Now all my screens are in landscape mode, with the touchscreen aligned but for some apps and views of the contents is cut off:
(https://imgur.com/rOgFqBE)
The Notification bar seems to have the right width, app 2/3 of the screen are cut off, there is also no touch recorded at this 'black' area.

Any idea how to fix this?



Did you ever find a solution to this?

I'm also experiencing the bug, but in my case, it happens in an app that is completely in portrait mode and only when activities that have been called with startActivityForResult() return their result (so we go back to the caller activity).

Re: Landscape display with Android 8

Posted: Thu Mar 18, 2021 6:23 am
by Tiemichael
No, I never found a solution to this ...

I overcame this issue by pre-installing a landscape-manager app, which needs to be configured at first boot.

Working reasonable well

Re: Landscape display with Android 8

Posted: Sun Apr 25, 2021 6:49 pm
by Badger_Tu16
Thanks, I gave it a try as well, and it worked for me! I was getting really frustrated with this one...

Re: Landscape display with Android 8

Posted: Fri Jan 14, 2022 6:19 am
by kossmoss
Briggs wrote:
Daitaro wrote:
Tiemichael wrote:

Now all my screens are in landscape mode, with the touchscreen aligned but for some apps and views of the contents is cut off:
(https://imgur.com/rOgFqBE)
The Notification bar seems to have the right width, app 2/3 of the screen are cut off, there is also no touch recorded at this 'black' area.

Any idea how to fix this?



Did you ever find a solution to this?

I'm also experiencing the bug, but in my case, it happens in an app that is completely in portrait mode and only when activities that have been called with startActivityForResult() return their result (so we go back to the caller activity).

i agree to post .

Re: Landscape display with Android 8

Posted: Fri Jan 14, 2022 11:41 am
by lordgoku
Tiemichael wrote:
I understand that changes in InputReader.cpp only influence the touch-screen.

The screen rotation can be disabled in 'frameworks/base/core/res/res/values/config.xml' by "<bool name="config_forceDefaultOrientation">true</bool>" **) and "<bool name="config_supportAutoRotation">false</bool>" .
**) : Flag indicating that this device does not rotate and will always remain in its default orientation. Activities that desire to run in a non-compatible orientation will be run from an emulated display within the physical display.

My device can also tell apps that it only supports landscape mode by deleting 'frameworks/native/data/etc/android.hardware.screen.portrait.xml'.

Now all my screens are in landscape mode, with the touchscreen aligned but for some apps and views of the contents is cut off:
(https://imgur.com/rOgFqBE)
The Notification bar seems to have the right width, app 2/3 of the screen are cut off, there is also no touch recorded at this 'black' area.

Any idea how to fix this?

Same happened with me on app. But after researching on it. I solved.

Re: Landscape display with Android 8

Posted: Mon Jan 22, 2024 5:58 pm
by Thiagoros
v8dave wrote:
The changes to InputReader.cpp will fix the touch screen for Landscape more. It's not the ideal way but seems to be the only way I could get it to work in Landscape mode.

There is also a setting somewhere in the XML files that tell the system it should only offer Landscape mode only. Can't recall exactly where though.

tweaking InputReader.cpp for improved touch screen functionality in Landscape mode are valuable for troubleshooting. While it may not be the ideal solution, sometimes it's the practical one. Mentioning a setting in XML files for exclusive Landscape mode adds another layer of customization. Thanks for sharing your expertise!Fm Whatsapp Download

Re: Landscape display with Android 8

Posted: Sun Mar 03, 2024 10:26 am
by tyler77
Leveraging the landscape display feature in Android 8 enhances user experience by providing a broader, more immersive view. Whether gaming, watching videos, or multitasking, the landscape mode optimizes visual engagement, showcasing the versatility and user-centric design of the Android 8 operating system.

Re: Landscape display with Android 8

Posted: Mon Mar 11, 2024 2:04 pm
by tyler77
For landscape display on Android 8, ensure your app's layout accommodates both portrait and landscape orientations. Leverage the "res/layout-land" folder for landscape-specific XML layouts. Test thoroughly on various devices to guarantee a seamless user experience, providing flexibility for users who prefer different screen orientations.

Re: Landscape display with Android 8

Posted: Mon Mar 11, 2024 2:04 pm
by tyler77
For landscape display on Android 8, ensure your app's layout accommodates both portrait and landscape orientations. Leverage the "res/layout-land" folder for landscape-specific XML layouts. Test thoroughly on various devices to guarantee a seamless user experience, providing flexibility for users who prefer different screen orientations.

Re: Landscape display with Android 8

Posted: Mon Mar 11, 2024 2:08 pm
by tyler77
Tiemichael wrote:
I understand that changes in InputReader.cpp only influence the touch-screen.

The screen rotation can be disabled in 'frameworks/base/core/res/res/values/config.xml' by "<bool name="config_forceDefaultOrientation">true</bool>" **) and "<bool name="config_supportAutoRotation">false</bool>" .
**) : Flag indicating that this device does not rotate and will always remain in its default orientation. Activities that desire to run in a non-compatible orientation will be run from an emulated display within the physical display.

My device can also tell apps that it only supports landscape mode by deleting 'frameworks/native/data/etc/android.hardware.screen.portrait.xml'.

Now all my screens are in landscape mode, with the touchscreen aligned but for some apps and views of the contents is cut off:
(https://imgur.com/rOgFqBE)
The Notification bar seems to have the right width, app 2/3 of the screen are cut off, there is also no touch recorded at this 'black' area.

Any idea how to fix this?

Thanks for share good informetion.