Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def switch_tabs_to_text(self, istance_android_tabs):
for instance_tab in istance_android_tabs.ids.scrollview.children[
0
].children:
for k, v in md_icons.items():
if v == instance_tab.text:
istance_android_tabs.ids.scrollview.children[0].remove_widget(
instance_tab
)
istance_android_tabs.add_widget(
MyTab(text=" ".join(k.split("-")).capitalize())
)
break
def switch_tabs_to_text(self, istance_android_tabs):
for instance_tab in istance_android_tabs.ids.scrollview.children[
0
].children:
for k, v in md_icons.items():
if v == instance_tab.text:
istance_android_tabs.ids.scrollview.children[
0
].remove_widget(instance_tab)
istance_android_tabs.add_widget(
MyTab(text=" ".join(k.split("-")).capitalize())
)
break
def switch_tabs_to_text(self, istance_android_tabs):
for instance_tab in istance_android_tabs.ids.scrollview.children[
0
].children:
for k, v in md_icons.items():
if v == instance_tab.text:
istance_android_tabs.ids.scrollview.children[
0
].remove_widget(instance_tab)
istance_android_tabs.add_widget(
Factory.KitchenSinkTabItem(
text=" ".join(k.split("-")).capitalize()
)
)
break
def on_state(self, *args):
if self.state == 'down':
self.check_anim_in.cancel(self)
self.check_anim_out.start(self)
self._radio_icon = "{}".format(
md_icons['checkbox-marked-circle-outline'])
self._checkbox_icon = "{}".format(
md_icons['checkbox-marked-outline'])
self.active = True
else:
self.check_anim_in.cancel(self)
self.check_anim_out.start(self)
self._radio_icon = "{}".format(
md_icons['checkbox-blank-circle-outline'])
self._checkbox_icon = "{}".format(
md_icons['checkbox-blank-outline'])
self.active = False
def on_icon(self, instance, value):
self.ids['_icon'].text = u"{}".format(md_icons[value])
def on_state(self, *args):
if self.state == 'down':
self.check_anim_in.cancel(self)
self.check_anim_out.start(self)
self._radio_icon = u"{}".format(
md_icons['checkbox-marked-circle-outline'])
self._checkbox_icon = u"{}".format(
md_icons['checkbox-marked-outline'])
self.active = True
else:
self.check_anim_in.cancel(self)
self.check_anim_out.start(self)
self._radio_icon = u"{}".format(
md_icons['checkbox-blank-circle-outline'])
self._checkbox_icon = u"{}".format(
md_icons['checkbox-blank-outline'])
self.active = False
def on_text(self, widget, text):
# Set the icon
if text in md_icons:
self.tab_label.font_name = fonts_path + "materialdesignicons-webfont.ttf"
self.tab_label.text = md_icons[self.text]
self.tab_label.font_size = "24sp"
# Set the label text
else:
self.tab_label.text = self.text