react-native-telecom 0.0.0-stage → 0.1.1

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.
Files changed (57) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +321 -2
  3. package/Telecom.podspec +20 -0
  4. package/android/build.gradle +58 -0
  5. package/android/src/main/AndroidManifest.xml +43 -0
  6. package/android/src/main/java/com/telecom/CallSession.kt +37 -0
  7. package/android/src/main/java/com/telecom/CallSessionManager.kt +486 -0
  8. package/android/src/main/java/com/telecom/TelecomAudioRouter.kt +227 -0
  9. package/android/src/main/java/com/telecom/TelecomAvatarLoader.kt +77 -0
  10. package/android/src/main/java/com/telecom/TelecomCallService.kt +395 -0
  11. package/android/src/main/java/com/telecom/TelecomCallUi.kt +65 -0
  12. package/android/src/main/java/com/telecom/TelecomInCallActivity.kt +285 -0
  13. package/android/src/main/java/com/telecom/TelecomIncomingCallActivity.kt +171 -0
  14. package/android/src/main/java/com/telecom/TelecomModule.kt +189 -0
  15. package/android/src/main/java/com/telecom/TelecomPackage.kt +31 -0
  16. package/android/src/main/java/com/telecom/TelecomPushBridge.kt +82 -0
  17. package/android/src/main/java/com/telecom/TelecomRingtonePlayer.kt +109 -0
  18. package/android/src/main/java/com/telecom/TelecomUiConfig.kt +27 -0
  19. package/android/src/main/res/drawable/rn_telecom_action_pill.xml +6 -0
  20. package/android/src/main/res/drawable/rn_telecom_answer_circle.xml +8 -0
  21. package/android/src/main/res/drawable/rn_telecom_answer_circle_green.xml +8 -0
  22. package/android/src/main/res/drawable/rn_telecom_avatar_bg.xml +6 -0
  23. package/android/src/main/res/drawable/rn_telecom_avatar_circle.xml +12 -0
  24. package/android/src/main/res/drawable/rn_telecom_btn_answer.xml +6 -0
  25. package/android/src/main/res/drawable/rn_telecom_btn_decline.xml +6 -0
  26. package/android/src/main/res/drawable/rn_telecom_btn_message.xml +9 -0
  27. package/android/src/main/res/drawable/rn_telecom_btn_secondary.xml +6 -0
  28. package/android/src/main/res/drawable/rn_telecom_control_circle.xml +8 -0
  29. package/android/src/main/res/drawable/rn_telecom_control_circle_on.xml +8 -0
  30. package/android/src/main/res/drawable/rn_telecom_decline_circle.xml +8 -0
  31. package/android/src/main/res/drawable/rn_telecom_ic_call.xml +10 -0
  32. package/android/src/main/res/drawable/rn_telecom_ic_call_end.xml +16 -0
  33. package/android/src/main/res/drawable/rn_telecom_ic_call_white.xml +10 -0
  34. package/android/src/main/res/drawable/rn_telecom_ic_dialpad.xml +13 -0
  35. package/android/src/main/res/drawable/rn_telecom_ic_hold.xml +10 -0
  36. package/android/src/main/res/drawable/rn_telecom_ic_message.xml +10 -0
  37. package/android/src/main/res/drawable/rn_telecom_ic_mic.xml +10 -0
  38. package/android/src/main/res/drawable/rn_telecom_ic_mic_off.xml +10 -0
  39. package/android/src/main/res/drawable/rn_telecom_ic_speaker.xml +10 -0
  40. package/android/src/main/res/layout/rn_telecom_control_item.xml +36 -0
  41. package/android/src/main/res/layout/rn_telecom_incall.xml +168 -0
  42. package/android/src/main/res/layout/rn_telecom_incoming_call.xml +188 -0
  43. package/ios/Telecom.h +5 -0
  44. package/ios/Telecom.mm +66 -0
  45. package/lib/module/NativeTelecom.js +5 -0
  46. package/lib/module/NativeTelecom.js.map +1 -0
  47. package/lib/module/index.js +102 -0
  48. package/lib/module/index.js.map +1 -0
  49. package/lib/module/package.json +1 -0
  50. package/lib/typescript/package.json +1 -0
  51. package/lib/typescript/src/NativeTelecom.d.ts +40 -0
  52. package/lib/typescript/src/NativeTelecom.d.ts.map +1 -0
  53. package/lib/typescript/src/index.d.ts +104 -0
  54. package/lib/typescript/src/index.d.ts.map +1 -0
  55. package/package.json +154 -4
  56. package/src/NativeTelecom.ts +55 -0
  57. package/src/index.tsx +217 -0
