use constants and proper names

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2025-05-26 18:20:48 +02:00 committed by Marcel Hibbe
parent 6e48b86940
commit 652dd5033a
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
2 changed files with 12 additions and 5 deletions

View File

@ -37,11 +37,11 @@ class ContactsViewModel @Inject constructor(
private val _isAddParticipantsView = MutableStateFlow(false) private val _isAddParticipantsView = MutableStateFlow(false)
val isAddParticipantsView: StateFlow<Boolean> = _isAddParticipantsView val isAddParticipantsView: StateFlow<Boolean> = _isAddParticipantsView
@Suppress("PropertyName") @SuppressLint("PropertyName")
private val _enableAddButton = MutableStateFlow(false) private val _enableAddButton = MutableStateFlow(false)
val enableAddButton: StateFlow<Boolean> = _enableAddButton val enableAddButton: StateFlow<Boolean> = _enableAddButton
@Suppress("PropertyName") @SuppressLint("PropertyName")
private val _selectedContacts = MutableStateFlow<List<AutocompleteUser>>(emptyList()) private val _selectedContacts = MutableStateFlow<List<AutocompleteUser>>(emptyList())
@SuppressLint("PropertyName") @SuppressLint("PropertyName")

View File

@ -40,15 +40,15 @@ fun SearchComponent(
onDisableSearch: () -> Unit, onDisableSearch: () -> Unit,
isAddParticipants: Boolean isAddParticipants: Boolean
) { ) {
var width_ratio = 0.85f var widthRatio = SearchComponentCompanionClass.WIDTH_RATI0_SMALL
if (!isAddParticipants) { if (!isAddParticipants) {
width_ratio = 1.0f widthRatio = SearchComponentCompanionClass.WIDTH_RATIO_LARGE
} }
val keyboardController = LocalSoftwareKeyboardController.current val keyboardController = LocalSoftwareKeyboardController.current
TextField( TextField(
modifier = Modifier modifier = Modifier
.background(MaterialTheme.colorScheme.background) .background(MaterialTheme.colorScheme.background)
.fillMaxWidth(width_ratio) .fillMaxWidth(widthRatio)
.height(60.dp), .height(60.dp),
value = text, value = text,
onValueChange = { onTextChange(it) }, onValueChange = { onTextChange(it) },
@ -109,3 +109,10 @@ fun searchKeyboardActions(text: String, keyboardController: SoftwareKeyboardCont
} }
} }
) )
class SearchComponentCompanionClass {
companion object {
const val WIDTH_RATI0_SMALL = 0.85f
const val WIDTH_RATIO_LARGE = 1.0f
}
}