This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.App; | |
using Android.Content; | |
namespace Droid | |
{ | |
public static class DpiToPixelConverter | |
{ | |
public static int Convert(int dpi) | |
{ | |
float scale = Application.Context.Resources.DisplayMetrics.Density; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace CSharp | |
{ | |
public static class BytesConverter | |
{ | |
public static double ConvertBytesToKB(long bytes) | |
{ | |
return bytes / 1024f; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace CSharp | |
{ | |
public static class StringConverter | |
{ | |
public static string Capitalized(string text) | |
{ | |
if (string.IsNullOrEmpty(text)) | |
{ | |
return text; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UIKit; | |
using CoreImage; | |
namespace iOS | |
{ | |
public static class UIImageConverter | |
{ | |
public static UIImage Blur(UIImage image) | |
{ | |
var ciImage = new CIImage(image); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.OS; | |
using Java.Lang; | |
namespace Droid | |
{ | |
public static class ThreadUtil | |
{ | |
public static bool IsMainThread(this Thread currentThread) | |
{ | |
return currentThread == Looper.MainLooper.Thread; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Drawing; | |
using System.Runtime.InteropServices; | |
using CoreGraphics; | |
using UIKit; | |
namespace iOS | |
{ | |
public static class UIImageExtensions | |
{ | |
public static string GetPixelHexColor(this UIImage image, float x, float y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CoreGraphics; | |
using Foundation; | |
using UIKit; | |
namespace iOS | |
{ | |
public class FreeDrawUIView : UIView | |
{ | |
UIBezierPath _path; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.Content; | |
using Android.Graphics; | |
using Android.Util; | |
using Android.Views; | |
namespace Droid | |
{ | |
public class FreeDrawView : View | |
{ | |
Path _drawPath; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using CoreGraphics; | |
using UIKit; | |
namespace iOS | |
{ | |
public class StackView : UIView | |
{ | |
nfloat _previousWidth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ComponentModel; | |
using System.Runtime.CompilerServices; | |
using Android.Content; | |
using Android.Graphics; | |
using Android.Util; | |
using Android.Views; | |
using Android.Widget; | |
namespace Droid |