mirror of
https://github.com/ComradCollective/Comrad
synced 2024-11-01 21:40:32 +00:00
finishing add post stuff
This commit is contained in:
parent
1a193bb7eb
commit
fff395da54
@ -29,7 +29,8 @@ We present a simplified set of social media features drawn from everything that'
|
||||
* Show profile only to friends (e.g. Facebook)
|
||||
* Show profile only to your local area (e.g. Nextdoor)
|
||||
|
||||
* Posting
|
||||
* Posting
|
||||
* Post up to 1 image and/or 1000 characters
|
||||
* Post to the entire world (e.g. Twitter)
|
||||
* Post to your friends (e.g. Facebook)
|
||||
* Post to your surrounding area by a distance radius (e.g. Nextdoor)
|
||||
|
@ -92,7 +92,7 @@ class PostCard(MDCard):
|
||||
image_layout.height='300dp'
|
||||
# log(image.image_ratio)
|
||||
|
||||
content = PostContent(text=self.content)
|
||||
self.post_content = PostContent(text=self.content)
|
||||
|
||||
# post_layout = PostGridLayout()
|
||||
#content = PostContent()
|
||||
@ -122,7 +122,7 @@ class PostCard(MDCard):
|
||||
|
||||
|
||||
# scroller.bind(size=('300dp',scroller.setter('height'))
|
||||
scroller.add_widget(content)
|
||||
scroller.add_widget(self.post_content)
|
||||
self.add_widget(scroller)
|
||||
# self.add_widget(post_layout)
|
||||
|
||||
|
@ -14,12 +14,12 @@
|
||||
color_mode: 'custom'
|
||||
# size_hint_y:0.5
|
||||
size_hint: (1,None)
|
||||
size: ('300dp','300dp')
|
||||
# size: ('300dp','300dp')
|
||||
pos_hint: {'center_x': 0.5}
|
||||
line_color_focus: 1,0,0,1
|
||||
line_color_normal: 1,0,0,1
|
||||
current_hint_text_color: 1,0,0,1
|
||||
max_text_length: 10
|
||||
# max_text_length: 1000
|
||||
# mode:'fill'
|
||||
font_size:'23dp'
|
||||
# font_style:'H5'
|
||||
|
@ -90,8 +90,10 @@ class AddPostScreen(ProtectedScreen):
|
||||
post_TextField.font_name='assets/overpass-mono-regular.otf'
|
||||
post_TextField.hint_text='word?'
|
||||
|
||||
post.remove_widget(post.scroller)
|
||||
post.add_widget(post_TextField)
|
||||
# post.remove_widget(post.scroller)
|
||||
post.scroller.remove_widget(post.post_content)
|
||||
post.scroller.add_widget(post_TextField)
|
||||
post.scroller.size=('300dp','300dp')
|
||||
self.add_widget(post)
|
||||
|
||||
self.button_layout = ButtonLayout()
|
||||
@ -175,12 +177,13 @@ class AddPostScreen(ProtectedScreen):
|
||||
|
||||
def post(self):
|
||||
# check?
|
||||
maxlen = 500
|
||||
content = self.post_textfield.text
|
||||
lencontent = len(content)
|
||||
maxlen = int(self.post_textfield.max_text_length)
|
||||
lencontent = content.strip().replace(' ',' ').count(' ')
|
||||
# maxlen = int(self.post_textfield.max_text_length)
|
||||
lendiff = lencontent - maxlen
|
||||
if lendiff>0:
|
||||
self.open_msg_dialog(f'Text is currently {lencontent} characters long, which is {lendiff} over the maximum text length of {maxlen} characters.\n\n({lencontent}/{maxlen})')
|
||||
self.open_msg_dialog(f'Text is currently {lencontent} words long, which is {lendiff} over the maximum text length of {maxlen} words.\n\n({lencontent}/{maxlen})')
|
||||
return
|
||||
|
||||
# log('?????????????????'+self.media_uid)
|
||||
|
Loading…
Reference in New Issue
Block a user