Skip to content

Commit e1d3582

Browse files
committed
feat: show warning in SMS bottom sheet that Key Mapper devs are not liable for any charges
1 parent eb238bf commit e1d3582

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

base/src/main/java/io/github/sds100/keymapper/base/actions/CreateActionDelegate.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ class CreateActionDelegate(
169169

170170
if (result is SystemError.PermissionDenied) {
171171
useCase.requestPermission(result.permission)
172+
smsActionBottomSheetState = state.copy(testResult = null)
172173
} else {
173174
smsActionBottomSheetState = state.copy(testResult = State.Data(result))
174175
}

base/src/main/java/io/github/sds100/keymapper/base/actions/SmsActionBottomSheet.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,18 @@ private fun SmsActionBottomSheet(
201201
},
202202
)
203203

204-
Spacer(modifier = Modifier.height(16.dp))
204+
Spacer(modifier = Modifier.height(8.dp))
205+
206+
Text(
207+
modifier = Modifier
208+
.fillMaxWidth()
209+
.padding(horizontal = 16.dp),
210+
text = stringResource(R.string.warning_sms_charges),
211+
color = MaterialTheme.colorScheme.onSurfaceVariant,
212+
style = MaterialTheme.typography.labelMedium,
213+
)
214+
215+
Spacer(modifier = Modifier.height(8.dp))
205216

206217
if (state is SmsActionBottomSheetState.SendSms) {
207218
Row(

base/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,6 +1768,7 @@
17681768

17691769
<string name="button_test_sms">Test SMS</string>
17701770
<string name="test_sms_result_ok">Sent successfully!</string>
1771+
<string name="warning_sms_charges">Sending SMS may incur carrier or roaming charges. Key Mapper developers are not liable for any costs.</string>
17711772
<string name="hint_shell_command_description">Description</string>
17721773
<string name="hint_shell_command_timeout">Timeout</string>
17731774

0 commit comments

Comments
 (0)