Skip to content

Instantly share code, notes, and snippets.

Avatar

Jesse Jiang jessejiang0214

View GitHub Profile
@jessejiang0214
jessejiang0214 / FilterScriptPhase.sh
Last active Dec 16, 2019 — forked from steipete/FilterScriptPhase.sh
This filter script phase is required to remove unused architectures from your application, which would be flagged as issue during upload to the Apple AppStore. Read more at http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/
View FilterScriptPhase.sh
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
@jessejiang0214
jessejiang0214 / AndroidGetUUIDFromAdv.cs
Created Dec 11, 2017
As filter in startLeScan is not working, use this function to filter the UUID
View AndroidGetUUIDFromAdv.cs
// Solution from https://stackoverflow.com/questions/18019161/startlescan-with-128-bit-uuids-doesnt-work-on-native-android-ble-implementation
List<string> ParseUUIDs(byte[] advertisedData)
{
List<string> uuids = new List<string>();
int offset = 0;
while (offset < (advertisedData.Length - 2))
{
int len = advertisedData[offset++];
if (len == 0)
break;
@jessejiang0214
jessejiang0214 / BasePage.cs
Last active Jun 13, 2019
Custom navigation bar in Xamarin.Forms PCL
View BasePage.cs
using System;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace {YOURNAMESPACE}
{
public class BasePage : ContentPage
{
ContentView _header;
public ContentView Header
@jessejiang0214
jessejiang0214 / CustomAllViewCellRendereriOS.cs
Created Jan 25, 2016
Disable Xamarin Forms ListView select item HightLight color
View CustomAllViewCellRendereriOS.cs
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer (typeof(ViewCell), typeof(MyAPP.iOS.CustomAllViewCellRendereriOS))]
namespace MyAPP.iOS
{
public class CustomAllViewCellRendereriOS : ViewCellRenderer
{
public override UIKit.UITableViewCell GetCell (Cell item, UIKit.UITableViewCell reusableCell, UIKit.UITableView tv)
@jessejiang0214
jessejiang0214 / RoundBorderDatePicker.cs
Last active Nov 21, 2019
This is the Xamarin Forms date picker extension. It can set border width, color and radius, also it can add PlaceHolder and MinimumAge
View RoundBorderDatePicker.cs
using System;
using Xamarin.Forms;
namespace MyApp
{
public interface ICanBeValidated
{
Action<bool> ValidateChange { get; set; }
bool IsValidated { get; set; }
View NavigationPageRendereriOS.cs
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using UIKit;
[assembly: ExportRenderer (typeof(ContentPage), typeof(ChangeBackIcon.iOS.NavigationPageRendereriOS))]
namespace ChangeBackIcon.iOS
{
public class NavigationPageRendereriOS : PageRenderer
{
@jessejiang0214
jessejiang0214 / ChangeBackIcon.Droid.cs
Last active Mar 24, 2016
Change back icon Android renderer
View ChangeBackIcon.Droid.cs
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using Android.Graphics.Drawables;
using Android.Widget;
[assembly: ExportRenderer (typeof(ContentPage), typeof(ChangeBackIcon.Droid.NavigationPageRendererDroid))]
namespace ChangeBackIcon.Droid
{
public class NavigationPageRendererDroid : PageRenderer
You can’t perform that action at this time.