123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- #:import LinearRecycleLayoutManager kivy.garden.recycleview.LinearRecycleLayoutManager
- # Goblinoid: Experience all of MediaGoblin on an Android Device
- # Copyright (C) 2015 Dylan Jeffers
- #
- # This program is free software: you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation, either version 3 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- # box layout for each activity in feed
- <FeedLayout>
- id: feed_layout
- padding: 20
- orientation: 'vertical'
- BoxLayout:
- size_hint: (1.0, 0.05)
- orientation: 'horizontal'
- Button:
- halign: 'left'
- text: root.actor
- on_release: root.open_profile_modal()
- Label:
- halign: 'right'
- text: '{0} hrs, {1} min'.format(root.post_time[0], root.post_time[1])
- RelativeLayout:
- orientation: 'horizontal'
- # size_hint_y: None
- # Note: change this to wrap activity text
- size_hint: (1.0, 0.6)
- id: content
- ScrollView:
- size: self.size
- opacity: 1 if root.note_content else 0
- Label:
- size_hint_y: None
- text_size: self.width, None
- height: self.texture_size[1]
- text: root.note_content
- valight: 'middle'
- background_color:
- AsyncImage:
- size_hint_x: None
- source: root.image_content
- allow_stretch: True
- keep_ratio: True
- width: content.width
- opacity: 1 if root.image_content else 0
- Button:
- size_hint_x: None
- width: content.width
- text: root.else_content
- opacity: 1 if root.else_content else 0
- BoxLayout:
- size_hint: (1.0, 0.05)
- orientation: 'horizontal'
- Button:
- text: 'like'
- Button:
- text: 'comment'
- on_release: root.open_comment_modal()
- Button:
- text: 'share'
- on_release: root.share_activity()
- Button:
- text: 'report'
- on_release: root.report_activity()
- BoxLayout:
- size_hint_y: 0.3
- orientation: 'vertical'
- Label:
- text: root.likes
- Label:
- size_hint_y: 0.5
- text: root.description if root.description else 'no description'
- text_size: root.width, self.height
- valign: 'middle'
- BoxLayout:
- orientation: 'horizontal'
- # Note: this will eventually not be hard-coded
- Label:
- max_lines: 1
- size_hint_x: 0.2
- text_size: self.size
- text: '{0}'.format(root.comments[0]["author"])
- Label:
- max_lines: 1
- valign: 'middle'
- text_size: self.size
- text: '{0}'.format(root.comments[0]["content"])
- Button:
- text: 'view all {0} comments'.format(len(root.comments))
- on_release: root.open_comment_modal()
- <FeedView>:
- BoxLayout:
- orientation: 'vertical'
- RecycleView:
- size_hint_y: 1
- opacity: 1 if root.data else 0
- layout_manager: LinearRecycleLayoutManager(orientation="vertical",default_size=self.height)
- data: root.data
- viewclass: 'FeedLayout'
- #root view for gallery, photo, video, and upload subviews
- <MediaView>
- msm: msm
- #Note: No BoxLayout allows MediaView to take up full screen
- BoxLayout:
- orientation: 'vertical'
- ScreenManager:
- size_hint: (1.0, 0.9)
- id: msm
- BoxLayout:
- size_hint: (1.0, 0.1)
- Button:
- text: 'gallery'
- on_release: root.open_media_view('gallery', True)
- Button:
- text: 'camera'
- on_release: root.open_media_view('camera', False)
- Button:
- text: 'video'
- on_release: root.open_media_view('camcorder', False)
- <ProfileModalView>
- BoxLayout:
- orientation: 'vertical'
- BoxLayout:
- size_hint_y: 0.1
- orientation: 'horizontal'
- Button:
- size_hint_x: 0.2
- text: 'exit'
- on_release: root.dismiss()
- Label:
- text: str(root.profile.display_name) if root.profile else ''
- Button:
- size_hint_x: 0.2
- text: 'Log Out'
- on_release: root.log_out()
- TabbedProfilePanel:
- profile: root.profile
-
- <TabbedProfilePanel>:
- activity_grid: activity_grid
- follower_grid: follower_grid
- following_grid: following_grid
- do_default_tab: False
- tab_pos: 'top_mid'
- TabbedPanelItem:
- text: 'activity'
- BoxLayout:
- orientation: 'vertical'
- ScrollView:
- size: self.size
- GridLayout:
- id: activity_grid
- cols: 1
- size_hint_y: None
- row_default_height: 200
- TabbedPanelItem:
- text: 'followers'
- BoxLayout:
- orientation: 'vertical'
- ScrollView:
- size: self.size
- GridLayout:
- id: follower_grid
- cols: 1
- size_hint_y: None
- row_default_height: 200
- TabbedPanelItem:
- text: 'following'
- BoxLayout:
- orientation: 'vertical'
- ScrollView:
- size: self.size
- GridLayout:
- id: following_grid
- cols: 1
- size_hint_y: None
- row_default_height: 200
-
- <SettingsView>
- BoxLayout:
- orientation:'vertical'
- ActionBar:
- pos_hint: {'top':1}
- ActionView:
- use_separator: True
- ActionPrevious:
- title: 'MediaGoblin'
- with_previous: False
- ActionOverflow:
- ActionButton:
- on_release: app.open_feed(self)
- text: 'Feed'
- Label:
- text: 'User Name'
- <CommentModalView>:
- comment_layout: comment_layout
- BoxLayout:
- orientation: 'vertical'
- auto_dismiss: False
- AnchorLayout:
- size_hint_y: 0.05
- anchor_y: 'top'
- Button:
- text: 'exit'
- on_release: root.dismiss()
-
- ScrollView:
- size_hint_y: 0.9
- size: self.size
- GridLayout:
- id: comment_layout
- cols: 1
- size_hint_y: None
- row_default_height: 300
- AnchorLayout:
- size_hint_y: 0.05
- anchor_y: 'bottom'
- BoxLayout:
- orientation: 'horizontal'
- TextInput:
- id: comment_input
- hint_text: 'comment'
- height: self.minimum_height
- Button:
- size_hint_x: 0.1
- text: 'post'
- on_release: root.post_comment(comment_input.text)
- <ActivityDescriptionCell>:
- orientation: 'horizontal'
- padding: [0,10,0,30]
- Label:
- size_hint_x: None
- text: str(root.actor) if root.actor else ''
- text_size: self.size
- Label:
- size_hint_y: None
- text_size: self.width, None
- height: self.texture_size[1]
- text: str(root.description) if root.description else ''
- <CommentModalViewCell>
- orientation: 'horizontal'
- padding: [0,10,0,10]
- Button:
- size_hint_x: None
- text: str(root.comment.author) if root.comment else 'no author'
- text_size: self.size
- valign: 'middle'
- on_release: root.open_profile_modal()
- ScrollView:
- size: self.size
- Label:
- size_hint_y: None
- text_size: self.width, None
- height: self.texture_size[1]
- text: root.comment.content if root.comment else 'no comment'
-
- # the following activity content types may be moved to a different kv
- # file in the future
- <ANote>:
- text_size: self.width, None
- valign: 'middle'
- halign: 'center'
- height: self.texture_size[1]
- <AImage>:
|