generated from bitwarden/template
-
Notifications
You must be signed in to change notification settings - Fork 9
/
ItemSearchContent.kt
50 lines (47 loc) · 1.83 KB
/
ItemSearchContent.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.bitwarden.authenticator.ui.authenticator.feature.search
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.bitwarden.authenticator.ui.authenticator.feature.search.handlers.SearchHandlers
/**
* The content state for the item search screen.
*/
@Composable
fun ItemSearchContent(
viewState: ItemSearchState.ViewState.Content,
searchHandlers: SearchHandlers,
modifier: Modifier = Modifier,
) {
LazyColumn(modifier = modifier) {
items(viewState.displayItems) {
VaultVerificationCodeItem(
modifier = Modifier
.fillMaxWidth()
.padding(
start = 16.dp,
// There is some built-in padding to the menu button that makes up
// the visual difference here.
end = 12.dp,
),
authCode = it.authCode,
issuer = it.issuer,
periodSeconds = it.periodSeconds,
timeLeftSeconds = it.timeLeftSeconds,
alertThresholdSeconds = it.alertThresholdSeconds,
supportingLabel = it.supportingLabel,
startIcon = it.startIcon,
onCopyClick = { searchHandlers.onItemClick(it.id) },
onItemClick = { searchHandlers.onItemClick(it.id) },
)
}
item {
Spacer(modifier = Modifier.navigationBarsPadding())
}
}
}