mirror of
https://github.com/bitwarden/mobile.git
synced 2025-01-07 18:58:35 +01:00
[PS-2520] Restore copy confirmation toast on Android 13+ (#2388)
* Restore copy notification toast on Android 13+ * fixed space
This commit is contained in:
parent
3f72d35145
commit
6da1875ab6
@ -49,12 +49,6 @@ namespace Bit.Droid.Services
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsCopyNotificationHandledByPlatform()
|
||||
{
|
||||
// Android 13+ provides built-in notification when text is copied to the clipboard
|
||||
return (int)Build.VERSION.SdkInt >= 33;
|
||||
}
|
||||
|
||||
private void CopyToClipboard(string text, bool isSensitive = true)
|
||||
{
|
||||
var clipboardManager = Application.Context.GetSystemService(Context.ClipboardService) as ClipboardManager;
|
||||
|
@ -134,11 +134,7 @@ namespace Bit.App.Services
|
||||
|
||||
public void ShowToastForCopiedValue(string valueNameCopied)
|
||||
{
|
||||
if (!_clipboardService.IsCopyNotificationHandledByPlatform())
|
||||
{
|
||||
ShowToast("info", null,
|
||||
string.Format(AppResources.ValueHasBeenCopied, valueNameCopied));
|
||||
}
|
||||
ShowToast("info", null, string.Format(AppResources.ValueHasBeenCopied, valueNameCopied));
|
||||
}
|
||||
|
||||
public bool SupportsFido2()
|
||||
|
@ -15,10 +15,5 @@ namespace Bit.Core.Abstractions
|
||||
/// <param name="expiresInMs">Expiration time in milliseconds of the copied text</param>
|
||||
/// <param name="isSensitive">Flag to mark copied text as sensitive</param>
|
||||
Task CopyTextAsync(string text, int expiresInMs = -1, bool isSensitive = true);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the platform provides its own notification when text is copied to the clipboard
|
||||
/// </summary>
|
||||
bool IsCopyNotificationHandledByPlatform();
|
||||
}
|
||||
}
|
||||
|
@ -38,11 +38,5 @@ namespace Bit.iOS.Core.Services
|
||||
ExpirationDate = clearSeconds > 0 ? NSDate.FromTimeIntervalSinceNow(clearSeconds) : null
|
||||
}));
|
||||
}
|
||||
|
||||
public bool IsCopyNotificationHandledByPlatform()
|
||||
{
|
||||
// return true for any future versions of iOS that notify the user when text is copied to the clipboard
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user