Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeException when trying to use FabSpeedDialBehaviour #29

Closed
scottyab opened this issue Sep 6, 2016 · 2 comments
Closed

RuntimeException when trying to use FabSpeedDialBehaviour #29

scottyab opened this issue Sep 6, 2016 · 2 comments

Comments

@scottyab
Copy link

scottyab commented Sep 6, 2016

Great library btw thanks. However I'm seeing an issue using the FabSpeedDialBehaviour which I was hoping to use to hide the FAB when scrolling a recyclerview.

Using version fab-speed-dial:1.0.4

Min SDK 21,
Target 24,
buildToolsVersion "23.0.3"
Dependancies
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:recyclerview-v7:24.2.0'

Caused by: java.lang.RuntimeException: Could not inflate Behavior subclass io.github.yavski.fabspeeddial.FabSpeedDialBehaviour
...
 Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet]
                      at java.lang.Class.getConstructor(Class.java:531)
                      at java.lang.Class.getConstructor(Class.java:495)
                      at android.support.design.widget.CoordinatorLayout.parseBehavior(CoordinatorLayout.java:595)

This is my xml

  <io.github.yavski.fabspeeddial.FabSpeedDial
        android:id="@+id/addFab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end|bottom"
        app:fabGravity="bottom_end"
        app:fabMenu="@menu/timeline_fab_menu"
        app:layout_behavior="io.github.yavski.fabspeeddial.FabSpeedDialBehaviour"
        app:miniFabBackgroundTint="@android:color/white"
        app:miniFabDrawableTint="?attr/colorPrimaryDark"
        app:miniFabTitleTextColor="?attr/colorPrimaryDark" />

@scottyab
Copy link
Author

scottyab commented Sep 6, 2016

Digging deeper it seems the FabSpeedDialBehaviour needs this constructor adding

  public FabSpeedDialBehaviour(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

@yavski yavski closed this as completed in 9c0265a Oct 16, 2016
@yavski
Copy link
Owner

yavski commented Oct 16, 2016

Sorry for taking ages to respond, I've added the constructor in 1.0.5. Let me know if you still have that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants