Giter Site home page Giter Site logo

floatingactionbutton-xamarin.android's Introduction

Floating Action Button for Xamarin.Android

NuGet version

This is a Java Library binding for the Clans FloatingActionButton version 1.6.4. I've also ported the Android sample project to show some of the features in action.

Installation

To add this binding to your Xamarin.Android project use the NuGet package :

PM> Install-Package FAB.XamarinAndroid

Requirements

The library requires Android API Level 14+.

Screenshots

Main screen Main drawer Menu closed Menu default opened Menu mini opened Menu right opened Menu down opened Progress background Progress no background Snackbar Tabs

Credits

Dmitry Tarianyk for create its library FloatingActionButton.

floatingactionbutton-xamarin.android's People

Contributors

fabionuno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

floatingactionbutton-xamarin.android's Issues

Use this Control into Xamarin.Forms using Native Embedding feature

Hello,
there is way to embed this control inside the shared project for the Android platform ?

Into shared class I am able to use a UISegmentedControl for the iPhone side

#if __IOS__

var segmentControl = new UISegmentedControl();
segmentControl.Frame = new CGRect(20, 20, 280, 40);
segmentControl.InsertSegment("One", 0, false);
segmentControl.InsertSegment("Two", 1, false);
segmentControl.SelectedSegment = 1;
segmentControl.ValueChanged += async (sender, e) =>
{
  var selectedSegmentId = (sender as UISegmentedControl).SelectedSegment;
  await MainPage.DisplayAlert($"Native Segmented Control Clicked {selectedSegmentId}",
                                            "Whoa!!!!!!", "OK");
};
stack.Children.Add(segmentControl);
 pageLayout.Children.Insert(0, stack);

#endif

In wich way I could add your component inside the Android side ?

#if __ANDROID__
using Xamarin.Forms.Platform.Android;
using MyProject.Droid;
using Android.Views;
using Android.Support.Design.Widget;
using Android.Util;
using Clans.Fab;
#endif
..
..
#if __ANDROID__
// ...
            Clans.Fab.FloatingActionButton fabSend;
            Clans.Fab.FloatingActionButton fabDelete;
            FloatingActionMenu fam = new FloatingActionMenu(Forms.Context, 

#endif

Thanks a lot!

Using FAB in project

Hi Fabio,
Is there a way I can use this already bound library in my xamarin project or do I have to bind it again on my own? copying the FAB.Bind-Xamarin.Android folder to my project seems to have no effect.

Can't set LabelText on FloatingActionButton

        var fabViolation1 = new Clans.Fab.FloatingActionButton(this);
        fabViolation1.ColorNormal = Color.ParseColor("#272B35");
        fabViolation1.ColorPressed = Resource.Color.accent;
        fabViolation1.ButtonSize = FloatingActionButton.SizeMini;
        fabViolation1.LabelVisibility = 1;     
        fabViolation1.LabelText = ExamManager.Instance.LightViolationList.Find(a => a.ID == 1).Description;
        fabViolation1.SetImageResource(Resource.Drawable.icon_fab_end_exam);

fabViolation1.LabelText gives a NullPointerException.

capture

Issue when FAB menu is in open state

Hi, can you please fix this bug, the problem is that when you clicking floating button and its show menu with subitems, but the same time background view is clickable, so user can click them, but the logic I think will be block user to click any other item, only menu items, so can you make background view not clickable, its will solve that issue.

Regards,
Shant

How to add a Floating Action Menu in my Main Activity?

Hi,

I have the following layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#E2E2E2"
    android:id="@+id/sampleMainLayout">
    <FrameLayout
        android:id="@+id/sampleContentFragment"
        android:layout_weight="2"
        android:layout_width="match_parent"
        android:layout_height="0px" />
</LinearLayout>

This FrameLayout is filled (programatically) with a Fragment that has three TabViews (ViewPager with PageAdapter).

Something like the main screen of WhatsApp:

image

Now I want to add a Floating Action Menu on the bottom right corner that will contain three Floating Action Buttons (appart from the main button (menú). Similar to your "red_menu" example.

The problem is that when I've added a Floating Action Menu (almost exactly as your "red_menu" example), it appears and works correctly, but other things disappears.

How I have to add & configure the Floating Action Menu to maintain my main layout with the TabViews and with the Floating Action Menu overlayed?

I don't know why the other things disappears. It seems that the menu is occopying all the screen, which I think that is right, but I think that when the menu is disabled (not showing the buttons), my other things should be visible, but not.

Of course, I've tried changing the android:background attribute but everything remains equals.

Thanks a lot,

Joan

Arc style.

Is it possible to do it in a arc style? I am really loving this with the "jumpy" label text you have provided in the animations folder. I would like to do it with a Arc style menu with new animations I can hopefully pull off.

If it is at all possible to do an arc style, please help. If not, thank you very much too for this awesome nuget.

Snackbar from Design Support library throws Null Pointer Exception after adding this library

Hi,

I wanted to implement Floating Action Menu in my existing app. I added this library along with Design support library.

I wanted to show snackbar on click of Floating Action Button. But I got this exception..

{Java.Lang.NullPointerException: Exception of type 'Java.Lang.NullPointerException' was thrown.
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Users/builder/data/lanes/2185/53fce373/source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:61 
  at Android.Runtime.JNIEnv.CallStaticObjectMethod (IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue* parms) [0x00064] in /Users/builder/data/lanes/2185/53fce373/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1301 
  at Android.Support.Design.Widget.Snackbar.Make (Android.Views.View view, ICharSequence text, Int32 duration) [0x00078] in <filename unknown>:0 
  at Android.Support.Design.Widget.Snackbar.Make (Android.Views.View view, System.String text, Int32 duration) [0x00013] in <filename unknown>:0 
  at Cheesesquare.CheeseDetailActivity.fabPhoto_Click (System.Object sender, System.EventArgs e) [0x00002] in d:\Puppy Projects\Cheesesquare\CheeseDetailActivity.cs:55 
  --- End of managed exception stack trace ---
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
    at android.support.design.widget.Snackbar.setText(Snackbar.java:331)
    at android.support.design.widget.Snackbar.make(Snackbar.java:207)
    at mono.android.view.View_OnClickListenerImplementor.n_onClick(Native Method)
    at mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:29)
    at android.view.View.performClick(View.java:4789)
    at android.view.View$PerformClick.run(View.java:19881)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5294)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
}

After removing this library, snackbar started working fine!

Scroll Hindrance

while using placing fab it is hindering scroll.. I think a layout is placed to left and top of the fab which does not allow the scroll to work

Add extension methods to simplify Recyclerview, ListView

Hi

When I migrated FAB from https://github.com/jamesmontemagno/FloatingActionButton-for-Xamarin.Android, I found that AttachToRecyclerView missing, which means I have to hook appropriate events in all the places in my app. This was cumbersome so, I have implemented extension library that basically has the same implementations from https://github.com/jamesmontemagno/FloatingActionButton-for-Xamarin.Android

You can merge my implementation from https://github.com/binoypatel/FloatingActionButton-Xamarin.Android

Hope this will help others too,

Cheers,
Binoy

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.