Skip to content

Instantly share code, notes, and snippets.

View trinnguyen's full-sized avatar

Tri Nguyen trinnguyen

View GitHub Profile
@trinnguyen
trinnguyen / gist:2fcb4a2ff619c800fc916a83f4e72ccb
Created September 24, 2016 07:52
ios launch-screen image size
https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/
Static Launch Screen Images
It’s best to use an Xcode storyboard for your launch screen, but you can provide a set of static images if necessary. Create static images in different sizes for different devices, and be sure to include the status bar region.
Device Portrait size Landscape size
iPhone 6s Plus, iPhone 6 Plus 1080px by 1920px 1920px by 1080px
iPhone 6s, iPhone 6 750px by 1334px 1334px by 750px
iPhone SE 640px by 1136px 1136px by 640px
@trinnguyen
trinnguyen / android_statusbarcolor.cs
Created September 24, 2016 06:43
Xamarin.Android SetStastusBarColor
void SetStatusBarColor()
{
if (Build.VERSION.SdkInt < BuildVersionCodes.Kitkat)
{
return;
}
if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
{
Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
Window.ClearFlags(WindowManagerFlags.TranslucentStatus);
@trinnguyen
trinnguyen / UITabbar.cs
Created July 1, 2016 11:02
Add TopLine to UITabbar
//Add line
CALayer topBorder = CALayer.Create();
topBorder.Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, 1);
topBorder.BackgroundColor = UIColor.FromRGB(128, 128, 128).CGColor;
TabBar.Layer.AddSublayer(topBorder);
@trinnguyen
trinnguyen / keytool_hash
Created June 21, 2016 03:34
Linkedin Mobile SDK Android - generate hash for debug keystore
keytool -exportcert -keystore debug.keystore -alias androiddebugkey | openssl sha1 -binary | openssl base64
@trinnguyen
trinnguyen / Metadata.xml
Created June 21, 2016 03:30
Xamarin.Android Binding Linkedin Mobile SDK Android - Metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<!--
This sample removes the class: android.support.v4.content.AsyncTaskLoader.LoadTask:
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='AsyncTaskLoader.LoadTask']" />
This sample removes the method: android.support.v4.content.CursorLoader.loadInBackground:
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" />
-->
<!--
@trinnguyen
trinnguyen / Distance_Matrix_APIs_JSON
Created June 16, 2016 04:19
Google Maps Distance Matrix APIs JSON response
{
"destination_addresses": [
"76 Lê Lai, Phạm Ngũ Lão, Quận 1, Hồ Chí Minh, Vietnam"
],
"origin_addresses": [
"557A/C6 Nguyễn Tri Phương Tổ 12 KP 3, phường 14, Quận 10, Hồ Chí Minh, Vietnam"
],
"rows": [
{
"elements": [
@trinnguyen
trinnguyen / QuickstartMobileAppConfigurationExtensions.cs
Created May 28, 2016 04:34
Source code of Azure Mobile Server SDK - Quickstart
// ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------
using System;
using Microsoft.Azure.Mobile.Server.Tables.Config;
namespace Microsoft.Azure.Mobile.Server.Config
{
public static class QuickstartMobileAppConfigurationExtensions
@trinnguyen
trinnguyen / Objective_Sharpie_Sample.txt
Created May 3, 2016 04:16
Xamarin Objective Sharpie samples
#Cocoa Pod Binding
sharpie bind -sdk iphoneos9.2 -o tmp Pods/Headers/Public/NearbyMessages/GNSMessages.h
@trinnguyen
trinnguyen / ObservableTableViewController.cs
Created April 19, 2016 08:34 — forked from praeclarum/ObservableTableViewController.cs
This is my UITableViewController with DataSource property that listens for INotifyCollectionChanged
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Diagnostics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Praeclarum.UI
{
using System;
using Foundation;
using UIKit;
using System.Collections.Specialized;
using System.Windows.Input;
using MvvmCross.iOS.Views;
namespace AutoLinker
{
// This class is never actually executed, but when Xamarin linking is enabled it does ensure types and properties