@rentlydev/rently-tuya 0.2.2 → 0.2.3

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 (62) hide show
  1. package/android/src/main/java/com/rentlytuya/RentlyTuyaModule.kt +4 -0
  2. package/android/src/main/java/com/rentlytuya/alerts/PermissionAlert.kt +2 -2
  3. package/android/src/main/java/com/rentlytuya/components/AnchorButton.kt +4 -2
  4. package/android/src/main/java/com/rentlytuya/components/Button.kt +5 -4
  5. package/android/src/main/java/com/rentlytuya/components/CustomDatePicker.kt +9 -7
  6. package/android/src/main/java/com/rentlytuya/components/Divider.kt +1 -5
  7. package/android/src/main/java/com/rentlytuya/components/Label.kt +1 -1
  8. package/android/src/main/java/com/rentlytuya/dashboard/AdvancedSettings.kt +11 -9
  9. package/android/src/main/java/com/rentlytuya/dashboard/Dashboard.kt +4 -4
  10. package/android/src/main/java/com/rentlytuya/dashboard/DoorbellSettings.kt +100 -97
  11. package/android/src/main/java/com/rentlytuya/dashboard/FirmwareUpdate.kt +5 -8
  12. package/android/src/main/java/com/rentlytuya/dashboard/Messages.kt +3 -4
  13. package/android/src/main/java/com/rentlytuya/dashboard/NavController.kt +9 -11
  14. package/android/src/main/java/com/rentlytuya/dashboard/OfflineScreen.kt +11 -9
  15. package/android/src/main/java/com/rentlytuya/dashboard/Playback.kt +3 -3
  16. package/android/src/main/java/com/rentlytuya/tuya/Tuya.kt +2 -1
  17. package/android/src/main/java/com/rentlytuya/ui/theme/LocalColor.kt +34 -21
  18. package/android/src/main/java/com/rentlytuya/ui/theme/Theme.kt +13 -1
  19. package/android/src/main/res/drawable/update_complete.png +0 -0
  20. package/ios/components/Alert.swift +5 -7
  21. package/ios/components/AnchorButton.swift +2 -0
  22. package/ios/components/Button.swift +17 -2
  23. package/ios/components/CustomDatePicker.swift +5 -5
  24. package/ios/components/Label.swift +6 -1
  25. package/ios/dashboard/AdvanceSettings.swift +5 -5
  26. package/ios/dashboard/Dashboard.swift +3 -2
  27. package/ios/dashboard/FirmwareSettings.swift +11 -9
  28. package/ios/dashboard/Messages.swift +5 -3
  29. package/ios/dashboard/NavigationController.swift +38 -4
  30. package/ios/dashboard/Playback.swift +7 -5
  31. package/ios/dashboard/PreviewManager.swift +20 -4
  32. package/ios/dashboard/Settings.swift +7 -7
  33. package/ios/generated/RNRentlyTuyaSpec/RNRentlyTuyaSpec.h +18 -0
  34. package/ios/icons/cloud.png +0 -0
  35. package/ios/icons/cloud@2x.png +0 -0
  36. package/ios/icons/cloud@3x.png +0 -0
  37. package/ios/icons/down_update.png +0 -0
  38. package/ios/icons/down_update@2x.png +0 -0
  39. package/ios/icons/down_update@3x.png +0 -0
  40. package/ios/listener/RentlyTuya.mm +4 -1
  41. package/ios/listener/RentlyTuyaImpl.swift +7 -1
  42. package/ios/theme/LocalColor.swift +66 -20
  43. package/ios/theme/Theme.swift +162 -25
  44. package/ios/tuya/CameraManager.swift +1 -1
  45. package/ios/tuya/Tuya.swift +5 -0
  46. package/lib/commonjs/NativeRentlyTuya.js.map +1 -1
  47. package/lib/commonjs/index.js.map +1 -1
  48. package/lib/module/NativeRentlyTuya.js.map +1 -1
  49. package/lib/module/index.js.map +1 -1
  50. package/lib/typescript/commonjs/src/NativeRentlyTuya.d.ts +3 -0
  51. package/lib/typescript/commonjs/src/NativeRentlyTuya.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/src/index.d.ts +3 -0
  53. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  54. package/lib/typescript/module/src/NativeRentlyTuya.d.ts +3 -0
  55. package/lib/typescript/module/src/NativeRentlyTuya.d.ts.map +1 -1
  56. package/lib/typescript/module/src/index.d.ts +3 -0
  57. package/lib/typescript/module/src/index.d.ts.map +1 -1
  58. package/package.json +1 -1
  59. package/src/NativeRentlyTuya.ts +3 -0
  60. package/src/index.tsx +3 -0
  61. package/android/src/main/res/drawable/green_complete.png +0 -0
  62. package/android/src/main/res/drawable/white_complete.png +0 -0
