Source code for enamlnative.android.android_relative_layout
"""
Copyright (c) 2017-2022, 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
"""
from atom.api import Typed
from enamlnative.widgets.relative_layout import ProxyRelativeLayout
from .android_view_group import AndroidViewGroup, ViewGroup
from .bridge import JavaMethod
class RelativeLayout(ViewGroup):
__nativeclass__ = "android.widget.RelativeLayout"
setHorizontalGravity = JavaMethod(int)
setVerticalGravity = JavaMethod(int)
[docs]class AndroidRelativeLayout(AndroidViewGroup, ProxyRelativeLayout):
"""An Android implementation of an Enaml ProxyRelativeLayout."""
#: A reference to the widget created by the proxy.
widget = Typed(RelativeLayout)
# -------------------------------------------------------------------------
# Initialization API
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# ProxyRelativeLayout API
# -------------------------------------------------------------------------
def set_gravity(self, gravity):
self.widget.setGravity(gravity)
def set_horizontal_gravity(self, gravity):
self.widget.setHorizontalGravity(gravity)
def set_vertical_gravity(self, gravity):
self.widget.setVerticalGravity(gravity)