react-native-mytatva-rn-sdk 1.2.97 → 1.2.99
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.
- package/android/src/main/java/com/mytatvarnsdk/CgmTrackyLibModule.kt +25 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/ConnectSensorActivity.kt +164 -18
- package/android/src/main/java/com/mytatvarnsdk/activity/HelpActivity.kt +3 -9
- package/android/src/main/java/com/mytatvarnsdk/activity/PermissionActivity.kt +8 -16
- package/android/src/main/java/com/mytatvarnsdk/activity/PlaceSensorActivity.kt +12 -13
- package/android/src/main/java/com/mytatvarnsdk/activity/PlaceTransmitterActivity.kt +12 -13
- package/android/src/main/java/com/mytatvarnsdk/activity/SearchTransmitterActivity.kt +9 -14
- package/android/src/main/java/com/mytatvarnsdk/activity/SensorConnectSuccessActivity.kt +12 -16
- package/android/src/main/java/com/mytatvarnsdk/activity/StartCGMActivity.kt +9 -15
- package/android/src/main/java/com/mytatvarnsdk/activity/VideoActivity.kt +96 -50
- package/android/src/main/java/com/mytatvarnsdk/network/AuthenticateSDKService.kt +50 -0
- package/android/src/main/java/com/mytatvarnsdk/utils/CustomerSupportConfig.kt +137 -0
- package/android/src/main/java/com/mytatvarnsdk/utils/ToolbarSupportHelper.kt +83 -0
- package/android/src/main/res/layout/activity_connect_sensor.xml +117 -2
- package/ios/Custom/CustomTopUIView.swift +25 -0
- package/ios/Database/KLTBluetoothManager.m +69 -14
- package/ios/MyReactNativeBridge.m +4 -0
- package/ios/Support/API.swift +117 -18
- package/ios/Support/CustomTopViewSupportHelper.swift +55 -0
- package/ios/Support/CustomerSupportConfig.swift +169 -0
- package/ios/Support/Global.swift +2 -2
- package/ios/Support/GlobalYouTubePlayerView.swift +102 -11
- package/ios/TableViewCell/ImageTVC/ImageTVC.swift +147 -15
- package/ios/ViewControllers/AttachTransmitterViewController.swift +16 -21
- package/ios/ViewControllers/ChatWithExpertViewController.swift +1 -7
- package/ios/ViewControllers/ConnectToSensorViewController.swift +213 -34
- package/ios/ViewControllers/ConnectToTransmitterViewController.swift +16 -21
- package/ios/ViewControllers/ProvidePermissionViewController.swift +16 -21
- package/ios/ViewControllers/PutOnTheSensorViewController.swift +16 -21
- package/ios/ViewControllers/StartConnectionViewController.swift +18 -25
- package/ios/ViewModel/FinalViewModel.swift +2 -2
- package/package.json +1 -1
|
@@ -44,6 +44,7 @@ import com.mytatvarnsdk.model.GlucoseLogRequest
|
|
|
44
44
|
import com.mytatvarnsdk.model.MainActivityModel
|
|
45
45
|
import com.mytatvarnsdk.network.AuthenticateSDKService
|
|
46
46
|
import com.mytatvarnsdk.network.AuthenticateSDKService.LoaderListener
|
|
47
|
+
import com.mytatvarnsdk.utils.CustomerSupportConfig
|
|
47
48
|
import com.mytatvarnsdk.utils.DeviceStatus
|
|
48
49
|
import com.mytatvarnsdk.utils.TATVA_ENVIRONMENT
|
|
49
50
|
import io.sentry.ScopeCallback
|
|
@@ -379,6 +380,28 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
379
380
|
}
|
|
380
381
|
}
|
|
381
382
|
|
|
383
|
+
private fun fetchCustomerSupportDetails() {
|
|
384
|
+
if (userToken.isEmpty()) {
|
|
385
|
+
CustomerSupportConfig.applyFailureDefaults()
|
|
386
|
+
return
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
val environment =
|
|
390
|
+
if (env.lowercase() == "uat") TATVA_ENVIRONMENT.STAGE else TATVA_ENVIRONMENT.PROD
|
|
391
|
+
|
|
392
|
+
authenticateSDKService.fetchCustomerSupportDetails(
|
|
393
|
+
environment = environment,
|
|
394
|
+
token = userToken,
|
|
395
|
+
onSuccess = { response ->
|
|
396
|
+
CustomerSupportConfig.updateFromResponse(response)
|
|
397
|
+
},
|
|
398
|
+
onFailure = {
|
|
399
|
+
Log.w("fetchCustomerSupportDetails", "Failed to fetch customer support details, using failure defaults")
|
|
400
|
+
CustomerSupportConfig.applyFailureDefaults()
|
|
401
|
+
}
|
|
402
|
+
)
|
|
403
|
+
}
|
|
404
|
+
|
|
382
405
|
@ReactMethod
|
|
383
406
|
fun observeDeviceStatus(token: String, envType: String) {
|
|
384
407
|
try {
|
|
@@ -700,6 +723,7 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
700
723
|
updateUserData(userData)
|
|
701
724
|
userToken = token
|
|
702
725
|
env = envType.lowercase()
|
|
726
|
+
fetchCustomerSupportDetails()
|
|
703
727
|
val intent = Intent(currentActivity, StartCGMActivity::class.java)
|
|
704
728
|
intent.putExtra("envType", env)
|
|
705
729
|
currentActivity?.startActivity(intent)
|
|
@@ -728,6 +752,7 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
728
752
|
updateUserData(userData)
|
|
729
753
|
userToken = token
|
|
730
754
|
env = envType.lowercase()
|
|
755
|
+
fetchCustomerSupportDetails()
|
|
731
756
|
currentActivity?.startActivity(
|
|
732
757
|
Intent(currentActivity, StartCGMActivity::class.java).putExtra(
|
|
733
758
|
"IsForReconnect",
|
|
@@ -14,6 +14,8 @@ import android.view.Gravity
|
|
|
14
14
|
import android.view.View
|
|
15
15
|
import android.view.ViewGroup
|
|
16
16
|
import android.view.Window
|
|
17
|
+
import android.widget.Toast
|
|
18
|
+
import ist.com.sdk.AlgorithmTools
|
|
17
19
|
import androidx.activity.OnBackPressedCallback
|
|
18
20
|
import androidx.activity.enableEdgeToEdge
|
|
19
21
|
import androidx.core.app.ActivityCompat
|
|
@@ -21,10 +23,13 @@ import androidx.core.content.ContextCompat
|
|
|
21
23
|
import androidx.core.graphics.drawable.toDrawable
|
|
22
24
|
import androidx.core.view.ViewCompat
|
|
23
25
|
import androidx.core.view.WindowInsetsCompat
|
|
26
|
+
import cgmblelib.Enum.enumUnBind
|
|
27
|
+
import cgmblelib.ble.gattcallback.GattTool
|
|
24
28
|
import cgmblelib.ble.gattcallback.ManageGattCallback
|
|
25
29
|
import cgmblelib.ble.scancallback.ManageScanCallback
|
|
26
30
|
import cgmblelib.custom.livedata.scan.PocDeviceAndRssi
|
|
27
31
|
import cgmblelib.database.entity.PocDevice
|
|
32
|
+
import cgmblelib.database.repository.RepositoryDevice
|
|
28
33
|
import cgmblelib.utils.SharedPreferencesLibraryUtil
|
|
29
34
|
import com.bumptech.glide.Glide
|
|
30
35
|
import com.facebook.react.bridge.Arguments
|
|
@@ -42,6 +47,7 @@ import com.mytatvarnsdk.myView.progress.ProgressManagement
|
|
|
42
47
|
import com.mytatvarnsdk.myView.progress.ProgressType
|
|
43
48
|
import com.mytatvarnsdk.network.AuthenticateSDKService
|
|
44
49
|
import com.mytatvarnsdk.utils.TATVA_ENVIRONMENT
|
|
50
|
+
import com.mytatvarnsdk.utils.ToolbarSupportHelper
|
|
45
51
|
import com.mytatvarnsdk.utils.CgmModuleSentryLog.logModuleEvent
|
|
46
52
|
import com.mytatvarnsdk.utils.CgmModuleSentryLog.safeLogModuleEvent
|
|
47
53
|
import io.sentry.SentryLogLevel
|
|
@@ -58,6 +64,8 @@ class ConnectSensorActivity : BaseBleActivity() {
|
|
|
58
64
|
var transmitterDeviceInfo: PocDeviceAndRssi? = null
|
|
59
65
|
private var isForReconnect: Boolean = false
|
|
60
66
|
private val reactContext = CgmTrackyLibModule.mReactContext
|
|
67
|
+
private var isManualInputVisible: Boolean = false
|
|
68
|
+
private var suppressUnbindErrorForSensorRebind = false
|
|
61
69
|
|
|
62
70
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
63
71
|
super.onCreate(savedInstanceState)
|
|
@@ -102,19 +110,14 @@ class ConnectSensorActivity : BaseBleActivity() {
|
|
|
102
110
|
openExitDialog()
|
|
103
111
|
}
|
|
104
112
|
|
|
105
|
-
binding.toolbar.btnWhatsapp
|
|
106
|
-
startActivity(
|
|
107
|
-
Intent(this, HelpActivity::class.java).putExtra("ScreenName", "Sensor page")
|
|
108
|
-
)
|
|
109
|
-
}
|
|
113
|
+
ToolbarSupportHelper.bindWhatsappButton(this, binding.toolbar.btnWhatsapp)
|
|
110
114
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
115
|
+
ToolbarSupportHelper.configureWatchDemoButton(
|
|
116
|
+
context = this,
|
|
117
|
+
btnWatchDemo = binding.toolbar.btnWatchDemo,
|
|
118
|
+
isForReconnect = isForReconnect,
|
|
119
|
+
onClickAnalytics = { sendDataToRN("", "cgm_watch_demo_clicked") }
|
|
120
|
+
)
|
|
118
121
|
|
|
119
122
|
val callback: OnBackPressedCallback = object : OnBackPressedCallback(true) {
|
|
120
123
|
override fun handleOnBackPressed() {
|
|
@@ -137,6 +140,128 @@ class ConnectSensorActivity : BaseBleActivity() {
|
|
|
137
140
|
binding.commonButton.btnProceed.alpha = 0.5f
|
|
138
141
|
binding.clPermission.visibility = View.VISIBLE
|
|
139
142
|
}
|
|
143
|
+
|
|
144
|
+
binding.tvEnterIdManually.setOnClickListener {
|
|
145
|
+
toggleManualInput()
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
binding.btnConnectManual.setOnClickListener {
|
|
149
|
+
connectSensorManually()
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private fun toggleManualInput() {
|
|
154
|
+
isManualInputVisible = !isManualInputVisible
|
|
155
|
+
if (isManualInputVisible) {
|
|
156
|
+
binding.clPermission.visibility = View.GONE
|
|
157
|
+
binding.clManualInput.visibility = View.VISIBLE
|
|
158
|
+
binding.commonButton.root.visibility = View.GONE
|
|
159
|
+
binding.tvCantScanQr.text = "Scan the QR."
|
|
160
|
+
binding.tvEnterIdManually.text = "Scan QR"
|
|
161
|
+
} else {
|
|
162
|
+
binding.clManualInput.visibility = View.GONE
|
|
163
|
+
binding.clPermission.visibility = View.VISIBLE
|
|
164
|
+
binding.commonButton.root.visibility = View.VISIBLE
|
|
165
|
+
binding.tvCantScanQr.setText(R.string.txt_cant_scan_sensor_qr)
|
|
166
|
+
binding.tvEnterIdManually.setText(R.string.txt_enter_id_manually)
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
private fun connectSensorManually() {
|
|
171
|
+
val sensorId = binding.etSensorId.text.toString().trim().uppercase()
|
|
172
|
+
if (sensorId.isEmpty()) {
|
|
173
|
+
Toast.makeText(this, "Please enter Sensor ID", Toast.LENGTH_SHORT).show()
|
|
174
|
+
return
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
val device = transmitterDeviceInfo?.pocDevice
|
|
178
|
+
if (device == null) {
|
|
179
|
+
Toast.makeText(this, "Transmitter not found. Please restart.", Toast.LENGTH_SHORT).show()
|
|
180
|
+
return
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
val transmitterName = device.name
|
|
184
|
+
if (transmitterName.isNullOrEmpty()) {
|
|
185
|
+
Toast.makeText(this, "Transmitter not found. Please restart.", Toast.LENGTH_SHORT).show()
|
|
186
|
+
return
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
val decoded = try {
|
|
190
|
+
AlgorithmTools.getInstance().decodeCT(sensorId.toCharArray())
|
|
191
|
+
} catch (e: Exception) {
|
|
192
|
+
Log.e("ConnectSensor", "Manual entry decode failed: ${e.message}")
|
|
193
|
+
Toast.makeText(this, "Invalid Sensor ID format", Toast.LENGTH_SHORT).show()
|
|
194
|
+
return
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Match iOS manual entry: decoded CT code must yield usable algorithm coefficients.
|
|
198
|
+
if (decoded.k <= 0f && decoded.r <= 0f) {
|
|
199
|
+
Toast.makeText(this, getString(R.string.verification_fail), Toast.LENGTH_SHORT).show()
|
|
200
|
+
return
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
val prefsHelper = SharedPreferencesLibraryUtil(this)
|
|
204
|
+
prefsHelper.setQRInformation(
|
|
205
|
+
transmitterName,
|
|
206
|
+
sensorId,
|
|
207
|
+
decoded.k,
|
|
208
|
+
decoded.r,
|
|
209
|
+
sensorId
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
// Match QRActivity.showMessage: verify sensor/transmitter pairing before BLE bind.
|
|
213
|
+
val qrInformation = prefsHelper.qrInformation
|
|
214
|
+
val isEffective = qrInformation?.isEffective(transmitterName, decoded.r, decoded.k) ?: false
|
|
215
|
+
safeLogModuleEvent {
|
|
216
|
+
logModuleEvent(
|
|
217
|
+
where = "cgmJourney.cgm_manual_sensor_is_effective",
|
|
218
|
+
message = "CGM journey | screen=${javaClass.simpleName} | manualEntry isEffective=$isEffective",
|
|
219
|
+
level = SentryLogLevel.INFO,
|
|
220
|
+
jsonPayload = sensorId,
|
|
221
|
+
attributes = mapOf(
|
|
222
|
+
"journey_step" to "cgm_manual_sensor_is_effective",
|
|
223
|
+
"screen" to javaClass.simpleName,
|
|
224
|
+
"is_effective" to isEffective.toString(),
|
|
225
|
+
"transmitter_name" to transmitterName,
|
|
226
|
+
"sensor_id" to sensorId,
|
|
227
|
+
),
|
|
228
|
+
logsOnly = true,
|
|
229
|
+
)
|
|
230
|
+
}
|
|
231
|
+
if (!isEffective || qrInformation == null) {
|
|
232
|
+
Toast.makeText(this, getString(R.string.verification_fail), Toast.LENGTH_SHORT).show()
|
|
233
|
+
return
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
proceedToSensorBind(device)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
private fun proceedToSensorBind(device: PocDevice) {
|
|
240
|
+
val lastConnectCgm = CgmTrackyLibModule.lastConnectCgm
|
|
241
|
+
if (lastConnectCgm.equals("Diasens", ignoreCase = true)) {
|
|
242
|
+
validateDiasensSensor(device)
|
|
243
|
+
} else {
|
|
244
|
+
bind(device)
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* If the transmitter is already bound (e.g. from a prior failed manual attempt), the BLE stack
|
|
250
|
+
* takes the reset shortcut and skips check/init that programs K/R for the new sensor code.
|
|
251
|
+
* Force-clear the DB bind so the next connection runs the full sensor pairing flow.
|
|
252
|
+
*/
|
|
253
|
+
private fun clearExistingBindIfNeeded() {
|
|
254
|
+
try {
|
|
255
|
+
val existing = RepositoryDevice.getInstance(this).getLatestDeviceIoThread() ?: return
|
|
256
|
+
if (!existing.isBound) {
|
|
257
|
+
return
|
|
258
|
+
}
|
|
259
|
+
suppressUnbindErrorForSensorRebind = true
|
|
260
|
+
GattTool.unBindInDatabaseIoThread(this, existing, enumUnBind.UNBIND_FORCE)
|
|
261
|
+
} catch (e: Exception) {
|
|
262
|
+
suppressUnbindErrorForSensorRebind = false
|
|
263
|
+
Log.w("ConnectSensor", "clearExistingBindIfNeeded: ${e.message}")
|
|
264
|
+
}
|
|
140
265
|
}
|
|
141
266
|
|
|
142
267
|
fun manageErrorState(showError: Boolean, errorStatus: String) {
|
|
@@ -189,10 +314,14 @@ class ConnectSensorActivity : BaseBleActivity() {
|
|
|
189
314
|
binding.btnRetry.btnProceed.setOnClickListener {
|
|
190
315
|
sendDataToRN("", "cgm_retry_connect_sensor_clicked")
|
|
191
316
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
317
|
+
if (isManualInputVisible) {
|
|
318
|
+
manageErrorState(false, "")
|
|
319
|
+
} else {
|
|
320
|
+
transmitterDeviceInfo?.let {
|
|
321
|
+
QRActivity.startQR(
|
|
322
|
+
this, it.pocDevice
|
|
323
|
+
)
|
|
324
|
+
}
|
|
196
325
|
}
|
|
197
326
|
}
|
|
198
327
|
|
|
@@ -537,8 +666,12 @@ class ConnectSensorActivity : BaseBleActivity() {
|
|
|
537
666
|
binding.btnRetry.btnProceed.setOnClickListener {
|
|
538
667
|
sendDataToRN("", "cgm_retry_connect_sensor_clicked")
|
|
539
668
|
|
|
540
|
-
|
|
541
|
-
|
|
669
|
+
if (isManualInputVisible) {
|
|
670
|
+
manageErrorState(false, "")
|
|
671
|
+
} else {
|
|
672
|
+
transmitterDeviceInfo?.let {
|
|
673
|
+
QRActivity.startQR(this, it.pocDevice)
|
|
674
|
+
}
|
|
542
675
|
}
|
|
543
676
|
}
|
|
544
677
|
|
|
@@ -558,6 +691,7 @@ class ConnectSensorActivity : BaseBleActivity() {
|
|
|
558
691
|
private fun bind(device: PocDevice) {
|
|
559
692
|
try {
|
|
560
693
|
if (device.address != null) {
|
|
694
|
+
clearExistingBindIfNeeded()
|
|
561
695
|
ManageGattCallback.getInstance().ConnectViaAddress(device.address)
|
|
562
696
|
ManageScanCallback.getInstance().stopLeScan()
|
|
563
697
|
ProgressManagement.getInstance()
|
|
@@ -690,14 +824,26 @@ class ConnectSensorActivity : BaseBleActivity() {
|
|
|
690
824
|
|
|
691
825
|
override fun unbindReset() {
|
|
692
826
|
super.unbindReset()
|
|
827
|
+
if (suppressUnbindErrorForSensorRebind) {
|
|
828
|
+
suppressUnbindErrorForSensorRebind = false
|
|
829
|
+
return
|
|
830
|
+
}
|
|
693
831
|
manageErrorState(true, "Unbinded")
|
|
694
832
|
|
|
695
833
|
}
|
|
696
834
|
|
|
697
835
|
override fun unbindCommand() {
|
|
698
836
|
super.unbindCommand()
|
|
837
|
+
if (suppressUnbindErrorForSensorRebind) {
|
|
838
|
+
suppressUnbindErrorForSensorRebind = false
|
|
839
|
+
return
|
|
840
|
+
}
|
|
699
841
|
manageErrorState(true, "Unbinded")
|
|
700
842
|
|
|
701
843
|
}
|
|
702
844
|
|
|
845
|
+
override fun onResume() {
|
|
846
|
+
super.onResume()
|
|
847
|
+
}
|
|
848
|
+
|
|
703
849
|
}
|
|
@@ -17,6 +17,8 @@ import com.facebook.react.bridge.WritableMap
|
|
|
17
17
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
18
18
|
import com.mytatvarnsdk.CgmTrackyLibModule
|
|
19
19
|
import com.mytatvarnsdk.R
|
|
20
|
+
import com.mytatvarnsdk.utils.CustomerSupportConfig
|
|
21
|
+
import com.mytatvarnsdk.utils.ToolbarSupportHelper
|
|
20
22
|
import com.mytatvarnsdk.databinding.ActivityHelpBinding
|
|
21
23
|
import org.json.JSONObject
|
|
22
24
|
|
|
@@ -109,15 +111,7 @@ class HelpActivity : AppCompatActivity() {
|
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
private fun openWhatsApp() {
|
|
112
|
-
|
|
113
|
-
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(waBotUrl))
|
|
114
|
-
try {
|
|
115
|
-
// You don't need to set the package for browser-based WhatsApp bots
|
|
116
|
-
startActivity(intent)
|
|
117
|
-
} catch (e: Exception) {
|
|
118
|
-
e.printStackTrace()
|
|
119
|
-
Toast.makeText(this, "Error opening WhatsApp Bot", Toast.LENGTH_SHORT).show()
|
|
120
|
-
}
|
|
114
|
+
ToolbarSupportHelper.openWhatsApp(this, CustomerSupportConfig.effectiveWhatsAppNumber())
|
|
121
115
|
}
|
|
122
116
|
|
|
123
117
|
private fun sendDataToRN(data: String, status: String) {
|
|
@@ -36,6 +36,7 @@ import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
|
36
36
|
import com.mytatvarnsdk.CgmTrackyLibModule
|
|
37
37
|
import com.mytatvarnsdk.R
|
|
38
38
|
import com.mytatvarnsdk.base.BasePermissionActivity
|
|
39
|
+
import com.mytatvarnsdk.utils.ToolbarSupportHelper
|
|
39
40
|
import com.mytatvarnsdk.databinding.ActivityPermissionBinding
|
|
40
41
|
import com.mytatvarnsdk.databinding.BluetoothDialogBottomsheetBinding
|
|
41
42
|
import com.mytatvarnsdk.databinding.ExitDialogBottomsheetBinding
|
|
@@ -170,23 +171,14 @@ class PermissionActivity : BasePermissionActivity() {
|
|
|
170
171
|
finish()
|
|
171
172
|
}
|
|
172
173
|
|
|
173
|
-
binding.toolbar.btnWhatsapp
|
|
174
|
-
startActivity(
|
|
175
|
-
Intent(this, HelpActivity::class.java)
|
|
176
|
-
.putExtra("ScreenName", "connection journey page")
|
|
177
|
-
)
|
|
178
|
-
}
|
|
174
|
+
ToolbarSupportHelper.bindWhatsappButton(this, binding.toolbar.btnWhatsapp)
|
|
179
175
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (isForReconnect) "n_pUrFoZ1wQ" else "r5Zemc4R044"
|
|
187
|
-
)
|
|
188
|
-
)
|
|
189
|
-
}
|
|
176
|
+
ToolbarSupportHelper.configureWatchDemoButton(
|
|
177
|
+
context = this,
|
|
178
|
+
btnWatchDemo = binding.toolbar.btnWatchDemo,
|
|
179
|
+
isForReconnect = isForReconnect,
|
|
180
|
+
onClickAnalytics = { sendDataToRN("", "cgm_watch_demo_clicked") }
|
|
181
|
+
)
|
|
190
182
|
|
|
191
183
|
binding.tvKnowMore.setOnClickListener {
|
|
192
184
|
openBluetoothDialog()
|
|
@@ -27,6 +27,7 @@ import com.mytatvarnsdk.databinding.ActivityPlaceSensorBinding
|
|
|
27
27
|
import com.mytatvarnsdk.databinding.ExitDialogBottomsheetBinding
|
|
28
28
|
import com.mytatvarnsdk.utils.CgmModuleSentryLog.logModuleEvent
|
|
29
29
|
import com.mytatvarnsdk.utils.CgmModuleSentryLog.safeLogModuleEvent
|
|
30
|
+
import com.mytatvarnsdk.utils.ToolbarSupportHelper
|
|
30
31
|
import io.sentry.SentryLogLevel
|
|
31
32
|
|
|
32
33
|
class PlaceSensorActivity : AppCompatActivity() {
|
|
@@ -62,20 +63,14 @@ class PlaceSensorActivity : AppCompatActivity() {
|
|
|
62
63
|
.load(R.drawable.ic_play_gif)
|
|
63
64
|
.into(binding.ivPlay)
|
|
64
65
|
|
|
65
|
-
binding.toolbar.btnWhatsapp
|
|
66
|
-
startActivity(
|
|
67
|
-
Intent(this, HelpActivity::class.java)
|
|
68
|
-
.putExtra("ScreenName", "Sensor page")
|
|
69
|
-
)
|
|
70
|
-
}
|
|
66
|
+
ToolbarSupportHelper.bindWhatsappButton(this, binding.toolbar.btnWhatsapp)
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
68
|
+
ToolbarSupportHelper.configureWatchDemoButton(
|
|
69
|
+
context = this,
|
|
70
|
+
btnWatchDemo = binding.toolbar.btnWatchDemo,
|
|
71
|
+
isForReconnect = isForReconnect,
|
|
72
|
+
onClickAnalytics = { sendDataToRN("", "cgm_watch_demo_clicked") }
|
|
73
|
+
)
|
|
79
74
|
|
|
80
75
|
binding.commonButton.tvProceed.text = "I Have Placed The Sensor"
|
|
81
76
|
binding.commonButton.btnProceed.setOnClickListener {
|
|
@@ -181,5 +176,9 @@ class PlaceSensorActivity : AppCompatActivity() {
|
|
|
181
176
|
dialog.show()
|
|
182
177
|
}
|
|
183
178
|
|
|
179
|
+
override fun onResume() {
|
|
180
|
+
super.onResume()
|
|
181
|
+
}
|
|
182
|
+
|
|
184
183
|
|
|
185
184
|
}
|
|
@@ -27,6 +27,7 @@ import com.mytatvarnsdk.databinding.ActivityPlaceTransmitterBinding
|
|
|
27
27
|
import com.mytatvarnsdk.databinding.ExitDialogBottomsheetBinding
|
|
28
28
|
import com.mytatvarnsdk.utils.CgmModuleSentryLog.logModuleEvent
|
|
29
29
|
import com.mytatvarnsdk.utils.CgmModuleSentryLog.safeLogModuleEvent
|
|
30
|
+
import com.mytatvarnsdk.utils.ToolbarSupportHelper
|
|
30
31
|
import io.sentry.SentryLogLevel
|
|
31
32
|
|
|
32
33
|
class PlaceTransmitterActivity : AppCompatActivity() {
|
|
@@ -74,20 +75,14 @@ class PlaceTransmitterActivity : AppCompatActivity() {
|
|
|
74
75
|
finish()
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
binding.toolbar.btnWhatsapp
|
|
78
|
-
startActivity(
|
|
79
|
-
Intent(this, HelpActivity::class.java)
|
|
80
|
-
.putExtra("ScreenName", "Transmitter page")
|
|
81
|
-
)
|
|
82
|
-
}
|
|
78
|
+
ToolbarSupportHelper.bindWhatsappButton(this, binding.toolbar.btnWhatsapp)
|
|
83
79
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
80
|
+
ToolbarSupportHelper.configureWatchDemoButton(
|
|
81
|
+
context = this,
|
|
82
|
+
btnWatchDemo = binding.toolbar.btnWatchDemo,
|
|
83
|
+
isForReconnect = isForReconnect,
|
|
84
|
+
onClickAnalytics = { sendDataToRN("", "cgm_watch_demo_clicked") }
|
|
85
|
+
)
|
|
91
86
|
|
|
92
87
|
binding.toolbar.btnClose.setOnClickListener {
|
|
93
88
|
openExitDialog()
|
|
@@ -187,4 +182,8 @@ class PlaceTransmitterActivity : AppCompatActivity() {
|
|
|
187
182
|
Log.e("sendDataToRNDirectly", "Error sending data to React", e)
|
|
188
183
|
}
|
|
189
184
|
}
|
|
185
|
+
|
|
186
|
+
override fun onResume() {
|
|
187
|
+
super.onResume()
|
|
188
|
+
}
|
|
190
189
|
}
|
|
@@ -53,6 +53,7 @@ import com.mytatvarnsdk.myView.progress.ProgressManagement
|
|
|
53
53
|
import com.mytatvarnsdk.myView.progress.ProgressType
|
|
54
54
|
import com.mytatvarnsdk.network.AuthenticateSDKService
|
|
55
55
|
import com.mytatvarnsdk.utils.CgmModuleSentryLog.logModuleEvent
|
|
56
|
+
import com.mytatvarnsdk.utils.ToolbarSupportHelper
|
|
56
57
|
import com.mytatvarnsdk.utils.CgmModuleSentryLog.safeLogModuleEvent
|
|
57
58
|
import io.sentry.SentryLogLevel
|
|
58
59
|
import kotlinx.coroutines.CoroutineScope
|
|
@@ -381,20 +382,14 @@ class SearchTransmitterActivity : BaseBleActivity() {
|
|
|
381
382
|
}
|
|
382
383
|
|
|
383
384
|
private fun setupClickListeners() {
|
|
384
|
-
binding.toolbar.btnWhatsapp
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
sendDataToRN("", "cgm_watch_demo_clicked")
|
|
393
|
-
|
|
394
|
-
startActivity(
|
|
395
|
-
Intent(this, VideoActivity::class.java).putExtra("VideoId", if (isForReconnect) "n_pUrFoZ1wQ" else "r5Zemc4R044")
|
|
396
|
-
)
|
|
397
|
-
}
|
|
385
|
+
ToolbarSupportHelper.bindWhatsappButton(this, binding.toolbar.btnWhatsapp)
|
|
386
|
+
|
|
387
|
+
ToolbarSupportHelper.configureWatchDemoButton(
|
|
388
|
+
context = this,
|
|
389
|
+
btnWatchDemo = binding.toolbar.btnWatchDemo,
|
|
390
|
+
isForReconnect = isForReconnect,
|
|
391
|
+
onClickAnalytics = { sendDataToRN("", "cgm_watch_demo_clicked") }
|
|
392
|
+
)
|
|
398
393
|
|
|
399
394
|
binding.toolbar.btnClose.setOnClickListener {
|
|
400
395
|
openExitDialog()
|
|
@@ -31,6 +31,7 @@ import com.mytatvarnsdk.network.AuthenticateSDKService
|
|
|
31
31
|
import com.mytatvarnsdk.network.AuthenticateSDKService.LoaderListener
|
|
32
32
|
import com.mytatvarnsdk.utils.DeviceStatus
|
|
33
33
|
import com.mytatvarnsdk.utils.TATVA_ENVIRONMENT
|
|
34
|
+
import com.mytatvarnsdk.utils.ToolbarSupportHelper
|
|
34
35
|
import com.mytatvarnsdk.utils.CgmModuleSentryLog.logModuleEvent
|
|
35
36
|
import com.mytatvarnsdk.utils.CgmModuleSentryLog.safeLogModuleEvent
|
|
36
37
|
import io.sentry.SentryLogLevel
|
|
@@ -80,23 +81,14 @@ class SensorConnectSuccessActivity : AppCompatActivity() {
|
|
|
80
81
|
|
|
81
82
|
authenticateSDKService = AuthenticateSDKService(scope = scope)
|
|
82
83
|
|
|
83
|
-
binding.toolbar.btnWhatsapp
|
|
84
|
-
startActivity(
|
|
85
|
-
Intent(this, HelpActivity::class.java)
|
|
86
|
-
.putExtra("ScreenName", "Sensor page")
|
|
87
|
-
)
|
|
88
|
-
}
|
|
84
|
+
ToolbarSupportHelper.bindWhatsappButton(this, binding.toolbar.btnWhatsapp)
|
|
89
85
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (isForReconnect) "n_pUrFoZ1wQ" else "r5Zemc4R044"
|
|
97
|
-
)
|
|
98
|
-
)
|
|
99
|
-
}
|
|
86
|
+
ToolbarSupportHelper.configureWatchDemoButton(
|
|
87
|
+
context = this,
|
|
88
|
+
btnWatchDemo = binding.toolbar.btnWatchDemo,
|
|
89
|
+
isForReconnect = isForReconnect,
|
|
90
|
+
onClickAnalytics = { sendDataToRN("", "cgm_watch_demo_clicked") }
|
|
91
|
+
)
|
|
100
92
|
|
|
101
93
|
binding.commonButton.btnProceed.setOnClickListener {
|
|
102
94
|
sendDataToRN("", "cgm_connect_sensor_proceed_clicked")
|
|
@@ -255,4 +247,8 @@ class SensorConnectSuccessActivity : AppCompatActivity() {
|
|
|
255
247
|
dialog.show()
|
|
256
248
|
}
|
|
257
249
|
|
|
250
|
+
override fun onResume() {
|
|
251
|
+
super.onResume()
|
|
252
|
+
}
|
|
253
|
+
|
|
258
254
|
}
|
|
@@ -30,6 +30,7 @@ import com.mytatvarnsdk.databinding.ActivityStartCgmactivityBinding
|
|
|
30
30
|
import com.mytatvarnsdk.databinding.ExitDialogBottomsheetBinding
|
|
31
31
|
import com.mytatvarnsdk.utils.CgmModuleSentryLog.logModuleEvent
|
|
32
32
|
import com.mytatvarnsdk.utils.CgmModuleSentryLog.safeLogModuleEvent
|
|
33
|
+
import com.mytatvarnsdk.utils.ToolbarSupportHelper
|
|
33
34
|
import io.sentry.SentryLogLevel
|
|
34
35
|
|
|
35
36
|
|
|
@@ -95,22 +96,15 @@ class StartCGMActivity : AppCompatActivity() {
|
|
|
95
96
|
openExitDialog()
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
binding.toolbar.btnWhatsapp
|
|
99
|
-
startActivity(
|
|
100
|
-
Intent(this, HelpActivity::class.java)
|
|
101
|
-
.putExtra("ScreenName", "connection journey page")
|
|
102
|
-
)
|
|
103
|
-
}
|
|
99
|
+
ToolbarSupportHelper.bindWhatsappButton(this, binding.toolbar.btnWhatsapp)
|
|
104
100
|
|
|
105
|
-
binding.toolbar.btnWatchDemo.setOnClickListener
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
)
|
|
113
|
-
}
|
|
101
|
+
binding.toolbar.btnWatchDemo.setOnClickListener(null)
|
|
102
|
+
ToolbarSupportHelper.configureWatchDemoButton(
|
|
103
|
+
context = this,
|
|
104
|
+
btnWatchDemo = binding.toolbar.btnWatchDemo,
|
|
105
|
+
isForReconnect = isForReconnect,
|
|
106
|
+
onClickAnalytics = { sendDataToRN("", "cgm_watch_demo_clicked") }
|
|
107
|
+
)
|
|
114
108
|
|
|
115
109
|
val callback: OnBackPressedCallback = object : OnBackPressedCallback(true) {
|
|
116
110
|
override fun handleOnBackPressed() {
|