Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Declaring MyClass in a separate file causes the bubble to not show up #46

Closed
4 tasks done
kqvanity opened this issue Sep 16, 2023 · 7 comments
Closed
4 tasks done
Labels
Bug Something isn't working

Comments

@kqvanity
Copy link

Steps to reproduce

  1. Declare the intent within the MainActivity.kt file.
  2. Declare the MyClasss class within the same file.
  3. After configuring the method of that class run
  4. The bubble will show up
  5. Modularize the code by getting MyClass in a separate file
  6. Now the bubble doesn't show up

Expected behavior

The bubble shows up whether MyClass is declared within the MainActivity file or another separate file.

Actual behavior

The bubble shows up, only when MyClass is declared within the same file.

Crash logs

No crash logs. It just doesn't show up silently.

Floating-Bubble-View version

0.6.1

Android version

10

Device

Huwawei MRD-LX1F

Other details

I'm using a physical device for testing

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
  • I have written a short but informative title.
  • I have updated the library to the latest Version.
  • I will fill out all of the requested information in this form.
@kqvanity kqvanity added the Bug Something isn't working label Sep 16, 2023
@dofire
Copy link
Owner

dofire commented Sep 16, 2023

Hi @z0xyz 👋,

I don't think the issue comes from the library itself, you mentioned that the issue appears when you extract the service class to a separated file. Did you check the name of the service class in your manifest file?

...
     <service
+         android:name="<YOUR_PACKAGE>.MyService"
         android:foregroundServiceType="specialUse"
         >
         <property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE" android:value="foo"/>  <!-- optional -->
     </service>
...

Thank you 💖

@kqvanity
Copy link
Author

Thanks. That resolved the problem. Thanks for your help.

@kqvanity
Copy link
Author

kqvanity commented Sep 16, 2023

I still have another issue that popped out

  • Soft keyboard doesn't show up when selecting any text field at the expanded bubble. I'm using Jetpack compose for the expanded bubble not views. I've also looked at the sample app, but found you're only using views with the expanded form.

I was also wondering if there was a convenient way / code sample to incorporate Text selection event listener with chat bubbles. REF. For example showing the floating bubble when the context menu option is selected, then passing this text to the bubble/Expanded bubble. I was thinking of an Android service, but was wondering if you think this library would have a better/ more straightforward approach.

@dofire
Copy link
Owner

dofire commented Sep 17, 2023

Soft keyboard doesn't show up when selecting any text field at the expanded bubble

Thank you for reminding me, v0.6.2 has fixed this issue

you think this library would have a better/ more straightforward approach.

AFAIK, you can create an activity just for receiving the highlighted text, and call finish() after ran the service sample

@kqvanity
Copy link
Author

kqvanity commented Sep 18, 2023

v0.6.2 has fixed this issue

Great thanks!

you can create an activity just for receiving the highlighted text, and call finish() after ran the service

I've tried to achieve that. In fact, I already did before on an XML project, but now that I'm using compose creating an activity class extending ComponentActivity just gives me an overlay of a white background.

@kqvanity
Copy link
Author

kqvanity commented Sep 18, 2023

Unlike the previous version, the latest one 0.6.2 automatically fills the entire screen, making items behind the floating bubble non-interactive, unless the bubble is closed.
I used to hack around it in the previous version by having a column that fills the entire screen, but coincidentally/unironically after I updated to the latest version, now I want the previous behavior.
I was wondering if this behavior could be toggled/opt-in feature.

@dofire
Copy link
Owner

dofire commented Sep 19, 2023

Hi @z0xyz 👋,

Thanks for your suggestion, I'll support it if possible.

You can do magic like this:

Update expandedBubble layoutParams.flag before calling expand(). note that if you add FLAG_NOT_FOCUSABLE, you won't be able to show the soft keyboard, like you mentioned above

expandedBubble?.layoutParams?.flags = 
                    WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS or
+                    WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
                    WindowManager.LayoutParams.FLAG_DIM_BEHIND

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants