Coder Social home page Coder Social logo

floatingactionbutton's People

Contributors

afollestad avatar almozavr avatar eboudrant avatar insanityonabun avatar joshuabg avatar makovkastar avatar markshiz avatar paulmaddox avatar sreichholf avatar stephanebg avatar vickychijwani avatar viliuskraujutis avatar wdullaer avatar zeliret 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  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  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  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

floatingactionbutton's Issues

Classnotfoundexpeciton

Rendering Problems The following classes could not be instantiated:
- com.orange.ftpworld.floatingactionbutton.FloatingActionButton (Open Class, Show Exception)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE Exception Details java.lang.ClassNotFoundException: android.graphics.drawable.shapes.OvalShape

when i add the code in my xml , i got this error , i can run in my phone the project but i cant see floating button

Negative effect on custom layout?

After using FloatingActionButton my main layout started looking like the image below. My drawable code is this: http://pastebin.com/LNepQ7rm (I use it as background for a linear layout)
what could be the conflict? My layout should be like the second image
I'm using FloatingActionButton in a different activity, though the only effected activity is the startup activity.

screenshot_2014-08-27-10-17-42

screenshot_2014-08-16-21-09-50

OvalShape class not found while in edit mode

I'm getting

java.lang.ClassNotFoundException: android.graphics.drawable.shapes.OvalShape

exception while editing layout in Android Studio 0.8.11.

Anyone else experiencing this or should we really modify createDrawable method to add isInEditMode() modification?

On empty ListView FAB hides

Hi,

I'm using FloatingActionButton library along with a dynamic ListView populated using an ArrayAdapter. My app allows the user to add and remove items from the ListView by tapping on the FAB or swipping to dismiss respectively.
My problem is that if all items on the listview are removed, automatically, the FAB hides making impossible to add a new item to the list.
Is this a bug or is the normal behavior? And if is normal, do you know some workaround?

Thank you!

Animations

Is it possible to animate the FAB if its not attached to a listview or gridview?
Mine is on top of a relative layout.

Thanks

Preventing Access to OnScrollListener reduced available features

By not allowing OnScrollListener to be overridden, and instead only providing OnScrollUp and OnScrollDown, this library is hiding asyncronous data that comes through those methods such as visible/total items and the scroll state with access to a valid view:

public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
}
public void onScrollStateChanged(AbsListView view, int scrollState) {
}

two FAB's attached to same listview

If i attach two fabs to the same list view only one listens the onScroll so only one hides when scrolling.
Is there a way to attach both of them to onScroll?
Thanks

Can't use circular reveal on FAB

I'm trying to use circular reveals to show and hide a FAB, with code that looks like this:

ImageButton fab = (ImageButton) findViewById(R.id.fab);
int cx = (fab.getLeft() + fab.getRight()) / 2;
int cy = (fab.getTop() + fab.getBottom()) / 2;
Animator fabAnimator = ViewAnimationUtils.createCircularReveal(fab, cx, cy, (fab.getWidth()/2), 0);
fabAnimator.setDuration(500);
fabAnimator.start();

However, this doesn't seem to work correctly, as the FAB either disappears as soon as the animation starts, or appears as soon as it ends, depending on if I'm trying to hide it or show it. The circular reveal has worked on every other view I've tried it on, so I'm left to believe it must be a problem with the library. Any idea what gives?

Issue with Scroll Listener

Currently when using a list view, I set the onScrollListener(this) and use to be able to determine what to do if I got past a certain point.
If I attach the FAB to the same list view. My onScrollListener implementation never gets called.
I unattached the FAB from the list view and it works like it was suppose to again.

Anyone else noticing this?

Button covers listview items

When the number of ListView items is at the point where they fill all/most of the screen, but still fit within the screen so no scrolling is yet possible/activated the button covers the bottom list items. Since, one of the main features of this particular FAB library is that the FAB hides when scrolling I would suggest attaching to swipe up/down motions instead of onScrollDown() and onScrollUp().

Please add support for older sdk ...

Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 14 declared in library com.melnykov:floatingactionbutton:1.0.1

Thanks.

FloatingActionButton not working on Android 2

Thanks for the great library.
Unfortunately, I get an error when using it on Android 2 devices.
Have you tested it on Android 2 devices?
Here is the stacktrace. If I remove the FAB, the app starts:
E/AndroidRuntime(341): FATAL EXCEPTION: main
E/AndroidRuntime(341): java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x2
E/AndroidRuntime(341): at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463)
E/AndroidRuntime(341): at android.view.ViewGroup$MarginLayoutParams.(ViewGroup.java:3696)
E/AndroidRuntime(341): at android.widget.FrameLayout$LayoutParams.(FrameLayout.java:457)
E/AndroidRuntime(341): at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:423)
E/AndroidRuntime(341): at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:47)
E/AndroidRuntime(341): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:699)
E/AndroidRuntime(341): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
E/AndroidRuntime(341): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
E/AndroidRuntime(341): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)

