Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement floating "chat head" bubble #35

Merged
merged 6 commits into from
Aug 30, 2021

Conversation

dkramer95
Copy link
Contributor

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

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

image

Demo:

float-bubble-demo.mov

    * Add WindowControl toggles to minimize to bubble and exit (TODO
      need nice icons instead of ugly color placeholders)
    * Move minimize button to left side and exit to far right
    * Remove focus when displaying as bubble
    * Focus window if top control bar is tapped
    * Replace minimize button listener w/ expression lambda
@dkramer95 dkramer95 requested a review from a user August 22, 2021 22:11
@agnostic-apollo agnostic-apollo requested review from agnostic-apollo and removed request for a user August 29, 2021 00:37
Copy link
Member

@agnostic-apollo agnostic-apollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move drawable-anydpi-v26/round_button_with_outline.xml to drawable/round_button_with_outline.xml otherwise will cause missing resource crash on lower versions.

Also the float button requires clicking on the bottom right to open if minimized. Clicking on center does not work. If reproducible and fixable, then do it.

Thanks

    * Ignore window control touch interception if window controls are
      not visible
@dkramer95
Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Contributor Author

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.

Copy link
Member

@agnostic-apollo agnostic-apollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working fine now. Unless new changes suggested by grimler needs to be added, this can be merged. Although, button to disable and/or hide keyboard, like in termux-app could be more useful. I don't use the plugin myself, so up to others what suits their usability needs.

@dkramer95 dkramer95 merged commit 17a76b2 into termux:master Aug 30, 2021
@dkramer95 dkramer95 deleted the floating-bubble branch August 30, 2021 22:14
@agnostic-apollo
Copy link
Member

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

@dkramer95
Copy link
Contributor Author

@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
Copy link
Member

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants