User Animation Card

Example

from kivymd.app import MDApp
from kivy.lang import Builder
from kivy.factory import Factory

from kivymd.toast import toast
from kivymd.theming import ThemeManager
from kivymd.uix.useranimationcard import MDUserAnimationCard
from kivymd.uix.button import MDIconButton
from kivymd.uix.list import ILeftBodyTouch

# Your content for a contact card.
Builder.load_string('''
#:import get_hex_from_color kivy.utils.get_hex_from_color


<TestAnimationCard@BoxLayout>
    orientation: 'vertical'
    padding: dp(10)
    spacing: dp(10)
    size_hint_y: None
    height: self.minimum_height

    BoxLayout:
        size_hint_y: None
        height: self.minimum_height

        Widget:
        MDRoundFlatButton:
            text: "Free call"
        Widget:
        MDRoundFlatButton:
            text: "Free message"
        Widget:

    OneLineIconListItem:
        text: "Video call"
        IconLeftSampleWidget:
            icon: 'camera-front-variant'

    TwoLineIconListItem:
        text: "Call Viber Out"
        secondary_text: "[color=%s]Advantageous rates for calls[/color]" % get_hex_from_color(app.theme_cls.primary_color)
        IconLeftSampleWidget:
            icon: 'phone'

    TwoLineIconListItem:
        text: "Call over mobile network"
        secondary_text: "[color=%s]Operator's tariffs apply[/color]" % get_hex_from_color(app.theme_cls.primary_color)
        IconLeftSampleWidget:
            icon: 'remote'
''')


class IconLeftSampleWidget(ILeftBodyTouch, MDIconButton):
    pass


class Example(MDApp):
    title = "Example Animation Card"

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.user_animation_card = None

    def build(self):
        def main_back_callback():
            toast('Close card')

        if not self.user_animation_card:
            self.user_animation_card = MDUserAnimationCard(
                user_name="Lion Lion",
                path_to_avatar="./assets/african-lion-951778_1280.jpg",
                callback=main_back_callback)
            self.user_animation_card.box_content.add_widget(
                Factory.TestAnimationCard())
        self.user_animation_card.open()


Example().run()

API - kivymd.uix.useranimationcard

class kivymd.uix.useranimationcard.MDUserAnimationCard(**kwargs)

Bases: kivymd.theming.ThemableBehavior, kivy.uix.modalview.ModalView

user_name
path_to_avatar
box_content
callback
on_open(self)
on_touch_move(self, touch)
on_touch_down(self, touch)
on_touch_up(self, touch)
animation_to_bottom(self)
animation_to_top(self)
class kivymd.uix.useranimationcard.UserAnimationCard

Bases: kivymd.theming.ThemableBehavior, kivy.uix.floatlayout.FloatLayout

user_name
path_to_avatar
class kivymd.uix.useranimationcard.ModifiedToolbar(**kwargs)

Bases: kivymd.theming.ThemableBehavior, kivymd.uix.behaviors.SpecificBackgroundColorBehavior, kivy.uix.boxlayout.BoxLayout

left_action_items
title
on_left_action_items(self, instance, value)
update_action_bar(self, action_bar, action_bar_items)
update_action_bar_text_colors(self, instance, value)