Skip to content

Commit 0aacc38

Browse files
committed
fix
1 parent 4f95d57 commit 0aacc38

File tree

13 files changed

+496
-130
lines changed

13 files changed

+496
-130
lines changed

.kotlin/errors/errors-1759660195435.log

Lines changed: 0 additions & 57 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ android {
1818
// Android 7.0 (API 23) and earlier are not supported
1919
minSdk = 24
2020
targetSdk = 36
21-
versionCode = 19
22-
versionName = "1.1.8"
21+
versionCode = 20
22+
versionName = "1.1.9"
2323

2424
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2525

app/src/main/java/com/pira/ccloud/components/ExpandableTextComponent.kt

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,31 @@ package com.pira.ccloud.components
22

33
import androidx.compose.foundation.clickable
44
import androidx.compose.foundation.layout.Column
5+
import androidx.compose.foundation.layout.Row
56
import androidx.compose.foundation.layout.fillMaxWidth
7+
import androidx.compose.foundation.layout.padding
8+
import androidx.compose.material.icons.Icons
9+
import androidx.compose.material.icons.filled.ContentCopy
10+
import androidx.compose.material3.Icon
11+
import androidx.compose.material3.IconButton
612
import androidx.compose.material3.MaterialTheme
713
import androidx.compose.material3.Text
814
import androidx.compose.runtime.Composable
915
import androidx.compose.runtime.getValue
1016
import androidx.compose.runtime.mutableStateOf
1117
import androidx.compose.runtime.remember
1218
import androidx.compose.runtime.setValue
19+
import android.content.Context
20+
import androidx.compose.ui.Alignment
1321
import androidx.compose.ui.Modifier
22+
import androidx.compose.ui.platform.LocalContext
1423
import androidx.compose.ui.text.style.TextOverflow
1524
import androidx.compose.ui.unit.dp
1625
import androidx.compose.foundation.layout.Box
17-
import androidx.compose.foundation.layout.padding
26+
import androidx.compose.foundation.layout.Arrangement
1827
import androidx.compose.foundation.shape.RoundedCornerShape
1928
import androidx.compose.material3.Card
2029
import androidx.compose.material3.CardDefaults
21-
import androidx.compose.ui.Alignment
2230
import androidx.compose.ui.draw.clip
2331
import androidx.compose.ui.graphics.Color
2432
import androidx.compose.ui.text.font.FontWeight
@@ -32,19 +40,47 @@ fun ExpandableText(
3240
) {
3341
var expanded by remember { mutableStateOf(false) }
3442
var showReadMore by remember { mutableStateOf(false) }
43+
val context = LocalContext.current
3544

3645
Column(modifier = modifier) {
37-
Text(
38-
text = text,
39-
style = MaterialTheme.typography.bodyMedium,
40-
color = MaterialTheme.colorScheme.onSurface,
41-
maxLines = if (expanded) Int.MAX_VALUE else collapsedMaxLines,
42-
overflow = TextOverflow.Ellipsis,
43-
onTextLayout = { textLayoutResult ->
44-
// Check if text is truncated (more lines than maxLines)
45-
showReadMore = textLayoutResult.hasVisualOverflow
46+
Row(
47+
modifier = Modifier.fillMaxWidth(),
48+
horizontalArrangement = Arrangement.SpaceBetween,
49+
verticalAlignment = Alignment.CenterVertically
50+
) {
51+
Text(
52+
text = text,
53+
style = MaterialTheme.typography.bodyMedium,
54+
color = MaterialTheme.colorScheme.onSurface,
55+
modifier = Modifier.weight(1f),
56+
maxLines = if (expanded) Int.MAX_VALUE else collapsedMaxLines,
57+
overflow = TextOverflow.Ellipsis,
58+
onTextLayout = { textLayoutResult ->
59+
// Check if text is truncated (more lines than maxLines)
60+
showReadMore = textLayoutResult.hasVisualOverflow
61+
}
62+
)
63+
64+
// Copy icon
65+
IconButton(
66+
onClick = {
67+
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as android.content.ClipboardManager
68+
val clip = android.content.ClipData.newPlainText("Description", text)
69+
clipboard.setPrimaryClip(clip)
70+
71+
// Show a toast to indicate success
72+
android.widget.Toast.makeText(context, "Description copied to clipboard", android.widget.Toast.LENGTH_SHORT).show()
73+
},
74+
modifier = Modifier
75+
.padding(start = 8.dp)
76+
) {
77+
Icon(
78+
imageVector = Icons.Default.ContentCopy,
79+
contentDescription = "Copy description",
80+
tint = MaterialTheme.colorScheme.primary
81+
)
4682
}
47-
)
83+
}
4884

4985
if (showReadMore || expanded) {
5086
// Glass-like button for Show More/Show Less

app/src/main/java/com/pira/ccloud/screens/AboutScreen.kt

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import androidx.compose.material.icons.automirrored.filled.ArrowBack
2121
import androidx.compose.material.icons.filled.Email
2222
import androidx.compose.material.icons.filled.Public
2323
import androidx.compose.material.icons.filled.Send
24+
import androidx.compose.material.icons.filled.ContentCopy
2425
import androidx.compose.material3.Card
2526
import androidx.compose.material3.CardDefaults
2627
import androidx.compose.material3.Icon
@@ -172,6 +173,43 @@ fun AboutScreen(navController: NavController?) {
172173

173174
Spacer(modifier = Modifier.height(24.dp))
174175

176+
// Donation Card
177+
Card(
178+
modifier = Modifier.fillMaxWidth(),
179+
elevation = CardDefaults.cardElevation(defaultElevation = 4.dp)
180+
) {
181+
Column(modifier = Modifier.padding(16.dp)) {
182+
Text(
183+
text = "Support Us",
184+
style = MaterialTheme.typography.titleMedium,
185+
modifier = Modifier.padding(bottom = 16.dp)
186+
)
187+
188+
Text(
189+
text = "If you find CCloud useful, consider supporting the development with a donation.",
190+
style = MaterialTheme.typography.bodyMedium,
191+
color = MaterialTheme.colorScheme.onSurfaceVariant,
192+
modifier = Modifier.padding(bottom = 16.dp)
193+
)
194+
195+
// Tron Address (TRX)
196+
DonationItem(
197+
coinName = "Tron (TRX)",
198+
address = "TZDVavXKzfgpAX7NFVh8h2KY3XWCbNEyEe"
199+
)
200+
201+
Spacer(modifier = Modifier.height(12.dp))
202+
203+
// Bitcoin Address (BTC)
204+
DonationItem(
205+
coinName = "Bitcoin (BTC)",
206+
address = "bc1q74l58mhmtwgk4ygr3l0zyv53fgxdajp28tvrld"
207+
)
208+
}
209+
}
210+
211+
Spacer(modifier = Modifier.height(24.dp))
212+
175213
// Copyright
176214
Text(
177215
text = "© ${java.util.Calendar.getInstance().get(java.util.Calendar.YEAR)} CCloud. All rights reserved.",
@@ -240,6 +278,53 @@ fun LinkItem(
240278
}
241279
}
242280

281+
@Composable
282+
fun DonationItem(
283+
coinName: String,
284+
address: String
285+
) {
286+
val context = LocalContext.current
287+
288+
Row(
289+
modifier = Modifier
290+
.fillMaxWidth()
291+
.clickable {
292+
// Copy address to clipboard
293+
val clipboard = context.getSystemService(android.content.Context.CLIPBOARD_SERVICE) as android.content.ClipboardManager
294+
val clip = android.content.ClipData.newPlainText("$coinName Address", address)
295+
clipboard.setPrimaryClip(clip)
296+
297+
// Show toast
298+
android.widget.Toast.makeText(context, "$coinName address copied to clipboard", android.widget.Toast.LENGTH_SHORT).show()
299+
}
300+
.padding(12.dp),
301+
verticalAlignment = Alignment.CenterVertically
302+
) {
303+
Column(modifier = Modifier.weight(1f)) {
304+
Text(
305+
text = coinName,
306+
style = MaterialTheme.typography.bodyLarge,
307+
fontWeight = FontWeight.Bold
308+
)
309+
310+
Spacer(modifier = Modifier.height(4.dp))
311+
312+
Text(
313+
text = address,
314+
style = MaterialTheme.typography.bodySmall,
315+
color = MaterialTheme.colorScheme.onSurfaceVariant
316+
)
317+
}
318+
319+
Icon(
320+
imageVector = Icons.Default.ContentCopy,
321+
contentDescription = "Copy address",
322+
tint = MaterialTheme.colorScheme.primary,
323+
modifier = Modifier.size(24.dp)
324+
)
325+
}
326+
}
327+
243328
fun getArchitecture(): String {
244329
return try {
245330
// Get the device's primary ABI

app/src/main/java/com/pira/ccloud/screens/FavoritesScreen.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,14 +656,17 @@ fun FavoritesScreen(navController: NavController) {
656656
DropdownMenuItem(
657657
text = { Text("Rename") },
658658
onClick = {
659-
// Implementation for rename
659+
groupToRename = group
660+
newGroupName = group.name
661+
showRenameGroupDialog = true
660662
showGroupMenu = false
661663
}
662664
)
663665
DropdownMenuItem(
664666
text = { Text("Delete") },
665667
onClick = {
666-
// Implementation for delete
668+
groupToDelete = group
669+
showDeleteGroupDialog = true
667670
showGroupMenu = false
668671
}
669672
)

app/src/main/java/com/pira/ccloud/screens/SingleMovieScreen.kt

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ fun MovieDetailsContent(
199199
verticalAlignment = Alignment.Bottom
200200
) {
201201
// Foreground movie poster
202+
var showImageDialog by remember { mutableStateOf(false) }
203+
202204
Image(
203205
painter = rememberAsyncImagePainter(
204206
ImageRequest.Builder(LocalContext.current)
@@ -209,10 +211,37 @@ fun MovieDetailsContent(
209211
contentDescription = movie.title,
210212
modifier = Modifier
211213
.height(200.dp)
212-
.clip(RoundedCornerShape(8.dp)),
214+
.clip(RoundedCornerShape(8.dp))
215+
.clickable { showImageDialog = true },
213216
contentScale = ContentScale.Fit
214217
)
215218

219+
// Image URL dialog
220+
if (showImageDialog) {
221+
AlertDialog(
222+
onDismissRequest = { showImageDialog = false },
223+
title = { Text("Image Options") },
224+
text = { Text("Choose an action for this image") },
225+
confirmButton = {
226+
TextButton(
227+
onClick = {
228+
DownloadUtils.copyToClipboard(context, movie.image)
229+
showImageDialog = false
230+
}
231+
) {
232+
Text("Copy Image URL")
233+
}
234+
},
235+
dismissButton = {
236+
TextButton(
237+
onClick = { showImageDialog = false }
238+
) {
239+
Text("Cancel")
240+
}
241+
}
242+
)
243+
}
244+
216245
// Movie details to the right of the poster
217246
Column(
218247
modifier = Modifier
@@ -404,13 +433,20 @@ fun MovieDetailsContent(
404433
}
405434

406435
// Description
407-
Text(
408-
text = "Description",
409-
style = MaterialTheme.typography.titleMedium,
410-
fontWeight = FontWeight.Bold,
411-
color = MaterialTheme.colorScheme.primary,
412-
modifier = Modifier.padding(start = 16.dp, top = 16.dp, end = 16.dp)
413-
)
436+
Row(
437+
modifier = Modifier
438+
.fillMaxWidth()
439+
.padding(start = 16.dp, top = 16.dp, end = 16.dp),
440+
horizontalArrangement = Arrangement.SpaceBetween,
441+
verticalAlignment = Alignment.CenterVertically
442+
) {
443+
Text(
444+
text = "Description",
445+
style = MaterialTheme.typography.titleMedium,
446+
fontWeight = FontWeight.Bold,
447+
color = MaterialTheme.colorScheme.primary
448+
)
449+
}
414450

415451
// Set layout direction to RTL for the description text
416452
CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Rtl) {

0 commit comments

Comments
 (0)