mirror of
https://github.com/bitwarden/mobile
synced 2025-12-14 15:23:35 +00:00
attachments page with upload/delete
This commit is contained in:
@@ -17,6 +17,7 @@ using Bit.App.Models.Page;
|
||||
using Bit.App;
|
||||
using Android.Nfc;
|
||||
using Android.Views.InputMethods;
|
||||
using System.IO;
|
||||
|
||||
namespace Bit.Android
|
||||
{
|
||||
@@ -215,6 +216,25 @@ namespace Bit.Android
|
||||
ZXing.Net.Mobile.Forms.Android.PermissionsHandler.OnRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
|
||||
{
|
||||
if(requestCode == Constants.SelectFileRequestCode && resultCode == Result.Ok)
|
||||
{
|
||||
global::Android.Net.Uri uri = null;
|
||||
if(data != null)
|
||||
{
|
||||
uri = data.Data;
|
||||
using(var stream = ContentResolver.OpenInputStream(uri))
|
||||
using(var memoryStream = new MemoryStream())
|
||||
{
|
||||
stream.CopyTo(memoryStream);
|
||||
MessagingCenter.Send(Xamarin.Forms.Application.Current, "SelectFileResult",
|
||||
new Tuple<byte[], string>(memoryStream.ToArray(), Utilities.GetFileName(ApplicationContext, uri)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RateApp()
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user