This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def my_args_converter(row_index, rec): | |
dict = {'text': rec.is_selected, | |
'font_size':100, | |
'padding_x': 100, | |
'halign': 'left', | |
'size_hint_y': None, | |
'cls_dicts': [{'cls': ImageButton, 'kwargs': {'text': str(rec[0])+', '+ rec[1], 'source': '/home/clyde/' + rec[3],'is_selected': rec.is_selected, 'size_hint': (.175,1), | |
'border_color': [0,0,0,1], 'deselected_color': [3,0,0,1], 'selected_color': [0, 6,.0,1], 'on_release' : callback4}}, | |
{'cls': ListItemLabel, | |
'kwargs': {'text': str(rec.is_selected), 'font_size': 24, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def build(self): | |
l= Builder.load_file('grd7.kv') | |
m= Builder.load_file('studentlist3.kv') | |
carousel = Carousel(direction='right') | |
carousel.add_widget(l) | |
carousel.add_widget(m) | |
popup = Popup(title='Please select a waypoint', | |
content = Button(text='close window'), | |
size_hint=(None, None), size=(400, 400)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FloatLayout: | |
Popup: | |
id: popup1 | |
Button: | |
text: ('button pressed') | |
on_release: root.remove_widget(popup1) | |
#on_release: popup1.dismiss(force=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def build(self): | |
l= Builder.load_file('grd7.kv') | |
m= Builder.load_file('studentlist3.kv') | |
carousel = Carousel(direction='right') | |
carousel.add_widget(l) | |
carousel.add_widget(m) | |
popup = Popup(title='Please select a waypoint', | |
content = Button(text='close window'), | |
size_hint=(None, None), size=(400, 400)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def callback4(instance): | |
app = App.get_running_app() | |
if instance.text in app.l.ids['missing'].adapter.data and instance.is_selected == False: | |
newlist = app.l.ids['missing'].adapter.data | |
newlist.remove(instance.text) | |
#app.l.ids['missing'].adapter = SimpleListAdapter(data= newlist, cls= ListItemLabel) | |
print 'newlist is: ', newlist | |
the list logic is working, but the adapter assignment fails with this error: Exception: list adapter: data must be a tuple or list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
here is the class: | |
class StudentDetailList(ListView): | |
updater = ListProperty([]) | |
def __init__(self, **kwargs): | |
super(StudentDetailList, self).__init__(**kwargs) | |
here are the adapters: | |
class carouselApp(App): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
here is my listadapter using an objectProperty: | |
class studentDetailsAdapter(ListAdapter): | |
SDA = ObjectProperty(None) | |
def __init__(self, **kwargs): | |
super(studentDetailsAdapter, self).__init__(**kwargs) | |
self.args_converter = lambda row_index, rec: {'text': rec, | |
class studentDetailsAdapter(ListAdapter): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
here is the adapter: | |
class studentDetailsAdapter(ListAdapter): | |
def __init__(self, **kwargs): | |
super(studentDetailsAdapter, self).__init__(**kwargs) | |
self.args_converter= lambda row_index, rec: {'text': rec, | |
'size_hint_y': None, | |
'text_size': (200, 30), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
here is my SimpleListAdapter that i used to override he default one: | |
class SimpleListAdapter(SimpleListAdapter): | |
def __init__(self, **kwargs): | |
super(SimpleListAdapter, self).__init__(**kwargs) | |
self.args_converter= lambda row_index, x: {'text': x, | |
'size_hint_y': None, | |
'color' : [1,1,0,1], | |
'text_size': (250, 25), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[app] | |
# (str) Title of your application | |
title = SafeTrip DetailView | |
# (str) Package name | |
package.name = myapp | |
# (str) Package domain (needed for android/ios packaging) | |
package.domain = org.test |