From c7e5d66f1047bb7b1c085900fb15deb4084032b9 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Wed, 25 Aug 2021 11:42:16 -0500 Subject: [PATCH] UI/UX starting to improve view/usability of Tweets in the collection. --- .../Tweet.class/instance/asCardElement.st | 19 +++++- .../Tweet.class/instance/asTestCardElement.st | 62 +++++++++++++++++++ .../instance/gtTweetsFor..st | 2 +- 3 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 Datanalitica.package/Tweet.class/instance/asTestCardElement.st diff --git a/Datanalitica.package/Tweet.class/instance/asCardElement.st b/Datanalitica.package/Tweet.class/instance/asCardElement.st index 455510c..afbddfd 100644 --- a/Datanalitica.package/Tweet.class/instance/asCardElement.st +++ b/Datanalitica.package/Tweet.class/instance/asCardElement.st @@ -18,5 +18,22 @@ asCardElement addChild: (BrEditor new aptitude: BrGlamorousRegularEditorAptitude new; beReadOnlyWithSelection; - text: self text)); + text: self text); + addChild:(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: 'Web view'; + action: [ "anEditor beReadOnlyWithoutSelection" ] + })); when: BlClickEvent do: [ :e | e target phlow spawnObject: self ] \ No newline at end of file diff --git a/Datanalitica.package/Tweet.class/instance/asTestCardElement.st b/Datanalitica.package/Tweet.class/instance/asTestCardElement.st new file mode 100644 index 0000000..d2d1336 --- /dev/null +++ b/Datanalitica.package/Tweet.class/instance/asTestCardElement.st @@ -0,0 +1,62 @@ +accessing +asTestCardElement + + | 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: [ anEditor beReadOnlyWithSelection ]. + BrButton new + aptitude: BrGlamorousButtonWithLabelAptitude new; + label: 'Web view'; + action: [ anEditor beReadOnlyWithoutSelection ]. + } + } + } \ No newline at end of file diff --git a/Datanalitica.package/TweetsCollection.class/instance/gtTweetsFor..st b/Datanalitica.package/TweetsCollection.class/instance/gtTweetsFor..st index aa65e84..8706c4c 100644 --- a/Datanalitica.package/TweetsCollection.class/instance/gtTweetsFor..st +++ b/Datanalitica.package/TweetsCollection.class/instance/gtTweetsFor..st @@ -21,6 +21,6 @@ gtTweetsFor: aView constraintsDo: [ :c | c vertical exact: 200. c horizontal matchParent ]; - elementBuilder: [ each asCardElement margin: (BlInsets all: 20) ]. + elementBuilder: [ each asTestCardElement margin: (BlInsets all: 20) ]. container addChild: imageContainer]. container asScrollableElement ] \ No newline at end of file