rjsvieira / floatingMenu

An orbit-like action button
Apache License 2.0
305 stars 42 forks source link

XML FloatingMenuButton is not working #9

Closed RiccardoM closed 6 years ago

RiccardoM commented 7 years ago

Hi, here is my sample code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:floatingMenuActionButton="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center">

    <rjsv.floatingmenu.floatingmenubutton.FloatingMenuButton
        android:id="@+id/my_floating_button"
        android:layout_width="40dp"
        android:layout_height="40dp"
        floatingMenuActionButton:anchored="true"
        floatingMenuActionButton:animationType="radial"
        floatingMenuActionButton:dispositionEndAngle="0"
        floatingMenuActionButton:dispositionStartAngle="360"
        floatingMenuActionButton:subActionButtonRadius="300">

        <rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
            android:id="@+id/sub_button_1"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:background="@drawable/two" />

        <rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
            android:id="@+id/sub_button_2"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:background="@drawable/one" />

    </rjsv.floatingmenu.floatingmenubutton.FloatingMenuButton>

</LinearLayout>

After starting an activity, It looks like the first button is hidden from the second one, which is the only one showing. Also the buttons are not displayed correctly but they overlap the floating menu button.

Am I doing something wrong?

rjsvieira commented 7 years ago

Hello @RiccardoM Thank you for letting me know of a possible mistake. I took the code you've posted and ran it to try it out but it seems everything is working accordingly. Attached follows the .mp4 file containing the test.

Best regards,

test.zip

RiccardoM commented 7 years ago

Is it possible that this error occurs becasue I'm using your library inside a library module and not the app module? Did you just inflate the layout or perform other activities?

rjsvieira commented 7 years ago

Hello @RiccardoM It is very unlikely. Are you using the latest version (1.2.0) as a gradle dependency? Or are you importing the source-code directly from a specific folder? For that matter, I have tested it with a dummy Activity on a debug project that I have. The manifest starts that same activity directly and the FloatingMenuButton is being inflated from .xml (I'm not even linking the view's reference to the activity).

Regards,