예제 #1
0
    def __init__(self):
        Ui.DroidUi.__init__(self)
        self.layout = Ui.LinearLayout(
            self,
            layout_width=Ui.FILL_PARENT,
            layout_height=Ui.FILL_PARENT,
            background=color_bg,
            orientation=Ui.VERTICAL,
        )

        Ui.TextView(
            self.layout,
            layout_width=Ui.FILL_PARENT,
            layout_height="0px",
            textSize="20dp",
            text="Gyro Test",
            textColor=color_white,
            layout_weight=19,
            gravity=Ui.CENTER,
        )

        box1 = self._boxLayout(self.layout)
        self._block(box1, color_bg)
        self.txt_top = self._block(box1, color_default)
        self._block(box1, color_bg)

        box2 = self._boxLayout(self.layout)
        self.txt_left = self._block(box2, color_default)
        self._block(box2, color_bg)
        self.txt_right = self._block(box2, color_default)

        box3 = self._boxLayout(self.layout)
        self._block(box3, color_bg)
        self.txt_bottom = self._block(box3, color_default)
        self._block(box3, color_bg)

        self.reg_event('sensors', self.gyro)

        # start sensing
        self.sensing = Ui.Sensing()