react-native-mytatva-rn-sdk 1.2.32 → 1.2.34
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/build.gradle +144 -141
- package/android/src/main/AndroidManifest.xml +4 -1
- package/android/src/main/AndroidManifestNew.xml +141 -138
- package/android/src/main/java/com/mytatvarnsdk/CgmTrackyLibModule.kt +74 -101
- package/android/src/main/java/com/mytatvarnsdk/MainApplication.kt +4 -4
- package/android/src/main/java/com/mytatvarnsdk/activity/ConnectSensorActivity.kt +20 -2
- package/android/src/main/java/com/mytatvarnsdk/activity/PermissionActivity.kt +6 -0
- package/android/src/main/java/com/mytatvarnsdk/activity/PlaceSensorActivity.kt +82 -65
- package/android/src/main/java/com/mytatvarnsdk/activity/PlaceTransmitterActivity.kt +106 -89
- package/android/src/main/java/com/mytatvarnsdk/activity/SearchTransmitterActivity.kt +13 -7
- package/android/src/main/java/com/mytatvarnsdk/activity/SensorConnectSuccessActivity.kt +113 -96
- package/android/src/main/java/com/mytatvarnsdk/activity/StartCGMActivity.kt +110 -54
- package/android/src/main/java/com/mytatvarnsdk/activity/VideoActivity.kt +94 -0
- package/android/src/main/res/drawable/img_sensor_cross.png +0 -0
- package/android/src/main/res/drawable/radio_button_background.xml +1 -1
- package/android/src/main/res/drawable/radio_checked.xml +1 -1
- package/android/src/main/res/layout/activity_connect_sensor.xml +497 -495
- package/android/src/main/res/layout/activity_place_sensor.xml +250 -238
- package/android/src/main/res/layout/activity_place_transmitter.xml +219 -207
- package/android/src/main/res/layout/activity_search_transmitter.xml +714 -712
- package/android/src/main/res/layout/activity_sensor_connect_success.xml +250 -179
- package/android/src/main/res/layout/activity_start_cgmactivity.xml +153 -153
- package/android/src/main/res/layout/activity_video.xml +32 -0
- package/android/src/main/res/values/styles.xml +1 -3
- package/ios/Database/KLTDatabaseHandler.m +8 -0
- package/package.json +1 -1
|
@@ -25,121 +25,138 @@ import com.mytatvarnsdk.CgmTrackyLibModule
|
|
|
25
25
|
import com.mytatvarnsdk.R
|
|
26
26
|
import com.mytatvarnsdk.databinding.ActivityPlaceTransmitterBinding
|
|
27
27
|
import com.mytatvarnsdk.databinding.ExitDialogBottomsheetBinding
|
|
28
|
+
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.YouTubePlayer
|
|
29
|
+
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.listeners.AbstractYouTubePlayerListener
|
|
30
|
+
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.listeners.FullscreenListener
|
|
31
|
+
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.options.IFramePlayerOptions
|
|
28
32
|
|
|
29
33
|
class PlaceTransmitterActivity : AppCompatActivity() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
private lateinit var binding: ActivityPlaceTransmitterBinding
|
|
35
|
+
private val reactContext = CgmTrackyLibModule.mReactContext
|
|
36
|
+
|
|
37
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
38
|
+
super.onCreate(savedInstanceState)
|
|
39
|
+
binding = ActivityPlaceTransmitterBinding.inflate(layoutInflater)
|
|
40
|
+
enableEdgeToEdge()
|
|
41
|
+
setContentView(binding.root)
|
|
42
|
+
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
|
|
43
|
+
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
|
44
|
+
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
|
45
|
+
insets
|
|
46
|
+
}
|
|
47
|
+
init()
|
|
42
48
|
}
|
|
43
|
-
init()
|
|
44
|
-
}
|
|
45
49
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
private fun init() {
|
|
51
|
+
Glide.with(this)
|
|
52
|
+
.load(R.drawable.img_female)
|
|
53
|
+
.transform(RoundedCorners(50))
|
|
54
|
+
.into(binding.ivTransmitter)
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
Glide.with(this)
|
|
57
|
+
.asGif()
|
|
58
|
+
.load(R.drawable.ic_play_gif)
|
|
59
|
+
.into(binding.ivPlay)
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
binding.commonButton.tvProceed.text = "Complete"
|
|
58
62
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
binding.commonButton.btnProceed.setOnClickListener {
|
|
64
|
+
sendDataToRN("")
|
|
65
|
+
finish()
|
|
66
|
+
}
|
|
63
67
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
binding.toolbar.btnWhatsapp.setOnClickListener {
|
|
69
|
+
startActivity(Intent(this, HelpActivity::class.java))
|
|
70
|
+
}
|
|
67
71
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
binding.toolbar.btnWatchDemo.setOnClickListener {
|
|
73
|
+
startActivity(
|
|
74
|
+
Intent(this, VideoActivity::class.java).putExtra("VideoId", "r5Zemc4R044")
|
|
75
|
+
)
|
|
76
|
+
}
|
|
71
77
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
binding.toolbar.btnClose.setOnClickListener {
|
|
79
|
+
openExitDialog()
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
binding.ivPlay.setOnClickListener {
|
|
83
|
+
startActivity(
|
|
84
|
+
Intent(this, VideoActivity::class.java).putExtra("VideoId", "1C7VK2d5niY")
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
val callback: OnBackPressedCallback = object : OnBackPressedCallback(true) {
|
|
89
|
+
override fun handleOnBackPressed() {
|
|
90
|
+
openExitDialog()
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
onBackPressedDispatcher.addCallback(this, callback)
|
|
76
94
|
}
|
|
77
|
-
onBackPressedDispatcher.addCallback(this, callback)
|
|
78
|
-
}
|
|
79
95
|
|
|
80
|
-
private fun openExitDialog() {
|
|
81
|
-
val binding = ExitDialogBottomsheetBinding.inflate(layoutInflater)
|
|
82
96
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
dialog.setContentView(binding.root)
|
|
97
|
+
private fun openExitDialog() {
|
|
98
|
+
val binding = ExitDialogBottomsheetBinding.inflate(layoutInflater)
|
|
86
99
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
window?.setBackgroundDrawable(Color.TRANSPARENT.toDrawable())
|
|
100
|
+
val dialog = Dialog(this)
|
|
101
|
+
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
|
|
102
|
+
dialog.setContentView(binding.root)
|
|
91
103
|
|
|
92
|
-
|
|
104
|
+
val window = dialog.window
|
|
105
|
+
window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
|
106
|
+
window?.setGravity(Gravity.BOTTOM)
|
|
107
|
+
window?.setBackgroundDrawable(Color.TRANSPARENT.toDrawable())
|
|
93
108
|
|
|
94
|
-
|
|
95
|
-
finish()
|
|
96
|
-
dialog.dismiss()
|
|
97
|
-
})
|
|
109
|
+
binding.btnExit.tvProceed.text = "Exit"
|
|
98
110
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
111
|
+
binding.btnExit.root.setOnClickListener(View.OnClickListener { v: View? ->
|
|
112
|
+
finish()
|
|
113
|
+
dialog.dismiss()
|
|
114
|
+
})
|
|
102
115
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
116
|
+
binding.btnCancel.root.setOnClickListener(View.OnClickListener { v: View? ->
|
|
117
|
+
dialog.dismiss()
|
|
118
|
+
})
|
|
106
119
|
|
|
107
|
-
|
|
108
|
-
|
|
120
|
+
binding.closeButton.setOnClickListener(View.OnClickListener { v: View? ->
|
|
121
|
+
dialog.dismiss()
|
|
122
|
+
})
|
|
109
123
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
try {
|
|
113
|
-
val catalystInstance: CatalystInstance = reactContext.catalystInstance
|
|
114
|
-
val module = catalystInstance.getNativeModule(CgmTrackyLibModule::class.java)
|
|
124
|
+
dialog.show()
|
|
125
|
+
}
|
|
115
126
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
127
|
+
private fun sendDataToRN(data: String) {
|
|
128
|
+
if (reactContext != null) {
|
|
129
|
+
try {
|
|
130
|
+
val catalystInstance: CatalystInstance = reactContext.catalystInstance
|
|
131
|
+
val module = catalystInstance.getNativeModule(CgmTrackyLibModule::class.java)
|
|
132
|
+
|
|
133
|
+
if (module == null) {
|
|
134
|
+
sendDataToRNDirectly("", "WARM_PERIOD_STARTED")
|
|
135
|
+
Log.d("sendDataToRN: ", "Module null")
|
|
136
|
+
} else {
|
|
137
|
+
module.sendDataToReact(data, "WARM_PERIOD_STARTED", "cgmDeviceEvent")
|
|
138
|
+
Log.d("sendDataToRN: ", "Module is not null")
|
|
139
|
+
}
|
|
140
|
+
} catch (e: Exception) {
|
|
141
|
+
Log.e("sendDataToRN: Error ", e.message.toString())
|
|
142
|
+
}
|
|
119
143
|
} else {
|
|
120
|
-
|
|
121
|
-
Log.d("sendDataToRN: ", "Module is not null")
|
|
144
|
+
Log.e("TrackyActivity", "ReactApplicationContext is null")
|
|
122
145
|
}
|
|
123
|
-
} catch (e: Exception) {
|
|
124
|
-
Log.e("sendDataToRN: Error ", e.message.toString())
|
|
125
|
-
}
|
|
126
|
-
} else {
|
|
127
|
-
Log.e("TrackyActivity", "ReactApplicationContext is null")
|
|
128
146
|
}
|
|
129
|
-
}
|
|
130
147
|
|
|
131
148
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
149
|
+
private fun sendDataToRNDirectly(data: String, status: String) {
|
|
150
|
+
try {
|
|
151
|
+
val map: WritableMap = Arguments.createMap().apply {
|
|
152
|
+
putString("data", data)
|
|
153
|
+
putString("status", status)
|
|
154
|
+
}
|
|
138
155
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
156
|
+
reactContext?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
157
|
+
?.emit("cgmDeviceEvent", map)
|
|
158
|
+
} catch (e: Exception) {
|
|
159
|
+
Log.e("sendDataToRNDirectly", "Error sending data to React", e)
|
|
160
|
+
}
|
|
143
161
|
}
|
|
144
|
-
}
|
|
145
162
|
}
|
|
@@ -130,8 +130,13 @@ class SearchTransmitterActivity : BaseBleActivity() {
|
|
|
130
130
|
binding.btnSupport.tvProceed.text = "Contact Support"
|
|
131
131
|
binding.btnRetry.tvProceed.text = "Retry"
|
|
132
132
|
|
|
133
|
-
binding.
|
|
134
|
-
|
|
133
|
+
binding.llWatchDemo.post {
|
|
134
|
+
binding.llWatchDemo.setOnClickListener {
|
|
135
|
+
Log.d("CLICK", "Layout Clicked")
|
|
136
|
+
val intent = Intent(this, VideoActivity::class.java)
|
|
137
|
+
intent.putExtra("VideoId", "zRlFFdr-QD4")
|
|
138
|
+
startActivity(intent)
|
|
139
|
+
}
|
|
135
140
|
}
|
|
136
141
|
|
|
137
142
|
binding.btnSupport.btnProceed.setOnClickListener {
|
|
@@ -344,13 +349,14 @@ class SearchTransmitterActivity : BaseBleActivity() {
|
|
|
344
349
|
startActivity(Intent(this, HelpActivity::class.java))
|
|
345
350
|
}
|
|
346
351
|
|
|
347
|
-
binding.toolbar.
|
|
348
|
-
|
|
352
|
+
binding.toolbar.btnWatchDemo.setOnClickListener {
|
|
353
|
+
startActivity(
|
|
354
|
+
Intent(this, VideoActivity::class.java).putExtra("VideoId", "r5Zemc4R044")
|
|
355
|
+
)
|
|
349
356
|
}
|
|
350
357
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
// Implement demo video functionality
|
|
358
|
+
binding.toolbar.btnClose.setOnClickListener {
|
|
359
|
+
openExitDialog()
|
|
354
360
|
}
|
|
355
361
|
|
|
356
362
|
// Connect button (visible when device is detected)
|
|
@@ -36,121 +36,138 @@ import java.util.Locale
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
class SensorConnectSuccessActivity : AppCompatActivity() {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
private lateinit var binding: ActivitySensorConnectSuccessBinding
|
|
40
|
+
lateinit var authenticateSDKService: AuthenticateSDKService
|
|
41
|
+
private val job = Job()
|
|
42
|
+
private val scope = CoroutineScope(Dispatchers.IO + job)
|
|
43
|
+
private var isForReconnect: Boolean = false
|
|
44
|
+
|
|
45
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
46
|
+
super.onCreate(savedInstanceState)
|
|
47
|
+
binding = ActivitySensorConnectSuccessBinding.inflate(layoutInflater)
|
|
48
|
+
enableEdgeToEdge()
|
|
49
|
+
setContentView(binding.root)
|
|
50
|
+
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
|
|
51
|
+
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
|
52
|
+
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
|
53
|
+
insets
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
init()
|
|
53
57
|
}
|
|
54
58
|
|
|
55
|
-
init()
|
|
56
|
-
|
|
59
|
+
private fun init() {
|
|
60
|
+
isForReconnect = intent.getBooleanExtra("IsForReconnect", false)
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
binding.tvDateTime.text = "Connected on ${formatter.format(Date()).uppercase()}"
|
|
62
|
+
val formatter = SimpleDateFormat("hh:mm a", Locale.getDefault())
|
|
63
|
+
binding.tvDateTime.text = "Connected on ${formatter.format(Date()).uppercase()}"
|
|
61
64
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
Glide.with(this)
|
|
66
|
+
.asGif()
|
|
67
|
+
.load(R.drawable.success_anim)
|
|
68
|
+
.into(binding.ivSuccess)
|
|
66
69
|
|
|
67
|
-
|
|
70
|
+
authenticateSDKService = AuthenticateSDKService(scope = scope)
|
|
68
71
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
binding.toolbar.btnWhatsapp.setOnClickListener {
|
|
73
|
+
startActivity(Intent(this, HelpActivity::class.java))
|
|
74
|
+
}
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
binding.toolbar.btnWatchDemo.setOnClickListener {
|
|
77
|
+
startActivity(
|
|
78
|
+
Intent(this, VideoActivity::class.java).putExtra("VideoId", "r5Zemc4R044")
|
|
79
|
+
)
|
|
80
|
+
}
|
|
77
81
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
binding.commonButton.btnProceed.setOnClickListener {
|
|
83
|
+
if (isForReconnect) {
|
|
84
|
+
startActivity(Intent(this, PlaceTransmitterActivity::class.java))
|
|
85
|
+
} else {
|
|
86
|
+
startActivity(Intent(this, PlaceSensorActivity::class.java))
|
|
87
|
+
}
|
|
88
|
+
finish()
|
|
89
|
+
}
|
|
81
90
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
openExitDialog()
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
onBackPressedDispatcher.addCallback(this, callback)
|
|
88
|
-
|
|
89
|
-
postEventDataToAPI()
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
private fun postEventDataToAPI() {
|
|
93
|
-
val sharedPreferencesLibraryUtil = SharedPreferencesLibraryUtil(this)
|
|
94
|
-
val information = sharedPreferencesLibraryUtil.qrInformation
|
|
95
|
-
|
|
96
|
-
val rawData = JSONObject()
|
|
97
|
-
rawData.put("transmitterName", information.transmitterName)
|
|
98
|
-
rawData.put("SensorId", information.sensor)
|
|
99
|
-
rawData.put("R", information.r)
|
|
100
|
-
rawData.put("K", information.k)
|
|
101
|
-
rawData.put("Sensor", information.sensor)
|
|
102
|
-
rawData.put("timeInMillis", information.timeInMillis)
|
|
103
|
-
|
|
104
|
-
val obj = JSONObject()
|
|
105
|
-
obj.put("sensorId", information.sensor)
|
|
106
|
-
obj.put("status", DeviceStatus.CONNECTED.id)
|
|
107
|
-
obj.put("rawData", rawData)
|
|
108
|
-
|
|
109
|
-
authenticateSDKService.postDeviceData(
|
|
110
|
-
environment = if ("uat".uppercase() == "PROD") TATVA_ENVIRONMENT.PROD else TATVA_ENVIRONMENT.STAGE,
|
|
111
|
-
data = obj.toString(),
|
|
112
|
-
token = CgmTrackyLibModule.userToken,
|
|
113
|
-
loaderListener = object : LoaderListener {
|
|
114
|
-
override fun onShowLoader() {
|
|
115
|
-
ProgressManagement.getInstance()
|
|
116
|
-
.showWait(this@SensorConnectSuccessActivity, ProgressType.PROGRESSDIALOG_CONNECT, null)
|
|
91
|
+
binding.toolbar.btnClose.setOnClickListener {
|
|
92
|
+
openExitDialog()
|
|
117
93
|
}
|
|
118
94
|
|
|
119
|
-
|
|
120
|
-
|
|
95
|
+
val callback: OnBackPressedCallback = object : OnBackPressedCallback(true) {
|
|
96
|
+
override fun handleOnBackPressed() {
|
|
97
|
+
openExitDialog()
|
|
98
|
+
}
|
|
121
99
|
}
|
|
122
|
-
|
|
123
|
-
)
|
|
124
|
-
}
|
|
100
|
+
onBackPressedDispatcher.addCallback(this, callback)
|
|
125
101
|
|
|
126
|
-
|
|
127
|
-
|
|
102
|
+
postEventDataToAPI()
|
|
103
|
+
}
|
|
128
104
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
105
|
+
private fun postEventDataToAPI() {
|
|
106
|
+
val sharedPreferencesLibraryUtil = SharedPreferencesLibraryUtil(this)
|
|
107
|
+
val information = sharedPreferencesLibraryUtil.qrInformation
|
|
108
|
+
|
|
109
|
+
val rawData = JSONObject()
|
|
110
|
+
rawData.put("transmitterName", information.transmitterName)
|
|
111
|
+
rawData.put("SensorId", information.sensor)
|
|
112
|
+
rawData.put("R", information.r)
|
|
113
|
+
rawData.put("K", information.k)
|
|
114
|
+
rawData.put("Sensor", information.sensor)
|
|
115
|
+
rawData.put("timeInMillis", information.timeInMillis)
|
|
116
|
+
|
|
117
|
+
val obj = JSONObject()
|
|
118
|
+
obj.put("sensorId", information.sensor)
|
|
119
|
+
obj.put("status", DeviceStatus.CONNECTED.id)
|
|
120
|
+
obj.put("rawData", rawData)
|
|
121
|
+
|
|
122
|
+
authenticateSDKService.postDeviceData(
|
|
123
|
+
environment = if ("uat".uppercase() == "PROD") TATVA_ENVIRONMENT.PROD else TATVA_ENVIRONMENT.STAGE,
|
|
124
|
+
data = obj.toString(),
|
|
125
|
+
token = CgmTrackyLibModule.userToken,
|
|
126
|
+
loaderListener = object : LoaderListener {
|
|
127
|
+
override fun onShowLoader() {
|
|
128
|
+
ProgressManagement.getInstance()
|
|
129
|
+
.showWait(
|
|
130
|
+
this@SensorConnectSuccessActivity,
|
|
131
|
+
ProgressType.PROGRESSDIALOG_CONNECT,
|
|
132
|
+
null
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
override fun onHideLoader() {
|
|
137
|
+
ProgressManagement.getInstance().dismissWait(this@SensorConnectSuccessActivity)
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
}
|
|
132
142
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
window?.setGravity(Gravity.BOTTOM)
|
|
136
|
-
window?.setBackgroundDrawable(Color.TRANSPARENT.toDrawable())
|
|
143
|
+
private fun openExitDialog() {
|
|
144
|
+
val binding = ExitDialogBottomsheetBinding.inflate(layoutInflater)
|
|
137
145
|
|
|
138
|
-
|
|
146
|
+
val dialog = Dialog(this)
|
|
147
|
+
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
|
|
148
|
+
dialog.setContentView(binding.root)
|
|
139
149
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
150
|
+
val window = dialog.window
|
|
151
|
+
window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
|
152
|
+
window?.setGravity(Gravity.BOTTOM)
|
|
153
|
+
window?.setBackgroundDrawable(Color.TRANSPARENT.toDrawable())
|
|
144
154
|
|
|
145
|
-
|
|
146
|
-
dialog.dismiss()
|
|
147
|
-
})
|
|
155
|
+
binding.btnExit.tvProceed.text = "Exit"
|
|
148
156
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
157
|
+
binding.btnExit.root.setOnClickListener(View.OnClickListener { v: View? ->
|
|
158
|
+
finish()
|
|
159
|
+
dialog.dismiss()
|
|
160
|
+
})
|
|
152
161
|
|
|
153
|
-
|
|
154
|
-
|
|
162
|
+
binding.btnCancel.root.setOnClickListener(View.OnClickListener { v: View? ->
|
|
163
|
+
dialog.dismiss()
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
binding.closeButton.setOnClickListener(View.OnClickListener { v: View? ->
|
|
167
|
+
dialog.dismiss()
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
dialog.show()
|
|
171
|
+
}
|
|
155
172
|
|
|
156
173
|
}
|