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

TextView + FloatingActionButton #48

Closed philipesteiff closed 9 years ago

philipesteiff commented 9 years ago

I'm trying to put a TextView next to a FloatingActionButton. But the width of FloatingActionMenu not allows it to fit the two, using match_parent or by setting in hand widh also is not working. Any suggestions for how I can do this?

Exemple:

 <com.getbase.floatingactionbutton.FloatingActionsMenu
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_marginEnd="16dp"
        android:layout_marginRight="16dp"
        android:layout_marginTop="16dp"
        app:fab_addButtonColorNormal="@color/white"
        app:fab_addButtonColorPressed="@color/primary_button_pressed_color"
        app:fab_addButtonPlusIconColor="?attr/colorPrimary">

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="start"
                android:layout_marginEnd="50dp"
                android:layout_marginRight="50dp"
                android:text="Teste" />

            <com.getbase.floatingactionbutton.FloatingActionButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:adjustViewBounds="true"
                app:fab_colorNormal="@color/white"
                app:fab_colorPressed="@color/primary_button_pressed_color"
                app:fab_size="mini" />

        </FrameLayout>

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:fab_colorNormal="@color/white"
            app:fab_colorPressed="@color/primary_button_pressed_color"
            app:fab_size="mini" />

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:fab_colorNormal="@color/white"
            app:fab_colorPressed="@color/primary_button_pressed_color"
            app:fab_size="mini" />

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:id="@+id/floating_action_button_diary_my_items_list"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:fab_colorNormal="@color/white"
            app:fab_colorPressed="@color/primary_button_pressed_color"
            app:fab_size="mini" />

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:fab_colorNormal="@color/white"
            app:fab_colorPressed="@color/primary_button_pressed_color"
            app:fab_size="mini" />

    </com.getbase.floatingactionbutton.FloatingActionsMenu>
chalup commented 9 years ago

Are you trying to add label to your button? In that case, take a look at #45 implementation. Would that work for you?

philipesteiff commented 9 years ago

I was trying to the same as Inbox.

http://www.droid-life.com/wp-content/uploads/2014/10/Inbox-iOS.png

chalup commented 9 years ago

Then the labels branch is just what you need. I'm going to merge it tomorrow and push this change as v1.3.0 to Maven Central. On Dec 7, 2014 6:30 PM, "Philipe Steiff" notifications@github.com wrote:

I was trying to the same as Inbox.

http://www.droid-life.com/wp-content/uploads/2014/10/Inbox-iOS.png

— Reply to this email directly or view it on GitHub https://github.com/futuresimple/android-floating-action-button/issues/48#issuecomment-65945205 .

philipesteiff commented 9 years ago

thks :D

romangromov commented 9 years ago

@chalup Man, I owe you a beer... this great stuff should be added to repo's README. Thank you so much for awesome library and cool modern feature!