Skip to content

Instantly share code, notes, and snippets.

@PureWeen
PureWeen / ReactiveRouting.cs
Last active May 19, 2018 04:12
RxUI Routing
public interface IParScreen
{
/// <summary>
/// The Router associated with this Screen.
/// </summary>
IParRoutingState Router { get; }
}
public interface IParRoutingState
{

TouchGestureRecognizer

Generic Touch Gesture Recognizer

Whenever a touch state changes this Gesture Recognizer will fire an Updated event. This allows for a raw feed of touch data that a user could essentially use for anything.

API

Supporting APIs

@PureWeen
PureWeen / BorderDrawable.cs
Last active December 20, 2018 23:21
Border Drawable
using System;
using System.Linq;
using Android.Graphics;
using Android.Graphics.Drawables;
using AColor = Android.Graphics.Color;
namespace Xamarin.Forms.Platform.Android
{
internal class BorderDrawable : Drawable
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using Xamarin.Forms;
public delegate void RepeaterViewItemAddedEventHandler(object sender, RepeaterViewItemAddedEventArgs args);
/// <summary>
@PureWeen
PureWeen / RoutingUri.md
Last active April 11, 2019 22:57
Routing URI Spec
Relative push - edit
Relative replace - \\edit
absolute push - \edit or if your shell route is unique shell\edit
absolute replace - \\\edit or if your shell route is unique \\shell\edit

Route construction and GoToAsync behavior

Api Changes

@PureWeen
PureWeen / shellstructures.md
Last active May 3, 2019 22:19
Shell XAML Structures

Existing Structures

This is only showing browsable areas and just assume there's always a shell parent

Core Control => Aliases

  • ShellItem (Design Hidden) => FlyoutItem and TabBar
    • ShellSection (Design Hidden) => Tab (Bottom Tabs)
      • ShellContent => (Top Tabs represents)

Navigation note(s)

  • Pushing global route pages happens at the Shell Section Level. So if you push a page onto the stack you've left that Shell Section and that Shell section (with its top tabs) is now one level down in the stack.
@PureWeen
PureWeen / ShellNavigation.md
Last active June 11, 2019 04:31
Spec for shell navigation hooks

Shell Navigation interfaces

Existing work being done here xamarin/Xamarin.Forms#6383

Notes

The intent of this setup is to empower MVVM frameworks to effectively influence every aspect of shell processing a Uri. ShellRouteState represents the data object that Shell understands but MVVM frameworks can effectively implement there own uri scheme with the above set of interfaces. People can also just tap into parts of the process if they only want to influence one or two things.

public FormsView
{
  Func<Point, bool> _setInitialTransformationCallBack;
  
  // could hide this behind explicit interface
  public void RegisterCallBack(Func<Point, bool> callback)
  {
    _setInitialTransformationCallBack = callback;
  }
@PureWeen
PureWeen / PickerIOS.md
Last active August 29, 2019 19:40
Picker
[assembly:ExportRenderer(typeof(Picker), typeof(PlaceHolderPicker), new[] { typeof(VisualMarker.MaterialVisual), typeof(CustomMaterial) })]
namespace VisualPicker.iOS
{
    public class PlaceHolderPicker : MaterialPickerRenderer, IMaterialEntryRenderer
    {
        public PlaceHolderPicker()
        {
        }
@PureWeen
PureWeen / Crashes.md
Created August 30, 2019 14:27
Android Crashes
08-30 08:09:55.562 3318-3318/? E/memtrack: Couldn't load memtrack module (No such file or directory)
08-30 08:09:55.562 3318-3318/? E/android.os.Debug: failed to load memtrack module: -2
08-30 08:09:56.865 4366-4413/com.android.launcher3 E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb403d3e0
08-30 08:10:00.190 1264-1293/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
08-30 08:10:00.330 3327-3351/AndroidControlGallery.AndroidControlGallery E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
08-30 08:10:00.330 3327-3351/AndroidControlGallery.AndroidControlGallery E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
08-30 08:10:03.663 3327-3327/AndroidControlGallery.AndroidControlGallery E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
08-30 08:10:03.663 3327-3327/AndroidControlGallery.AndroidControlGallery E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
08-30 08:10:03.780 3327-3327/AndroidCo