Howdy yall, I'm working on creating a react native package that utilizes this package. Ive got the bubble showing up and all that works fine. I have created the secondary layout that should show up on bubble press however whenever i try to use the findViewById method in my case since its across a native bridge it's reactContext.getCurrentActivity().findViewById(r.id.layout) it's just returning null. The layout ive added is in the bubble_layout file yet i cant seem to figure out why all im getting is null. any help is appreciated thanks!
heres an example of what im trying to do
update
so i have found out how to add the view on press however the code below is causing a second bubble to pop up which is resulting in a crash :/ on top of that the view only expands while in the app so i i still have some issues im working through if anyone has a tip that would be awesome
private void addNewBubble(int x, int y) {
this.removeBubble();
bubbleView =
(BubbleLayout) LayoutInflater
.from(reactContext)
.inflate(R.layout.bubble_layout, null);
bubbleView.setOnBubbleRemoveListener(
new BubbleLayout.OnBubbleRemoveListener() {
@Override
public void onBubbleRemoved(BubbleLayout bubble) {
bubbleView = null;
sendEvent("floating-bubble-remove");
}
}
);
bubbleView.setOnBubbleClickListener(
new BubbleLayout.OnBubbleClickListener() {
@Override
public void onBubbleClick(BubbleLayout bubble) {
reactContext.getCurrentActivity().setContentView(R.layout.bubble_layout); <-- this was the only way to get the code below to not return null for notification layout i have found
notificationLayout = reactContext.getCurrentActivity().findViewById(R.id.notification_layout);
System.out.println(notificationLayout); <-- this prints null
System.out.println(bubble);
if (notificationLayout.getVisibility() == View.GONE) {
notificationLayout.setVisibility(View.VISIBLE);
} else {
notificationLayout.setVisibility(View.GONE);
}
sendEvent("floating-bubble-press");
}
}
);
bubbleView.setShouldStickToWall(true);
bubblesManager.addBubble(bubbleView, x, y);
}
Howdy yall, I'm working on creating a react native package that utilizes this package. Ive got the bubble showing up and all that works fine. I have created the secondary layout that should show up on bubble press however whenever i try to use the
findViewById
method in my case since its across a native bridge it'sreactContext.getCurrentActivity().findViewById(r.id.layout)
it's just returning null. The layout ive added is in the bubble_layout file yet i cant seem to figure out why all im getting is null. any help is appreciated thanks!heres an example of what im trying to do
update
so i have found out how to add the view on press however the code below is causing a second bubble to pop up which is resulting in a crash :/ on top of that the view only expands while in the app so i i still have some issues im working through if anyone has a tip that would be awesome