Home

Awesome

Xamarin.Forms-Coordinator-Workaround

A Xamarin.Forms (Android Only) Implementation of CoordinatorLayout with CollapsingToolbar

NuGet version

Documentation

Alt Text

Installation

Xamarin.Android

Initialize the renderer below the Xamarin.Forms.Init

global::Xamarin.Forms.Forms.Init(this, bundle);
CoordinatorWorkaround.Droid.Renderers.Forms.Init();

Xamarin.Forms (.NetStandard)

Create the page as normal page and navigate to it

var page = new CoordinatorPage
{
    Title = "Finally Worked Monkeys!",
    NestedContent = //the instance of my ContentPage here,
    ImageSource = "my image source here",
    StatusBarColor = Color.DarkMagenta,
    ToolbarBackgroundColor = Color.DimGray,
    CoordinatorBackgroundColor = Color.Green,
    CoordinatorScrimBackgroundColor = Color.Red,
    FloatingButtonImageSource = "my image source here",
    FloatingButtonBackgroundColor = Color.DarkRed,
    FloatingButtonCommand = new Command(async () => await DisplayAlert("hehe", "hehe", "ok"), () => true),
    ChangeStatusBarColor = true,
    HasBackButton = true
};

Bindable Properties

PropertyTypeDescription
NestedContentContentPageThe content of the NestedScrollView
ImageSourceImageSourceThe Source of the image that is used inside the CollapsingToolbar
ToolbarBackgroundColorXamarin.Forms.ColorThe background color of the toolbar
ChangeStatusBarColorboolType of bool, if you want to change the color of the status bar
StatusBarColorXamarin.Forms.ColorThe background color of the status bar (only if ChangeStatusBarColor is set to true)
CoordinatorScrimBackgroundColorXamarin.Forms.ColorThe color of the scrim effect in the collapsing toolbar
CoordinatorBackgroundColorXamarin.Forms.ColorThe background color of the coordinator layout (the background of the image source)
HasBackButtonboolIf you want the toolbar have the back button
IsFloatingButtonEnabledboolIf you want the floating action button to be enabled
FloatingButtonImageSourceImageSourceThe image source of the icon of the FAB (only if IsFloatingButtonEnabled is set to true)
FloatingButtonBackgroundColorXamarin.Forms.ColorThe background color FAB (only if IsFloatingButtonEnabled is set to true)
FloatingButtonCommandICommandThe command that will execute when the user presses the FAB (only if IsFloatingButtonEnabled is set to true)