Merge pull request #31 from surbhicis/CQkivy2

fixed CQ for bitmessagekivy.mpybit module part3
This commit is contained in:
surbhi 2020-06-16 20:04:12 +05:30 committed by GitHub
commit e1b1e23ddf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,33 +311,39 @@ class Inbox(Screen):
def inboxDataQuery(self, xAddress, where, what, start_indx=0, end_indx=20): def inboxDataQuery(self, xAddress, where, what, start_indx=0, end_indx=20):
"""This method is used for retrieving inbox data""" """This method is used for retrieving inbox data"""
self.queryreturn = kivy_helper_search.search_sql( self.queryreturn = kivy_helper_search.search_sql(
xAddress, self.account, "inbox", where, what, xAddress, self.account, "inbox", where, what, False, start_indx, end_indx
False, start_indx, end_indx) )
def set_mdList(self, data): def set_mdList(self, data):
"""This method is used to create the mdList""" """This method is used to create the mdList"""
total_message = len(self.ids.ml.children) total_message = len(self.ids.ml.children)
for item in data: for item in data:
meny = TwoLineAvatarIconListItem( meny = TwoLineAvatarIconListItem(
text=item['text'], secondary_text=item['secondary_text'], text=item["text"],
theme_text_color='Custom', secondary_text=item["secondary_text"],
text_color=NavigateApp().theme_cls.primary_color) theme_text_color="Custom",
text_color=NavigateApp().theme_cls.primary_color
)
meny._txt_right_pad = dp(70) meny._txt_right_pad = dp(70)
meny.add_widget(AvatarSampleWidget( meny.add_widget(
source='./images/text_images/{}.png'.format( AvatarSampleWidget(
avatarImageFirstLetter(item['secondary_text'].strip())))) source="./images/text_images/{}.png".format(
meny.bind(on_press=partial(self.inbox_detail, item['msgid'])) avatarImageFirstLetter(item["secondary_text"].strip())
meny.add_widget(AddTimeWidget(item['received'])) )
carousel = Carousel(direction='right') )
)
meny.bind(on_press=partial(self.inbox_detail, item["msgid"]))
meny.add_widget(AddTimeWidget(item["received"]))
carousel = Carousel(direction="right")
carousel.height = meny.height carousel.height = meny.height
carousel.size_hint_y = None carousel.size_hint_y = None
carousel.ignore_perpendicular_swipes = True carousel.ignore_perpendicular_swipes = True
carousel.data_index = 0 carousel.data_index = 0
carousel.min_move = 0.2 carousel.min_move = 0.2
del_btn = Button(text='Delete') del_btn = Button(text="Delete")
del_btn.background_normal = '' del_btn.background_normal = ""
del_btn.background_color = (1, 0, 0, 1) del_btn.background_color = (1, 0, 0, 1)
del_btn.bind(on_press=partial(self.delete, item['msgid'])) del_btn.bind(on_press=partial(self.delete, item["msgid"]))
carousel.add_widget(del_btn) carousel.add_widget(del_btn)
carousel.add_widget(meny) carousel.add_widget(meny)
# ach_btn = Button(text='Achieve') # ach_btn = Button(text='Achieve')
@ -351,8 +357,10 @@ class Inbox(Screen):
def check_scroll_y(self, instance, somethingelse): def check_scroll_y(self, instance, somethingelse):
"""Loads data on scroll""" """Loads data on scroll"""
if self.children[2].children[0].children[ if (
0].scroll_y <= -0.0 and self.has_refreshed: self.children[2].children[0].children[0].scroll_y <= -0.0
and self.has_refreshed
):
self.children[2].children[0].children[0].scroll_y = 0.06 self.children[2].children[0].children[0].scroll_y = 0.06
total_message = len(self.ids.ml.children) total_message = len(self.ids.ml.children)
self.update_inbox_screen_on_scroll(total_message) self.update_inbox_screen_on_scroll(total_message)