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)
val isAddParticipantsView: StateFlow<Boolean> = _isAddParticipantsView
@Suppress("PropertyName")
@SuppressLint("PropertyName")
private val _enableAddButton = MutableStateFlow(false)
val enableAddButton: StateFlow<Boolean> = _enableAddButton
@Suppress("PropertyName")
@SuppressLint("PropertyName")
private val _selectedContacts = MutableStateFlow<List<AutocompleteUser>>(emptyList())
@SuppressLint("PropertyName")

View File

@ -40,15 +40,15 @@ fun SearchComponent(
onDisableSearch: () -> Unit,
isAddParticipants: Boolean
) {
var width_ratio = 0.85f
var widthRatio = SearchComponentCompanionClass.WIDTH_RATI0_SMALL
if (!isAddParticipants) {
width_ratio = 1.0f
widthRatio = SearchComponentCompanionClass.WIDTH_RATIO_LARGE
}
val keyboardController = LocalSoftwareKeyboardController.current
TextField(
modifier = Modifier
.background(MaterialTheme.colorScheme.background)
.fillMaxWidth(width_ratio)
.fillMaxWidth(widthRatio)
.height(60.dp),
value = text,
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
}
}