Coder Social home page Coder Social logo

shawnlamountain / thunderdesign.xamarin.forms.floatingactionbutton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thunderdesign/thunderdesign.xamarin.forms.floatingactionbutton

0.0 0.0 0.0 685 KB

FloatingActionButton (FAB) for both Android and iOS

License: MIT License

C# 100.00%

thunderdesign.xamarin.forms.floatingactionbutton's Introduction

ThunderDesign.Xamarin.Forms.FloatingActionButton

CI CD Nuget License Net

FloatingActionButton (FAB) with custom shadow (Color, Offset, Blur) and custom Animation Easing (Show, Hide) for Xamarin.Forms view (Android, iOS, UWP)


Supported platforms
✔️ Android
✔️ iOS
✔️ UWP

Presentation

Getting Started:

Sample

After installation, start using the features you're after.

If you're using XAML, you can add this namespace to your root node to get access to the FAB: xmlns:fab="clr-namespace:ThunderDesign.Xamarin.Forms.FloatingActionButton.Controls;assembly=ThunderDesign.Xamarin.Forms.FloatingActionButton".

<fab:FloatingActionButton
  Text="+"
  Style="{StaticResource RoundFAB}"
  Command="{Binding NewItemCommandAsync}"		
  VerticalOptions="End"
  HorizontalOptions="End"
  Margin="25"/>

Sample Style (same as Button)

<Style x:Key="RoundFAB" TargetType="fab:FloatingActionButton">
    <Setter Property="TextColor" Value="White"></Setter>
    <Setter Property="FontSize" Value="30"></Setter>
    <Setter Property="WidthRequest" Value="56"></Setter>
    <Setter Property="HeightRequest" Value="56"></Setter>
    <Setter Property="CornerRadius" Value="28"></Setter>
</Style>

<Style TargetType="fab:FloatingActionButton">
    <Setter Property="VisualStateManager.VisualStateGroups">
        <VisualStateGroupList>
            <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal">
                    <VisualState.Setters>
                        <Setter Property="BackgroundColor" Value="{StaticResource Primary}" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="Disabled">
                    <VisualState.Setters>
                        <Setter Property="BackgroundColor" Value="#332196F3" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateGroupList>
    </Setter>
</Style>

Installation

Grab the latest ThunderDesign.Xamarin.Forms.FloatingActionButton NuGet package and install in your solution.

Install-Package ThunderDesign.Xamarin.Forms.FloatingActionButton

Use the -version option to specify an older version to install.

Platforms

  • Android
    • You will need to add the NuGet package to your .NET Standard library project
  • iOS
    • Important: You will need to add the NuGet package to both your .NET Standard library project and your platform-dependent iOS project.

    • modify AppDelegate.cs and add Sharpnado.Shades.iOS.iOSShadowsRenderer.Initialize();

      public override bool FinishedLaunching(UIApplication app, NSDictionary options)
      {
          ...
          global::Xamarin.Forms.Forms.Init();
          Sharpnado.Shades.iOS.iOSShadowsRenderer.Initialize();
          LoadApplication(new App());
          ...
      }
  • UWM
    • Important: You will need to add the NuGet package to both your .NET Standard library project and your platform-dependent UWM project.

    • modify App.xaml.cs and add var rendererAssemblies = new[] { typeof(UWPShadowsRenderer).GetTypeInfo().Assembly };

      protected override void OnLaunched(LaunchActivatedEventArgs e)
      {
          ...
          global::Xamarin.Forms.Forms.SetFlags("Shell_UWP_Experimental");
          var rendererAssemblies = new[] { typeof(UWPShadowsRenderer).GetTypeInfo().Assembly }; 
          Xamarin.Forms.Forms.Init(e);
          ...
      }

Examples

(TIP: Clone repo, open the solution, build it and run sample app.)

Please Contribute!

This is an open source project that welcomes contributions/suggestions/bug reports from those who use it. If you have any ideas on how to improve the library, please post an issue here on GitHub. Please check out the How to Contribute.

thunderdesign.xamarin.forms.floatingactionbutton's People

Contributors

shawnlamountain avatar thunderdesign avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.