Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
[Android] Naming
Lyubo Marinova5cd1185509f
diff --git a/android/README.md b/android/README.mdindex bf2c9989a1..42957a85ba 100644--- a/android/README.md+++ b/android/README.md@@ -97,7 +97,7 @@ display a Jitsi Meet conference (or a welcome page).#### getListener()-Returns the `JitsiMeetView.Listener` instance attached to the view.+Returns the `JitsiMeetViewListener` instance attached to the view.#### loadURL(url)@@ -106,7 +106,7 @@ is displayed instead.#### setListener(listener)-Sets the given listener (class implementing the `JitsiMeetView.Listener`+Sets the given listener (class implementing the `JitsiMeetViewListener`interface) on the view.#### onBackPressed()@@ -144,10 +144,16 @@ activity's `onNewIntent` method.This is a static method.-#### Listener+#### JitsiMeetViewListener-JitsiMeetView.Listener provides an interface apps can implement in order to get-notified about the state of the Jitsi Meet conference.+`JitsiMeetViewListener` provides an interface apps can implement to listen to+the state of the Jitsi Meet conference displayed in a `JitsiMeetView`.++### JitsiMeetViewAdapter++A default implementation of the `JitsiMeetViewListener` interface. Apps may+extend the class instead of implementing the interface in order to minimize+boilerplate.##### onConferenceFailed@@ -180,10 +186,3 @@ The `data` HashMap contains a "url" key with the conference URL.Called before a conference is left.The `data` HashMap contains a "url" key with the conference URL.--### JitsiMeetViewAbstractListener--Utility (abstract) class with stub methods for the `JitsiMeetView.Listener`-interface. Applications can innherit from this class instead of implementing-the interface in order to avoid adding stubs for methods they don't care about.-diff --git a/android/sdk/.gitignore b/android/sdk/.gitignoredeleted file mode 100644index 796b96d1c4..0000000000--- a/android/sdk/.gitignore+++ /dev/null@@ -1 +0,0 @@-/builddiff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.javaindex e277653937..b298ec0ce4 100644--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java@@ -46,7 +46,7 @@ public class JitsiMeetActivity extends AppCompatActivity {public static final int OVERLAY_PERMISSION_REQ_CODE = 4242;/**- * Instance of the {@JitsiMeetView} which this activity will display.+ * Instance of the {@link JitsiMeetView} which this activity will display.*/private JitsiMeetView view;diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.javaindex 4a443042a5..389dd9f42e 100644--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java@@ -30,7 +30,6 @@ import com.facebook.react.ReactRootView;import com.facebook.react.common.LifecycleState;import java.net.URL;-import java.util.HashMap;public class JitsiMeetView extends FrameLayout {/**@@ -43,7 +42,7 @@ public class JitsiMeetView extends FrameLayout {* Reference to the single instance of this class we currently allow. It's* currently used for fetching the instance from the listener's callbacks.*- * TODO: lift this limitation.+ * TODO: Lift this limitation.*/private static JitsiMeetView instance;@@ -54,10 +53,10 @@ public class JitsiMeetView extends FrameLayout {private static ReactInstanceManager reactInstanceManager;/**- * {@JitsiMeetView.Listener} instance for reporting events occurring in+ * {@link JitsiMeetViewListener} instance for reporting events occurring in* Jitsi Meet.*/- private JitsiMeetView.Listener listener;+ private JitsiMeetViewListener listener;/*** React Native root view.@@ -90,18 +89,19 @@ public class JitsiMeetView extends FrameLayout {/*** Returns the only instance of this class we currently allow creating.*- * @returns The {@JitsiMeetView} instance.+ * @returns The {@code JitsiMeetView} instance.*/public static JitsiMeetView getInstance() {return instance;}/**- * Getter for the {@JitsiMeetView.Listener} set on this view.+ * Gets the {@link JitsiMeetViewListener} set on this {@code JitsiMeetView}.*- * @returns The {@JitsiMeetView.Listener} instance.+ * @returns The {@code JitsiMeetViewListener} set on this+ * {@code JitsiMeetView}.*/- public Listener getListener() {+ public JitsiMeetViewListener getListener() {return listener;}@@ -160,11 +160,13 @@ public class JitsiMeetView extends FrameLayout {}/**- * Setter for the {@JitsiMeetView.Listener} set on this view.+ * Sets a specific {@link JitsiMeetViewListener} on this+ * {@code JitsiMeetView}.*- * @param listener - Listener for this view.+ * @param listener - The {@code JitsiMeetViewListener} to set on this+ * {@code JitsiMeetView}.*/- public void setListener(Listener listener) {+ public void setListener(JitsiMeetViewListener listener) {this.listener = listener;}@@ -237,46 +239,4 @@ public class JitsiMeetView extends FrameLayout {reactInstanceManager.onNewIntent(intent);}}-- /**- * Interface for listening to events coming from Jitsi Meet.- */- public interface Listener {- /**- * Called when joining a conference fails or an ongoing conference is- * interrupted due to a failure.- *- * @param data - HashMap with an "error" key describing the problem, and- * a "url" key with the conference URL.- */- void onConferenceFailed(HashMap<String, Object> data);-- /**- * Called when a conference was joined.- *- * @param data - HashMap with a "url" key with the conference URL.- */- void onConferenceJoined(HashMap<String, Object> data);-- /**- * Called when the conference was left, typically after hanging up.- *- * @param data - HashMap with a "url" key with the conference URL.- */- void onConferenceLeft(HashMap<String, Object> data);-- /**- * Called before the conference is joined.- *- * @param data - HashMap with a "url" key with the conference URL.- */- void onConferenceWillJoin(HashMap<String, Object> data);-- /**- * Called before the conference is left.- *- * @param data - HashMap with a "url" key with the conference URL.- */- void onConferenceWillLeave(HashMap<String, Object> data);- }}diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetViewAbstractListener.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetViewAdapter.javasimilarity index 59%rename from android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetViewAbstractListener.javarename to android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetViewAdapter.javaindex 0fdb42c641..0ae42232f6 100644--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetViewAbstractListener.java+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetViewAdapter.java@@ -16,51 +16,45 @@package org.jitsi.meet.sdk;-import java.util.HashMap;+import java.util.Map;/**- * This class provides a reference implementation for {@JitsiMeetView.Listener} so applications- * don't need to add stubs for all methods in the interface if they are only interested in some.+ * Implements {@link JitsiMeetViewListener} so apps don't have to add stubs for+ * all methods in the interface if they are only interested in some.*/-public abstract class JitsiMeetViewAbstractListener implements JitsiMeetView.Listener {-+public abstract class JitsiMeetViewAdapter implements JitsiMeetViewListener {/*** {@inheritDoc}*/@Override- public void onConferenceFailed(HashMap<String, Object> data) {-+ public void onConferenceFailed(Map<String, Object> data) {}/*** {@inheritDoc}*/@Override- public void onConferenceJoined(HashMap<String, Object> data) {-+ public void onConferenceJoined(Map<String, Object> data) {}/*** {@inheritDoc}*/@Override- public void onConferenceLeft(HashMap<String, Object> data) {-+ public void onConferenceLeft(Map<String, Object> data) {}/*** {@inheritDoc}*/@Override- public void onConferenceWillJoin(HashMap<String, Object> data) {-+ public void onConferenceWillJoin(Map<String, Object> data) {}/*** {@inheritDoc}*/@Override- public void onConferenceWillLeave(HashMap<String, Object> data) {-+ public void onConferenceWillLeave(Map<String, Object> data) {}}diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetViewListener.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetViewListener.javanew file mode 100644index 0000000000..a7bb03ca1c--- /dev/null+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetViewListener.java@@ -0,0 +1,61 @@+/*+ * Copyright @ 2017-present Atlassian Pty Ltd+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++package org.jitsi.meet.sdk;++import java.util.Map;++/**+ * Interface for listening to events coming from Jitsi Meet.+ */+public interface JitsiMeetViewListener {+ /**+ * Called when joining a conference fails or an ongoing conference is+ * interrupted due to a failure.+ *+ * @param data - Map with an "error" key describing the problem, and+ * a "url" key with the conference URL.+ */+ void onConferenceFailed(Map<String, Object> data);++ /**+ * Called when a conference was joined.+ *+ * @param data - Map with a "url" key with the conference URL.+ */+ void onConferenceJoined(Map<String, Object> data);++ /**+ * Called when the conference was left, typically after hanging up.+ *+ * @param data - Map with a "url" key with the conference URL.+ */+ void onConferenceLeft(Map<String, Object> data);++ /**+ * Called before the conference is joined.+ *+ * @param data - Map with a "url" key with the conference URL.+ */+ void onConferenceWillJoin(Map<String, Object> data);++ /**+ * Called before the conference is left.+ *+ * @param data - Map with a "url" key with the conference URL.+ */+ void onConferenceWillLeave(Map<String, Object> data);+}diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/externalapi/ExternalAPIModule.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/externalapi/ExternalAPIModule.javaindex 6cd727da92..ef921922af 100644--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/externalapi/ExternalAPIModule.java+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/externalapi/ExternalAPIModule.java@@ -22,6 +22,7 @@ import com.facebook.react.bridge.ReactMethod;import com.facebook.react.bridge.ReadableMap;import org.jitsi.meet.sdk.JitsiMeetView;+import org.jitsi.meet.sdk.JitsiMeetViewListener;import java.util.HashMap;@@ -67,7 +68,7 @@ public class ExternalAPIModule extends ReactContextBaseJavaModule {@ReactMethodpublic void sendEvent(final String name, ReadableMap data) {JitsiMeetView view = JitsiMeetView.getInstance();- JitsiMeetView.Listener listener+ JitsiMeetViewListener listener= view != null ? view.getListener() : null;if (listener == null) {@@ -84,18 +85,22 @@ public class ExternalAPIModule extends ReactContextBaseJavaModule {dataMap.put("url", data.getString("url"));listener.onConferenceFailed(dataMap);break;+case "CONFERENCE_JOINED":dataMap.put("url", data.getString("url"));listener.onConferenceJoined(dataMap);break;+case "CONFERENCE_LEFT":dataMap.put("url", data.getString("url"));listener.onConferenceLeft(dataMap);break;+case "CONFERENCE_WILL_JOIN":dataMap.put("url", data.getString("url"));listener.onConferenceWillJoin(dataMap);break;+case "CONFERENCE_WILL_LEAVE":dataMap.put("url", data.getString("url"));listener.onConferenceWillLeave(dataMap);