@@ -24,6 +24,7 @@ import androidx.compose.ui.Modifier
2424import androidx.compose.ui.draw.alpha
2525import androidx.compose.ui.graphics.ColorFilter
2626import androidx.compose.ui.text.font.FontWeight
27+ import androidx.compose.ui.text.style.TextOverflow
2728import androidx.compose.ui.unit.dp
2829import androidx.compose.ui.unit.sp
2930import com.notes.components.ItemModifications
@@ -77,7 +78,7 @@ private fun NoItems() = Column(
7778@Composable
7879private fun ListView (items : List <Note >, handler : ItemModifications ) {
7980 LazyVerticalGrid (
80- cells = GridCells .Adaptive (120 .dp)
81+ cells = GridCells .Adaptive (180 .dp)
8182 ) {
8283 items(items) { item ->
8384 NoteItemView (
@@ -94,20 +95,34 @@ private fun ListView(items: List<Note>, handler: ItemModifications) {
9495@OptIn(ExperimentalFoundationApi ::class )
9596@Composable
9697private fun LazyItemScope.NoteItemView (item : Note , onClick : () -> Unit , onDeleteClicked : () -> Unit ) =
97- Box (Modifier .fillMaxWidth().padding(8 .dp)) {
98+ Box (Modifier .fillMaxWidth().padding(12 .dp)) {
9899 val removing = mutableStateOf(false )
99100 Card (
100101 modifier = Modifier .fillMaxSize().selectable(true ) { onClick() }
101102 .combinedClickable(
102103 enabled = true ,
103104 onClick = onClick,
104105 onLongClick = { removing.value = ! removing.value }
105- )
106+ ),
107+ elevation = 6 .dp
106108 ) {
107109 if (! removing.value) {
108110 Column (modifier = Modifier .padding(8 .dp)) {
109- Text (text = item.name, fontWeight = FontWeight .Bold , fontSize = 24 .sp)
110- Text (text = item.text)
111+ Text (
112+ text = item.name,
113+ fontWeight = FontWeight .Bold ,
114+ fontSize = 18 .sp,
115+ maxLines = 1 ,
116+ overflow = TextOverflow .Ellipsis
117+ )
118+ Text (
119+ modifier = Modifier .alpha(0.8f ),
120+ text = item.text,
121+ fontWeight = FontWeight .Light ,
122+ fontSize = 14 .sp,
123+ maxLines = 3 ,
124+ overflow = TextOverflow .Ellipsis
125+ )
111126 }
112127 } else {
113128 Row (
0 commit comments