mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 22:04:24 +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)
|
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")
|
||||||
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user