mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 13:59:48 +01:00
use constants and proper names
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
6e48b86940
commit
652dd5033a
@ -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")
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user