Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes for Twitter event feed display
This commit includes fixes for Twitter in the event feed display, and also more shared code between Facebook and Twitter attached pages.
- Loading branch information
1 parent
58eb0af
commit 4bfbb36
Showing
11 changed files
with
369 additions
and
306 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import QtQuick 2.0 | ||
import Sailfish.Silica 1.0 | ||
|
||
Item { | ||
id: container | ||
property alias avatar: socialAvatar.icon | ||
property alias source: header.title | ||
property date timestamp | ||
property alias body: body.text | ||
property alias belowAvatar: belowAvatarContainer.children | ||
property alias socialButtons: socialButtonsContainer.children | ||
|
||
height: childrenRect.height | ||
anchors { | ||
left: parent.left | ||
right: parent.right | ||
} | ||
|
||
Formatter { | ||
id: formatter | ||
} | ||
|
||
Rectangle { | ||
anchors.fill: parent | ||
color: Theme.highlightColor | ||
opacity: 0.1 | ||
} | ||
|
||
PageHeader { | ||
id: header | ||
} | ||
|
||
SocialAvatar { | ||
id: socialAvatar | ||
anchors.top: header.bottom | ||
} | ||
|
||
SocialBody { | ||
id: body | ||
anchors { | ||
top: header.bottom | ||
left: socialAvatar.right | ||
leftMargin: Theme.paddingMedium | ||
right: parent.right | ||
rightMargin: Theme.paddingLarge | ||
} | ||
|
||
time: formatter.formatDate(container.timestamp, Formatter.DurationElapsed) | ||
} | ||
|
||
// This item is used to anchors social buttons and below avatar content | ||
Item { | ||
id: mainContentMask | ||
anchors.top: header.bottom | ||
anchors.left: parent.left | ||
anchors.right: parent.right | ||
height: belowAvatarContainer.childrenRect.height > 0 ? Math.max(body.height, socialAvatar.height) | ||
: body.height | ||
} | ||
|
||
Item { | ||
id: belowAvatarContainer | ||
anchors { | ||
left: socialAvatar.left | ||
right: socialAvatar.right | ||
top: mainContentMask.bottom | ||
} | ||
height: socialButtonsContainer.height | ||
} | ||
|
||
Item { | ||
id: socialButtonsContainer | ||
anchors { | ||
top: mainContentMask.bottom | ||
left: belowAvatarContainer.right | ||
leftMargin: Theme.paddingMedium | ||
right: parent.right | ||
rightMargin: Theme.paddingLarge | ||
} | ||
height: childrenRect.height | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import QtQuick 2.0 | ||
import Sailfish.Silica 1.0 | ||
|
||
Item { | ||
property alias text: label.text | ||
anchors { | ||
left: parent.left | ||
right: parent.right | ||
} | ||
|
||
height: label.text != "" ? (label.height + 2 * Theme.paddingLarge) : Theme.paddingLarge | ||
opacity: label.text != "" ? 1 : 0 | ||
|
||
Label { | ||
id: label | ||
anchors { | ||
left: parent.left | ||
leftMargin: Theme.paddingMedium | ||
right: parent.right | ||
rightMargin: Theme.paddingMedium | ||
verticalCenter: parent.verticalCenter | ||
} | ||
font.pixelSize: Theme.fontSizeSmall | ||
wrapMode: Text.WordWrap | ||
} | ||
|
||
Behavior on opacity { FadeAnimation {} } | ||
Behavior on height { FadeAnimation { property: "height" } } | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import QtQuick 2.0 | ||
import Sailfish.Silica 1.0 | ||
|
||
Item { | ||
id: container | ||
property bool displayMargins | ||
property alias avatar: avatar.source | ||
property alias placeholderText: textField.placeholderText | ||
property alias text: textField.text | ||
property alias allowComment: textField.enabled | ||
signal enterKeyClicked() | ||
|
||
function forceActiveFocus() { | ||
textField.forceActiveFocus() | ||
} | ||
|
||
function clear() { | ||
textField.text = "" | ||
} | ||
|
||
anchors { | ||
left: parent.left | ||
right: parent.right | ||
} | ||
height: childrenRect.height + Theme.paddingMedium | ||
+ (displayMargins ? Theme.paddingLarge : 0) | ||
|
||
Behavior on opacity { FadeAnimation {} } | ||
|
||
Image { | ||
id: avatar | ||
anchors { | ||
left: parent.left | ||
top: parent.top | ||
topMargin: container.displayMargins ? Theme.paddingLarge : 0 | ||
} | ||
width: Theme.iconSizeMedium | ||
height: Theme.iconSizeMedium | ||
} | ||
|
||
TextField { | ||
id: textField | ||
anchors { | ||
top: parent.top | ||
topMargin: container.displayMargins ? Theme.paddingLarge : 0 | ||
left: avatar.right | ||
right: parent.right | ||
} | ||
|
||
EnterKey.onClicked: { | ||
container.enterKeyClicked() | ||
} | ||
} | ||
} |
Oops, something went wrong.