FloatingActionButton

Example

from enamlnative.core.api import *
from enamlnative.widgets.api import *
from enamlnative.android.app import AndroidApplication

enamldef ContentView(FrameLayout):
    attr app = AndroidApplication.instance()
    Flexbox:
        flex_direction = "column"
        Button:
            text = "default"
            text_color = "#f00"
            font_family = "sans-serif-light"
            align_self = 'flex_end'
            text_size = 32
            clicked :: app.show_toast("Clicked {}".format(self.text))
        Button:
            text = "flat"
            flat = True
            text_color = "#c1a"
            align_self = 'flex_start'
            clicked :: app.show_toast("Clicked {}".format(self.text))
        ToggleButton:
            text = "Initial"
            text_on = "It's on!"
            text_off = "Awwff"
            min_width = 400
            max_width = 500
            align_self = 'center'
            clicked :: app.show_toast("State {}".format(self.checked))
    FloatingActionButton:
        gravity = "bottom|right"
        margin = (0, 0, 10, 10)
        src = "{md-play-arrow}"
        clicked :: app.show_toast("Play clicked!")

Declaration

class enamlnative.widgets.button.FloatingActionButton(parent=None, **kwargs)[source]

Bases: enamlnative.widgets.button.ImageButton

A simple control for displaying a floating button with an Image.

proxy

A reference to the proxy object.

size

Size of the button. Auto will resize to mini for small screens

elevation

Elevation to use

ripple_color

Color of the ripple touch effect

show

Show or hide the button

Android Implementation

class enamlnative.android.android_button.AndroidFloatingActionButton[source]

Bases: enamlnative.android.android_button.AndroidImageButton, enamlnative.widgets.button.ProxyFloatingActionButton

An Android implementation of an Enaml ProxyImageButton.

widget

A reference to the widget created by the proxy.

create_widget()[source]

Create the underlying widget.

No iOS implementation found.