Improving views and navitation of Tweets.
This commit is contained in:
parent
907deb5752
commit
11b95e0b19
14
Datanalitica.package/Tweet.class/instance/asCardElement.st
Normal file
14
Datanalitica.package/Tweet.class/instance/asCardElement.st
Normal file
@ -0,0 +1,14 @@
|
||||
accessing
|
||||
asCardElement
|
||||
^ BrHorizontalPane new
|
||||
hFitContent;
|
||||
vFitContent;
|
||||
padding: (BlInsets all: 20);
|
||||
margin: (BlInsets all: 10);
|
||||
addChild: (self user profileImage asElement asScalableElement size: 64@64);
|
||||
addChild: (BrVerticalPane new
|
||||
fitContent;
|
||||
margin: (BlInsets left: 20);
|
||||
addChild: (BrLabel new aptitude: BrGlamorousLabelAptitude; text: self created);
|
||||
addChild: (BrLabel new aptitude: BrGlamorousLabelAptitude; text: self text));
|
||||
when: BlClickEvent do: [:e | e target phlow spawnObject: self]
|
@ -4,6 +4,6 @@ fromDictionary: aDictionary
|
||||
text := aDictionary at: 'text'.
|
||||
id := aDictionary at: 'id'.
|
||||
authorId := aDictionary at: 'author_id'.
|
||||
username := aDictionary at: 'username' ifAbsent: [''] .
|
||||
user := aDictionary at: 'username' ifAbsent: [''] .
|
||||
conversationId := aDictionary at: 'conversation_id' ifAbsent: [ '' ].
|
||||
^ self
|
3
Datanalitica.package/Tweet.class/instance/user..st
Normal file
3
Datanalitica.package/Tweet.class/instance/user..st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
user: aTwitterUser
|
||||
user := aTwitterUser
|
3
Datanalitica.package/Tweet.class/instance/user.st
Normal file
3
Datanalitica.package/Tweet.class/instance/user.st
Normal file
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
user
|
||||
^ user
|
@ -11,7 +11,7 @@
|
||||
"id",
|
||||
"authorId",
|
||||
"conversationId",
|
||||
"username"
|
||||
"user"
|
||||
],
|
||||
"name" : "Tweet",
|
||||
"type" : "normal"
|
||||
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
add: aTweet
|
||||
self tweets add: aTweet
|
@ -0,0 +1,26 @@
|
||||
accessing
|
||||
gtTweetsFor: aView
|
||||
<gtView>
|
||||
^ aView explicit
|
||||
title: 'Tweets';
|
||||
stencil: [
|
||||
| container imageContainer |
|
||||
container := BlElement new
|
||||
layout: BlFlowLayout new;
|
||||
constraintsDo: [ :c |
|
||||
c vertical fitContent.
|
||||
c horizontal matchParent ];
|
||||
padding: (BlInsets all: 10).
|
||||
self tweets do: [ :each |
|
||||
imageContainer := BlLazyElement new
|
||||
withGlamorousPreview;
|
||||
aptitude: BrShadowAptitude new;
|
||||
background: Color white;
|
||||
|
||||
margin: (BlInsets all: 20);
|
||||
constraintsDo: [ :c |
|
||||
c vertical exact: 100.
|
||||
c horizontal exact: 1000 ];
|
||||
elementBuilder: [ each asCardElement margin: (BlInsets all: 20) ].
|
||||
container addChild: imageContainer].
|
||||
container asScrollableElement ]
|
@ -0,0 +1,5 @@
|
||||
accessing
|
||||
printOn: aStream
|
||||
super printOn: aStream.
|
||||
aStream
|
||||
nextPutAll: '( ',self size asString, ' Tweet(s) )'
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
size
|
||||
^ self tweets size
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
tweets: aTweetsCollection
|
||||
^ tweets := aTweetsCollection
|
@ -0,0 +1,3 @@
|
||||
accessing
|
||||
tweets
|
||||
^ tweets ifNil: [ tweets := OrderedCollection new]
|
13
Datanalitica.package/TweetsCollection.class/properties.json
Normal file
13
Datanalitica.package/TweetsCollection.class/properties.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"commentStamp" : "",
|
||||
"super" : "Object",
|
||||
"category" : "Datanalitica-Datanalitica",
|
||||
"classinstvars" : [ ],
|
||||
"pools" : [ ],
|
||||
"classvars" : [ ],
|
||||
"instvars" : [
|
||||
"tweets"
|
||||
],
|
||||
"name" : "TweetsCollection",
|
||||
"type" : "normal"
|
||||
}
|
@ -5,8 +5,10 @@ messagesAuthors
|
||||
groupedTweets := self data groupedBy: [:each | each at: 'author_id' ].
|
||||
^ (self includes at: 'users') collect: [:userDict | | user |
|
||||
user := TwitterUser new fromDictionary: userDict.
|
||||
(groupedTweets at: (user id)) do: [:tweetDict |
|
||||
user tweets add: (Tweet new fromDictionary: tweetDict)
|
||||
(groupedTweets at: (user id)) do: [:tweetDict | | currentTweet |
|
||||
currentTweet := Tweet new fromDictionary: tweetDict.
|
||||
currentTweet user: user.
|
||||
user tweets add: currentTweet.
|
||||
].
|
||||
user.
|
||||
]
|
@ -1,5 +1,5 @@
|
||||
accessing
|
||||
gtViewContactDetailsOn: aView
|
||||
gtViewProfileDetailsOn: aView
|
||||
<gtView>
|
||||
^ aView explicit
|
||||
title: 'Details' translated;
|
@ -1,3 +1,3 @@
|
||||
accessing
|
||||
tweets
|
||||
^ tweets ifNil: [ tweets := OrderedCollection new]
|
||||
^ tweets ifNil: [ tweets := TweetsCollection new]
|
Loading…
Reference in New Issue
Block a user