如何复制收件箱浮动操作按钮(每个子按钮有文本)?

Fis*_*fon 4 java android view android-custom-view floating-action-button

我只是想知道是否有人知道如何复制新的收件箱应用程序为Android的浮动操作按钮视图?我有浮动操作按钮工作(带子按钮)使用此库的修改版本:https: //github.com/futuresimple/android-floating-action-button/blob/master/README.md

但是我在尝试获取按钮旁边的textview时遇到了麻烦,就像在收件箱应用程序中一样.

如果有人可以向我提出如何修改图书馆以适应这个或任何其他实现方式的建议,我将非常感激.

谢谢你的时间科里

Rom*_*man 7

由于标签FAB功能(如在Evernote或Inbox应用程序中)被添加到这个很棒的库中,可以随意使用它:

Gradle依赖:

    compile 'com.getbase:floatingactionbutton:1.3.0'
Run Code Online (Sandbox Code Playgroud)

Layout.xml:

     <com.getbase.floatingactionbutton.FloatingActionsMenu
        android:id="@+id/multiple_actions"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"
        fab:fab_addButtonColorNormal="@color/white"
        fab:fab_addButtonColorPressed="@color/white_pressed"
        fab:fab_addButtonPlusIconColor="@color/half_black"
        fab:fab_labelStyle="@style/menu_labels_style"
        android:layout_marginBottom="16dp"
        android:layout_marginRight="16dp"
        android:layout_marginEnd="16dp">

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_colorNormal="@color/white"
            fab:fab_title="Action A"
            fab:fab_colorPressed="@color/white_pressed"/>

        <com.getbase.floatingactionbutton.FloatingActionButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            fab:fab_colorNormal="@color/white"
            fab:fab_title="Action B"
            fab:fab_colorPressed="@color/white_pressed"/>

    </com.getbase.floatingactionbutton.FloatingActionsMenu>
Run Code Online (Sandbox Code Playgroud)

menu_labels_style.xml:

    <style name="menu_labels_style">
        <item name="android:background">@drawable/fab_label_background</item>
        <item name="android:textColor">@color/white</item>
    </style>
Run Code Online (Sandbox Code Playgroud)

fab_label_background.xml:

    <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/black_semi_transparent"/>
    <padding
        android:left="16dp"
        android:top="4dp"
        android:right="16dp"
        android:bottom="4dp"/>
    <corners
        android:radius="2dp"/>
</shape>
Run Code Online (Sandbox Code Playgroud)

请享用!