Does anyone have any idea what could be causing this? My Kivy RecycleView has a weird static version of it behind the editable one - it can't be selected or changed in any way. This is making me think I may have a duplicate version of all of my Kivy widgets? I'm hesitant to paste all of my code as it reaches out to an api and has credential information as well as a lot of personal info in the app itself.
DoubledRecycleView
class SelectableRecycleBoxLayout(FocusBehavior, LayoutSelectionBehavior,
RecycleBoxLayout):
''' Adds selection and focus behaviour to the view. '''
class SelectableLabel(RecycleDataViewBehavior, Label):
''' Add selection support to the Label '''
index = None
selected = BooleanProperty(False)
selectable = BooleanProperty(True)
def refresh_view_attrs(self, rv, index, data):
''' Catch and handle the view changes '''
self.index = index
return super(SelectableLabel, self).refresh_view_attrs(
rv, index, data)
def on_touch_down(self, touch):
''' Add selection on touch down '''
if super(SelectableLabel, self).on_touch_down(touch):
return True
if self.collide_point(*touch.pos) and self.selectable:
return self.parent.select_with_touch(self.index, touch)
def apply_selection(self, rv, index, is_selected):
''' Respond to the selection of items in the view. '''
self.selected = is_selected
if is_selected:
print("selection changed to {0}".format(rv.data[index]))
else:
print("selection removed for {0}".format(rv.data[index]))
class RV(RecycleView):
def __init__(self, **kwargs):
super(RV, self).__init__(**kwargs)
self.data = [{'text': str(x)} for x in range(10)]
class GuiApp(App):
theme_cls = ThemeManager()
theme_cls.theme_style = 'Dark'
previous_date = ''
previous_date2 = ''
StartDate = ObjectProperty("Start Date")
EndDate = ObjectProperty("End Date")
def build(self):
self.pickers = Factory.AnotherScreen()
presentation = Builder.load_file("gui.kv")
return presentation
Here's my Kivy:
RV:
id: rv
viewclass: 'SelectableLabel'
SelectableRecycleBoxLayout:
default_size: None, dp(56)
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
orientation: 'vertical'
multiselect: True
touch_multiselect: True
<SelectableLabel>:
# Draw a background to indicate selection
canvas.before:
Color:
rgba: (.4, 0.4, .4, .3) if self.selected else (.2, .2, .2, 1)
Rectangle:
pos: self.pos
size: self.size
I hope this is enough information to at least give me an idea where to look..I'm also struggling to update the data in the RecycleView but that may be because of this issue? I may have two different instances of the widgets running but I'm not sure how that's possible..