@@ -0,0 +1,82 @@
1
+ package com.telecom
2
+
3
+ import android.content.Context
4
+ import android.util.Log
5
+
6
+ /**
7
+ * Native entry for FCM / push data messages when the JS runtime may be dead.
8
+ *
9
+ * Expected data keys (string values):
10
+ * - `uuid` or `callUUID` (required)
11
+ * - `handle` or `number` (required)
12
+ * - `callerName` or `name` (optional)
13
+ * - `hasVideo` ("true"/"1")
14
+ * - `autoAnswer` ("true"/"1")
15
+ * - `avatarUrl` or `avatar` (optional https/file url)
16
+ *
17
+ * Call from your `FirebaseMessagingService.onMessageReceived` for high-priority
18
+ * data messages with `type=incoming_call` (or always if your payload is call-only).
19
+ */
20
+ object TelecomPushBridge {
21
+ private const val TAG = "RNTelecomPush"
22
+
23
+ @JvmStatic
24
+ fun isIncomingCallPayload(data: Map<String, String>): Boolean {
25
+ val type = data["type"] ?: data["callType"] ?: ""
26
+ if (type.equals("incoming_call", ignoreCase = true) ||
27
+ type.equals("call", ignoreCase = true)
28
+ ) {
29
+ return true
30
+ }
31
+ val uuid = data["uuid"] ?: data["callUUID"]
32
+ val handle = data["handle"] ?: data["number"]
33
+ return !uuid.isNullOrBlank() && !handle.isNullOrBlank()
34
+ }
35
+
36
+ /**
37
+ * @return true if an incoming call UI was started
38
+ */
39
+ @JvmStatic
40
+ fun handleIncomingCall(context: Context, data: Map<String, String>): Boolean {
41
+ if (!isIncomingCallPayload(data)) {
42
+ Log.i(TAG, "payload ignored — not an incoming call")
43
+ return false
44
+ }
45
+
46
+ val uuid = (data["uuid"] ?: data["callUUID"]).orEmpty()
47
+ val handle = (data["handle"] ?: data["number"]).orEmpty()
48
+ if (uuid.isBlank() || handle.isBlank()) {
49
+ Log.w(TAG, "payload missing uuid/handle")
50
+ return false
51
+ }
52
+
53
+ val callerName = data["callerName"] ?: data["name"] ?: handle
54
+ val hasVideo = truthy(data["hasVideo"])
55
+ val autoAnswer = truthy(data["autoAnswer"])
56
+ val avatarUrl = data["avatarUrl"] ?: data["avatar"] ?: ""
57
+
58
+ val appContext = context.applicationContext
59
+ val manager =
60
+ CallSessionManager.instance
61
+ ?: CallSessionManager(appContext) { _, _ ->
62
+ // JS may be dead; events are no-op until module binds.
63
+ }.also {
64
+ it.setup(supportsVideo = true)
65
+ }
66
+
67
+ Log.i(TAG, "push → displayIncomingCall uuid=$uuid handle=$handle")
68
+ manager.displayIncomingCall(
69
+ uuid = uuid,
70
+ handle = handle,
71
+ callerName = callerName,
72
+ hasVideo = hasVideo,
73
+ autoAnswer = autoAnswer,
74
+ avatarUrl = avatarUrl,
75
+ )
76
+ return true
77
+ }
78
+
79
+ private fun truthy(value: String?): Boolean {
80
+ return value.equals("true", ignoreCase = true) || value == "1" || value.equals("yes", ignoreCase = true)
81
+ }
82
+ }
@@ -0,0 +1,109 @@
1
+ package com.telecom
2
+
3
+ import android.content.Context
4
+ import android.media.AudioAttributes
5
+ import android.media.AudioManager
6
+ import android.media.Ringtone
7
+ import android.media.RingtoneManager
8
+ import android.os.Build
9
+ import android.os.VibrationEffect
10
+ import android.os.Vibrator
11
+ import android.os.VibratorManager
12
+ import android.util.Log
13
+
14
+ /**
15
+ * Plays the **user's default ringtone + vibration** from system settings.
16
+ * Notification-channel sound alone is often silenced by OEMs while the app is
17
+ * foreground / showing a full-screen Activity — so we ring ourselves.
18
+ */
19
+ internal object TelecomRingtonePlayer {
20
+ private const val TAG = "RNTelecomRingtone"
21
+ private var ringtone: Ringtone? = null
22
+ private var vibrator: Vibrator? = null
23
+
24
+ @Synchronized
25
+ fun start(context: Context) {
26
+ stop()
27
+
28
+ try {
29
+ val uri =
30
+ RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE)
31
+ ?: RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE)
32
+
33
+ val tone = RingtoneManager.getRingtone(context, uri)
34
+ if (tone != null) {
35
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
36
+ tone.isLooping = true
37
+ }
38
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
39
+ tone.audioAttributes =
40
+ AudioAttributes.Builder()
41
+ .setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE)
42
+ .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
43
+ .build()
44
+ }
45
+ // Respect silent / vibrate modes via ringer mode.
46
+ val am = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager
47
+ when (am.ringerMode) {
48
+ AudioManager.RINGER_MODE_SILENT -> {
49
+ Log.i(TAG, "ringerMode=SILENT — no sound")
50
+ }
51
+ AudioManager.RINGER_MODE_VIBRATE -> {
52
+ Log.i(TAG, "ringerMode=VIBRATE — vibrate only")
53
+ startVibrate(context)
54
+ }
55
+ else -> {
56
+ tone.play()
57
+ ringtone = tone
58
+ startVibrate(context)
59
+ Log.i(TAG, "playing default ringtone uri=$uri")
60
+ }
61
+ }
62
+ }
63
+ } catch (error: Exception) {
64
+ Log.e(TAG, "start failed: ${error.message}", error)
65
+ }
66
+ }
67
+
68
+ @Synchronized
69
+ fun stop() {
70
+ val tone = ringtone
71
+ ringtone = null
72
+ try {
73
+ if (tone?.isPlaying == true) {
74
+ tone.stop()
75
+ } else {
76
+ tone?.stop()
77
+ }
78
+ } catch (_: Exception) {
79
+ }
80
+ val vib = vibrator
81
+ vibrator = null
82
+ try {
83
+ vib?.cancel()
84
+ } catch (_: Exception) {
85
+ }
86
+ Log.i(TAG, "ringtone + vibrate stopped")
87
+ }
88
+
89
+ private fun startVibrate(context: Context) {
90
+ val vib =
91
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
92
+ val vm = context.getSystemService(Context.VIBRATOR_MANAGER_SERVICE) as VibratorManager
93
+ vm.defaultVibrator
94
+ } else {
95
+ @Suppress("DEPRECATION")
96
+ context.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
97
+ }
98
+
99
+ vibrator = vib
100
+ // Classic ring pattern: wait, buzz, wait, buzz...
101
+ val pattern = longArrayOf(0, 1000, 1000, 1000)
102
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
103
+ vib.vibrate(VibrationEffect.createWaveform(pattern, 0))
104
+ } else {
105
+ @Suppress("DEPRECATION")
106
+ vib.vibrate(pattern, 0)
107
+ }
108
+ }
109
+ }
@@ -0,0 +1,27 @@
1
+ package com.telecom
2
+
3
+ /**
4
+ * Appearance / behavior knobs for the incoming full-screen host Activity.
5
+ * Apps can change these at runtime via [TelecomModule.setup] / JS `setup({ ui: ... })`.
6
+ * Layout resource `R.layout.rn_telecom_incoming_call` can also be overridden by the host app.
7
+ */
8
+ data class TelecomUiConfig(
9
+ val incomingTitle: String = "Incoming call",
10
+ val answerLabel: String = "Answer",
11
+ val declineLabel: String = "Decline",
12
+ val messageLabel: String = "Message",
13
+ /** Light Material You cream — matches stock Android incoming UI. */
14
+ val backgroundColor: Int = 0xFFF7F4EF.toInt(),
15
+ val titleColor: Int = 0xFF79747E.toInt(),
16
+ val nameColor: Int = 0xFF1C1B1F.toInt(),
17
+ val handleColor: Int = 0xFF49454F.toInt(),
18
+ val answerColor: Int = 0xFF1B5E20.toInt(),
19
+ val declineColor: Int = 0xFF1C1B1F.toInt(),
20
+ /** When false, only the native CallStyle notification is shown (no Activity). */
21
+ val launchFullScreenOnIncoming: Boolean = true,
22
+ ) {
23
+ companion object {
24
+ @Volatile
25
+ var current: TelecomUiConfig = TelecomUiConfig()
26
+ }
27
+ }
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:shape="rectangle">
4
+ <solid android:color="#FFE8E4DE" />
5
+ <corners android:radius="48dp" />
6
+ </shape>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:shape="oval">
4
+ <solid android:color="#FFFFFFFF" />
5
+ <size
6
+ android:width="64dp"
7
+ android:height="64dp" />
8
+ </shape>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:shape="oval">
4
+ <solid android:color="#FF1B5E20" />
5
+ <size
6
+ android:width="72dp"
7
+ android:height="72dp" />
8
+ </shape>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:shape="oval">
4
+ <solid android:color="#1F2937" />
5
+ <size android:width="88dp" android:height="88dp" />
6
+ </shape>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:shape="oval">
4
+ <gradient
5
+ android:angle="135"
6
+ android:endColor="#FF69F0AE"
7
+ android:startColor="#FF1B5E20"
8
+ android:type="linear" />
9
+ <size
10
+ android:width="168dp"
11
+ android:height="168dp" />
12
+ </shape>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:shape="rectangle">
4
+ <solid android:color="#43A047" />
5
+ <corners android:radius="28dp" />
6
+ </shape>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:shape="rectangle">
4
+ <solid android:color="#E53935" />
5
+ <corners android:radius="28dp" />
6
+ </shape>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:shape="rectangle">
4
+ <solid android:color="#00FFFFFF" />
5
+ <stroke
6
+ android:width="1.5dp"
7
+ android:color="#FFCAC4D0" />
8
+ <corners android:radius="24dp" />
9
+ </shape>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:shape="rectangle">
4
+ <solid android:color="#2A2A2A" />
5
+ <corners android:radius="28dp" />
6
+ </shape>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:shape="oval">
4
+ <solid android:color="#FFE8E4DE" />
5
+ <size
6
+ android:width="60dp"
7
+ android:height="60dp" />
8
+ </shape>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:shape="oval">
4
+ <solid android:color="#FF1C1B1F" />
5
+ <size
6
+ android:width="60dp"
7
+ android:height="60dp" />
8
+ </shape>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:shape="oval">
4
+ <solid android:color="#FFE53935" />
5
+ <size
6
+ android:width="72dp"
7
+ android:height="72dp" />
8
+ </shape>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:width="24dp"
4
+ android:height="24dp"
5
+ android:viewportWidth="24"
6
+ android:viewportHeight="24">
7
+ <path
8
+ android:fillColor="#FF1B5E20"
9
+ android:pathData="M6.62,10.79c1.44,2.83 3.76,5.14 6.59,6.59l2.2,-2.2c0.27,-0.27 0.67,-0.36 1.02,-0.24 1.12,0.37 2.33,0.57 3.57,0.57 0.55,0 1,0.45 1,1V20c0,0.55 -0.45,1 -1,1 -9.39,0 -17,-7.61 -17,-17 0,-0.55 0.45,-1 1,-1h3.5c0.55,0 1,0.45 1,1 0,1.25 0.2,2.45 0.57,3.57 0.11,0.35 0.03,0.74 -0.25,1.02l-2.2,2.2z" />
10
+ </vector>
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:width="24dp"
4
+ android:height="24dp"
5
+ android:viewportWidth="24"
6
+ android:viewportHeight="24">
7
+ <!-- Hang-up style: phone rotated -->
8
+ <group
9
+ android:pivotX="12"
10
+ android:pivotY="12"
11
+ android:rotation="135">
12
+ <path
13
+ android:fillColor="#FFFFFFFF"
14
+ android:pathData="M6.62,10.79c1.44,2.83 3.76,5.14 6.59,6.59l2.2,-2.2c0.27,-0.27 0.67,-0.36 1.02,-0.24 1.12,0.37 2.33,0.57 3.57,0.57 0.55,0 1,0.45 1,1V20c0,0.55 -0.45,1 -1,1 -9.39,0 -17,-7.61 -17,-17 0,-0.55 0.45,-1 1,-1h3.5c0.55,0 1,0.45 1,1 0,1.25 0.2,2.45 0.57,3.57 0.11,0.35 0.03,0.74 -0.25,1.02l-2.2,2.2z" />
15
+ </group>
16
+ </vector>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:width="24dp"
4
+ android:height="24dp"
5
+ android:viewportWidth="24"
6
+ android:viewportHeight="24">
7
+ <path
8
+ android:fillColor="#FFFFFFFF"
9
+ android:pathData="M6.62,10.79c1.44,2.83 3.76,5.14 6.59,6.59l2.2,-2.2c0.27,-0.27 0.67,-0.36 1.02,-0.24 1.12,0.37 2.33,0.57 3.57,0.57 0.55,0 1,0.45 1,1V20c0,0.55 -0.45,1 -1,1 -9.39,0 -17,-7.61 -17,-17 0,-0.55 0.45,-1 1,-1h3.5c0.55,0 1,0.45 1,1 0,1.25 0.2,2.45 0.57,3.57 0.11,0.35 0.03,0.74 -0.25,1.02l-2.2,2.2z" />
10
+ </vector>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:width="24dp"
4
+ android:height="24dp"
5
+ android:viewportWidth="24"
6
+ android:viewportHeight="24">
7
+ <path
8
+ android:fillColor="#FF1C1B1F"
9
+ android:pathData="M12,19c0.83,0 1.5,-0.67 1.5,-1.5h-3c0,0.83 0.67,1.5 1.5,1.5zM17.25,16.5H6.75v-1.5h10.5v1.5zM19,4H5C3.9,4 3,4.9 3,6v8c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2zM19,14H5V6h14v8z" />
10
+ <path
11
+ android:fillColor="#FF1C1B1F"
12
+ android:pathData="M8,8h2v2H8zM11,8h2v2h-2zM14,8h2v2h-2zM8,11h2v2H8zM11,11h2v2h-2zM14,11h2v2h-2z" />
13
+ </vector>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:width="24dp"
4
+ android:height="24dp"
5
+ android:viewportWidth="24"
6
+ android:viewportHeight="24">
7
+ <path
8
+ android:fillColor="#FF1C1B1F"
9
+ android:pathData="M6,19h4V5H6v14zM14,5v14h4V5h-4z" />
10
+ </vector>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:width="18dp"
4
+ android:height="18dp"
5
+ android:viewportWidth="24"
6
+ android:viewportHeight="24">
7
+ <path
8
+ android:fillColor="#FF49454F"
9
+ android:pathData="M20,2H4c-1.1,0 -2,0.9 -2,2v18l4,-4h14c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zM20,16H5.17L4,17.17V4h16v12z" />
10
+ </vector>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:width="24dp"
4
+ android:height="24dp"
5
+ android:viewportWidth="24"
6
+ android:viewportHeight="24">
7
+ <path
8
+ android:fillColor="#FF1C1B1F"
9
+ android:pathData="M12,14c1.66,0 2.99,-1.34 2.99,-3L15,5c0,-1.66 -1.34,-3 -3,-3S9,3.34 9,5v6c0,1.66 1.34,3 3,3zM17.3,11c0,3 -2.54,5.1 -5.3,5.1S6.7,14 6.7,11H5c0,3.41 2.72,6.23 6,6.72V21h2v-3.28c3.28,-0.48 6,-3.3 6,-6.72h-1.7z" />
10
+ </vector>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:width="24dp"
4
+ android:height="24dp"
5
+ android:viewportWidth="24"
6
+ android:viewportHeight="24">
7
+ <path
8
+ android:fillColor="#FF1C1B1F"
9
+ android:pathData="M19,11h-1.7c0,0.74 -0.16,1.43 -0.43,2.05l1.23,1.23c0.56,-0.98 0.9,-2.09 0.9,-3.28zM14.98,11.17c0,-0.06 0.02,-0.11 0.02,-0.17V5c0,-1.66 -1.34,-3 -3,-3S9,3.34 9,5v0.18l5.98,5.99zM4.27,3L3,4.27l6.01,6.01V11c0,1.66 1.33,3 2.99,3 0.22,0 0.44,-0.03 0.65,-0.08l1.66,1.66c-0.71,0.33 -1.5,0.52 -2.31,0.52 -2.76,0 -5.3,-2.1 -5.3,-5.1H5c0,3.41 2.72,6.23 6,6.72V21h2v-3.28c0.91,-0.13 1.77,-0.45 2.54,-0.9L19.73,21 21,19.73 4.27,3z" />
10
+ </vector>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:width="24dp"
4
+ android:height="24dp"
5
+ android:viewportWidth="24"
6
+ android:viewportHeight="24">
7
+ <path
8
+ android:fillColor="#FF1C1B1F"
9
+ android:pathData="M3,9v6h4l5,5V4L7,9H3zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,3.23v2.06c2.89,0.86 5,3.54 5,6.71s-2.11,5.85 -5,6.71v2.06c4.01,-0.91 7,-4.49 7,-8.77s-2.99,-7.86 -7,-8.77z" />
10
+ </vector>
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+ android:layout_width="match_parent"
4
+ android:layout_height="wrap_content"
5
+ android:gravity="center"
6
+ android:orientation="vertical"
7
+ android:clickable="true"
8
+ android:focusable="true"
9
+ android:background="?android:attr/selectableItemBackgroundBorderless"
10
+ android:paddingTop="4dp"
11
+ android:paddingBottom="4dp">
12
+
13
+ <FrameLayout
14
+ android:id="@+id/rn_telecom_control_icon_bg"
15
+ android:layout_width="60dp"
16
+ android:layout_height="60dp"
17
+ android:background="@drawable/rn_telecom_control_circle">
18
+
19
+ <ImageView
20
+ android:id="@+id/rn_telecom_control_icon"
21
+ android:layout_width="26dp"
22
+ android:layout_height="26dp"
23
+ android:layout_gravity="center"
24
+ android:contentDescription="@null"
25
+ android:importantForAccessibility="no" />
26
+ </FrameLayout>
27
+
28
+ <TextView
29
+ android:id="@+id/rn_telecom_control_label"
30
+ android:layout_width="wrap_content"
31
+ android:layout_height="wrap_content"
32
+ android:layout_marginTop="8dp"
33
+ android:gravity="center"
34
+ android:textColor="#FF1C1B1F"
35
+ android:textSize="12sp" />
36
+ </LinearLayout>
@@ -0,0 +1,168 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ Outgoing + in-call screen (Material You / Pixel style).
4
+ Host apps can override via res/layout/rn_telecom_incall.xml
5
+ -->
6
+ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
7
+ android:id="@+id/rn_telecom_incall_root"
8
+ android:layout_width="match_parent"
9
+ android:layout_height="match_parent"
10
+ android:background="#FFF7F4EF"
11
+ android:fitsSystemWindows="true">
12
+
13
+ <LinearLayout
14
+ android:layout_width="match_parent"
15
+ android:layout_height="match_parent"
16
+ android:gravity="center_horizontal"
17
+ android:orientation="vertical"
18
+ android:paddingLeft="28dp"
19
+ android:paddingRight="28dp"
20
+ android:paddingTop="64dp"
21
+ android:paddingBottom="32dp">
22
+
23
+ <TextView
24
+ android:id="@+id/rn_telecom_incall_status"
25
+ android:layout_width="wrap_content"
26
+ android:layout_height="wrap_content"
27
+ android:text="Calling…"
28
+ android:textColor="#FF79747E"
29
+ android:textSize="14sp"
30
+ android:letterSpacing="0.02" />
31
+
32
+ <TextView
33
+ android:id="@+id/rn_telecom_incall_name"
34
+ android:layout_width="match_parent"
35
+ android:layout_height="wrap_content"
36
+ android:layout_marginTop="12dp"
37
+ android:gravity="center"
38
+ android:textColor="#FF1C1B1F"
39
+ android:textSize="32sp"
40
+ android:textStyle="bold"
41
+ android:maxLines="2"
42
+ android:ellipsize="end" />
43
+
44
+ <TextView
45
+ android:id="@+id/rn_telecom_incall_handle"
46
+ android:layout_width="match_parent"
47
+ android:layout_height="wrap_content"
48
+ android:layout_marginTop="6dp"
49
+ android:gravity="center"
50
+ android:textColor="#FF49454F"
51
+ android:textSize="16sp" />
52
+
53
+ <View
54
+ android:layout_width="match_parent"
55
+ android:layout_height="0dp"
56
+ android:layout_weight="1" />
57
+
58
+ <FrameLayout
59
+ android:id="@+id/rn_telecom_incall_avatar"
60
+ android:layout_width="140dp"
61
+ android:layout_height="140dp"
62
+ android:background="@drawable/rn_telecom_avatar_circle"
63
+ android:clipToOutline="true">
64
+
65
+ <TextView
66
+ android:id="@+id/rn_telecom_incall_initials"
67
+ android:layout_width="match_parent"
68
+ android:layout_height="match_parent"
69
+ android:gravity="center"
70
+ android:textColor="#FFFFFFFF"
71
+ android:textSize="48sp"
72
+ android:textStyle="bold" />
73
+
74
+ <ImageView
75
+ android:id="@+id/rn_telecom_incall_avatar_image"
76
+ android:layout_width="match_parent"
77
+ android:layout_height="match_parent"
78
+ android:contentDescription="@null"
79
+ android:scaleType="centerCrop"
80
+ android:visibility="gone" />
81
+ </FrameLayout>
82
+
83
+ <View
84
+ android:layout_width="match_parent"
85
+ android:layout_height="0dp"
86
+ android:layout_weight="1" />
87
+
88
+ <!-- Keypad (hidden until toggled) -->
89
+ <GridLayout
90
+ android:id="@+id/rn_telecom_keypad"
91
+ android:layout_width="match_parent"
92
+ android:layout_height="wrap_content"
93
+ android:layout_marginBottom="16dp"
94
+ android:columnCount="3"
95
+ android:visibility="gone" />
96
+
97
+ <!-- Control row -->
98
+ <LinearLayout
99
+ android:id="@+id/rn_telecom_controls"
100
+ android:layout_width="match_parent"
101
+ android:layout_height="wrap_content"
102
+ android:gravity="center"
103
+ android:orientation="horizontal">
104
+
105
+ <include
106
+ android:id="@+id/rn_telecom_btn_mute"
107
+ layout="@layout/rn_telecom_control_item"
108
+ android:layout_width="0dp"
109
+ android:layout_height="wrap_content"
110
+ android:layout_weight="1" />
111
+
112
+ <include
113
+ android:id="@+id/rn_telecom_btn_keypad"
114
+ layout="@layout/rn_telecom_control_item"
115
+ android:layout_width="0dp"
116
+ android:layout_height="wrap_content"
117
+ android:layout_weight="1" />
118
+
119
+ <include
120
+ android:id="@+id/rn_telecom_btn_speaker"
121
+ layout="@layout/rn_telecom_control_item"
122
+ android:layout_width="0dp"
123
+ android:layout_height="wrap_content"
124
+ android:layout_weight="1" />
125
+
126
+ <include
127
+ android:id="@+id/rn_telecom_btn_hold"
128
+ layout="@layout/rn_telecom_control_item"
129
+ android:layout_width="0dp"
130
+ android:layout_height="wrap_content"
131
+ android:layout_weight="1" />
132
+ </LinearLayout>
133
+
134
+ <LinearLayout
135
+ android:id="@+id/rn_telecom_btn_end"
136
+ android:layout_width="wrap_content"
137
+ android:layout_height="wrap_content"
138
+ android:layout_marginTop="28dp"
139
+ android:gravity="center"
140
+ android:orientation="vertical"
141
+ android:clickable="true"
142
+ android:focusable="true"
143
+ android:background="?android:attr/selectableItemBackgroundBorderless">
144
+
145
+ <FrameLayout
146
+ android:layout_width="72dp"
147
+ android:layout_height="72dp"
148
+ android:background="@drawable/rn_telecom_decline_circle">
149
+
150
+ <ImageView
151
+ android:layout_width="32dp"
152
+ android:layout_height="32dp"
153
+ android:layout_gravity="center"
154
+ android:contentDescription="@null"
155
+ android:src="@drawable/rn_telecom_ic_call_end"
156
+ android:importantForAccessibility="no" />
157
+ </FrameLayout>
158
+
159
+ <TextView
160
+ android:layout_width="wrap_content"
161
+ android:layout_height="wrap_content"
162
+ android:layout_marginTop="8dp"
163
+ android:text="End"
164
+ android:textColor="#FF1C1B1F"
165
+ android:textSize="14sp" />
166
+ </LinearLayout>
167
+ </LinearLayout>
168
+ </FrameLayout>