UI/UX improvements in Twitter User and Tweet.
This commit is contained in:
parent
3853c3e9fc
commit
3134c006e6
@ -1,4 +1,61 @@
|
|||||||
accessing
|
accessing
|
||||||
asCardElement
|
asCardElement
|
||||||
|
| aModeLook anEditor textInfoPane |
|
||||||
|
|
||||||
^ self asTestCardElement
|
aModeLook := BrEditorModeAptitude new
|
||||||
|
editableFocused: [ :aWidget | aWidget border: (BlBorder paint: BrGlamorousColors focusedEditorBorderColor width: 1) ];
|
||||||
|
editableUnfocused: [ :aWidget | aWidget border: (BlBorder paint: BrGlamorousColors editorBorderColor width: 1) ];
|
||||||
|
readOnly: [ :aWidget | aWidget border: BlBorder empty ].
|
||||||
|
|
||||||
|
anEditor := BrEditor new
|
||||||
|
aptitude: BrGlamorousRegularEditorAptitude new + aModeLook;
|
||||||
|
text: self text;
|
||||||
|
vFitContent.
|
||||||
|
|
||||||
|
textInfoPane := BrVerticalPane new
|
||||||
|
hMatchParent;
|
||||||
|
vFitContent;
|
||||||
|
margin: (BlInsets left: 20);
|
||||||
|
addChild: (BrLabel new
|
||||||
|
aptitude: BrGlamorousLabelAptitude;
|
||||||
|
text: '@' , self user userName , ' | ' , self created asString;
|
||||||
|
beSmallSize);
|
||||||
|
addChild: anEditor.
|
||||||
|
|
||||||
|
^ BrHorizontalPane new
|
||||||
|
padding: (BlInsets all: 15);
|
||||||
|
margin: (BlInsets all: 10);
|
||||||
|
cellSpacing: 5;
|
||||||
|
hMatchParent;
|
||||||
|
vFitContent;
|
||||||
|
addChildren: {
|
||||||
|
(self user profileImage asElement asScalableElement size: 64 @ 64).
|
||||||
|
BrVerticalPane new
|
||||||
|
cellSpacing: 5;
|
||||||
|
hMatchParent;
|
||||||
|
vFitContent;
|
||||||
|
addChildren: {
|
||||||
|
textInfoPane.
|
||||||
|
BrHorizontalPane new
|
||||||
|
fitContent;
|
||||||
|
cellSpacing: 5;
|
||||||
|
addChildren: {
|
||||||
|
BrButton new
|
||||||
|
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
||||||
|
label: 'Toggle subtopics';
|
||||||
|
action: [ anEditor beEditable ].
|
||||||
|
BrButton new
|
||||||
|
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
||||||
|
label: 'Add subtopic keyword';
|
||||||
|
action: [ anEditor beReadOnlyWithSelection ].
|
||||||
|
BrButton new
|
||||||
|
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
||||||
|
label: 'Details';
|
||||||
|
action: [ :e | e phlow spawnObject: self ].
|
||||||
|
BrButton new
|
||||||
|
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
||||||
|
label: 'Web view';
|
||||||
|
action: [ self webView ].
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,62 +0,0 @@
|
|||||||
accessing
|
|
||||||
asTestCardElement
|
|
||||||
<gtExample>
|
|
||||||
| aModeLook anEditor textInfoPane |
|
|
||||||
|
|
||||||
aModeLook := BrEditorModeAptitude new
|
|
||||||
editableFocused: [ :aWidget | aWidget border: (BlBorder paint: BrGlamorousColors focusedEditorBorderColor width: 1) ];
|
|
||||||
editableUnfocused: [ :aWidget | aWidget border: (BlBorder paint: BrGlamorousColors editorBorderColor width: 1) ];
|
|
||||||
readOnly: [ :aWidget | aWidget border: BlBorder empty ].
|
|
||||||
|
|
||||||
anEditor := BrEditor new
|
|
||||||
aptitude: BrGlamorousRegularEditorAptitude new + aModeLook;
|
|
||||||
text: self text;
|
|
||||||
vFitContent.
|
|
||||||
|
|
||||||
textInfoPane := BrVerticalPane new
|
|
||||||
hMatchParent;
|
|
||||||
vFitContent;
|
|
||||||
margin: (BlInsets left: 20);
|
|
||||||
addChild: (BrLabel new
|
|
||||||
aptitude: BrGlamorousLabelAptitude;
|
|
||||||
text: '@' , self user userName , ' | ' , self created asString;
|
|
||||||
beSmallSize);
|
|
||||||
addChild: anEditor.
|
|
||||||
|
|
||||||
^ BrHorizontalPane new
|
|
||||||
padding: (BlInsets all: 15);
|
|
||||||
margin: (BlInsets all: 10);
|
|
||||||
cellSpacing: 5;
|
|
||||||
hMatchParent;
|
|
||||||
vFitContent;
|
|
||||||
addChildren: {
|
|
||||||
(self user profileImage asElement asScalableElement size: 64 @ 64).
|
|
||||||
BrVerticalPane new
|
|
||||||
cellSpacing: 5;
|
|
||||||
hMatchParent;
|
|
||||||
vFitContent;
|
|
||||||
addChildren: {
|
|
||||||
textInfoPane.
|
|
||||||
BrHorizontalPane new
|
|
||||||
fitContent;
|
|
||||||
cellSpacing: 5;
|
|
||||||
addChildren: {
|
|
||||||
BrButton new
|
|
||||||
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
|
||||||
label: 'Toggle subtopics';
|
|
||||||
action: [ anEditor beEditable ].
|
|
||||||
BrButton new
|
|
||||||
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
|
||||||
label: 'Add subtopic keyword';
|
|
||||||
action: [ anEditor beReadOnlyWithSelection ].
|
|
||||||
BrButton new
|
|
||||||
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
|
||||||
label: 'Details';
|
|
||||||
action: [ :e | e phlow spawnObject: self ].
|
|
||||||
BrButton new
|
|
||||||
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
|
||||||
label: 'Web view';
|
|
||||||
action: [ self webView ].
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,16 @@
|
|||||||
|
accessing
|
||||||
|
gtViewTweetDetailsOn: aView
|
||||||
|
<gtView>
|
||||||
|
^ aView explicit
|
||||||
|
title: 'Tweet Details' translated;
|
||||||
|
priority: 5;
|
||||||
|
stencil: [
|
||||||
|
BlElement new
|
||||||
|
layout: BlFlowLayout new;
|
||||||
|
constraintsDo: [ :c |
|
||||||
|
c vertical fitContent.
|
||||||
|
c horizontal matchParent ];
|
||||||
|
padding: (BlInsets all: 10);
|
||||||
|
addChild: (self asCardElement margin: (BlInsets all: 20))
|
||||||
|
]
|
||||||
|
|
@ -18,8 +18,8 @@ gtTweetsFor: aView
|
|||||||
background: Color white;
|
background: Color white;
|
||||||
margin: (BlInsets all: 10);
|
margin: (BlInsets all: 10);
|
||||||
constraintsDo: [ :c |
|
constraintsDo: [ :c |
|
||||||
c vertical exact: 135.
|
c vertical exact: 145.
|
||||||
c horizontal matchParent ];
|
c horizontal matchParent ];
|
||||||
elementBuilder: [ each asTestCardElement margin: (BlInsets all: 20) ].
|
elementBuilder: [ each asCardElement margin: (BlInsets all: 20) ].
|
||||||
container addChild: imageContainer].
|
container addChild: imageContainer].
|
||||||
container asScrollableElement ]
|
container asScrollableElement ]
|
@ -1,29 +1,60 @@
|
|||||||
ui
|
accessing
|
||||||
asCardElement
|
asCardElement
|
||||||
|
| aModeLook anEditor textInfoPane |
|
||||||
|
|
||||||
|
aModeLook := BrEditorModeAptitude new
|
||||||
|
editableFocused: [ :aWidget | aWidget border: (BlBorder paint: BrGlamorousColors focusedEditorBorderColor width: 1) ];
|
||||||
|
editableUnfocused: [ :aWidget | aWidget border: (BlBorder paint: BrGlamorousColors editorBorderColor width: 1) ];
|
||||||
|
readOnly: [ :aWidget | aWidget border: BlBorder empty ].
|
||||||
|
|
||||||
|
anEditor := BrEditor new
|
||||||
|
aptitude: BrGlamorousRegularEditorAptitude new + aModeLook;
|
||||||
|
text: self description;
|
||||||
|
vFitContent.
|
||||||
|
|
||||||
|
textInfoPane := BrVerticalPane new
|
||||||
|
hMatchParent;
|
||||||
|
vFitContent;
|
||||||
|
margin: (BlInsets left: 20);
|
||||||
|
addChild: (BrLabel new
|
||||||
|
aptitude: BrGlamorousLabelAptitude;
|
||||||
|
text: '@' , self userName ;
|
||||||
|
beHugeSize);
|
||||||
|
addChild: (BrLabel new
|
||||||
|
aptitude: BrGlamorousLabelAptitude;
|
||||||
|
text: self name;
|
||||||
|
beLargeSize);
|
||||||
|
addChild: (BrLabel new
|
||||||
|
aptitude: BrGlamorousLabelAptitude;
|
||||||
|
text: 'Joined: ' , self createdAtShorted );
|
||||||
|
addChild: anEditor.
|
||||||
|
|
||||||
^ BrHorizontalPane new
|
^ BrHorizontalPane new
|
||||||
hFitContent;
|
padding: (BlInsets all: 15);
|
||||||
vFitContent;
|
|
||||||
padding: (BlInsets all: 20);
|
|
||||||
margin: (BlInsets all: 10);
|
margin: (BlInsets all: 10);
|
||||||
addChild: (self profileImage asElement asScalableElement size: 124@124);
|
cellSpacing: 5;
|
||||||
addChild: (BrVerticalPane new
|
hMatchParent;
|
||||||
fitContent;
|
vFitContent;
|
||||||
margin: (BlInsets left: 20);
|
addChildren: {
|
||||||
addChild: (BlTextElement new
|
(self profileImage asElement asScalableElement size: 124 @ 124).
|
||||||
constraintsDo: [ :c |
|
BrVerticalPane new
|
||||||
c horizontal fitContent ];
|
cellSpacing: 5;
|
||||||
margin: (BlInsets top: 5 right: 0 bottom: 5 left: 5);
|
hMatchParent;
|
||||||
text: (('@', self userName) asRopedText glamorousRegularFont
|
vFitContent;
|
||||||
fontSize: 20;
|
addChildren: {
|
||||||
foreground: Color black));
|
textInfoPane.
|
||||||
addChild: (BrLabel new aptitude: BrGlamorousLabelAptitude; text: self name; beLargeSize);
|
BrHorizontalPane new
|
||||||
addChild: (BrLabel new
|
fitContent;
|
||||||
aptitude: BrGlamorousLabelAptitude; text: 'joined: ', self createdAtShorted);
|
cellSpacing: 5;
|
||||||
addChild: (BrLabel new aptitude: BrGlamorousLabelAptitude; text: self description);
|
addChildren: {
|
||||||
addChild: (BrEditor new
|
BrButton new
|
||||||
constraintsDo: [ :c |
|
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
||||||
c horizontal matchParent ];
|
label: 'Tweets';
|
||||||
aptitude: BrGlamorousRegularEditorAptitude new;
|
action: [ :e | e phlow spawnObject: self tweets ].
|
||||||
beReadOnlyWithSelection;
|
BrButton new
|
||||||
text: String loremIpsum));
|
aptitude: BrGlamorousButtonWithLabelAptitude new;
|
||||||
when: BlClickEvent do: [:e | e target phlow spawnObject: self tweets]
|
label: 'Web view';
|
||||||
|
action: [ self webView ].
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
accessing
|
ui
|
||||||
gtViewProfileDetailsOn: aView
|
gtViewProfileDetailsOn: aView
|
||||||
<gtView>
|
<gtView>
|
||||||
^ aView explicit
|
^ aView explicit
|
||||||
@ -18,7 +18,7 @@ gtViewProfileDetailsOn: aView
|
|||||||
background: Color white;
|
background: Color white;
|
||||||
margin: (BlInsets all: 20);
|
margin: (BlInsets all: 20);
|
||||||
constraintsDo: [ :c |
|
constraintsDo: [ :c |
|
||||||
c vertical exact: 150.
|
c vertical exact: 175.
|
||||||
c horizontal matchParent ];
|
c horizontal matchParent ];
|
||||||
elementBuilder: [ self asCardElement margin: (BlInsets all: 20) ].
|
elementBuilder: [ self asCardElement margin: (BlInsets all: 20) ].
|
||||||
container addChild: imageContainer].
|
container addChild: imageContainer].
|
Loading…
Reference in New Issue
Block a user