Create the underlying widget.
176059
def create_widget(self):
        
        d = self.declaration
        self.widget = TextView(self.get_context(), None,
                               d.style or '@attr/textViewStyle')
191685
def add(self, widget, condition=lambda: 42):
        

        assert callable(condition)
        assert isinstance(widget, BaseWidget)
        self._widgets.append((widget, condition))

        return widget
474724
def init_widget(self):
        
        super(AndroidViewAnimator, self).init_widget()
        d = self.declaration
        if d.animate_first_view:
            self.set_animate_first_view(d.animate_first_view)
        if d.displayed_child:
            self.set_displayed_child(d.displayed_child)
1222171
protected function createWidget()
    {
        $type   = $this->widgetData('type');
        $widget = $this->resolveWidget($type);

        if ($this instanceof ObjectContainerInterface && $widget instanceof ObjectContainerInterface) {
            if (empty($widget->objType())) {
                $widget->setObjType($this->objType());
            }

            if (empty($widget->objId()) && !empty($this->objId())) {
                $widget->setObjId($this->objId());
            }
        }

        $widget->setData($this->widgetData());
        $widget->setData($this->renderableData());

        return $widget;
    }
1045992
def init_widget(self):
        
        super(AndroidTextClock, self).init_widget()
        d = self.declaration
        if d.format_12_hour:
            self.set_format_12_hour(d.format_12_hour)
        if d.format_24_hour:
            self.set_format_24_hour(d.format_24_hour)
        if d.time_zone:
            self.set_time_zone(d.time_zone)
104876
def setup(self):
        """"""
        # Widgets
        icon_info = HelperToolButton()
        icon_info.setIcon(get_std_icon('MessageBoxInformation'))
        layout_icon_info = QVBoxLayout()
        layout_icon_info.setContentsMargins(0, 0, 0, 0)
        layout_icon_info.setSpacing(0)
        layout_icon_info.addWidget(icon_info)
        layout_icon_info.addStretch(100)

        self.label_info = QLabel()
        self.label_info.setText(
            _("Press the new shortcut and select 'Ok' to confirm, "
              "click 'Cancel' to revert to the previous state, "
              "or use 'Clear' to unbind the command from a shortcut."))
        self.label_info.setAlignment(Qt.AlignTop | Qt.AlignLeft)
        self.label_info.setWordWrap(True)
        layout_info = QHBoxLayout()
        layout_info.setContentsMargins(0, 0, 0, 0)
        layout_info.addLayout(layout_icon_info)
        layout_info.addWidget(self.label_info)
        layout_info.setStretch(1, 100)

        self.label_current_sequence = QLabel(_("Current shortcut:"))
        self.text_current_sequence = QLabel(self.current_sequence)

        self.label_new_sequence = QLabel(_("New shortcut:"))
        self.text_new_sequence = ShortcutLineEdit(self)
        self.text_new_sequence.setPlaceholderText(_("Press shortcut."))

        self.helper_button = HelperToolButton()
        self.helper_button.setIcon(QIcon())
        self.label_warning = QLabel()
        self.label_warning.setWordWrap(True)
        self.label_warning.setAlignment(Qt.AlignTop | Qt.AlignLeft)

        self.button_default = QPushButton(_('Default'))
        self.button_ok = QPushButton(_('Ok'))
        self.button_ok.setEnabled(False)
        self.button_clear = QPushButton(_('Clear'))
        self.button_cancel = QPushButton(_('Cancel'))
        button_box = QHBoxLayout()
        button_box.addWidget(self.button_default)
        button_box.addStretch(100)
        button_box.addWidget(self.button_ok)
        button_box.addWidget(self.button_clear)
        button_box.addWidget(self.button_cancel)

        # New Sequence button box
        self.btn_clear_sequence = create_toolbutton(
            self, icon=ima.icon('editclear'),
            tip=_("Clear all entered key sequences"),
            triggered=self.clear_new_sequence)
        self.button_back_sequence = create_toolbutton(
            self, icon=ima.icon('ArrowBack'),
            tip=_("Remove last key sequence entered"),
            triggered=self.back_new_sequence)

        newseq_btnbar = QHBoxLayout()
        newseq_btnbar.setSpacing(0)
        newseq_btnbar.setContentsMargins(0, 0, 0, 0)
        newseq_btnbar.addWidget(self.button_back_sequence)
        newseq_btnbar.addWidget(self.btn_clear_sequence)

        # Setup widgets
        self.setWindowTitle(_('Shortcut: {0}').format(self.name))
        self.helper_button.setToolTip('')
        style = """
            QToolButton {
              margin:1px;
              border: 0px solid grey;
              padding:0px;
              border-radius: 0px;
            }"""
        self.helper_button.setStyleSheet(style)
        icon_info.setToolTip('')
        icon_info.setStyleSheet(style)

        # Layout
        layout_sequence = QGridLayout()
        layout_sequence.setContentsMargins(0, 0, 0, 0)
        layout_sequence.addLayout(layout_info, 0, 0, 1, 4)
        layout_sequence.addItem(QSpacerItem(15, 15), 1, 0, 1, 4)
        layout_sequence.addWidget(self.label_current_sequence, 2, 0)
        layout_sequence.addWidget(self.text_current_sequence, 2, 2)
        layout_sequence.addWidget(self.label_new_sequence, 3, 0)
        layout_sequence.addWidget(self.helper_button, 3, 1)
        layout_sequence.addWidget(self.text_new_sequence, 3, 2)
        layout_sequence.addLayout(newseq_btnbar, 3, 3)
        layout_sequence.addWidget(self.label_warning, 4, 2, 1, 2)
        layout_sequence.setColumnStretch(2, 100)
        layout_sequence.setRowStretch(4, 100)

        layout = QVBoxLayout()
        layout.addLayout(layout_sequence)
        layout.addSpacing(5)
        layout.addLayout(button_box)
        self.setLayout(layout)

        # Signals
        self.button_ok.clicked.connect(self.accept_override)
        self.button_clear.clicked.connect(self.unbind_shortcut)
        self.button_cancel.clicked.connect(self.reject)
        self.button_default.clicked.connect(self.set_sequence_to_default)

        # Set all widget to no focus so that we can register <Tab> key
        # press event.
        widgets = (
            self.label_warning, self.helper_button, self.text_new_sequence,
            self.button_clear, self.button_default, self.button_cancel,
            self.button_ok, self.btn_clear_sequence, self.button_back_sequence)
        for w in widgets:
            w.setFocusPolicy(Qt.NoFocus)
            w.clearFocus()
