-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements distance / speed limit voice announcement and displaying for speed cameras (#3721 and #8108, android part) + minor fix for alert icon resizing on large screens #12923
Open
AlexNcUa
wants to merge
7
commits into
osmandapp:master
Choose a base branch
from
AlexNcUa:8108_3721_initial_impl
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2a5c946
#3721 and #8108 initial implementation.
AlexNcUa 70ff0c2
#8108, #3721
AlexNcUa 6327ea5
Merge branch 'master' into 8108_3721_initial_impl
AlexNcUa b829487
Fix build after master backmerge + minor AlarmWidget createWidgetBitm…
AlexNcUa 09688ec
Merge branch 'master' into 8108_3721_initial_impl
AlexNcUa 7bd8351
#8108, #3721 Code review fixes part 1:
AlexNcUa c70a074
#8108, #3721 Code review fixes part 2:
AlexNcUa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,39 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="92dp" | ||
android:height="92dp" | ||
android:viewportWidth="92" | ||
android:viewportHeight="92"> | ||
|
||
<path | ||
android:pathData="M14,7H78C81.866,7 85,10.134 85,14V77C85,80.866 81.866,84 78,84H14C10.134,84 7,80.866 7,77V14C7,10.134 10.134,7 14,7Z" | ||
android:fillColor="#000000" | ||
android:fillAlpha="0.2" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M8,14C8,10.6863 10.6863,8 14,8H78C81.3137,8 84,10.6863 84,14V77C84,80.3137 81.3137,83 78,83H14C10.6863,83 8,80.3137 8,77V14Z" | ||
android:fillColor="#0055FF"/> | ||
<path | ||
android:pathData="M78,11H14C12.3431,11 11,12.3431 11,14V77C11,78.6569 12.3431,80 14,80H78C79.6569,80 81,78.6569 81,77V14C81,12.3431 79.6569,11 78,11ZM14,8C10.6863,8 8,10.6863 8,14V77C8,80.3137 10.6863,83 14,83H78C81.3137,83 84,80.3137 84,77V14C84,10.6863 81.3137,8 78,8H14Z" | ||
android:fillColor="#FFFFFF" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M14,15C14,14.4477 14.4477,14 15,14H77C77.5523,14 78,14.4477 78,15V55C78,55.5523 77.5523,56 77,56H15C14.4477,56 14,55.5523 14,55V15Z" | ||
android:fillColor="#FFFFFF"/> | ||
|
||
<path | ||
android:pathData="M29,20H47C48.657,20 50,21.343 50,23V47C50,48.657 48.657,50 47,50H29C27.343,50 26,48.657 26,47V23C26,21.343 27.343,20 29,20ZM36,34C39.314,34 42,36.686 42,40C42,43.314 39.314,46 36,46C32.686,46 30,43.314 30,40C30,36.686 32.686,34 36,34ZM42,22C44.209,22 46,23.791 46,26C46,28.209 44.209,30 42,30C39.791,30 38,28.209 38,26C38,23.791 39.791,22 42,22Z" | ||
android:fillColor="#000000" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M36,38C37.105,38 38,38.895 38,40C38,41.105 37.105,42 36,42C34.895,42 34,41.105 34,40C34,38.895 34.895,38 36,38Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M42,25C42.552,25 43,25.448 43,26C43,26.552 42.552,27 42,27C41.448,27 41,26.552 41,26C41,25.448 41.448,25 42,25Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M52,26H56V42H52V26Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M58,30H62V34H66V42H62V50H52V46H58V30Z" | ||
android:fillColor="#000000"/> | ||
</vector> |
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,46 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="92dp" | ||
android:height="92dp" | ||
android:viewportWidth="92" | ||
android:viewportHeight="92"> | ||
|
||
<path | ||
android:pathData="M14,7H78C81.866,7 85,10.134 85,14V77C85,80.866 81.866,84 78,84H14C10.134,84 7,80.866 7,77V14C7,10.134 10.134,7 14,7Z" | ||
android:fillColor="#000000" | ||
android:fillAlpha="0.2" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M8,14C8,10.6863 10.6863,8 14,8H78C81.3137,8 84,10.6863 84,14V77C84,80.3137 81.3137,83 78,83H14C10.6863,83 8,80.3137 8,77V14Z" | ||
android:fillColor="#0055FF"/> | ||
<path | ||
android:pathData="M78,11H14C12.3431,11 11,12.3431 11,14V77C11,78.6569 12.3431,80 14,80H78C79.6569,80 81,78.6569 81,77V14C81,12.3431 79.6569,11 78,11ZM14,8C10.6863,8 8,10.6863 8,14V77C8,80.3137 10.6863,83 14,83H78C81.3137,83 84,80.3137 84,77V14C84,10.6863 81.3137,8 78,8H14Z" | ||
android:fillColor="#FFFFFF" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M14,15C14,14.4477 14.4477,14 15,14H77C77.5523,14 78,14.4477 78,15V55C78,55.5523 77.5523,56 77,56H15C14.4477,56 14,55.5523 14,55V15Z" | ||
android:fillColor="#FFFFFF"/> | ||
|
||
<path | ||
android:pathData="M19,24H37C38.657,24 40,25.343 40,27V51C40,52.657 38.657,54 37,54H19C17.343,54 16,52.657 16,51V27C16,25.343 17.343,24 19,24ZM26,38C29.314,38 32,40.686 32,44C32,47.314 29.314,50 26,50C22.686,50 20,47.314 20,44C20,40.686 22.686,38 26,38ZM32,26C34.209,26 36,27.791 36,30C36,32.209 34.209,34 32,34C29.791,34 28,32.209 28,30C28,27.791 29.791,26 32,26Z" | ||
android:fillColor="#000000" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M26,42C27.105,42 28,42.895 28,44C28,45.105 27.105,46 26,46C24.895,46 24,45.105 24,44C24,42.895 24.895,42 26,42Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M32,29C32.552,29 33,29.448 33,30C33,30.552 32.552,31 32,31C31.448,31 31,30.552 31,30C31,29.448 31.448,29 32,29Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M42,30H46V46H42V30Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M48,34H52V38H56V46H52V54H42V50H48V34Z" | ||
android:fillColor="#000000"/> | ||
|
||
<path | ||
android:pathData="M74,0C83.941,0 92,8.059 92,18C92,27.941 83.941,36 74,36C64.059,36 56,27.941 56,18C56,8.059 64.059,0 74,0Z" | ||
android:fillColor="#FF0000"/> | ||
<path | ||
android:pathData="M74,3C82.284,3 89,9.716 89,18C89,26.284 82.284,33 74,33C65.716,33 59,26.284 59,18C59,9.716 65.716,3 74,3Z" | ||
android:fillColor="#FFFFFF"/> | ||
</vector> |
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,38 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="92dp" | ||
android:height="92dp" | ||
android:viewportWidth="92" | ||
android:viewportHeight="92"> | ||
|
||
<path | ||
android:pathData="M8,14C8,10.6863 10.6863,8 14,8H78C81.3137,8 84,10.6863 84,14V77C84,80.3137 81.3137,83 78,83H14C10.6863,83 8,80.3137 8,77V14Z" | ||
android:fillColor="#FFD200"/> | ||
<path | ||
android:pathData="M78,11H14C12.3431,11 11,12.3431 11,14V77C11,78.6569 12.3431,80 14,80H78C79.6569,80 81,78.6569 81,77V14C81,12.3431 79.6569,11 78,11ZM14,8C10.6863,8 8,10.6863 8,14V77C8,80.3137 10.6863,83 14,83H78C81.3137,83 84,80.3137 84,77V14C84,10.6863 81.3137,8 78,8H14Z" | ||
android:fillColor="#000000" | ||
android:fillType="evenOdd"/> | ||
|
||
<path | ||
android:pathData="M59,0H89C90.657,0 92,1.343 92,3V33C92,34.657 90.657,36 89,36H59C57.343,36 56,34.657 56,33V3C56,1.343 57.343,0 59,0Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M60,2H88C89.105,2 90,2.895 90,4V32C90,33.105 89.105,34 88,34H60C58.895,34 58,33.105 58,32V4C58,2.895 58.895,2 60,2Z" | ||
android:fillColor="#FFFFFF"/> | ||
|
||
<path | ||
android:pathData="M19,24H37C38.657,24 40,25.343 40,27V51C40,52.657 38.657,54 37,54H19C17.343,54 16,52.657 16,51V27C16,25.343 17.343,24 19,24ZM26,38C29.314,38 32,40.686 32,44C32,47.314 29.314,50 26,50C22.686,50 20,47.314 20,44C20,40.686 22.686,38 26,38ZM32,26C34.209,26 36,27.791 36,30C36,32.209 34.209,34 32,34C29.791,34 28,32.209 28,30C28,27.791 29.791,26 32,26Z" | ||
android:fillColor="#000000" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M26,42C27.105,42 28,42.895 28,44C28,45.105 27.105,46 26,46C24.895,46 24,45.105 24,44C24,42.895 24.895,42 26,42Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M32,29C32.552,29 33,29.448 33,30C33,30.552 32.552,31 32,31C31.448,31 31,30.552 31,30C31,29.448 31.448,29 32,29Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M42,30H46V46H42V30Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M48,34H52V38H56V46H52V54H42V50H48V34Z" | ||
android:fillColor="#000000"/> | ||
</vector> |
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,31 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="92dp" | ||
android:height="92dp" | ||
android:viewportWidth="92" | ||
android:viewportHeight="92"> | ||
|
||
<path | ||
android:pathData="M8,14C8,10.6863 10.6863,8 14,8H78C81.3137,8 84,10.6863 84,14V77C84,80.3137 81.3137,83 78,83H14C10.6863,83 8,80.3137 8,77V14Z" | ||
android:fillColor="#FFD200"/> | ||
<path | ||
android:pathData="M78,11H14C12.3431,11 11,12.3431 11,14V77C11,78.6569 12.3431,80 14,80H78C79.6569,80 81,78.6569 81,77V14C81,12.3431 79.6569,11 78,11ZM14,8C10.6863,8 8,10.6863 8,14V77C8,80.3137 10.6863,83 14,83H78C81.3137,83 84,80.3137 84,77V14C84,10.6863 81.3137,8 78,8H14Z" | ||
android:fillColor="#000000" | ||
android:fillType="evenOdd"/> | ||
|
||
<path | ||
android:pathData="M29,20H47C48.657,20 50,21.343 50,23V47C50,48.657 48.657,50 47,50H29C27.343,50 26,48.657 26,47V23C26,21.343 27.343,20 29,20ZM36,34C39.314,34 42,36.686 42,40C42,43.314 39.314,46 36,46C32.686,46 30,43.314 30,40C30,36.686 32.686,34 36,34ZM42,22C44.209,22 46,23.791 46,26C46,28.209 44.209,30 42,30C39.791,30 38,28.209 38,26C38,23.791 39.791,22 42,22Z" | ||
android:fillColor="#000000" | ||
android:fillType="evenOdd"/> | ||
<path | ||
android:pathData="M36,38C37.105,38 38,38.895 38,40C38,41.105 37.105,42 36,42C34.895,42 34,41.105 34,40C34,38.895 34.895,38 36,38Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M42,25C42.552,25 43,25.448 43,26C43,26.552 42.552,27 42,27C41.448,27 41,26.552 41,26C41,25.448 41.448,25 42,25Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M52,26H56V42H52V26Z" | ||
android:fillColor="#000000"/> | ||
<path | ||
android:pathData="M58,30H62V34H66V42H62V50H52V46H58V30Z" | ||
android:fillColor="#000000"/> | ||
</vector> |
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
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
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
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
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks strange that here we store converted data, I guess it should happen at the end UI / Voice prompt cause here it's to early to do conversions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vshcherb To be honest, I also had strong doubts when writing this code.
On the right hand it is not the best place for conversion, on the left hand the
AlarmInfo.intValue
also used for speed limit alarm, and in that case the field will contain converted value.It could be very confusing if the same field will contain speed value in different units of measurement.
Probably, it would be better to introduce dedicated explicit field in AlarmInfo for meters per second speed and provide getter method to provide converted speed. But it will require re-factoring in multiple places, and also I guess there was signifact reason to use several common fields like "floatValue", "intValue" etc. instead of "maxSpeedInMetersPerSecond", "distance" etc...