Adapt profile page to use NetImageManager

This commit is contained in:
Morgan McMillian 2017-11-16 13:06:59 -08:00
parent 6f41f3b948
commit b7dc358c33
2 changed files with 39 additions and 18 deletions

View file

@ -18,11 +18,12 @@
*/
import bb.cascades 1.4
import org.labsquare 1.0
import com.netimage 1.0
import "parser.js" as Parser
Page {
property variant imgManager: imgManager
property variant user
property variant theme: Application.themeSupport.theme.colorTheme.style
property string lorem: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse non enim tellus. Donec vestibulum enim urna, eget faucibus diam commodo a. Donec eget hendrerit metus. Pellentesque vehicula nisi nec vehicula ullamcorper. Aliquam a elit eget mi fringilla porta fermentum eget eros. Phasellus vestibulum nulla sed elit congue adipiscing. Cras imperdiet urna ac ipsum volutpat lobortis. Maecenas vehicula tortor at viverra convallis. Curabitur nibh massa, tristique id felis ut, venenatis faucibus dui. Donec fringilla, mi nec tincidunt dignissim, neque nunc semper mi, quis rutrum diam turpis sit amet erat. Cras a sodales nisi. Nunc sit amet diam sed lectus molestie cursus convallis et erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis vitae varius leo. Mauris eu leo a nunc bibendum rutrum euismod et ipsum. "
@ -45,13 +46,21 @@ Page {
Container {
Container {
opacity: 0.6
WebImageView {
ImageView {
id: cover
preferredWidth: 1440
maxHeight: ui.du(24)
scalingMethod: ScalingMethod.AspectFill
//imageSource: "asset:///icons/default_cover.png"
url: user.content.cover_image.link
//url: user.content.cover_image.link
image: cimgtracker.image
attachedObjects: [
NetImageTracker {
id: cimgtracker
manager: imgManager
source: user.content.cover_image.link
}
]
}
}
}
@ -64,11 +73,19 @@ Page {
verticalAlignment: VerticalAlignment.Center
Container {
background: (theme === VisualStyle.Bright) ? Color.create("#e9e9e9") : Color.create("#282828")
WebImageView {
ImageView {
//imageSource: "asset:///icons/laughing_man.png"
url: user.content.avatar_image.link
//url: user.content.avatar_image.link
maxHeight: ui.du(14)
maxWidth: ui.du(14)
image: aimgtracker.image
attachedObjects: [
NetImageTracker {
id: aimgtracker
manager: imgManager
source: user.content.avatar_image.link
}
]
}
}
Container {
@ -278,6 +295,10 @@ Page {
ComponentDefinition {
id: userListPage
source: "UserPage.qml"
},
NetImageManager {
id: imgManager
cacheId: "feedImageManager"
}
]
}

View file

@ -96,55 +96,55 @@
<context>
<name>ProfilePage</name>
<message>
<location filename="../assets/ProfilePage.qml" line="128"/>
<location filename="../assets/ProfilePage.qml" line="201"/>
<location filename="../assets/ProfilePage.qml" line="145"/>
<location filename="../assets/ProfilePage.qml" line="218"/>
<source>Following</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/ProfilePage.qml" line="141"/>
<location filename="../assets/ProfilePage.qml" line="216"/>
<location filename="../assets/ProfilePage.qml" line="158"/>
<location filename="../assets/ProfilePage.qml" line="233"/>
<source>Followers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/ProfilePage.qml" line="154"/>
<location filename="../assets/ProfilePage.qml" line="188"/>
<location filename="../assets/ProfilePage.qml" line="171"/>
<location filename="../assets/ProfilePage.qml" line="205"/>
<source>Posts</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/ProfilePage.qml" line="167"/>
<location filename="../assets/ProfilePage.qml" line="184"/>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/ProfilePage.qml" line="233"/>
<location filename="../assets/ProfilePage.qml" line="250"/>
<source>Unfollow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/ProfilePage.qml" line="233"/>
<location filename="../assets/ProfilePage.qml" line="250"/>
<source>Follow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/ProfilePage.qml" line="246"/>
<location filename="../assets/ProfilePage.qml" line="263"/>
<source>Unmute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/ProfilePage.qml" line="246"/>
<location filename="../assets/ProfilePage.qml" line="263"/>
<source>Mute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/ProfilePage.qml" line="259"/>
<location filename="../assets/ProfilePage.qml" line="276"/>
<source>Unblock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/ProfilePage.qml" line="259"/>
<location filename="../assets/ProfilePage.qml" line="276"/>
<source>Block</source>
<translation type="unfinished"></translation>
</message>