zendesk / android-floating-action-button

Floating Action Button for Android based on Material Design specification
Apache License 2.0
6.38k stars 1.46k forks source link

how to change the direction of expanding sub-floatingButtons. #221

Open Shajeel-Afzal opened 9 years ago

Shajeel-Afzal commented 9 years ago

Hi!

Currently the Floating Button shows sub menus from down to up but i want to show the sub menus from top to down direction.

Is it possible?

Thanks.

chalup commented 9 years ago

Use fab_expandDirection attribute with down option.

Shajeel-Afzal commented 9 years ago

@chalup adding 'fab:fab_expandDirection="down"' makes the floating action button invisible.

I am adding it as:

'<com.getbase.floatingactionbutton.FloatingActionsMenu android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@id/video_description_tv" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:layout_marginBottom="16dp" android:layout_marginEnd="16dp" android:layout_marginRight="16dp" fab:fab_addButtonColorNormal="@color/accent" fab:fab_addButtonSize="mini" fab:fab_labelsPosition="left">

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:id="@+id/menu_share"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_colorNormal="@color/accent"
            fab:fab_colorPressed="@color/primary"
            fab:fab_size="mini"
            fab:fab_title="Label on the right" />

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:id="@+id/menu_comment"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_colorNormal="@color/accent"
            fab:fab_colorPressed="@color/primary"
            fab:fab_size="mini"
            fab:fab_title="Label on the right" />

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:id="@+id/menu_like"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_colorNormal="@color/accent"
            fab:fab_colorPressed="@color/primary"
            fab:fab_size="mini"
            fab:fab_title="Label on the right" />

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:id="@+id/menu_facebook"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_colorNormal="@color/accent"
            fab:fab_colorPressed="@color/primary"
            fab:fab_size="mini"
            fab:fab_title="Label on the right" />

    </com.getbase.floatingactionbutton.FloatingActionsMenu>

'

CodeBendr commented 9 years ago

Does anyone know how to implement a Fab Menu with the new Material Design support library from Google?! Something similar to what this library provides.

Sent from my iPhone 6

On Jun 16, 2015, at 7:43 AM, Shajeel Afzal notifications@github.com wrote:

@chalup adding 'fab:fab_expandDirection="down"' makes the floating action button invisible.

I am adding it as:

' android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@id/video_description_tv" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:layout_marginBottom="16dp" android:layout_marginEnd="16dp" android:layout_marginRight="16dp" fab:fab_addButtonColorNormal="@color/accent" fab:fab_addButtonSize="mini" fab:fab_labelsPosition="left">

    <com.getbase.floatingactionbutton.FloatingActionButton
        android:id="@+id/menu_share"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        fab:fab_colorNormal="@color/accent"
        fab:fab_colorPressed="@color/primary"
        fab:fab_size="mini"
        fab:fab_title="Label on the right" />

    <com.getbase.floatingactionbutton.FloatingActionButton
        android:id="@+id/menu_comment"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        fab:fab_colorNormal="@color/accent"
        fab:fab_colorPressed="@color/primary"
        fab:fab_size="mini"
        fab:fab_title="Label on the right" />

    <com.getbase.floatingactionbutton.FloatingActionButton
        android:id="@+id/menu_like"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        fab:fab_colorNormal="@color/accent"
        fab:fab_colorPressed="@color/primary"
        fab:fab_size="mini"
        fab:fab_title="Label on the right" />

    <com.getbase.floatingactionbutton.FloatingActionButton
        android:id="@+id/menu_facebook"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        fab:fab_colorNormal="@color/accent"
        fab:fab_colorPressed="@color/primary"
        fab:fab_size="mini"
        fab:fab_title="Label on the right" />

</com.getbase.floatingactionbutton.FloatingActionsMenu>

'

— Reply to this email directly or view it on GitHub.

chalup commented 9 years ago

@Shajeel-Afzal Can you modify the sample app to reproduce this issue?

Shajeel-Afzal commented 9 years ago

@chalup i will try do so later today. Added to my todo list.

Shajeel-Afzal commented 9 years ago

@CodeBendr that would be great if we can achieve the same thing from Material Design Support Library. Please share if you have found any solution.

VladimirYugay commented 8 years ago

Good day. A great library. Still can't change the direction of expanding