Skip to content

Commit

Permalink
Ground breaking new feature
Browse files Browse the repository at this point in the history
Images now have names (Only available on an ANDROID near you)!
Also
	Stuff looks clean now
  • Loading branch information
jonjohansen authored and MaxJohansen committed Jul 5, 2018
1 parent 4551d4e commit d7bed33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Diplomatic.Android/Classes/Picture_Droid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ public void SavePictureToDisk(string filename, byte[] imageArray)
{
// Write file to the android disk
System.IO.File.WriteAllBytes(FilePath, imageArray);

// Now it needs to be added to image gallery
var mediaScanIntent = new Intent(Intent.ActionMediaScannerScanFile);
mediaScanIntent.SetData(Android.Net.Uri.FromFile(new File(FilePath)));
Xamarin.Forms.Forms.Context.SendBroadcast(mediaScanIntent);
Android.App.Application.Context.SendBroadcast(mediaScanIntent);
}
catch(System.Exception e)
catch (System.Exception e)
{
System.Console.WriteLine(e.ToString());
}
Expand Down
2 changes: 0 additions & 2 deletions Diplomatic.iOS/Classes/Picture_iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Diplomatic.iOS.Classes
{
public class Picture_iOS : IPicture
{

public void SavePictureToDisk(string filename, byte[] imageArray)
{
var Img = new UIImage(NSData.FromArray(imageArray));
Expand All @@ -18,7 +17,6 @@ public void SavePictureToDisk(string filename, byte[] imageArray)
if (error != null)
{
Console.WriteLine(error);
throw new Exception("Yeeeeeeeeeeeeeeeeeet");
}
});
}
Expand Down
4 changes: 1 addition & 3 deletions Diplomatic.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>MinimumOSVersion</key>
<string>11.3</string>
<string>11.0</string>
<key>CFBundleDisplayName</key>
<string>Diplomatic</string>
<key>CFBundleIdentifier</key>
Expand All @@ -38,7 +38,5 @@
<string>Assets.xcassets/LaunchImage.launchimage</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string></string>
<key>NSPhotoLibraryUsageDescription</key>
<string></string>
</dict>
</plist>

0 comments on commit d7bed33

Please sign in to comment.