@@ -100,6 +100,10 @@ class RentlyTuyaModule(private val reactContext: ReactApplicationContext) :
100
100
  if (params.hasKey("event_recording")) params.getBoolean("event_recording") else false
101
101
  Tuya.setSensitivityLow =
102
102
  if (params.hasKey("set_sensitivity_low")) params.getBoolean("set_sensitivity_low") else false
103
+ Tuya.darkThemeEnabled =
104
+ if (params.hasKey("darkThemeEnabled")) params.getBoolean("darkThemeEnabled") else false
105
+ Tuya.useSystemSetting =
106
+ if (params.hasKey("useSystemSetting")) params.getBoolean("useSystemSetting") else false
103
107
 
104
108
  // For navigation handling for AOSU charging
105
109
  Tuya.doorbellSetting =
@@ -61,7 +61,7 @@ fun PermissionAlert(
61
61
  .height(50.dp),
62
62
  id = "AudioPermission_NotNow",
63
63
  title = strings(id = R.string.notNow),
64
- textColor = LocalColor.Monochrome.White,
64
+ textColor = LocalColor.Monochrome.StaticWhite,
65
65
  primary = true,
66
66
  semiBold = true
67
67
  ) {
@@ -74,7 +74,7 @@ fun PermissionAlert(
74
74
  .height(50.dp),
75
75
  id = "AudioPermission_Agree",
76
76
  title = strings(id = R.string.agree),
77
- textColor = LocalColor.Monochrome.White,
77
+ textColor = LocalColor.Monochrome.StaticWhite,
78
78
  primary = true,
79
79
  semiBold = true
80
80
  ) {
@@ -5,6 +5,7 @@ import androidx.compose.material3.TextButton
5
5
  import androidx.compose.runtime.Composable
6
6
  import androidx.compose.runtime.CompositionLocalProvider
7
7
  import androidx.compose.ui.Modifier
8
+ import androidx.compose.ui.graphics.Color
8
9
  import androidx.compose.ui.platform.LocalDensity
9
10
  import androidx.compose.ui.semantics.contentDescription
10
11
  import androidx.compose.ui.semantics.semantics
@@ -34,6 +35,7 @@ fun AnchorButton(
34
35
  // Color
35
36
  primary: Boolean = false,
36
37
  black: Boolean = false,
38
+ customColor: Color? = null,
37
39
  // Font Weight
38
40
  light: Boolean = false,
39
41
  medium: Boolean = false,
@@ -50,9 +52,9 @@ fun AnchorButton(
50
52
  onClick: () -> Unit = {}
51
53
  ) {
52
54
 
53
- val textColor = when {
55
+ val textColor = customColor ?: when {
54
56
  primary -> LocalColor.Primary.Light
55
- black -> LocalColor.Monochrome.Black
57
+ black -> LocalColor.Monochrome.BlackColor
56
58
  else -> LocalColor.Primary.Light
57
59
  }
58
60
 
@@ -48,6 +48,7 @@ fun Button(
48
48
  grey: Boolean = false,
49
49
  black: Boolean = false,
50
50
  textColor: Color?,
51
+ backgroundColor: Color? = null,
51
52
  borderColor: Color? = null,
52
53
  // Font Weight
53
54
  light: Boolean = false,
@@ -61,11 +62,11 @@ fun Button(
61
62
  onClick: () -> Unit = {}
62
63
  ) {
63
64
 
64
- val buttonColor = when {
65
+ val buttonColor = backgroundColor ?: when {
65
66
  primary -> LocalColor.Primary.Medium
66
- secondary -> Color(0xFFf37787)
67
+ secondary -> LocalColor.Danger.Secondary
67
68
  white -> LocalColor.Monochrome.White
68
- grey -> LocalColor.Monochrome.LightGrey
69
+ grey -> LocalColor.Monochrome.Grey
69
70
  black -> LocalColor.Monochrome.Black
70
71
  else -> LocalColor.Primary.Light
71
72
  }
@@ -134,7 +135,7 @@ fun Button(
134
135
  fontSize = fontSize,
135
136
  fontFamily = fontFamily,
136
137
  textAlign = TextAlign.Center,
137
- color = textColor!!,
138
+ color = if (disabled) textColor!!.copy(alpha = 0.5f) else textColor!!,
138
139
  maxLines = 1,
139
140
  overflow = TextOverflow.Clip,
140
141
  modifier = Modifier
@@ -86,21 +86,21 @@ fun DatePicker(
86
86
  Column(
87
87
  modifier = Modifier
88
88
  .fillMaxWidth()
89
- .background(LocalColor.Main.Dark)
89
+ .background(LocalColor.Monochrome.DatePickerBackground)
90
90
  .padding(start = 15.dp, top = 20.dp, bottom = 30.dp)
91
91
  ) {
92
92
  Label(
93
93
  modifier = Modifier.padding(bottom = 20.dp),
94
94
  title = "Select date",
95
95
  l = true,
96
- white = true,
96
+ customColor = LocalColor.Monochrome.StaticWhite,
97
97
  bold = true
98
98
  )
99
99
  Label(
100
100
  title = LocalDate.ofEpochDay(tempDate / 86400000)
101
101
  .format(DateTimeFormatter.ofPattern("MMM dd yyyy")),
102
102
  xl34 = true,
103
- white = true,
103
+ customColor = LocalColor.Monochrome.StaticWhite,
104
104
  bold = true
105
105
  )
106
106
  }
@@ -126,7 +126,8 @@ fun DatePicker(
126
126
  ) {
127
127
  Icon(
128
128
  Icons.AutoMirrored.Filled.ArrowBack,
129
- contentDescription = "Previous Month"
129
+ contentDescription = "Previous Month",
130
+ tint = LocalColor.Main.Dark
130
131
  )
131
132
  }
132
133
 
@@ -147,7 +148,8 @@ fun DatePicker(
147
148
  ) {
148
149
  Icon(
149
150
  Icons.AutoMirrored.Filled.ArrowForward,
150
- contentDescription = "Next Month"
151
+ contentDescription = "Next Month",
152
+ tint = LocalColor.Main.Dark
151
153
  )
152
154
  }
153
155
  }
@@ -234,7 +236,7 @@ fun DatePicker(
234
236
  title = (day + 1).toString(),
235
237
  m = true,
236
238
  bold = isSelected,
237
- white = isSelected,
239
+ customColor = if (isSelected) LocalColor.Monochrome.StaticWhite else null,
238
240
  black = !isSelected
239
241
  )
240
242
  }
@@ -261,7 +263,7 @@ fun DatePicker(
261
263
  modifier = Modifier.padding(5.dp),
262
264
  id = "DatePicker_OK",
263
265
  title = strings(id = R.string.ok).uppercase(),
264
- black = true,
266
+ customColor = LocalColor.Main.Dark,
265
267
  semiBold = true
266
268
  ) {
267
269
  selectedDate = tempDate
@@ -23,17 +23,13 @@ fun Divider(
23
23
  modifier: Modifier = Modifier,
24
24
  thickness: Dp = 1.dp,
25
25
  direction: DividerDirection = DividerDirection.Horizontal,
26
- primary: Boolean = false,
27
26
  ) {
28
27
  val targetThickness = when (thickness) {
29
28
  Dp.Hairline -> (1f / LocalDensity.current.density).dp
30
29
  else -> thickness
31
30
  }
32
31
 
33
- val color = when {
34
- primary -> LocalColor.Secondary.Light
35
- else -> LocalColor.Secondary.Light
36
- }
32
+ val color = LocalColor.Monochrome.LightGrey
37
33
 
38
34
  Box(
39
35
  when (direction) {
@@ -82,7 +82,7 @@ fun Label(
82
82
  lightGrey -> LocalColor.Monochrome.Regular
83
83
  grey -> LocalColor.Monochrome.Medium
84
84
  white -> LocalColor.Monochrome.White
85
- black -> LocalColor.Monochrome.Black
85
+ black -> LocalColor.Monochrome.BlackColor
86
86
  else -> LocalColor.Primary.Light
87
87
  }
88
88
 
@@ -52,6 +52,7 @@ import com.rentlytuya.ui.theme.LocalFont.FontSize
52
52
  import com.rentlytuya.util.DateUtil.isNotNull
53
53
  import com.rentlytuya.util.Util.strings
54
54
  import androidx.compose.foundation.Image
55
+ import androidx.compose.ui.graphics.ColorFilter
55
56
 
56
57
 
57
58
  @Composable
@@ -96,12 +97,11 @@ fun AdvancedSettings(
96
97
  modifier = Modifier
97
98
  .fillMaxSize()
98
99
  .background(LocalColor.Main.Light)
99
- .padding(top = 15.dp)
100
+ .padding(vertical = 15.dp, horizontal = 12.dp)
100
101
  ) {
101
102
  Column(
102
103
  modifier = Modifier
103
104
  .background(LocalColor.Monochrome.White)
104
- .padding(horizontal = 10.dp)
105
105
  ) {
106
106
  Item(
107
107
  title = strings(id = R.string.productName),
@@ -183,6 +183,7 @@ fun StorageSettings(
183
183
  modifier = Modifier
184
184
  .fillMaxSize()
185
185
  .background(LocalColor.Main.Light)
186
+ .padding(horizontal = 12.dp)
186
187
  ) {
187
188
  Column(
188
189
  modifier = Modifier
@@ -192,19 +193,19 @@ fun StorageSettings(
192
193
  Item(
193
194
  title = strings(id = R.string.totalCapacity),
194
195
  value = totalStorageCapacity.value,
195
- background = LocalColor.Main.Light
196
+ background = LocalColor.Monochrome.White
196
197
  )
197
198
 
198
199
  Item(
199
200
  title = strings(id = R.string.used),
200
201
  value = usedStorage.value,
201
- background = LocalColor.Main.Light
202
+ background = LocalColor.Monochrome.White
202
203
  )
203
204
 
204
205
  Item(
205
206
  title = strings(id = R.string.remainingCapacity),
206
207
  value = remainingStorageCapacity.value,
207
- background = LocalColor.Main.Light
208
+ background = LocalColor.Monochrome.White
208
209
  )
209
210
 
210
211
  val annotatedText = buildAnnotatedString {
@@ -214,7 +215,7 @@ fun StorageSettings(
214
215
  SpanStyle(
215
216
  fontFamily = LocalFont.FontFamily.medium,
216
217
  fontWeight = FontWeight.Bold,
217
- color = LocalColor.Monochrome.Black,
218
+ color = LocalColor.Monochrome.BlackColor,
218
219
  fontSize = FontSize.L
219
220
  ),
220
221
  start = 0,
@@ -226,7 +227,7 @@ fun StorageSettings(
226
227
  addStyle(
227
228
  SpanStyle(
228
229
  fontFamily = LocalFont.FontFamily.medium,
229
- color = LocalColor.Monochrome.Black,
230
+ color = LocalColor.Monochrome.BlackColor,
230
231
  fontSize = FontSize.L
231
232
  ),
232
233
  start = length - message.length,
@@ -264,7 +265,7 @@ fun StorageSettings(
264
265
  .height(50.dp),
265
266
  id = "FormatSDCard",
266
267
  title = strings(id = R.string.format),
267
- textColor = LocalColor.Monochrome.White,
268
+ textColor = LocalColor.Monochrome.StaticWhite,
268
269
  secondary = true,
269
270
  semiBold = true,
270
271
  disabled = storageFunctionType.intValue == 4
@@ -356,13 +357,14 @@ fun Item(
356
357
  .size(12.dp),
357
358
  painter = painterResource(id = R.drawable.ic_arrow_blue_right),
358
359
  contentDescription = "rightArrow",
360
+ colorFilter = ColorFilter.tint(LocalColor.Monochrome.BlackColor)
359
361
  )
360
362
  }
361
363
  }
362
364
  }
363
365
 
364
366
  Divider(
365
- thickness = 1.dp
367
+ thickness = 0.5.dp
366
368
  )
367
369
  }
368
370
  }
@@ -339,8 +339,8 @@ fun BoxScope.DoorbellControls(
339
339
  } else {
340
340
  strings(id = R.string.charging)
341
341
  },
342
- white = true,
343
- s = true
342
+ s = true,
343
+ customColor = LocalColor.Monochrome.StaticWhite
344
344
  )
345
345
  }
346
346
  }
@@ -365,7 +365,7 @@ fun BoxScope.DoorbellControls(
365
365
  semiBold = true,
366
366
  grey = true,
367
367
  disabled = isLoading.value,
368
- textColor = LocalColor.Monochrome.White,
368
+ textColor = LocalColor.Monochrome.StaticWhite,
369
369
  cornerRadius = 20.dp,
370
370
  onClick = {
371
371
  Tuya.changeResolution(
@@ -390,7 +390,7 @@ fun BoxScope.DoorbellControls(
390
390
  medium = isMicOn.value,
391
391
  semiBold = true,
392
392
  disabled = isLoading.value,
393
- textColor = LocalColor.Monochrome.White,
393
+ textColor = LocalColor.Monochrome.StaticWhite,
394
394
  cornerRadius = 40.dp,
395
395
  onClick = {
396
396
  if (PermissionHandler.arePermissionsGranted(context, permissions)) {
@@ -8,6 +8,7 @@ import androidx.compose.foundation.background
8
8
  import androidx.compose.foundation.clickable
9
9
  import androidx.compose.foundation.interaction.MutableInteractionSource
10
10
  import androidx.compose.foundation.layout.Arrangement
11
+ import androidx.compose.foundation.layout.Box
11
12
  import androidx.compose.foundation.layout.Column
12
13
  import androidx.compose.foundation.layout.Row
13
14
  import androidx.compose.foundation.layout.fillMaxHeight
@@ -27,6 +28,7 @@ import androidx.compose.runtime.mutableStateOf
27
28
  import androidx.compose.runtime.remember
28
29
  import androidx.compose.ui.Alignment
29
30
  import androidx.compose.ui.Modifier
31
+ import androidx.compose.ui.graphics.ColorFilter
30
32
  import androidx.compose.ui.platform.LocalConfiguration
31
33
  import androidx.compose.ui.platform.LocalContext
32
34
  import androidx.compose.ui.res.painterResource
@@ -35,13 +37,11 @@ import androidx.compose.ui.unit.sp
35
37
  import androidx.compose.ui.window.Dialog
36
38
  import androidx.compose.ui.window.DialogProperties
37
39
  import androidx.navigation.NavController
38
- import com.facebook.react.ReactApplication
39
40
  import com.rentlytuya.R
40
41
  import com.rentlytuya.alerts.RemoveDoorbellAlert
41
42
  import com.rentlytuya.alerts.RemoveDoorbellFailureAlert
42
43
  import com.rentlytuya.alerts.ResetWifiAlert
43
44
  import com.rentlytuya.components.Button
44
- import com.rentlytuya.components.Divider
45
45
  import com.rentlytuya.components.Label
46
46
  import com.rentlytuya.components.LoadingIndicator
47
47
  import com.rentlytuya.components.Switch
@@ -226,7 +226,9 @@ fun DoorbellSettings(
226
226
 
227
227
  else -> {
228
228
  LazyColumn(
229
- modifier = Modifier.fillMaxSize()
229
+ modifier = Modifier
230
+ .fillMaxSize()
231
+ .background(LocalColor.Main.Light)
230
232
  ) {
231
233
  item {
232
234
  Heading(title = strings(id = R.string.basicSettings))
@@ -685,7 +687,7 @@ fun DoorbellSettings(
685
687
  .height(50.dp),
686
688
  id = "RemoveDoorbell",
687
689
  title = strings(id = R.string.removeDoorbell),
688
- textColor = LocalColor.Monochrome.White,
690
+ textColor = LocalColor.Monochrome.StaticWhite,
689
691
  secondary = true,
690
692
  m = true,
691
693
  semiBold = true
@@ -706,7 +708,7 @@ fun Heading(title: String) {
706
708
  modifier = Modifier
707
709
  .fillMaxWidth()
708
710
  .height(40.dp)
709
- .background(LocalColor.Monochrome.White),
711
+ .background(LocalColor.Main.Light),
710
712
  verticalAlignment = Alignment.CenterVertically
711
713
  ) {
712
714
  Label(
@@ -742,117 +744,117 @@ fun SettingsItem(
742
744
  mutableStateOf(false)
743
745
  }
744
746
 
745
- Column(modifier = Modifier.background(LocalColor.Main.Light)) {
746
- Row(
747
- modifier = Modifier
748
- .fillMaxWidth()
749
- .clickable(
750
- interactionSource = remember { MutableInteractionSource() },
751
- indication = if (withDropDown || onClick.isNotNull()) ripple() else null
752
- ) {
753
- if (withDropDown) isDropDownVisible.value = true else onClick?.invoke()
754
- }
755
- .padding(horizontal = 20.dp),
756
- horizontalArrangement = Arrangement.SpaceBetween,
757
- verticalAlignment = Alignment.CenterVertically
758
- ) {
759
- Column(
760
- modifier = Modifier
761
- .fillMaxWidth(0.7f)
762
- .padding(vertical = 10.dp)
763
- ) {
764
- Label(
765
- modifier = Modifier,
766
- id = title.lowercase(),
767
- title = title,
768
- m = true,
769
- grey = true,
770
- semiBold = true,
771
- )
772
-
773
- if (description.isNotBlank()) {
774
- Label(
775
- modifier = Modifier
776
- .padding(top = 5.dp),
777
- id = title.lowercase() + "Description",
778
- title = description,
779
- maxLines = 6,
780
- s = true,
781
- lightGrey = true,
782
- medium = true,
783
- lineHeight = 15.sp
784
- )
785
- }
786
- }
787
-
747
+ Box(modifier = Modifier
748
+ .padding( horizontal = 12.dp)
749
+ .background(LocalColor.Monochrome.White))
750
+ {
751
+ Column(modifier = Modifier) {
788
752
  Row(
789
753
  modifier = Modifier
790
- .fillMaxWidth(),
791
- horizontalArrangement = Arrangement.End,
754
+ .fillMaxWidth()
755
+ .clickable(
756
+ interactionSource = remember { MutableInteractionSource() },
757
+ indication = if (withDropDown || onClick.isNotNull()) ripple() else null
758
+ ) {
759
+ if (withDropDown) isDropDownVisible.value = true else onClick?.invoke()
760
+ }
761
+ .padding(horizontal = 12.dp),
762
+ horizontalArrangement = Arrangement.SpaceBetween,
792
763
  verticalAlignment = Alignment.CenterVertically
793
764
  ) {
794
- when {
795
- withSwitch -> {
796
- Switch(
797
- id = title + "Switch",
798
- checked = checked,
799
- onChange = onToggle
800
- )
801
- }
765
+ Column(
766
+ modifier = Modifier
767
+ .fillMaxWidth(0.7f)
768
+ .padding(vertical = 10.dp)
769
+ ) {
770
+ Label(
771
+ modifier = Modifier,
772
+ id = title.lowercase(),
773
+ title = title,
774
+ m = true,
775
+ black = true,
776
+ semiBold = true,
777
+ )
802
778
 
803
- withDropDown -> {
804
- PopUp(
805
- isVisible = isDropDownVisible,
806
- dropDownTitle = dropDownTitle,
807
- dropDownList = dropDownList,
808
- selectedOption = selectedOption,
809
- onDropDownItemSelected = onDropDownItemSelected,
779
+ if (description.isNotBlank()) {
780
+ Label(
781
+ modifier = Modifier
782
+ .padding(top = 5.dp),
783
+ id = title.lowercase() + "Description",
784
+ title = description,
785
+ maxLines = 6,
786
+ s = true,
787
+ lightGrey = true,
788
+ medium = true,
789
+ lineHeight = 15.sp
810
790
  )
811
791
  }
792
+ }
812
793
 
813
- else -> {
814
- if (leftIcon == true) {
815
- Image(
816
- modifier = Modifier
817
- .width(24.dp)
818
- .height(24.dp)
819
- .padding(end = 5.dp),
820
- painter = painterResource(id = R.drawable.ic_warning),
821
- contentDescription = "warningIcon",
794
+ Row(
795
+ modifier = Modifier
796
+ .fillMaxWidth(),
797
+ horizontalArrangement = Arrangement.End,
798
+ verticalAlignment = Alignment.CenterVertically
799
+ ) {
800
+ when {
801
+ withSwitch -> {
802
+ Switch(
803
+ id = title + "Switch",
804
+ checked = checked,
805
+ onChange = onToggle
822
806
  )
823
807
  }
824
- if (additionalInfo != "") {
825
- Label(
826
- modifier = Modifier
827
- .padding(end = 5.dp),
828
- id = title.lowercase(),
829
- title = additionalInfo,
830
- maxLines = 1,
831
- m = true,
832
- black = true,
833
- semiBold = true
808
+
809
+ withDropDown -> {
810
+ PopUp(
811
+ isVisible = isDropDownVisible,
812
+ dropDownTitle = dropDownTitle,
813
+ dropDownList = dropDownList,
814
+ selectedOption = selectedOption,
815
+ onDropDownItemSelected = onDropDownItemSelected,
834
816
  )
835
817
  }
836
818
 
837
- if (rightArrow) {
838
- Image(
839
- modifier = Modifier
840
- .size(18.dp)
841
- .padding(top = 5.dp),
842
- painter = painterResource(id = R.drawable.ic_arrow_blue_right),
843
- contentDescription = "rightArrow",
844
- )
819
+ else -> {
820
+ if (leftIcon == true) {
821
+ Image(
822
+ modifier = Modifier
823
+ .width(24.dp)
824
+ .height(24.dp)
825
+ .padding(end = 5.dp),
826
+ painter = painterResource(id = R.drawable.ic_warning),
827
+ contentDescription = "warningIcon",
828
+ )
829
+ }
830
+ if (additionalInfo != "") {
831
+ Label(
832
+ modifier = Modifier
833
+ .padding(end = 5.dp),
834
+ id = title.lowercase(),
835
+ title = additionalInfo,
836
+ maxLines = 1,
837
+ m = true,
838
+ black = true,
839
+ semiBold = true
840
+ )
841
+ }
842
+ if (rightArrow) {
843
+ Image(
844
+ modifier = Modifier
845
+ .size(18.dp)
846
+ .padding(top = 5.dp),
847
+ painter = painterResource(id = R.drawable.ic_arrow_blue_right),
848
+ contentDescription = "rightArrow",
849
+ colorFilter = ColorFilter.tint(LocalColor.Monochrome.BlackColor)
850
+ )
851
+ }
845
852
  }
846
853
  }
847
854
  }
848
855
  }
849
856
  }
850
857
 
851
- Divider(
852
- modifier = Modifier
853
- .padding(horizontal = 10.dp),
854
- thickness = 1.dp
855
- )
856
858
  }
857
859
  }
858
860
 
@@ -892,6 +894,7 @@ fun PopUp(
892
894
  .size(12.dp),
893
895
  painter = painterResource(id = R.drawable.ic_arrow_blue_right),
894
896
  contentDescription = "rightArrow",
897
+ colorFilter = ColorFilter.tint(LocalColor.Monochrome.BlackColor)
895
898
  )
896
899
  }
897
900
 
@@ -194,8 +194,10 @@ fun FirmwareUpdate(
194
194
  title = strings(id = R.string.updateFirmware),
195
195
  semiBold = true,
196
196
  textModifier = Modifier,
197
+ primary = isNewVersionAvailable.value,
198
+ grey = !isNewVersionAvailable.value,
197
199
  xl18 = true,
198
- textColor = LocalColor.Monochrome.White,
200
+ textColor = LocalColor.Monochrome.StaticWhite,
199
201
  disabled = !isNewVersionAvailable.value || isLoading.value,
200
202
  onClick = {
201
203
  Heap.trackEvent(eventName = "clickUpdateFirmwareButton")
@@ -285,15 +287,10 @@ fun FirmwareUpdatingScreen(
285
287
  ) {
286
288
  Box(contentAlignment = Alignment.Center) {
287
289
  Image(
288
- painter = painterResource(id = R.drawable.green_complete),
290
+ painter = painterResource(id = R.drawable.update_complete),
289
291
  contentDescription = null,
290
292
  modifier = Modifier.size(150.dp)
291
293
  )
292
- Image(
293
- painter = painterResource(id = R.drawable.white_complete),
294
- contentDescription = null,
295
- modifier = Modifier.size(50.dp)
296
- )
297
294
  }
298
295
 
299
296
  Spacer(modifier = Modifier.height(36.dp))
@@ -339,7 +336,7 @@ fun FirmwareUpdatingScreen(
339
336
  "${(progress * 100).toInt()}%"
340
337
  },
341
338
  xl18 = true,
342
- white = true,
339
+ customColor = LocalColor.Monochrome.StaticWhite,
343
340
  modifier = Modifier.padding(top = 8.dp)
344
341
  )
345
342
  }
@@ -326,7 +326,7 @@ fun MessageItem(
326
326
  title = formatMessageDate(message.dateTime),
327
327
  bold = true,
328
328
  m = true,
329
- black = true,
329
+ secondary = true,
330
330
  medium = true
331
331
  )
332
332
 
@@ -340,7 +340,7 @@ fun MessageItem(
340
340
  strings(id = R.string.unableToCaptureDetectedEvents)
341
341
  },
342
342
  l = true,
343
- primary = true,
343
+ black = true,
344
344
  semiBold = true,
345
345
  maxLines = 6
346
346
  )
@@ -357,7 +357,6 @@ fun MessageItem(
357
357
  }
358
358
  }
359
359
 
360
- Divider(thickness = 1.dp)
361
360
  }
362
361
  }
363
362
  }
@@ -468,7 +467,7 @@ private suspend fun fetchMoreMessages(
468
467
  private fun formatMessageDate(dateTime: String): String {
469
468
  return try {
470
469
  val formatter = SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault())
471
- val date = formatter.parse(dateTime)
470
+ val date = formatter.parse(dateTime)!!
472
471
  val outputFormatter = SimpleDateFormat("MM/dd/yyyy hh:mm a", Locale.getDefault())
473
472
  outputFormatter.format(date)
474
473
  } catch (e: Exception) {