From 2cf2327fc27a6adc0b9b01664ee4f5be48c0c9c8 Mon Sep 17 00:00:00 2001 From: Oshioke Salaki Date: Sun, 25 Aug 2024 20:30:43 +0100 Subject: [PATCH] feat: copyable address (#51) --- .../main/java/com/example/walletapp/ReceiverActivity.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wallet_app/android/app/src/main/java/com/example/walletapp/ReceiverActivity.kt b/wallet_app/android/app/src/main/java/com/example/walletapp/ReceiverActivity.kt index d16e56cb..6834b00a 100644 --- a/wallet_app/android/app/src/main/java/com/example/walletapp/ReceiverActivity.kt +++ b/wallet_app/android/app/src/main/java/com/example/walletapp/ReceiverActivity.kt @@ -1,5 +1,8 @@ package com.example.walletapp +import android.content.ClipData +import android.content.ClipboardManager +import android.content.Context import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent @@ -88,7 +91,9 @@ class ReceiverActivity : ComponentActivity() { color = Color.White, fontSize = 15.sp, modifier = Modifier.clickable { - // TODO(47): Copy address to clipboard + val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager + val clip = ClipData.newPlainText("Wallet Address", "0xfoo...123") // Replace with actual wallet address + clipboard.setPrimaryClip(clip) } ) }