Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions library/android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/usr/lib/jvm/java-11-openjdk-amd64
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ public void showFloatingBubble(int x, int y, final Promise promise) {
}
}

@ReactMethod // Notates a method that should be exposed to React
public void isBubbleOpen(final Promise promise) {
try {
promise.resolve(this.bubbleView != null);
} catch (Exception e) {
promise.reject("");
}
}

@ReactMethod // Notates a method that should be exposed to React
public void hideFloatingBubble(final Promise promise) {
try {
Expand Down
16 changes: 12 additions & 4 deletions library/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@

import { NativeModules } from 'react-native';
import { NativeModules } from "react-native";

const { RNFloatingBubble } = NativeModules;

export const reopenApp = () => RNFloatingBubble.reopenApp();
export const showFloatingBubble = (x = 50, y = 100) => RNFloatingBubble.showFloatingBubble(x, y);
export const showFloatingBubble = (x = 50, y = 100) =>
RNFloatingBubble.showFloatingBubble(x, y);
export const hideFloatingBubble = () => RNFloatingBubble.hideFloatingBubble();
export const checkPermission = () => RNFloatingBubble.checkPermission();
export const requestPermission = () => RNFloatingBubble.requestPermission();
export const initialize = () => RNFloatingBubble.initialize();
export const isBubbleOpen = () => RNFloatingBubble.isBubbleOpen();

export default { showFloatingBubble, hideFloatingBubble, requestPermission, checkPermission, initialize, reopenApp };
export default {
showFloatingBubble,
hideFloatingBubble,
requestPermission,
checkPermission,
initialize,
isBubbleOpen,
};