diff --git a/app/src/main/java/com/m2049r/xmrwallet/fragment/dialog/ReceiveBottomSheetDialog.java b/app/src/main/java/com/m2049r/xmrwallet/fragment/dialog/ReceiveBottomSheetDialog.java index 84bce85..601a640 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/fragment/dialog/ReceiveBottomSheetDialog.java +++ b/app/src/main/java/com/m2049r/xmrwallet/fragment/dialog/ReceiveBottomSheetDialog.java @@ -5,6 +5,7 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; @@ -21,6 +22,7 @@ import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; import com.m2049r.xmrwallet.R; import com.m2049r.xmrwallet.data.Subaddress; import com.m2049r.xmrwallet.service.AddressService; +import com.m2049r.xmrwallet.util.Helper; import java.util.HashMap; import java.util.Map; @@ -39,10 +41,12 @@ public class ReceiveBottomSheetDialog extends BottomSheetDialogFragment { super.onViewCreated(view, savedInstanceState); ImageView addressImageView = view.findViewById(R.id.monero_qr_imageview); TextView addressTextView = view.findViewById(R.id.address_textview); + ImageButton copyAddressImageButton = view.findViewById(R.id.copy_address_imagebutton); Subaddress addr = AddressService.getInstance().getLatestSubaddress(); addressTextView.setText(addr.getAddress()); addressImageView.setImageBitmap(generate(addr.getAddress(), 256, 256)); + copyAddressImageButton.setOnClickListener(view1 -> Helper.clipBoardCopy(getContext(), "address", addr.getAddress())); } public Bitmap generate(String text, int width, int height) { diff --git a/app/src/main/res/layout/receive_bottom_sheet_dialog.xml b/app/src/main/res/layout/receive_bottom_sheet_dialog.xml index 8f50fb8..3792938 100644 --- a/app/src/main/res/layout/receive_bottom_sheet_dialog.xml +++ b/app/src/main/res/layout/receive_bottom_sheet_dialog.xml @@ -35,17 +35,30 @@ - + \ No newline at end of file