mirror of
https://github.com/moparisthebest/keepass2android
synced 2024-08-13 17:03:49 -04:00
53dd47044b
* EntryOutput is passed to CopyToClipboardService * Modifications of EntryOutput are passed to plugins to enable actions on added fields * PluginDatabase checks if Plugin is still installed and always updates the list of plugins (had an issue where a plugin had a request token but was not in pluginList) * first version of QR plugin implemented
41 lines
859 B
C#
41 lines
859 B
C#
using Android.Content;
|
|
using Android.Graphics.Drawables;
|
|
using PluginHostTest;
|
|
|
|
namespace keepass2android
|
|
{
|
|
/// <summary>
|
|
/// Reperesents the popup menu item in EntryActivity to copy a string to clipboard
|
|
/// </summary>
|
|
class CopyToClipboardPopupMenuIcon : IPopupMenuItem
|
|
{
|
|
private readonly Context _context;
|
|
private readonly IStringView _stringView;
|
|
|
|
public CopyToClipboardPopupMenuIcon(Context context, IStringView stringView)
|
|
{
|
|
_context = context;
|
|
_stringView = stringView;
|
|
|
|
}
|
|
|
|
public Drawable Icon
|
|
{
|
|
get
|
|
{
|
|
return _context.Resources.GetDrawable(Resource.Drawable.ic_menu_copy_holo_light);
|
|
}
|
|
}
|
|
public string Text
|
|
{
|
|
//TODO localize
|
|
get { return "Copy to clipboard"; }
|
|
}
|
|
|
|
|
|
public void HandleClick()
|
|
{
|
|
CopyToClipboardService.CopyValueToClipboardWithTimeout(_context, _stringView.Text);
|
|
}
|
|
}
|
|
} |