KaustubhPatange / XClipper

XClipper is a clipboard manager for Windows & Android which helps to track clipboard activities and makes it easier to interact with them.
https://kaustubhpatange.github.io/XClipper
Apache License 2.0
215 stars 25 forks source link

The Floating Button is not working - android 13 #57

Closed ms-2525 closed 1 year ago

ms-2525 commented 2 years ago

Please complete the following information:

Describe the Bug: The floating button option only works in xclipper app. Rest everywhere the button is not showing. The Floating Button shows just for a split second in chrome but then disappears. Also it have keyboard lag a bit when the keboard popup from the bottom when pressing the search bar.

I like the idea of having a floating button containing clips but it is not working in android 13.

Hope you can fix the problem

**Expected Behavior:**
KaustubhPatange commented 2 years ago

Android 13 did really messed up it seems. I'll check this on weekend & will let you know.

ms-2525 commented 2 years ago

Found an app that has a working floating button - Copy History Support.On 12 Oct 2022, 2:58 AM +0530, Kaustubh Patange @.***>, wrote:

Android 13 did really messed up it seems. I'll check this on weekend & will let you know.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

azumukupoe commented 1 year ago

stopped working for me with after updating my Android 12 S10+ to a newer version (but not 13) so I don't think the issue is unique to Android 13

KaustubhPatange commented 1 year ago

@azumukupoe Did re-installing the app solved the issue?

azumukupoe commented 1 year ago

@azumukupoe Did re-installing the app solved the issue?

unfortunately, no

KaustubhPatange commented 1 year ago

Okay, I figured out the problem. Let me explain,

So the way the suggestion bubble is shown is we first check if the keyboard is visible or not. Now coming from a dev, checking keyboard visibility is impossible in Android (many answers you'll find just predates the current Android version). So the way I use to do this is to check if there is another overlay (window) from the bottom & get the height of that overlay.

It seems that it worked for quite a long time until Android 12 decided that you cannot get screen overlay keyboard window height unless you are requesting it from the same app where the keyboard will be shown. Hence, the method I used didn't work.

What I've done now is patch up some hacks to figure out keyboard visibility through accessibility service events. It might not be perfect & could be buggy which is why I'm asking for you to test this apk I linked below. Download > unzip & install this version to see if it works on your devices.

app-release.apk.zip

ms-2525 commented 1 year ago

floating button feature is now working. I think the changes you did worked.

Few things i noticed :-

  1. Sometimes the floating button does not disappear when the keyboard is not visible

  2. the floating button is reverting to its default location every time i.e. on the left top side of the screen. I want to change its position the right top corner where it by default goes when opening the popup.

KaustubhPatange commented 1 year ago

Hey @ms-2525,

  1. Yeah as I've said the solution might be buggy, I'll be improving it. Currently, I'm working on a new feature #58. So optimizations will be made after this feature is landed, not too long :)
  2. To change the position go to Settings > General > Suggestions. From there adjust the start position of the bubble.
KaustubhPatange commented 1 year ago

Closing this

azumukupoe commented 1 year ago

the current implementation is a bit buggy sometimes the floating button disappears and it won't reappear until reboot

KaustubhPatange commented 1 year ago

Hey @azumukupoe, can you let me know the device model & OS version you are on?

azumukupoe commented 1 year ago

@KaustubhPatange sure, it's Galaxy S10+ on Android 12, One UI 4.1