Code Monkey home page Code Monkey logo

xamarin-onemorefabmenu's Introduction

sponsor

Xamarin-OneMoreFabMenu

Another floating action button menu with expand/collapse behavior. This Xamarin solution is based on André Servidoni's version: https://github.com/DeKoServidoni/OMFM

Example gif

How to use

Basic example:

XML:

<com.dekoservidoni.omfm.OneMoreFabMenu
	android:id="@+id/fabMenu"
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:layout_gravity="bottom|end"
	app:content_options="@menu/omfm_content_options"
	app:color_main_button="@color/colorPrimaryDark"
	app:close_on_click="true"
	app:color_secondary_buttons="@color/colorPrimary"
	app:expanded_background_color="@color/colorGrayTrans"/>

Menu:

omfm_content_options.xml

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

	<!-- First button is the initial Fab of the menu -->
	<!-- Don't need the title in this case, so let it empty -->
	<item
		android:id="@+id/main_option"
		android:icon="@drawable/icon1"
		android:title=""/>

	<!-- Options buttons of the Fab menu -->

	<item
		android:id="@+id/option1"
		android:icon="@drawable/icon2"
		android:title="@string/options_1" />

	<item
		android:id="@+id/option2"
		android:icon="@drawable/icon3"
		android:title="@string/options_2" />

	<item
		android:id="@+id/option3"
		android:icon="@drawable/icon4"
		android:title="@string/options_3" />
</menu>

C#:

private OneMoreFabMenu FabButtonMenu { get; set; }

public partial class MainActivity : AppCompatActivity, OneMoreFabMenu.IOptionsClick
{
	protected override async void OnCreate(Bundle savedInstanceState)
	{
		base.OnCreate(savedInstanceState);
		FabButtonMenu = FindViewById<OneMoreFabMenu>(Resource.Id.fabMenu);
		FabButtonMenu.SetOptionsClick(this);
	}
}

public void OnOptionClick(Integer p0)
{
	switch (Convert.ToInt32(p0))
	{
		case Resource.Id.option1:
			break;
		case Resource.Id.option2:
			break;
		case Resource.Id.option3:
			break;
	}
}

Download

Package Latest Release
Xamarin-OneMoreFabMenu NuGet Badge Xamarin-OneMoreFabMenu

Licence

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Follow me at:

LinkedIn YouTube Amazon Goodreads Instagram Cyber Prophets Sharing Your Stories
LinkedIn YouTube Amazon Goodreads Instagram RedCircle Podcast RedCircle Podcast

xamarin-onemorefabmenu's People

Contributors

fanmixco avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.