/
RatingDialog.qml
89 lines (77 loc) · 2.28 KB
/
RatingDialog.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import VPlayApps 1.0
import VPlay 2.0
import "../common"
// feedback window to contact V-Play
Dialog {
id: ratingDialog
negativeAction: true
negativeActionLabel: "Close"
positiveActionLabel: "Rate"
autoSize: true
outsideTouchable: false
property string ratingUrl: system.isPlatform(System.IOS) ? "itms-apps://itunes.apple.com/at/app/id1286758361?mt=8" :
system.isPlatform(System.Android) ? "http://play.google.com/store/apps/details?id=net.vplay.demos.qtws2017" :
"https://v-play.net/qws-conference-in-app-2017"
onCanceled: ratingDialog.close()
onAccepted: {
amplitude.logEvent("RateInStore")
DataModel.setFeedBackSent(true)
// open the store site to rate the game instead
nativeUtils.openUrl(ratingUrl)
ratingDialog.close()
}
Item {
id: contentArea
width: parent.width
height: content.height
Column {
id: content
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.margins: dp(20)
spacing: dp(10)
// rating header
Text {
id: ratingText
horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
text: "Rate This App"
color: Theme.textColor
font.pixelSize: sp(18)
width: parent.width * 0.8//- anchors.topMargin * 2
wrapMode: Text.Wrap
}
// rating note
Text {
id: ratingNote
horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
text: "Support us by rating the app in the store!"
color: Theme.textColor
font.pixelSize: sp(10)
width: parent.width * 0.8//- 20
wrapMode: Text.Wrap
}
AppButton {
text: "I already rated this app"
flat: true
anchors.horizontalCenter: parent.horizontalCenter
textSize: sp(12)
onClicked: {
DataModel.setFeedBackSent(true)
// close the window
ratingDialog.close()
}
}
// spacer
Item {
width: parent.width
height: parent.spacing
}
}
} // content area
}