Disable calendar and contact search settings if permission is not granted
This commit is contained in:
parent
974988f65d
commit
f83bab94ce
@ -65,10 +65,11 @@ fun SearchSettingsScreen() {
|
||||
title = stringResource(R.string.preference_search_contacts),
|
||||
summary = stringResource(R.string.preference_search_contacts_summary),
|
||||
icon = Icons.Rounded.Person,
|
||||
value = contacts == true,
|
||||
value = contacts == true && hasContactsPermission == true,
|
||||
onValueChanged = {
|
||||
viewModel.setContacts(it)
|
||||
}
|
||||
},
|
||||
enabled = hasContactsPermission == true
|
||||
)
|
||||
|
||||
val hasCalendarPermission by viewModel.hasCalendarPermission.observeAsState()
|
||||
@ -86,10 +87,11 @@ fun SearchSettingsScreen() {
|
||||
title = stringResource(R.string.preference_search_calendar),
|
||||
summary = stringResource(R.string.preference_search_calendar_summary),
|
||||
icon = Icons.Rounded.Today,
|
||||
value = calendar == true,
|
||||
value = calendar == true && hasCalendarPermission == true,
|
||||
onValueChanged = {
|
||||
viewModel.setCalendar(it)
|
||||
}
|
||||
},
|
||||
enabled = hasCalendarPermission == true
|
||||
)
|
||||
|
||||
val calculator by viewModel.calculator.observeAsState()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user