Compiles and runs fine depending on when you attach it

Spent a half hour trying to figure out why the button wasn't moving when scrolling occurred. I had the code to attach the FAB to a recyclerview prior to the adapter being set and it compiled and ran, except for the movement error everything worked. I tried moving it to after the adapter was attached and only then discovered the following:

Currently only LinearLayoutManager is supported for the RecyclerView.

You should probably state this in the Readme file.

Class not found when unmarshalling

I got this exception whenever I got back into my app after the fragment has been destroyed

Class not found when unmarshalling: com.melnykov.fab.FloatingActionButton$SavedState, e: java.lang.ClassNotFoundException: com.melnykov.fab.FloatingActionButton$SavedState

Any idea why this happens?

Add ripple highlight on Android 5.0+

If you look at many of the Google apps running on Android 5.0, their FABs all have a circular ripple effect when they are touched. The effect is subtle but it looks really nice. It would be great to see the same thing in this library.

Crashes onScroll on Android 2.3

I know that Gingerbread is far away, but i would like to use your library for a project which has to be API 10 and up

I think it is just a little fix, something like "if < 10 then no animate on hide"

java.lang.NoSuchMethodError: com.melnykov.fab.FloatingActionButton.animate
at com.melnykov.fab.FloatingActionButton.toggle(FloatingActionButton.java:312)
at com.melnykov.fab.FloatingActionButton.hide(FloatingActionButton.java:286)
at com.melnykov.fab.FloatingActionButton.hide(FloatingActionButton.java:278)
at com.melnykov.fab.FloatingActionButton$FabOnScrollListener.onScrollUp(FloatingActionButton.java:398)
at com.melnykov.fab.ScrollDirectionDetector.onScroll(ScrollDirectionDetector.java:33)
at android.widget.AbsListView.invokeOnItemScrollListener(AbsListView.java:772)
at android.widget.AbsListView.trackMotionScroll(AbsListView.java:3411)
at android.widget.AbsListView.onTouchEvent(AbsListView.java:2233)
at android.widget.ListView.onTouchEvent(ListView.java:3446)

Thank you!

Button icon size clarifications

Your documentation states that you should use a drawable of 24dp as the src attribute. I assume this is 24dp baseline (MDPI), which means XXHDPI would be a 72x72 image. However, your sample uses a 96x96 image in the XXHDPI folder.

Animation to open/close floating button

Hi,
I would like suggest an enhancement for this library: can you develop a method to call for close or open the floating button (animate from bottom to top and viceversa)? :)

Thanks!

ScrollListener библиотеки перезаписывает уже установленный обработчик

Я попробовал использовать эту чудесную либу вместе с StickyListHeaders.
И так получается, что ваш класс перебивает onScrollListener, который уже выставлен второй либой.
Было бы замечательно, если бы можно было часть переменных и методов повысить до protected, т.к. сейчас мне пришлось скопировать весь код класса ради одного дополнительного метода.

В любом случае спасибо за труд :)

ProGuard configuration

Hey, just wanted to confirm that this library doesn't require any ProGuard configuration? Thank you!

Add some icons

Any chance you can add some standard icons like the plus, minus, check mark, etc?

Inconsistent view when a transparent background color is used

Using a background color with some alpha (e.g. #99fe0038) when the shadow attribute value is set to true reveals two circles: one for the floating action button and another inside (cf. image below). The latter is probably caused by the shape of the drawable that is used for creating the shadow.

It would be nice to get a circle without the inner one when a transparent background color is used.

I have also noticed that the image drawable used for the shadow isn't provided for xxxhdpi.

device-2014-11-01-182232

Can't to import the library in eclipse?

Hi,
Is there anyway I can make this library work in eclipse? I have tried creating a new library project and importing the contents but the recylceview is not imported in eclipse. Please help....

Doesn't work with minSdkVersion 10

I'm new to Android development, and I'd like my app to run on 2.3.3 devices, is there any way that the FloatingActionButton could support this?

Thanks!

When compiling I get error:

uses-sdk:minSdkVersion 10 cannot be smaller than version 14 declared in library com.melnykov:floatingactionbutton:1.0.4

Cannot access mFloatingActionButton in extended FabRecyclerOnViewScrollListener

Hi,
I'm trying to customize a ScrollDirectionListener of FabRecyclerOnViewScrollListener with keeping show / hide FloatingActionButton.
However, the mFloatingActionButton is private, so I cannot call show() and hide() of mFloatingActionButton in extended FabRecyclerOnViewScrollListener.
Of course, the above behavior can be achieved with below codes.

class MyScrollListener extends FloatingActionButton.FabRecyclerOnViewScrollListener {
        private ScrollDirectionListener mListener;

        public MyFabRecyclerOnViewScrollListener() {
            super();
            mListener = getScrollDirectionListener();
            setScrollDirectionListener(new ScrollDirectionListener() {
                @Override
                public void onScrollDown() {
                    mListener.onScrollDown();
                    // custom code...
                }

                @Override
                public void onScrollUp() {
                    mListener.onScrollUp();
                    // custom code...
                }
            });
        }
}

I think it's redundant.
Could you change the access level of mFloatingActionButton from private to protected?

Animation on API < 11

If you use the button on an API < 11 device, you get an error with the animate() method.

I made a little change that maybe you could include on the next version. I included NineOldAndroids to the gradle dependencies and changed this piece of code:

@Override
public void handleMessage(Message msg) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
        animate()
            .setInterpolator(mInterpolator)
            .setDuration(TRANSLATE_DURATION_MILLIS)
            .translationY(mSettledScrollY);
    } else {
         // Here I have a Frame Layout on my layout, but maybe you could use a generic view or some other approach
         FrameLayout fm = (FrameLayout)mListView.getParent();
         // fm.getChildAt(1) this is the button
         com.nineoldandroids.view.ViewPropertyAnimator.animate(fm.getChildAt(1))
             .setInterpolator(mInterpolator)
             .setDuration(TRANSLATE_DURATION_MILLIS)
             .translationY(mSettledScrollY);
    }
}

