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
at: 'pinned'
put: (((xmlItem xpath: '//div[@class="pinned"]') stringValue trimmed) = 'Pinned Tweet'
ifTrue: [ True ]
ifFalse: [ False ])
ifTrue: [ true ]
ifFalse: [ false ])

View File

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

View File

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