@@ -45,6 +45,7 @@ import org.thoughtcrime.securesms.util.MediaUtil
4545import kotlin.collections.filterNot
4646import kotlin.collections.indexOfFirst
4747import androidx.core.net.toUri
48+ import org.thoughtcrime.securesms.ui.theme.LocalDimensions
4849
4950@OptIn(ExperimentalGlideComposeApi ::class )
5051@Composable
@@ -56,7 +57,6 @@ fun MediaFolderCell(
5657) {
5758 Box (
5859 modifier = Modifier
59- .padding(end = 2 .dp, bottom = 2 .dp)
6060 .fillMaxWidth()
6161 .clickable(onClick = onClick)
6262 ) {
@@ -72,50 +72,49 @@ fun MediaFolderCell(
7272 modifier = Modifier
7373 .align(Alignment .BottomCenter )
7474 .fillMaxWidth()
75- .height(50 .dp)
7675 .background(
7776 Brush .verticalGradient(
7877 colorStops = arrayOf(
7978 0.0f to Color .Transparent ,
80- 0.5f to Color .Black .copy(alpha = 0.5333f ),
81- 1.0f to Color .Black .copy(alpha = 0.6667f )
79+ 0.5f to Color .Black .copy(alpha = 0.5f ),
80+ 1.0f to Color .Black .copy(alpha = 0.7f )
8281 )
8382 )
8483 )
85- )
86- // Bottom row
87- Row (
88- modifier = Modifier
89- .align(Alignment .BottomStart )
90- .fillMaxWidth()
91- .padding(6 .dp),
92- verticalAlignment = Alignment .CenterVertically
84+ .padding(LocalDimensions .current.smallSpacing)
9385 ) {
94- Image (
95- painter = painterResource(R .drawable.ic_baseline_folder_24),
96- contentDescription = null ,
97- modifier = Modifier .size(20 .dp),
98- colorFilter = ColorFilter .tint(Color .White )
99- )
86+ // Bottom row
87+ Row (
88+ modifier = Modifier
89+ .fillMaxWidth(),
90+ verticalAlignment = Alignment .CenterVertically
91+ ) {
92+ Image (
93+ painter = painterResource(R .drawable.ic_baseline_folder_24),
94+ contentDescription = null ,
95+ modifier = Modifier .size(LocalDimensions .current.iconSmall),
96+ colorFilter = ColorFilter .tint(Color .White )
97+ )
10098
101- Spacer (Modifier .width(6 .dp ))
99+ Spacer (Modifier .width(LocalDimensions .current.xxsSpacing ))
102100
103- Text (
104- text = title,
105- modifier = Modifier .weight(1f ),
106- maxLines = 1 ,
107- overflow = TextOverflow .Ellipsis ,
108- color = Color .White ,
109- style = MaterialTheme .typography.bodyMedium
110- )
101+ Text (
102+ text = title,
103+ modifier = Modifier .weight(1f ),
104+ maxLines = 1 ,
105+ overflow = TextOverflow .Ellipsis ,
106+ color = Color .White ,
107+ style = MaterialTheme .typography.bodyMedium
108+ )
111109
112- Spacer (Modifier .width(6 .dp ))
110+ Spacer (Modifier .width(LocalDimensions .current.xxsSpacing ))
113111
114- Text (
115- text = count.toString(),
116- color = Color .White ,
117- style = MaterialTheme .typography.bodyMedium
118- )
112+ Text (
113+ text = count.toString(),
114+ color = Color .White ,
115+ style = MaterialTheme .typography.bodyMedium
116+ )
117+ }
119118 }
120119 }
121120 }
@@ -156,8 +155,11 @@ fun MediaPickerItemCell(
156155
157156 Box (
158157 modifier = modifier
159- .padding(end = 2 .dp, bottom = 2 .dp)
160158 .aspectRatio(1f )
159+ .border(
160+ width = LocalDimensions .current.borderStroke,
161+ color = Color .White .copy(alpha = 0.20f )
162+ )
161163 .combinedClickable(
162164 onClick = {
163165 if (selected.isEmpty() && ! forcedMultiSelect) {
@@ -192,29 +194,20 @@ fun MediaPickerItemCell(
192194 contentScale = ContentScale .Crop
193195 )
194196
195- // Border overlay (replaces @drawable/mediapicker_item_border_dark View)
196- Box (
197- Modifier
198- .matchParentSize()
199- .border(width = 1 .dp, color = Color .White .copy(alpha = 0.20f ))
200- )
201-
202197 // Play overlay (center) for video
203198 if (MediaUtil .isVideoType(media.mimeType)) {
204199 Box (
205200 modifier = Modifier
206201 .align(Alignment .Center )
207- .size(36 .dp )
202+ .size(LocalDimensions .current.mediaPlayOverlay )
208203 .clip(CircleShape )
209204 .background(Color .White ),
210205 contentAlignment = Alignment .Center
211206 ) {
212207 Image (
213208 painter = painterResource(R .drawable.triangle_right),
214209 contentDescription = null ,
215- modifier = Modifier
216- .size(width = 15 .dp, height = 18 .dp)
217- .padding(start = 2 .dp),
210+ modifier = Modifier .size(LocalDimensions .current.iconMedium),
218211 colorFilter = ColorFilter .tint(LocalColors .current.accent) // match @color/core_blue-ish
219212 )
220213 }
@@ -234,9 +227,9 @@ fun MediaPickerItemCell(
234227 Box (
235228 modifier = Modifier
236229 .align(Alignment .TopEnd )
237- .padding(6 .dp )
230+ .padding(LocalDimensions .current.xxsSpacing )
238231 ) {
239- IndicatorOff (size = dimensionResource( R .dimen.small_radial_size) )
232+ IndicatorOff (size = LocalDimensions .current.smallRadius )
240233 }
241234 }
242235
@@ -245,10 +238,10 @@ fun MediaPickerItemCell(
245238 Box (
246239 modifier = Modifier
247240 .align(Alignment .TopEnd )
248- .padding(6 .dp ),
241+ .padding(LocalDimensions .current.xxsSpacing ),
249242 contentAlignment = Alignment .Center
250243 ) {
251- IndicatorOn (size = dimensionResource( R .dimen.small_radial_size) )
244+ IndicatorOn (size = LocalDimensions .current.smallRadius )
252245
253246 Text (
254247 text = (selectedIndex + 1 ).toString(),
@@ -268,7 +261,7 @@ private fun IndicatorOff(size: Dp, modifier: Modifier = Modifier) {
268261 .size(size)
269262 .clip(CircleShape )
270263 .border(
271- width = 1 .dp ,
264+ width = LocalDimensions .current.borderStroke ,
272265 color = LocalColors .current.text,
273266 shape = CircleShape
274267 )
0 commit comments