Disable charts animations on Samsung S8

This commit is contained in:
Michael Zanetti 2022-02-06 13:06:03 +01:00
parent 801f44e8d2
commit a7a8d996c4
8 changed files with 16 additions and 12 deletions

View File

@ -108,7 +108,7 @@ int main(int argc, char *argv[])
qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
application.installTranslator(&qtTranslator);
qCInfo(dcApplication()) << application.applicationName() << APP_VERSION << "running on" << QSysInfo::machineHostName() << QSysInfo::prettyProductName() << QSysInfo::productType() << QSysInfo::productVersion();
qCInfo(dcApplication()) << application.applicationName() << APP_VERSION << "running on" << QSysInfo::machineHostName() << QSysInfo::prettyProductName() << QSysInfo::productType() << QSysInfo::productVersion() << PlatformHelper::instance()->deviceManufacturer() << PlatformHelper::instance()->deviceModel();
qCInfo(dcApplication()) << "Locale info:" << QLocale() << QLocale().name() << QLocale().language() << QLocale().system();
QTranslator appTranslator;

View File

@ -90,7 +90,7 @@ Item {
titleFont.pixelSize: app.largeFont
animationDuration: 300
animationOptions: ChartView.SeriesAnimations
animationOptions: NymeaUtils.chartsAnimationOptions
RowLayout {
anchors { left: parent.left; top: parent.top; right: parent.right; topMargin: app.margins / 2; leftMargin: app.margins * 1.5; rightMargin: app.margins }
@ -296,7 +296,7 @@ Item {
var newMin = xAxis.min.getTime() + diffMaxToNew;
xAxis.max = new Date(newPoint.x);
xAxis.min = new Date(newMin)
chartView.animationOptions = ChartView.SeriesAnimations
chartView.animationOptions = NymeaUtils.chartsAnimationOptions
}
}
@ -389,7 +389,7 @@ Item {
// If the user scrolled closer than 5 pixels to the right edge, enable autoscroll
autoScroll = overshoot > -5;
chartView.animationOptions = ChartView.SeriesAnimations
chartView.animationOptions = NymeaUtils.chartsAnimationOptions
}
function zoomInLimited(dy) {
@ -397,7 +397,7 @@ Item {
var oldMax = xAxis.max;
chartView.scrollRight(dy);
xAxis.min = new Date(xAxis.min.getTime() - xAxis.timeDiff * 1000 * 2)
chartView.animationOptions = ChartView.SeriesAnimations
chartView.animationOptions = NymeaUtils.chartsAnimationOptions
}
onPressed: {

View File

@ -206,7 +206,7 @@ StatsBase {
labels.push(entries[0].timestamp)
categoryAxis.timestamps = labels
chartView.animationOptions = ChartView.SeriesAnimations
chartView.animationOptions = NymeaUtils.chartsAnimationOptions
}
onLiveEntryChanged: {
@ -291,7 +291,7 @@ StatsBase {
map[consumer.id] = barSet
}
barSeries.thingBarSetMap = map
chartView.animationOptions = ChartView.SeriesAnimations
chartView.animationOptions = NymeaUtils.chartsAnimationOptions
}
Item {

View File

@ -9,7 +9,7 @@ import Nymea 1.0
ChartView {
id: root
backgroundColor: "transparent"
animationOptions: Qt.application.active ? ChartView.SeriesAnimations : ChartView.NoAnimation
animationOptions: Qt.application.active ? NymeaUtils.chartsAnimationOptions : ChartView.NoAnimation
title: qsTr("Consumers balance")
titleColor: Style.foregroundColor
legend.visible: false

View File

@ -9,7 +9,7 @@ import Nymea 1.0
ChartView {
id: consumptionPieChart
backgroundColor: "transparent"
animationOptions: Qt.application.active ? ChartView.SeriesAnimations : ChartView.NoAnimation
animationOptions: Qt.application.active ? NymeaUtils.chartsAnimationOptions : ChartView.NoAnimation
title: qsTr("My energy mix")
titleColor: Style.foregroundColor
legend.visible: false

View File

@ -9,7 +9,7 @@ import Nymea 1.0
ChartView {
id: productionPieChart
backgroundColor: "transparent"
animationOptions: Qt.application.active ? ChartView.SeriesAnimations : ChartView.NoAnimation
animationOptions: Qt.application.active ? NymeaUtils.chartsAnimationOptions : ChartView.NoAnimation
title: qsTr("My energy production")
titleColor: Style.foregroundColor
legend.visible: false

View File

@ -169,7 +169,7 @@ StatsBase {
// print("assigning categories:", labels)
categoryAxis.timestamps = labels
chartView.animationOptions = ChartView.SeriesAnimations
chartView.animationOptions = NymeaUtils.chartsAnimationOptions
for (var i = 0; i < entries.length; i++) {
// print("Appending to set", JSON.stringify(entries[i]))
@ -215,7 +215,7 @@ StatsBase {
d.acquisitionSet.append(acquisitionValue)
d.returnSet.append(returnValue)
chartView.animationOptions = ChartView.SeriesAnimations
chartView.animationOptions = NymeaUtils.chartsAnimationOptions
}
}

View File

@ -1,6 +1,7 @@
pragma Singleton
import QtQuick 2.9
import Nymea 1.0
import QtCharts 2.3
Item {
id: root
@ -145,4 +146,7 @@ Item {
function hasPermissionScope(permissions, requestedScope) {
return (permissions & requestedScope) === requestedScope;
}
property bool inhibitChartsAnimation: ["SM-G950x", "SM-G955x", "SM-G892A"].indexOf(PlatformHelper.deviceModel) >= 0
property int chartsAnimationOptions: !inhibitChartsAnimation ? ChartView.SeriesAnimations : ChartView.NoAnimation
}