@capgo/capacitor-stream-call 0.0.92 → 0.0.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
package ee.forgr.capacitor.streamcall
|
|
2
2
|
|
|
3
|
-
import TouchInterceptWrapper
|
|
4
3
|
import android.Manifest
|
|
5
4
|
import android.app.Activity
|
|
6
5
|
import android.app.AlertDialog
|
|
@@ -25,6 +24,7 @@ import android.view.View
|
|
|
25
24
|
import android.view.ViewGroup
|
|
26
25
|
import android.view.WindowManager
|
|
27
26
|
import android.widget.FrameLayout
|
|
27
|
+
import java.lang.ref.WeakReference
|
|
28
28
|
import androidx.compose.foundation.layout.fillMaxSize
|
|
29
29
|
import androidx.compose.runtime.collectAsState
|
|
30
30
|
import androidx.compose.runtime.getValue
|
|
@@ -2538,11 +2538,11 @@ class StreamCallPlugin : Plugin() {
|
|
|
2538
2538
|
|
|
2539
2539
|
companion object {
|
|
2540
2540
|
@JvmStatic fun preLoadInit(ctx: Context, app: Application) {
|
|
2541
|
-
holder ?: run {
|
|
2541
|
+
holder?.get() ?: run {
|
|
2542
2542
|
val p = StreamCallPlugin()
|
|
2543
2543
|
p.savedContext = ctx
|
|
2544
2544
|
p.initializeStreamVideo(ctx, app)
|
|
2545
|
-
holder = p
|
|
2545
|
+
holder = WeakReference(p)
|
|
2546
2546
|
|
|
2547
2547
|
// Register lifecycle callback to clean up when all activities are destroyed
|
|
2548
2548
|
app.registerActivityLifecycleCallbacks(object : Application.ActivityLifecycleCallbacks {
|
|
@@ -2556,7 +2556,7 @@ class StreamCallPlugin : Plugin() {
|
|
|
2556
2556
|
activityCount--
|
|
2557
2557
|
// Only clear holder when no activities remain AND no active/ringing calls
|
|
2558
2558
|
if (activityCount <= 0) {
|
|
2559
|
-
val hasActiveCalls = holder?.let { plugin ->
|
|
2559
|
+
val hasActiveCalls = holder?.get()?.let { plugin ->
|
|
2560
2560
|
val client = plugin.streamVideoClient
|
|
2561
2561
|
val hasActive = client?.state?.activeCall?.value != null
|
|
2562
2562
|
val hasRinging = client?.state?.ringingCall?.value != null
|
|
@@ -2578,7 +2578,7 @@ class StreamCallPlugin : Plugin() {
|
|
|
2578
2578
|
})
|
|
2579
2579
|
}
|
|
2580
2580
|
}
|
|
2581
|
-
private var holder: StreamCallPlugin
|
|
2581
|
+
private var holder: WeakReference<StreamCallPlugin>? = null
|
|
2582
2582
|
|
|
2583
2583
|
// Constants for SharedPreferences
|
|
2584
2584
|
private const val API_KEY_PREFS_NAME = "stream_video_api_key_prefs"
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
package ee.forgr.capacitor.streamcall
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.util.AttributeSet
|
|
1
5
|
import android.view.MotionEvent
|
|
2
6
|
import android.view.ViewGroup
|
|
3
7
|
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
@@ -5,10 +9,15 @@ import android.util.Log
|
|
|
5
9
|
import androidx.core.view.isNotEmpty
|
|
6
10
|
import androidx.core.view.isVisible
|
|
7
11
|
|
|
8
|
-
class TouchInterceptWrapper
|
|
9
|
-
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
+
class TouchInterceptWrapper : CoordinatorLayout {
|
|
13
|
+
|
|
14
|
+
constructor(context: Context) : super(context)
|
|
15
|
+
|
|
16
|
+
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
|
17
|
+
|
|
18
|
+
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
|
|
19
|
+
|
|
20
|
+
constructor(originalViewGroup: ViewGroup) : super(originalViewGroup.context) {
|
|
12
21
|
// Copy layout parameters and children
|
|
13
22
|
layoutParams = originalViewGroup.layoutParams
|
|
14
23
|
while (originalViewGroup.isNotEmpty()) {
|
package/package.json
CHANGED