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
__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
# -------------------------------------------------------------------------
self.widget = ViewAnimator(self.get_context())
# -------------------------------------------------------------------------
# ProxyViewAnimator API
# -------------------------------------------------------------------------
self.widget.setAnimateFirstView(enabled)
self.widget.setDisplayedChild(index)