use of android.content.ClipboardManager in project run-wallet-android by runplay.
the class AboutFragment method onAboutDonationIotaAddressClick.
@OnClick(R.id.about_donation_iota_address)
public void onAboutDonationIotaAddressClick() {
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText(getActivity().getString(R.string.seed), Constants.DONATION_ADDRESS);
clipboard.setPrimaryClip(clip);
Snackbar.make(getView(), getString(R.string.messages_iota_donation), Snackbar.LENGTH_LONG).show();
}
use of android.content.ClipboardManager in project run-wallet-android by runplay.
the class PendingCancelledFragment method onResume.
@Override
public void onResume() {
super.onResume();
if (Store.getCacheTransfer() == null) {
getActivity().onBackPressed();
} else {
View v = view.findViewById(R.id.transfer_card);
TransferViewManager.populateViewHolder(getActivity(), new TransferViewManager.ViewHolder(getActivity(), v), Store.getCacheTransfer(), false, -1, false);
List<TransferTransaction> transactions = new ArrayList<>();
transactions.addAll(Store.getCacheTransfer().getTransactions());
transactions.addAll(Store.getCacheTransfer().getOtherTransactions());
TransferViewManager.populateTransferTransactionOuts(getActivity(), breakdown, transactions, Store.getCacheTransfer());
cancelledHash.setText(Store.getCacheTransfer().getHash());
cancelledHash.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityMan.openAndroidBrowserUrl(getActivity(), sitesHash[0] + Store.getCacheTransfer().getHash());
}
});
copyClip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Transfer transfer = Store.getCacheTransfer();
if (transfer != null) {
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
StringBuilder sb = new StringBuilder();
sb.append("IOTA Transfer\n\n");
sb.append("time: " + Cal.getCal(transfer.getTimestamp()).getDatabaseDate());
sb.append("\nhash: " + transfer.getHash());
sb.append("\n\nTotal: " + transfer.getValue());
sb.append("\nStatus: " + (transfer.isCompleted() ? "Completed" : "Pending"));
sb.append("\nmilestone: " + transfer.getMilestone());
sb.append("\n\nAddress actions\n");
for (TransferTransaction tran : transfer.getTransactions()) {
sb.append(tran.getValue());
sb.append(" ");
sb.append(tran.getAddress());
}
for (TransferTransaction tran : transfer.getOtherTransactions()) {
sb.append(tran.getValue());
sb.append(" ");
sb.append(tran.getAddress());
}
sb.append("\n\nUsing run IOTA wallet, Android app http://iota.runplay.com");
ClipData clip = ClipData.newPlainText(getActivity().getString(R.string.seed), sb.toString());
clipboard.setPrimaryClip(clip);
Snackbar.make(getView(), getString(R.string.text_cancelled_copied), Snackbar.LENGTH_SHORT).show();
}
}
});
cancelledSites.setText(" " + sitesName[0]);
}
}
use of android.content.ClipboardManager in project run-wallet-android by runplay.
the class SnTrFragment method hasClipboardAddress.
private boolean hasClipboardAddress() {
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
ClipData cd = clipboard.getPrimaryClip();
if (cd != null && cd.getItemCount() > 0) {
String address = cd.getItemAt(0).coerceToText(getActivity()).toString();
// Log.e("CLIPB","has add? : "+isValidAddress(address)+" -- "+address);
return isValidAddress(address);
}
return false;
}
use of android.content.ClipboardManager in project xabber-android by redsolution.
the class ChatFragment method onItemClick.
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (menuItems != null && menuItems.size() > position) {
HashMap<String, String> menuItem = menuItems.get(position);
switch(menuItem.get(CustomMessageMenuAdapter.KEY_ID)) {
case "action_message_repeat":
if (MessageItem.isUploadFileMessage(clickedMessageItem)) {
uploadFile(clickedMessageItem.getFilePath());
} else {
sendMessage(clickedMessageItem.getText());
}
break;
case "action_message_copy":
Spannable spannable = MessageItem.getSpannable(clickedMessageItem);
((ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText(spannable, spannable));
break;
case "action_message_appeal":
setInputTextAtCursor(clickedMessageItem.getResource().toString() + ", ");
break;
case "action_message_quote":
setInputTextAtCursor("> " + clickedMessageItem.getText() + "\n");
break;
case "action_message_remove":
MessageManager.getInstance().removeMessage(clickedMessageItem.getUniqueId());
break;
case "action_message_open_muc_private_chat":
UserJid occupantFullJid = null;
try {
occupantFullJid = UserJid.from(JidCreate.domainFullFrom(user.getJid().asDomainBareJid(), clickedMessageItem.getResource()));
MessageManager.getInstance().openChat(account, occupantFullJid);
startActivity(ChatActivity.createSpecificChatIntent(getActivity(), account, occupantFullJid));
} catch (UserJid.UserJidCreateException e) {
LogManager.exception(this, e);
}
break;
case "action_message_show_original_otr":
chatMessageAdapter.addOrRemoveItemNeedOriginalText(clickedMessageItem.getUniqueId());
chatMessageAdapter.notifyDataSetChanged();
break;
case "action_message_status":
if (clickedMessageItem.isError())
showError(clickedMessageItem.getErrorDescription());
break;
default:
break;
}
}
}
use of android.content.ClipboardManager in project Klyph by jonathangerbaud.
the class ConversationFragment method handleCopyTextAction.
@TargetApi(11)
private void handleCopyTextAction(Message message) {
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("Message", message.getBody());
clipboard.setPrimaryClip(clip);
}
Aggregations