@@ -21,6 +21,7 @@ import androidx.compose.material.icons.Icons
21
21
import androidx.compose.material.icons.automirrored.filled.ArrowBack
22
22
import androidx.compose.material.icons.automirrored.filled.Sort
23
23
import androidx.compose.material.icons.filled.Favorite
24
+ import androidx.compose.material.icons.filled.Pin
24
25
import androidx.compose.material.icons.filled.Poll
25
26
import androidx.compose.material.icons.filled.QueryStats
26
27
import androidx.compose.material3.DropdownMenuItem
@@ -46,9 +47,11 @@ import androidx.compose.ui.Alignment
46
47
import androidx.compose.ui.Modifier
47
48
import androidx.compose.ui.draw.clip
48
49
import androidx.compose.ui.layout.onGloballyPositioned
50
+ import androidx.compose.ui.platform.LocalClipboardManager
49
51
import androidx.compose.ui.platform.LocalContext
50
52
import androidx.compose.ui.platform.LocalDensity
51
53
import androidx.compose.ui.res.stringResource
54
+ import androidx.compose.ui.text.AnnotatedString
52
55
import androidx.compose.ui.text.font.FontWeight
53
56
import androidx.compose.ui.text.style.TextAlign
54
57
import androidx.compose.ui.tooling.preview.Preview
@@ -114,6 +117,7 @@ fun StatDetailScreen(
114
117
) {
115
118
val density = LocalDensity .current
116
119
val context = LocalContext .current
120
+ val clipboard = LocalClipboardManager .current
117
121
val playerStat = state.selectedStatDetail
118
122
val playerRanking = state.selectedRankingDetail
119
123
var screenWidth by remember { mutableStateOf(0 .dp) }
@@ -203,6 +207,20 @@ fun StatDetailScreen(
203
207
}
204
208
},
205
209
actions = {
210
+ IconButton ({
211
+ if (playerStat != null ) {
212
+ clipboard.setText(
213
+ AnnotatedString (
214
+ state.selectedStatDetail.brawlhallaId.toString()
215
+ )
216
+ )
217
+ }
218
+ }) {
219
+ Icon (
220
+ Icons .Default .Pin ,
221
+ stringResource(R .string.copy_id),
222
+ )
223
+ }
206
224
IconButton ({
207
225
if (playerStat != null ) {
208
226
onStatDetailAction(
@@ -215,15 +233,14 @@ fun StatDetailScreen(
215
233
}) {
216
234
Icon (
217
235
Icons .Default .Favorite ,
218
- null ,
236
+ stringResource( R .string.favorites) ,
219
237
tint = if (state.isStatDetailFavorite) {
220
238
MaterialTheme .colorScheme.primary
221
239
} else {
222
240
MaterialTheme .colorScheme.onBackground
223
241
},
224
242
)
225
243
}
226
-
227
244
},
228
245
title = {
229
246
Row (
@@ -249,8 +266,6 @@ fun StatDetailScreen(
249
266
)
250
267
}
251
268
}
252
-
253
-
254
269
}
255
270
)
256
271
}
0 commit comments