917558
def create_widget(self):
        
        context = self.get_context()
        d = self.declaration
        style = d.style or '@attr/autoCompleteTextViewStyle'
        self.widget = AutoCompleteTextView(context, None, style)
        self.adapter = ArrayAdapter(context, '@layout/simple_list_item_1')
798874
def init_widget(self):
        
        super(AndroidPagerFragment, self).init_widget()
        d = self.declaration
        if d.title:
            self.set_title(d.title)
        if d.icon:
            self.set_icon(d.icon)
769561
def create_widget(self):
        
        d = self.declaration
        self.widget = FloatingActionButton(self.get_context(), None, d.style)
409916
def add_ui(self, klass, *args, **kwargs):
        '''

        '''
        ui = klass(self.widget, *args, **kwargs)
        self.widget.uis.append(ui)
        return ui
46934
def init_widget(self):
        
        w = self.widget
        # Selection listener
        w.setAdapter(self.adapter)
        w.setOnItemSelectedListener(w.getId())
        w.onItemSelected.connect(self.on_item_selected)
        w.onNothingSelected.connect(self.on_nothing_selected)
        super(AndroidSpinner, self).init_widget()
50334
def create_widget(self):
        
        d = self.declaration
        self.widget = EditText(self.get_context(), None,
                               d.style or "@attr/editTextStyle")
740953
def create_widget(self):
        
        d = self.declaration
        self.widget = CheckBox(self.get_context(), None,
                               d.style or "@attr/checkboxStyle")
327174
def create_widget(self):
        
        d = self.declaration

        if self.indeterminate:
            #: Note: Style will only exist on activity indicators!
            style = ProgressBar.STYLES[d.size]
        else:
            style = ProgressBar.STYLE_HORIZONTAL
        self.widget = ProgressBar(self.get_context(), None, style)
333450
def create_widget(self):
        
        d = self.declaration
        self.dialog = BottomSheetDialog(self.get_context(), d.style)
1096293
def init_widget(self):
        
        super(AndroidSeekBar, self).init_widget()
        w = self.widget

        #: Setup listener
        w.setOnSeekBarChangeListener(w.getId())
        w.onProgressChanged.connect(self.on_progress_changed)
1243400
def create_widget(self):
        
        d = self.declaration
        mode = 1 if d.mode == 'dropdown' else 0
        self.widget = Spinner(self.get_context(), mode)

        # Create the adapter simple_spinner_item = 0x01090008
        self.adapter = ArrayAdapter(self.get_context(),
                                    '@layout/simple_spinner_dropdown_item')