This file contains hidden or 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; | |
using Android.OS; | |
namespace CleanMyTwitter.Android { | |
[Activity(Label = "SchemeActivity", NoHistory = true)] | |
[IntentFilter(new[] { Intent.ActionView }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataSchemes = new[] { "http", "https" }, DataHost = "myurl.com", AutoVerify = true)] | |
public class SchemeActivity : Activity { | |
protected override void OnCreate(Bundle savedInstanceState) { | |
base.OnCreate(savedInstanceState); |
This file contains hidden or 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
/* | |
Reference: | |
https://stackoverflow.com/questions/27475178/how-do-i-make-wrap-content-work-on-a-recyclerview | |
*/ | |
public class WrapLayoutManager : LinearLayoutManager { | |
private const int DefaultChildSize = 100; | |
private static readonly Rect TmpRect = new Rect(); | |
private int _childSize = DefaultChildSize; | |
private static bool _canMakeInsetsDirty = true; |
This file contains hidden or 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.Collections.Generic; | |
using System.ComponentModel.DataAnnotations.Schema; | |
using System.Data.Common; | |
using System.Linq; | |
using System.Reflection; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.EntityFrameworkCore.Infrastructure; | |
using Microsoft.EntityFrameworkCore.Internal; |
This file contains hidden or 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.IO; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace myapp { | |
public static class PEMExporter { | |
public static string Export(RSA rsa, bool exportPrivateKey) { | |
var parameters = rsa.ExportParameters(includePrivateParameters : exportPrivateKey); | |
var key = new StringBuilder(); |
This file contains hidden or 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.IO; | |
using System.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace myapp { | |
public static class AESCipher { | |
public static string EncryptString(string key, string str) { | |
string encryptedStr = null; |
This file contains hidden or 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
-(void)scrollViewDidScroll:(UIScrollView *)scrollView { | |
if(scrollView.contentOffset.x == 0) { | |
CGPoint newOffset = CGPointMake(scrollView.bounds.size.width+scrollView.contentOffset.x, scrollView.contentOffset.y); | |
[scrollView setContentOffset:newOffset]; | |
[self rotateViewsRight]; | |
} | |
else if(scrollView.contentOffset.x == scrollView.bounds.size.width*2) { | |
CGPoint newOffset = CGPointMake(scrollView.contentOffset.x-scrollView.bounds.size.width, scrollView.contentOffset.y); | |
[scrollView setContentOffset:newOffset]; |
This file contains hidden or 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
UIView.transitionWithView(tableView, | |
duration: 0.35, | |
options: .TransitionCrossDissolve, | |
animations: { () -> Void in | |
self.tableView.reloadData() | |
}, | |
completion: nil); | |
/* | |
possible animations: |
This file contains hidden or 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
//only apply the blur if the user hasn't disabled transparency effects | |
if !UIAccessibilityIsReduceTransparencyEnabled() { | |
self.view.backgroundColor = UIColor.clear | |
let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.dark) | |
let blurEffectView = UIVisualEffectView(effect: blurEffect) | |
//always fill the view | |
blurEffectView.frame = self.view.bounds | |
blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight] |
This file contains hidden or 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
// Option 1 | |
- (void)drawTextInRect:(CGRect)rect { | |
UIEdgeInsets insets = {0, 5, 0, 5}; | |
[super drawTextInRect:UIEdgeInsetsInsetRect(rect, insets)]; | |
} | |
// Option 2 | |
NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; | |
style.alignment = NSTextAlignmentJustified; | |
style.firstLineHeadIndent = 10.0f; |
This file contains hidden or 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
- (UIImage *)tintedImageWithColor:(UIColor *)tintColor blendingMode:(CGBlendMode)blendMode highQuality:(BOOL) yerOrNo; | |
{ | |
UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0f); | |
if (yerOrNo) { | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetShouldAntialias(context, true); | |
CGContextSetAllowsAntialiasing(context, true); | |
CGContextSetInterpolationQuality(context, kCGInterpolationHigh); | |
} | |
[tintColor setFill]; |
NewerOlder