EverTranslator icon indicating copy to clipboard operation
EverTranslator copied to clipboard

Menu bar can go outside the screen

Open uomar8 opened this issue 1 year ago • 6 comments

Before 4.0.0: Screenshot_20240313_234153_com example android notepad_edit_225449584214035

After 4.0.0 : Screenshot_20240313_234225_com example android notepad_edit_225456984577055

uomar8 avatar Mar 13 '24 20:03 uomar8

Thanks for reporting this issue.

I can not reproduce this on my Pixel 8 pro, let me try to find some other devices to test 🤔 I've upgraded the compose version to the latest one, please try this again on https://github.com/firemaples/EverTranslator/releases/tag/v4.0.4 🙇‍♂️

firemaples avatar Mar 20 '24 14:03 firemaples

Thanks for reporting this issue.

I can not reproduce this on my Pixel 8 pro, let me try to find some other devices to test 🤔 I've upgraded the compose version to the latest one, please try this again on https://github.com/firemaples/EverTranslator/releases/tag/v4.0.4 🙇‍♂️

I just tried latest version, didn't fix the problem

I think it only happens with old android versions 9 and 10 😅 these the one I use

I will try to use android studio to see if there's anything could help us

Update: I tried to use android emulator and the same problem happened

If we could add more logs to get what is wrong, might help us to find what made this problem

uomar8 avatar Mar 21 '24 02:03 uomar8

What I notched it can detect the left and right side of the screen

So I guess it can detect up and down of the screen but it can't detect if it's near to it ( what code is responsible for this? And how we could check that?

uomar8 avatar Mar 21 '24 14:03 uomar8

I use the compose built-in DropdownMenu now. https://github.com/firemaples/EverTranslator/blob/7191b70fcb0cb8c20b3499fedb4b052187d6bc75/main/src/main/java/tw/firemaples/onscreenocr/floatings/compose/mainbar/MainBarMenu.kt#L16-L28 I thought it should be positioned inside of the scope by default. Maybe it can not aware the scope on the views on WindowManager

The menu was a component that I calculated the position by myself on the previous version https://github.com/firemaples/EverTranslator/blob/b4a8b22aa1d856e6a5dbf06f43839105f96dd058/main/src/main/java/tw/firemaples/onscreenocr/floatings/menu/MenuView.kt#L101-L121

Looks like I need to use a customized component instead of a built-in one 😅

firemaples avatar Mar 22 '24 07:03 firemaples

This might help:

https://github.com/material-components/material-components-android/blob/master/docs/components/Menu.md

Also what do you think of using Bottom sheets instead? https://github.com/material-components/material-components-android/blob/master/docs/components/BottomSheet.md

uomar8 avatar Mar 26 '24 04:03 uomar8

Thank you for the proposed components, let me try to find the relative compose component to use 👍

firemaples avatar Mar 27 '24 15:03 firemaples