Migrating to 08.1376, fixing code smells and refining UI elements because of external deprecation (but old problems arise).

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-04-09 19:31:10 -05:00
parent a84e9504f9
commit 36c261d534
4 changed files with 18 additions and 8 deletions

View File

@ -0,0 +1,9 @@
accessing
avatarPicture
| response |
response := ZnClient new url: (self profileImageUrl); get; response.
response contentType = ZnMimeType imageJpeg
ifTrue: [ ^ (JPEGReadWriter gtFromBuffer: response contents) asElement ].
response contentType = ZnMimeType imagePng
ifTrue: [ ^ (PNGReadWriter gtFromBuffer: response contents) asElement ].
^ BlElement new background: Color gray

View File

@ -39,5 +39,5 @@ fromNitterTimelineItem: xmlItem
metadata metadata
at: 'pinned' at: 'pinned'
put: (((xmlItem xpath: '//div[@class="pinned"]') stringValue trimmed) = 'Pinned Tweet' put: (((xmlItem xpath: '//div[@class="pinned"]') stringValue trimmed) = 'Pinned Tweet'
ifTrue: [ True ] ifTrue: [ true ]
ifFalse: [ False ]) ifFalse: [ false ])

View File

@ -12,7 +12,7 @@ gtViewProfileDetailsOn: aView
c vertical fitContent. c vertical fitContent.
c horizontal matchParent ]; c horizontal matchParent ];
padding: (BlInsets all: 10). padding: (BlInsets all: 10).
imageContainer := BlLazyElement new imageContainer := self avatarPicture;
withGlamorousPreview; withGlamorousPreview;
aptitude: BrShadowAptitude new; aptitude: BrShadowAptitude new;
background: Color white; background: Color white;

View File

@ -1,7 +1,8 @@
accessing accessing
profileImage profileImage
^ BlUrlImageElement url: self profileImageUrl | imageTemp |
"The previous version has something like imageTemp := BrAsyncFileWidget new url: self profileImageUrl.
imageTemp on: Error do: [ ^ GtABContact new avatar ]. "Going back to the previous version after BlLazyElement that solved the issues was deprecated"
^ imageTemp value asElement imageTemp on: Error do: [ ^ GtABContact new avatar ].
Should a generic avatar be reimplemented?" ^ imageTemp value asElement
"Should a generic avatar be reimplemented?"