Skip to content

Instantly share code, notes, and snippets.

View martijn00's full-sized avatar
🤘
Coding

Martijn van Dijk martijn00

🤘
Coding
View GitHub Profile
@martijn00
martijn00 / xamarinandroidbindings.md
Created October 21, 2016 09:49 — forked from JonDouglas/xamarinandroidbindings.md
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

@martijn00
martijn00 / AppDelegate.cs
Created September 23, 2015 22:22
Sidemenu in Xamarin.iOS using MvvmCross
public partial class AppDelegate : MvxApplicationDelegate
{
private UIWindow window;
public RootViewController RootViewController { get { return window.RootViewController as RootViewController; } }
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
window = new UIWindow(UIScreen.MainScreen.Bounds);
@martijn00
martijn00 / RecyclerViewActivity.cs
Last active March 18, 2024 22:13
Load more / endless scroll for Xamarin RecyclerView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var view = base.OnCreateView(inflater, container, savedInstanceState);
var recyclerView = view.FindViewById<RecyclerView>(Resource.Id.my_recycler_view);
if (recyclerView != null)
{
recyclerView.HasFixedSize = true;
var layoutManager = new LinearLayoutManager(Activity);
@martijn00
martijn00 / AndroidDesignLibraryFAB.xaml
Last active July 19, 2017 07:24
FAB Button using MvvmCross
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@martijn00
martijn00 / MainLayout.xaml
Last active June 15, 2024 11:13
Android v22.2 Tabs and ViewPager in MvvmCross
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@martijn00
martijn00 / App.cs
Last active January 15, 2018 16:54
MvvmCross Jsonlocalisation
public class App : MvxApplication
{
public override void Initialize()
{
TextProviderBuilder.SetDefaultLanguage(language);
TextProviderBuilder builder = new TextProviderBuilder(new AppJsonDictionaryTextProvider());
Mvx.RegisterSingleton<IMvxTextProviderBuilder>(builder);
Mvx.RegisterSingleton<IMvxTextProvider>(builder.TextProvider);
}
@martijn00
martijn00 / MvxCachingFragmentActivityCompat.cs
Created April 27, 2015 21:48
MvxCachingFragmentActivityCompat
public class MvxCachingFragmentActivityCompat : MvxCachingFragmentActivity
{
private AppCompatDelegate _compatDelegate;
private AppCompatDelegate CompatDelegate
{
get {
if(_compatDelegate == null)
_compatDelegate = AppCompatDelegate.Create (this, null);
return _compatDelegate;
}
@martijn00
martijn00 / CustomFragmentsPresenter.cs
Last active August 9, 2019 10:03
Custom fragment handling in MvvmCross and Xamarin
public class CustomFragmentsPresenter : MvxFragmentsPresenter
{
public interface IMvxFragmentHostEx : IMvxFragmentHost
{
void Close(IMvxViewModel viewModel);
void ChangePresentation (MvxPresentationHint hint);
}
private IMvxNavigationSerializer _serializer;