From 872dacd380a84982cb12fff3f5de94a33e27df6f Mon Sep 17 00:00:00 2001 From: Sthocs Date: Thu, 16 Nov 2017 23:58:56 +0100 Subject: [PATCH] v0.8.1: - Initial zoom level setting with translations - Native icon to show position + fixed auto-center on Xperia (check horizontalAccuracy) --- README.md | 2 +- qml/icons/me.png | Bin 5006 -> 0 bytes qml/items/StationMarker.qml | 6 +++--- qml/pages/InteractiveMap.qml | 26 +++++++++++++++----------- qml/pages/Settings.qml | 13 +++++++++++++ rpm/harbour-bikeme.changes | 5 +++++ rpm/harbour-bikeme.yaml | 2 +- translations/harbour-bikeme-en.ts | 6 +++++- translations/harbour-bikeme-es.ts | 4 ++++ translations/harbour-bikeme-fr.ts | 4 ++++ translations/harbour-bikeme-pl.ts | 4 ++++ translations/harbour-bikeme-ru.ts | 4 ++++ translations/harbour-bikeme-sv.ts | 4 ++++ translations/harbour-bikeme.ts | 4 ++++ 14 files changed, 67 insertions(+), 17 deletions(-) delete mode 100644 qml/icons/me.png diff --git a/README.md b/README.md index 2479b6c..5c1f81d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ You can also save your favourites stations and see their status on the cover. 500+ cities availables in 50+ countries. Check if yours is there! -Get it on [OpenRepos](https://openrepos.net/content/sthocs/bikeme). +Get it on [OpenRepos](https://openrepos.net/content/sthocs/bikeme). Translations on [Transifex](https://www.transifex.com/sthocs/harbour-bikeme). ![BikeMe banner](images/banner.png) diff --git a/qml/icons/me.png b/qml/icons/me.png deleted file mode 100644 index a8f44675136bfcc4772741dc0766622a3fb71e7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5006 zcmV;96LIW`P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*q- z4lOTqT5KTz000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000u{Nklt6OMNE%l#-tf9sj|Zf+v}rzvp?q7Z-Z;!^D9;W z;LO*-?x#h-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li&Z>N(I^^Dsfi%>7YT_01 zCB#)7uI@;N9jKw*9Bs2LJ{yCkv$9MyQ$<2FQ$t*yiheTPu|GQR!v}x(g^i=~hqq4J zFTGPglpxaqzkX#Y`ONQ+{`S~N@Xo`!9ga|QWK@E*a(1Jnp`-EU*(JVyBA`%r*%>&qpOqkjo&%Tsiec?xs-1Ej$ z%i*D?dK_pfY0rK&|CIo!CP+8WUiRU)*GAs=+oS&}MtiGwtaHK&CsLYWQ#m+^i74?C&i%WA(nd=u0 z4$9)80e4O*aciBkWg;>n;7n+0WWTEIZg=g`PFMGKQrq85?by{fA8Yo@m2ceNe$BG{ Ye_3Uf)&1%4>i_@%07*qoM6N<$g6F8vi~s-t diff --git a/qml/items/StationMarker.qml b/qml/items/StationMarker.qml index 9a7cdbe..f2d5341 100644 --- a/qml/items/StationMarker.qml +++ b/qml/items/StationMarker.qml @@ -12,7 +12,7 @@ Item { property string _COLOR_AVAILABLE : "#77A834" property string _COLOR_ALMOST_EMPTY : "orange" property string _COLOR_EMPTY : "red" - property string _COLOR_SELECTED1 : "steelblue" // blue when data is available + property string _COLOR_SELECTED1 : "DodgerBlue" // blue when data is available property string _COLOR_SELECTED2 : "#D60080" // pink when no data is available Rectangle { @@ -20,7 +20,7 @@ Item { width: Theme.iconSizeSmall; height: Theme.iconSizeSmall radius: 10 color: { - if (!opened) { + if (!opened && !selected) { return "grey"; } if (!displayAllStatus || available < 0) { @@ -60,7 +60,7 @@ Item { x: Theme.iconSizeSmall / 4; y: Theme.iconSizeSmall / 4 * 2.5 width: Theme.iconSizeSmall / 2; height: Theme.iconSizeSmall / 2 // c²=512 -> c=22.63 -> c/2=11.31 color: { - if (!opened) { + if (!opened && !selected) { return "grey"; } if (selected) { diff --git a/qml/pages/InteractiveMap.qml b/qml/pages/InteractiveMap.qml index e5b1295..b972218 100644 --- a/qml/pages/InteractiveMap.qml +++ b/qml/pages/InteractiveMap.qml @@ -60,10 +60,11 @@ Page { Component.onCompleted: { center = QtPositioning.coordinate(43.5508823, 7.0168207); - map.zoomLevel = autoEnableGPS ? 14 : city.zoom || 13; - if (mapPlugin === "osm") { - map.zoomLevel += 1; - } + var zoomSetting = !isNaN(configManager.getSetting("zoomLevel")) ? + parseInt(configManager.getSetting("zoomLevel")) : 15 + zoomLevel = zoomSetting >= minimumZoomLevel && zoomSetting <= maximumZoomLevel ? + zoomSetting : 15 + updateFilter(); stationLoadingLabel.visible = true; stations.city = city; @@ -74,7 +75,6 @@ Page { } gesture.onPanFinished: { - console.log("Pan FINISHED"); updateFilter(); } gesture.onPinchFinished: { @@ -88,10 +88,11 @@ Page { coordinate: positionSource.position.coordinate visible: positionReceived sourceItem: Image { - source: "../icons/me.png" + id: dot + source: "image://theme/icon-m-dot?DodgerBlue" } - anchorPoint.x: 24 - anchorPoint.y: 24 + anchorPoint.x: dot.width / 2 + anchorPoint.y: dot.height / 2 } MapMouseArea { @@ -279,7 +280,8 @@ Page { active: false onPositionChanged: { - if (!positionReceived && active && position.horizontalAccuracyValid) { // First time we receive a valid position, go to it. + if (!positionReceived && active && position.horizontalAccuracyValid && + position.horizontalAccuracy < 500) { // First time we receive a valid position, go to it. positionReceived = true; // Keep coordinates in a different object to avoid map auto-centering. var pos = QtPositioning.coordinate(positionSource.position.coordinate.latitude, @@ -377,7 +379,8 @@ Page { Image { id: centerPosIcon - source: positionReceived ? "image://theme/icon-cover-location" : "image://theme/icon-cover-location?gray" + source: positionSource.active && positionSource.position.horizontalAccuracyValid && + positionSource.position.horizontalAccuracy < 500 ? "image://theme/icon-cover-location" : "image://theme/icon-cover-location?gray" anchors { right: gpsIcon.left rightMargin: Theme.paddingMedium @@ -391,7 +394,8 @@ Page { MouseArea { anchors.fill: parent onClicked: { - if (positionReceived) { + if (positionSource.active && positionSource.position.horizontalAccuracyValid && + positionSource.position.horizontalAccuracy < 500) { map.center = map.toCoordinate(Qt.point(map.width / 2, map.height / 2)); var pos = QtPositioning.coordinate(positionSource.position.coordinate.latitude, positionSource.position.coordinate.longitude) diff --git a/qml/pages/Settings.qml b/qml/pages/Settings.qml index 597e111..ffa7c1d 100644 --- a/qml/pages/Settings.qml +++ b/qml/pages/Settings.qml @@ -88,6 +88,19 @@ Page { checked = configManager.getSetting("autoEnableGPS") !== "false"; } } + Slider { + label: qsTr("Map initial zoom level") + width: parent.width + minimumValue: 12 + maximumValue: 18 + value: !isNaN(configManager.getSetting("zoomLevel")) ? + parseInt(configManager.getSetting("zoomLevel")) : 15 + valueText: value + stepSize: 1 + onValueChanged: { + configManager.saveSetting("zoomLevel", value); + } + } Item { width: parent.width height: Theme.paddingLarge * 5 diff --git a/rpm/harbour-bikeme.changes b/rpm/harbour-bikeme.changes index b3b0ad7..fff8313 100644 --- a/rpm/harbour-bikeme.changes +++ b/rpm/harbour-bikeme.changes @@ -1,3 +1,8 @@ +* Mon Nov 13 2017 Sthocs 0.8.1-1 +- Use native icon to show position +- Map initial zoom level setting +- Removed dead systems, added tests, added Rennes (fr) + * Tue Jun 27 2017 Sthocs 0.8-1 - Added option to use CityBikes as data source - Workaround for the onPanFinished bug diff --git a/rpm/harbour-bikeme.yaml b/rpm/harbour-bikeme.yaml index 943c650..f87bc8a 100644 --- a/rpm/harbour-bikeme.yaml +++ b/rpm/harbour-bikeme.yaml @@ -1,6 +1,6 @@ Name: harbour-bikeme Summary: Find a bike with your Sailfish OS device! -Version: 0.8 +Version: 0.8.1 Release: 1 Group: Qt/Qt URL: https://openrepos.net/users/sthocs diff --git a/translations/harbour-bikeme-en.ts b/translations/harbour-bikeme-en.ts index 39e6cf2..3fed65b 100644 --- a/translations/harbour-bikeme-en.ts +++ b/translations/harbour-bikeme-en.ts @@ -17,7 +17,7 @@ Many thanks for the translations: %1 - Many thanks for the translations: % + Many thanks for the translations: %1 This app helps you to find a bike or a free parking spot for various self-service bicycle schemes arround the world:<ul>%1<li>And more!</li></ul>BikeMe provides a simple interactive map displaying all stations by city, their number of available bikes and free parking spots, and the geolocation.<br />Click on %2 to activate the geolocation and on %3 to center the map on your position.<br/>Regular users: Save your favourites stations and see their status directly on the cover! @@ -254,5 +254,9 @@ Open map on my position Open map on my position + + Map initial zoom level + Map initial zoom level + diff --git a/translations/harbour-bikeme-es.ts b/translations/harbour-bikeme-es.ts index 9da0948..2f67a8c 100644 --- a/translations/harbour-bikeme-es.ts +++ b/translations/harbour-bikeme-es.ts @@ -246,5 +246,9 @@ Open map on my position Abrir mapa en tu posición + + Map initial zoom level + Nivel de zoom inicial en mapa + \ No newline at end of file diff --git a/translations/harbour-bikeme-fr.ts b/translations/harbour-bikeme-fr.ts index 9d54dbe..afed718 100644 --- a/translations/harbour-bikeme-fr.ts +++ b/translations/harbour-bikeme-fr.ts @@ -254,5 +254,9 @@ Open map on my position Ouvrir la carte sur ma position + + Map initial zoom level + Zoom initial de la carte + diff --git a/translations/harbour-bikeme-pl.ts b/translations/harbour-bikeme-pl.ts index 710f668..028dbd0 100644 --- a/translations/harbour-bikeme-pl.ts +++ b/translations/harbour-bikeme-pl.ts @@ -246,5 +246,9 @@ Open map on my position Otwórz mapę w mojej lokalizacji + + Map initial zoom level + Początkowy poziom powiększenia mapy + \ No newline at end of file diff --git a/translations/harbour-bikeme-ru.ts b/translations/harbour-bikeme-ru.ts index 5c5b046..6c333e2 100644 --- a/translations/harbour-bikeme-ru.ts +++ b/translations/harbour-bikeme-ru.ts @@ -246,5 +246,9 @@ Open map on my position Показать мое местоположение на карте + + Map initial zoom level + Масштаб карты при запуске приложения + \ No newline at end of file diff --git a/translations/harbour-bikeme-sv.ts b/translations/harbour-bikeme-sv.ts index fa5f9c0..e8a03f1 100644 --- a/translations/harbour-bikeme-sv.ts +++ b/translations/harbour-bikeme-sv.ts @@ -246,5 +246,9 @@ Open map on my position Öppna kartan på min position + + Map initial zoom level + Kartans inledande zoomnivå + \ No newline at end of file diff --git a/translations/harbour-bikeme.ts b/translations/harbour-bikeme.ts index 1947d71..733c39e 100644 --- a/translations/harbour-bikeme.ts +++ b/translations/harbour-bikeme.ts @@ -252,5 +252,9 @@ Open map on my position + + Map initial zoom level + +