Skip to content

Instantly share code, notes, and snippets.

View alexshikov's full-sized avatar

Alexey Shikov alexshikov

  • Diversido
  • Kiev, Ukraine
View GitHub Profile
@alexshikov
alexshikov / pubspec.yaml
Created December 8, 2020 12:44
The pubspec example that fails with `flutter pub run`
name: my_app
description: My App
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
@alexshikov
alexshikov / AccountStoreFix.cs
Last active August 21, 2018 15:30
Fix an issue when update Xamarin.Auth NuGet from 1.5.x to 1.6.x
// Workaround
public static class AccountStoreFix
{
// Replace default construction with Android fix in the MainActivity.cs
public static Func<AccountStore> CreateFunc = AccountStore.Create;
public static AccountStore Create ()
{
return CreateFunc ();
}
@alexshikov
alexshikov / Button.cs
Last active September 1, 2017 13:11
i18N-Portable iOS auto-wire extensions
[Register("Button")]
public class LocalizedButton: UIButton
{
[Connect]
private NSString Translate
{
get { return (NSString)ValueForKey (new NSString (LocalizationExtensions.LocalizationKey)); }
set { SetValueForKey (new NSString (LocalizationExtensions.LocalizationKey), value); }
}
@alexshikov
alexshikov / FixedNavigationRenderer.cs
Last active May 23, 2018 13:43
Fix to NavigationPageRenderer constructor crash
using System;
using Android.Runtime;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android.AppCompat;
[assembly: ExportRenderer (typeof (NavigationPage), typeof (MyApp.Droid.Renderers.FixedNavigationRenderer))]
namespace MyApp.Droid.Renderers
{
// WARNING
// There is a crash happens for unknown reason:
@alexshikov
alexshikov / MainMasterDetailPage.cs
Last active March 11, 2019 17:48
Shadow for side menu using Xamarin.Forms MasterDetailPage
public class MainMasterDetailPage : MasterDetailPage
{
public MainMasterDetailPage ()
{
Detail = new ShadowNavigationPage();
}
}
@alexshikov
alexshikov / TilingTexture.shader
Last active April 18, 2018 04:32
Tiling shader for Unity3D 5.3.x (material tiling is broken in 5.3.4f1 for some reason)
Shader "Unlit/Tiling Texture"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Tiling ("Tiling", Vector) = (1, 1, 0, 0)
}
SubShader
{
Tags
@alexshikov
alexshikov / LocationService.cs
Last active April 25, 2016 19:56
Example of Task based LocationService implementation using Mvx Location Plugin
public interface ILocationService
{
Coordinates GetLastSeenLocation();
Task<Coordinates> GetCurrentLocation ();
}
public class LocationService : ILocationService
{
private const string Tag = "LocationService";
@alexshikov
alexshikov / FusedLocationPluginBootstrap.cs.pp
Created April 20, 2016 12:57
Mvx Fused Location Plugin NuSpec
using MvvmCross.Platform.Plugins;
namespace $rootnamespace$.Bootstrap
{
public class LocationPluginBootstrap
: MvxPluginBootstrapAction<MvvmCross.Plugins.Location.PluginLoader, MvvmCross.Plugins.Location.Fused.Droid.Plugin>
{
}
}
@alexshikov
alexshikov / README.md
Last active April 11, 2016 11:51
A script to exchange all MvvmCross or/and MvvmCross-Plugins NuGet dependencies on local binaries

How to use

Let's assume we want to test local changes of MvvmCross in one of MvvmCross-Samples projects.

Steps:

  1. Clone MvvmCross and MvvmCross-Samples into a folder
  2. Make changes to MvvmCross and rebuild all in Debug mode
  3. Assuming we want to test changes on ValueConvertion project, copy use_loca_mvx.fsx into MvvmCross-Samples/ValueConvertion folder
  4. Execute fsharpi use_local_mvx.fsx
@alexshikov
alexshikov / Setup.cs
Last active April 6, 2016 17:07
Custom plugin loading
public class Setup : MvxAndroidSetup
{
// ...
protected override IMvxPluginManager CreatePluginManager()
{
return new MyPluginManager(".Droid", ".dll");
}
private class MyPluginManager: MvxFilePluginManager