Source code for enamlnative.android.android_view_animator

"""
Copyright (c) 2017, CodeLV.

Distributed under the terms of the MIT License.

The full license is in the file LICENSE, distributed with this software.

Created on May 20, 2017

@author: jrm
"""
import jnius
from atom.api import Typed, set_default

from enamlnative.widgets.view_animator import ProxyViewAnimator

from .android_frame_layout import AndroidFrameLayout, FrameLayout


[docs]class ViewAnimator(FrameLayout):
__nativeclass__ = set_default('android.widget.ViewAnimator')
[docs]class AndroidViewAnimator(AndroidFrameLayout, ProxyViewAnimator): """ An Android implementation of an Enaml ProxyViewAnimator. """ #: A reference to the widget created by the proxy. widget = Typed(ViewAnimator) # ------------------------------------------------------------------------- # Initialization API # -------------------------------------------------------------------------
[docs] def create_widget(self): """ Create the underlying widget. """
self.widget = ViewAnimator(self.get_context()) # ------------------------------------------------------------------------- # ProxyViewAnimator API # -------------------------------------------------------------------------
[docs] def set_animate_first_view(self, enabled):
self.widget.setAnimateFirstView(enabled)
[docs] def set_displayed_child(self, index):
self.widget.setDisplayedChild(index)