Hope it helps!

Why don't available support by version lower of api level 14?

Currently I'm using your library by make apps look and feel with material design features but my application support from api level 9, I'm download your project and only change the next lines by enable support for lower api level the change it's

VERSION_NAME=1.0.8
VERSION_CODE=8
GROUP=com.melnykov

ANDROID_BUILD_MIN_SDK_VERSION=9
ANDROID_BUILD_TARGET_SDK_VERSION=21
ANDROID_BUILD_SDK_VERSION=21
ANDROID_BUILD_TOOLS_VERSION=21.0.2

I'll send a pull request to validate if allow the change :)

#60

Implement isVisible() for mVisible

Yo. I happened to see that inside the main class there's a boolean mVisible that changes depending on if you've called show() or hide() for the fab. For me it was just that method I needed to use, so I implemented it in the class.

Thought it could be a good enhancement to have in general.

org/codehaus/groovy/runtime/typehandling/ShortTypeHandling error when trying to open project in Android Studio 0.9.2

I cloned the repo and trying to open the project in Android Studio 0.9.2
Since this requires gradle build 0.14.1 I made that change, plus I'm also trying to use sdk 4.4.2 (19)

diff --git a/build.gradle b/build.gradle
index b790036..8a5da52 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ buildscript {
         mavenCentral()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:0.12.+'
+        classpath 'com.android.tools.build:gradle:0.14.1+'
     }

diff --git a/gradle.properties b/gradle.properties
index 0e3f783..92f1887 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -21,10 +21,10 @@ VERSION_NAME=1.0.6
 VERSION_CODE=7
 GROUP=com.melnykov

-ANDROID_BUILD_MIN_SDK_VERSION=14
-ANDROID_BUILD_TARGET_SDK_VERSION=21
-ANDROID_BUILD_SDK_VERSION=21
-ANDROID_BUILD_TOOLS_VERSION=21.0.2
+ANDROID_BUILD_MIN_SDK_VERSION=19
+ANDROID_BUILD_TARGET_SDK_VERSION=19
+ANDROID_BUILD_SDK_VERSION=19
+ANDROID_BUILD_TOOLS_VERSION=21.1.1

Android Studio throws this error while opening the project:

Cause: org/codehaus/groovy/runtime/typehandling/ShortTypeHandling

screen shot 2014-11-09 at 7 41 31 pm

How does overriding the Onscrollistener work?

How can I make the action bar and my tab bar hide when the float button hides..

I use a RecyclerView. I don't understand the documentation and I couldn't find examples. Nice library by the way!

FloatingActionButton and LoaderManager.LoaderCallbacks

Hello,
First of all allow me to thank you. This custom view is amazing :)
I was trying to implement it in my app to check how it works and I encountered an issue.
If I populate the ListView (or GridView in my case), using a LoaderManager, there might be an IndexOutOfBounds exception when calculating scroll Y if the list hasn't finished populating yet.

I tried attaching the view to the GridView in onLoadFinished and that seems to work only if there is a small amount of data to populate.

I'm trying to solve this right now, but if you have any lead, that would be awesome!

And thanks again.

EDIT:
I added a check if (mAdapter.getCount() != 0) in onLoadFinished() before attaching the GridView to the FloatButton.... this way I make sure there is info in the adapter once the attached method gets called.
I hope its stable enough...

extra margin on non Lollipop

the size of the FAB on non lollipop is bigger because of the shadow so changing the margin in xml will not have the same effect and you need to have different dimension for Lollipop

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.