termux / termux-float

Termux add-on app to show the terminal in a floating terminal window.
https://f-droid.org/en/packages/com.termux.window
Other
465 stars 77 forks source link

Implement floating "chat head" bubble #35

Closed dkramer95 closed 3 years ago

dkramer95 commented 3 years ago

Implement new bubble / "chat head" minimize functionality (#23)

Adds new top window controls panel w/ minimize and exit buttons:

image

Demo:

https://user-images.githubusercontent.com/6166095/130371420-04a0b35e-6a3a-4782-a8a9-c926d6b1b81d.mov

dkramer95 commented 3 years ago

Move drawable-anydpi-v26/round_button_with_outline.xml to drawable/round_button_with_outline.xml

Done

Also the float button requires clicking on the bottom right to open if minimized. Clicking on center does not work.

Tapping on center has worked for me on the 4 devices I've tested with.. I did find issue if you tap near very top it wasn't working, so I added a fix. Hopefully that will fix your issue as well.

Grimler91 commented 3 years ago

Clicking anywhere in the bubble to restore it to full size works for me as well.

It is not possible to long press the top bar to resize or move the window, I have to press the terminal area. Not really a big problem, but the top menu bar feels like the intuitive place to press for moving or re-size a window

dkramer95 commented 3 years ago

It is not possible to long press the top bar to resize or move the window, I have to press the terminal area.

Ya I encountered this as well. One idea I think would be useful is to add more controls to the remaining space (such as a hide/show/disable keyboard, settings, etc..) in future and keep this space reserved for those actions. That way touching an item doesn't accidentally cause a change to the terminal window.

agnostic-apollo commented 3 years ago

@dkramer95 Do you plan on adding anything else before I make a release?

dkramer95 commented 3 years ago

@agnostic-apollo There is a minor issue of bubble size on some display densities so I will be adding a fix to use dp instead of px. Then I'd say it's good for release. I do want to add more to it in future such as user customizable options but that can wait for subsequent release!

agnostic-apollo commented 3 years ago

Yeah definitely use dp, there is a util for that too, ViewUtils.dpTopx().

I tried setting the default width and height to half the display size x/y, but that was throwing an exception due to Context issue. There are probably other ways to get it, but its not too big an issue since user only needs to change it once at install time.

Also check latest changes in master and see if app is working fine for you if you have time.

For future, the most important thing would be to disable long press for changing size. This prevents copy/paste menu from showing. I disabled it myself which then started showing the selectors but for some reason the menu above them wouldn't show, I am not sure what's causing that, there are other touch listeners that might be causing it, didn't have time to look into it. The resizing option can be added to top level bar as a button, but preferable in a drop down so that more options can be added.