mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-24 06:53:46 +00:00
Compare commits
317 Commits
test/2025.
...
test/2025.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d36a0d8f0d | ||
|
|
68781adccb | ||
|
|
73cfd3a6dc | ||
|
|
439babe056 | ||
|
|
a69e68fb9f | ||
|
|
c2bef3bd45 | ||
|
|
33ad35206f | ||
|
|
234f13abcc | ||
|
|
5e7bc37fb5 | ||
|
|
08abddc7fc | ||
|
|
ef9f4ceb1e | ||
|
|
6c75604c38 | ||
|
|
5edaa05129 | ||
|
|
c4491563b7 | ||
|
|
c3d8f948ce | ||
|
|
008387b0cf | ||
|
|
3d450433e7 | ||
|
|
58cb8ecd9d | ||
|
|
3e9b507acd | ||
|
|
c9a261dee5 | ||
|
|
d609876c2d | ||
|
|
80b616daf2 | ||
|
|
4dca45f74a | ||
|
|
f5037a5ee2 | ||
|
|
802f54494a | ||
|
|
d4863643f7 | ||
|
|
431e305a48 | ||
|
|
d3c64a262b | ||
|
|
06c35e729f | ||
|
|
b2743ab2ad | ||
|
|
c004f2ed7e | ||
|
|
abcc95710d | ||
|
|
3a90f9783d | ||
|
|
a8353a6a80 | ||
|
|
dc8d4e7da9 | ||
|
|
6a85526ac9 | ||
|
|
447266c328 | ||
|
|
886d569895 | ||
|
|
c6cd23fb24 | ||
|
|
c6040d8ce6 | ||
|
|
0f5125c61c | ||
|
|
512475ec5c | ||
|
|
66d5306717 | ||
|
|
265e94edc3 | ||
|
|
4d6cecd9ba | ||
|
|
46c9a015e5 | ||
|
|
2e3efc0597 | ||
|
|
0b65c2ebff | ||
|
|
96a7b31f4b | ||
|
|
c11f007012 | ||
|
|
977a3b6734 | ||
|
|
c27b0dc6fb | ||
|
|
e367fa6792 | ||
|
|
06b6c3f794 | ||
|
|
ca720d7712 | ||
|
|
661445a053 | ||
|
|
c616e235a1 | ||
|
|
d1f9806901 | ||
|
|
795fe0ee09 | ||
|
|
ea588e7ece | ||
|
|
053855bd97 | ||
|
|
f485830c51 | ||
|
|
debea83908 | ||
|
|
729808fd14 | ||
|
|
b85c11ea5a | ||
|
|
315bba2a22 | ||
|
|
550455a14a | ||
|
|
588028c9eb | ||
|
|
6beabb2fe1 | ||
|
|
25a4a3b76f | ||
|
|
111e913478 | ||
|
|
632d9c0d1d | ||
|
|
1e729e980d | ||
|
|
339eca0bca | ||
|
|
ac453e36ac | ||
|
|
4052f0481e | ||
|
|
89d82be2b9 | ||
|
|
e98ecce375 | ||
|
|
0eee3c4bf4 | ||
|
|
2684e2b278 | ||
|
|
bb88861256 | ||
|
|
f1628c70bc | ||
|
|
ebb7c45d1a | ||
|
|
ef77314d7a | ||
|
|
72520310e8 | ||
|
|
8e1c723b41 | ||
|
|
b26deb3bb2 | ||
|
|
e8e94744f0 | ||
|
|
98689fbbf8 | ||
|
|
6cccd32166 | ||
|
|
1b04524d68 | ||
|
|
1a6bbd756a | ||
|
|
836c39ff64 | ||
|
|
7781528263 | ||
|
|
2aaf37e9ee | ||
|
|
a28d5d15ce | ||
|
|
55dc1e17e6 | ||
|
|
826b56cabc | ||
|
|
9aa86fc703 | ||
|
|
4fe21ec6eb | ||
|
|
cb2181a80e | ||
|
|
eeb53eb0c4 | ||
|
|
887bc2c755 | ||
|
|
29d60c9af0 | ||
|
|
e0c579634b | ||
|
|
266d62831f | ||
|
|
d94351a8f1 | ||
|
|
31970c87c4 | ||
|
|
8e9dbe0248 | ||
|
|
3b1551be52 | ||
|
|
9d8e84ae5a | ||
|
|
c4d5109d5b | ||
|
|
59499333ff | ||
|
|
b5e0d10cb1 | ||
|
|
55b85183d5 | ||
|
|
38406b149a | ||
|
|
ef2dea20fe | ||
|
|
aac80606f2 | ||
|
|
7765d97cda | ||
|
|
3aa74bc427 | ||
|
|
902e7f6453 | ||
|
|
cecca729db | ||
|
|
2b2518b0b4 | ||
|
|
3c34765595 | ||
|
|
3f7815017e | ||
|
|
0d4809c18e | ||
|
|
052a3123aa | ||
|
|
f81bff512a | ||
|
|
2587db91be | ||
|
|
3b5d5e882b | ||
|
|
3c4e0d05c5 | ||
|
|
4be5b5dc45 | ||
|
|
9ff72366d5 | ||
|
|
7c354645b9 | ||
|
|
00d3f9a370 | ||
|
|
cd29eda949 | ||
|
|
1ed27f4052 | ||
|
|
57ecf3848b | ||
|
|
697e871c1b | ||
|
|
d5966ff198 | ||
|
|
3abd04426c | ||
|
|
8237a7e417 | ||
|
|
1607769551 | ||
|
|
a189516736 | ||
|
|
9c0e1abd15 | ||
|
|
ca9b3535a8 | ||
|
|
dddbfa315d | ||
|
|
c30990ecda | ||
|
|
fdb72c9d31 | ||
|
|
139facfb00 | ||
|
|
7536591ca4 | ||
|
|
c7592276f7 | ||
|
|
8ef68a5559 | ||
|
|
e46d3d9b65 | ||
|
|
62de63eda0 | ||
|
|
e786dbe5f5 | ||
|
|
d44f0ae7da | ||
|
|
4232de04ac | ||
|
|
bfacc2a98d | ||
|
|
d04327082d | ||
|
|
3097b54036 | ||
|
|
e2fa169832 | ||
|
|
3d6d08e2a1 | ||
|
|
5e8eeb1f20 | ||
|
|
8d61c7447b | ||
|
|
4117cca562 | ||
|
|
416b8ab95a | ||
|
|
d8f9323705 | ||
|
|
e3d47775fc | ||
|
|
a580c19dc0 | ||
|
|
8e0d4776af | ||
|
|
674abcf02e | ||
|
|
fbaa59ce3b | ||
|
|
72ff90defd | ||
|
|
1d29e7816a | ||
|
|
7b4862b442 | ||
|
|
b7b87f5530 | ||
|
|
fb62982000 | ||
|
|
64f50d4e49 | ||
|
|
fda1da03c8 | ||
|
|
8477fff988 | ||
|
|
5158ceb311 | ||
|
|
7e5e6ec78e | ||
|
|
0ea0f2e49a | ||
|
|
b1c2b204a1 | ||
|
|
52a0c45083 | ||
|
|
4de9de38ad | ||
|
|
215c19dcc7 | ||
|
|
b5b333c832 | ||
|
|
dfd7af92fa | ||
|
|
e00d5d33b2 | ||
|
|
5ae8156fa3 | ||
|
|
b107638b8b | ||
|
|
c4599f4889 | ||
|
|
580209f7ea | ||
|
|
abc755c058 | ||
|
|
035a8edebb | ||
|
|
c59b63d784 | ||
|
|
daf2a7d8e7 | ||
|
|
f549108e72 | ||
|
|
90667e9fa1 | ||
|
|
8bac8b7d37 | ||
|
|
bfffa1fff4 | ||
|
|
9f0290c0ec | ||
|
|
8a8a3c5a08 | ||
|
|
518747d503 | ||
|
|
5063b511ae | ||
|
|
fbe3f72fb1 | ||
|
|
872c0d3e15 | ||
|
|
9833918aac | ||
|
|
0000ec149c | ||
|
|
da3053f5fc | ||
|
|
5a0ff536a7 | ||
|
|
36f123ef25 | ||
|
|
01c2f02c86 | ||
|
|
4d702ec541 | ||
|
|
344cf6d709 | ||
|
|
14b3e8fc8f | ||
|
|
6d0daf6fe7 | ||
|
|
9b3507211f | ||
|
|
a406462549 | ||
|
|
897d7a253d | ||
|
|
b23c2ba3e3 | ||
|
|
705c715356 | ||
|
|
826ddba26f | ||
|
|
2492e8bda4 | ||
|
|
9e494ed8a5 | ||
|
|
1c8ac1f32a | ||
|
|
d0bb8c1c49 | ||
|
|
6c4503b0db | ||
|
|
a39b3a9921 | ||
|
|
8493ed369a | ||
|
|
2ded7e5e2b | ||
|
|
d9335c0b6c | ||
|
|
ebc5370052 | ||
|
|
0a96a23ca0 | ||
|
|
5b05a7ac71 | ||
|
|
31104eed4d | ||
|
|
0f2353aae6 | ||
|
|
d01b8aaab4 | ||
|
|
33f8e20f1b | ||
|
|
76d8396cb1 | ||
|
|
0f744e7cf2 | ||
|
|
5d990bdc19 | ||
|
|
1f2d70c720 | ||
|
|
76ffc99abd | ||
|
|
c9cbb64f12 | ||
|
|
c4722f7025 | ||
|
|
211e3fb4f0 | ||
|
|
ab0c2e70d5 | ||
|
|
3133b88346 | ||
|
|
b1479127e7 | ||
|
|
18c3b8cda5 | ||
|
|
38037c1174 | ||
|
|
593f2fd828 | ||
|
|
066afe4aa8 | ||
|
|
2df3e3557b | ||
|
|
f79e86dff6 | ||
|
|
244af5ea34 | ||
|
|
185ae66101 | ||
|
|
f09b372590 | ||
|
|
de4ec645b6 | ||
|
|
b1710c0fd6 | ||
|
|
be0784e4ad | ||
|
|
78baadfe95 | ||
|
|
2dade5039a | ||
|
|
36ec212671 | ||
|
|
bdbbed6265 | ||
|
|
007aa818ff | ||
|
|
001246fd10 | ||
|
|
76d7ef146c | ||
|
|
ae349462c6 | ||
|
|
972cefb074 | ||
|
|
30718e106e | ||
|
|
82133c5743 | ||
|
|
8fe788c98d | ||
|
|
684784c2b2 | ||
|
|
492eab91fc | ||
|
|
86ebbf6006 | ||
|
|
45e15e2edb | ||
|
|
1e358375c6 | ||
|
|
c3d0689d8a | ||
|
|
607191503c | ||
|
|
7ec05f16e5 | ||
|
|
b41bad5ea4 | ||
|
|
1e22b678e2 | ||
|
|
f88b0afa58 | ||
|
|
d7ece38279 | ||
|
|
722fc5e333 | ||
|
|
f05a9c9eb4 | ||
|
|
07c26a5ab8 | ||
|
|
8f5c8a5bd7 | ||
|
|
04246a55f2 | ||
|
|
b096199695 | ||
|
|
5de22c6de8 | ||
|
|
d7f73f4b9b | ||
|
|
d5ce81b20b | ||
|
|
905a823490 | ||
|
|
b195059fb6 | ||
|
|
460a7fa480 | ||
|
|
e65ab6e458 | ||
|
|
effc8ba5d1 | ||
|
|
014b54b1f7 | ||
|
|
a25ae124d7 | ||
|
|
372a7a90c5 | ||
|
|
9bd6e2cdf2 | ||
|
|
c2cc61e4d9 | ||
|
|
e3fa656f4f | ||
|
|
d7216b7ccc | ||
|
|
aaa61f7f75 | ||
|
|
ccfd2107f3 | ||
|
|
45ec96dd3c | ||
|
|
dd7739a8b2 | ||
|
|
ae0ef4d3f8 | ||
|
|
68d1ead44c | ||
|
|
09de87fd29 | ||
|
|
1a241121c4 |
@@ -3,7 +3,6 @@ BasedOnStyle: Google
|
||||
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignArrayOfStructures: Right
|
||||
AlignConsecutiveMacros: AcrossEmptyLinesAndComments
|
||||
AlignEscapedNewlines: LeftWithLastLine
|
||||
AlignOperands: AlignAfterOperator
|
||||
@@ -40,8 +39,10 @@ ColumnLimit: 120
|
||||
ConstructorInitializerIndentWidth: 2
|
||||
ContinuationIndentWidth: 4
|
||||
DerivePointerAlignment: false
|
||||
EmptyLineBeforeAccessModifier: Always
|
||||
IncludeBlocks: Preserve
|
||||
IndentAccessModifiers: false
|
||||
IndentCaseLabels: false
|
||||
IndentExternBlock: NoIndent
|
||||
InsertBraces: false
|
||||
InsertNewlineAtEOF: true
|
||||
@@ -49,6 +50,7 @@ LambdaBodyIndentation: OuterScope
|
||||
PackConstructorInitializers: CurrentLine
|
||||
PointerAlignment: Middle
|
||||
RemoveBracesLLVM: true
|
||||
RemoveSemicolon: true
|
||||
QualifierAlignment: Right
|
||||
SpacesInContainerLiterals: false
|
||||
Standard: Latest
|
||||
|
||||
8
.clang-format-ignore
Normal file
8
.clang-format-ignore
Normal file
@@ -0,0 +1,8 @@
|
||||
# Files that should not be formatted.
|
||||
./3party
|
||||
# A patched copy of the https://registry.khronos.org/OpenGL/api/GLES3/gl3.h
|
||||
./android/sdk/src/main/cpp/app/organicmaps/sdk/opengl/gl3stub.h
|
||||
# Formatting it leads to crashes in runtime. Newer protobuf may fix it.
|
||||
./libs/indexer/drules_struct.pb.cc
|
||||
# No need to format this 3party tool.
|
||||
tools/osmctools/*.c
|
||||
@@ -32,9 +32,6 @@ on:
|
||||
- track_generator/**
|
||||
- xcode/**
|
||||
|
||||
env:
|
||||
JAVA_HOME: /usr/lib/jvm/temurin-17-jdk-amd64 # Java 17 is required for Android Gradle 8 plugin
|
||||
|
||||
jobs:
|
||||
android-google-beta:
|
||||
name: Android Google Beta
|
||||
|
||||
@@ -34,9 +34,6 @@ on:
|
||||
- track_generator/**
|
||||
- xcode/**
|
||||
|
||||
env:
|
||||
JAVA_HOME: /usr/lib/jvm/temurin-17-jdk-amd64 # Java 17 is required for Android Gradle 8 plugin
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Android Lint
|
||||
|
||||
@@ -4,9 +4,6 @@ on:
|
||||
schedule:
|
||||
- cron: '0 5 * * 0' # Once per week at 05:00 UTC
|
||||
|
||||
env:
|
||||
JAVA_HOME: /usr/lib/jvm/temurin-17-jdk-amd64 # Java 17 is required for Android Gradle 8 plugin
|
||||
|
||||
jobs:
|
||||
precondition:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -2,9 +2,6 @@ name: Android Release Metadata
|
||||
on:
|
||||
workflow_dispatch: # Manual trigger
|
||||
|
||||
env:
|
||||
JAVA_HOME: /usr/lib/jvm/temurin-17-jdk-amd64 # Java 17 is required for Android Gradle 8 plugin
|
||||
|
||||
jobs:
|
||||
android-release-metadata:
|
||||
name: Upload Google Play metadata
|
||||
|
||||
@@ -5,7 +5,6 @@ on:
|
||||
env:
|
||||
RELEASE_NOTES: android/app/src/google/play/release-notes/en-US/default.txt
|
||||
FDROID_VERSION: android/app/src/fdroid/play/version.yaml
|
||||
JAVA_HOME: /usr/lib/jvm/temurin-17-jdk-amd64 # Java 17 is required for Android Gradle 8 plugin
|
||||
|
||||
jobs:
|
||||
tag:
|
||||
|
||||
@@ -3,20 +3,20 @@ on:
|
||||
workflow_dispatch: # Manual trigger
|
||||
pull_request:
|
||||
paths:
|
||||
- packaging/app.organicmaps.desktop.metainfo.xml
|
||||
- .forgejo/workflows/appstream-check.yaml # Run check on self change
|
||||
- packaging/app.comaps.comaps.metainfo.xml
|
||||
- .forgejo/workflows/appstream-check.yaml # Run check on self change
|
||||
|
||||
jobs:
|
||||
validate-appstream:
|
||||
name: Validate appstream metadata xml
|
||||
runs-on: ubuntu-24.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
sparse-checkout: |
|
||||
packaging/app.organicmaps.desktop.metainfo.xml
|
||||
packaging/app.comaps.comaps.metainfo.xml
|
||||
|
||||
- name: Install appstream validator and flatpak Builder
|
||||
shell: bash
|
||||
@@ -29,8 +29,8 @@ jobs:
|
||||
|
||||
- name: Lint appstream data with flatpak Builder
|
||||
shell: bash
|
||||
run: flatpak run --command=flatpak-builder-lint org.flatpak.Builder appstream packaging/app.organicmaps.desktop.metainfo.xml
|
||||
run: flatpak run --command=flatpak-builder-lint org.flatpak.Builder appstream packaging/app.comaps.comaps.metainfo.xml
|
||||
|
||||
- name: Run appstreamcli in pedantic mode
|
||||
shell: bash
|
||||
run: flatpak run --command=appstreamcli org.flatpak.Builder validate --pedantic packaging/app.organicmaps.desktop.metainfo.xml
|
||||
run: flatpak run --command=appstreamcli org.flatpak.Builder validate --pedantic packaging/app.comaps.comaps.metainfo.xml
|
||||
|
||||
@@ -33,7 +33,7 @@ concurrency:
|
||||
jobs:
|
||||
should-run-check:
|
||||
name: Should run coverage
|
||||
runs-on: ubuntu-24.04
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
run-from-pr: ${{ steps.run-from-pr.outputs.run-from-pr }}
|
||||
manually-triggered: ${{ steps.manually-triggered.outputs.manually-triggered }}
|
||||
@@ -59,14 +59,9 @@ jobs:
|
||||
coverage:
|
||||
needs: should-run-check
|
||||
name: Generate coverage report
|
||||
runs-on: ubuntu-24.04
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ needs.should-run-check.outputs.run-from-pr == 'true' || needs.should-run-check.outputs.manually-triggered == 'true'}}
|
||||
steps:
|
||||
- name: Free disk space by removing .NET, Android and Haskell
|
||||
shell: bash
|
||||
run: |
|
||||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
name: dco
|
||||
name: DCO
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: codeberg-tiny
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://github.com/KineticCafe/actions-dco@v1
|
||||
- name: Check for Developer Certificate of Origin (DCO) compliance
|
||||
uses: https://github.com/KineticCafe/actions-dco@fb284c903a7673a3d4b0bdd104479a6f0d46dae7 # v1.3.6
|
||||
|
||||
@@ -3,20 +3,20 @@ on:
|
||||
workflow_dispatch: # Manual trigger
|
||||
pull_request:
|
||||
paths:
|
||||
- qt/res/app.organicmaps.desktop.desktop
|
||||
- .forgejo/workflows/desktop-file-check.yaml # Run check on self change
|
||||
- qt/res/linux/app.comaps.comaps.desktop
|
||||
- .forgejo/workflows/desktop-file-check.yaml # Run check on self change
|
||||
|
||||
jobs:
|
||||
validate-desktop-file:
|
||||
name: Validate .desktop file
|
||||
runs-on: ubuntu-24.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
sparse-checkout: |
|
||||
qt/res/app.organicmaps.desktop.desktop
|
||||
qt/res/linux/app.comaps.comaps.desktop
|
||||
|
||||
- name: Install desktop-file-validate tool
|
||||
shell: bash
|
||||
@@ -27,4 +27,4 @@ jobs:
|
||||
|
||||
- name: Validate desktop file
|
||||
shell: bash
|
||||
run: desktop-file-validate qt/res/app.organicmaps.desktop.desktop && echo "Successfully validated .desktop file"
|
||||
run: desktop-file-validate qt/res/linux/app.comaps.comaps.desktop && echo "Successfully validated .desktop file"
|
||||
|
||||
@@ -66,6 +66,10 @@ jobs:
|
||||
CERTIFICATES_DEV_P12: ${{ secrets.CERTIFICATES_DEV_P12 }}
|
||||
CERTIFICATES_DISTR_P12: ${{ secrets.CERTIFICATES_DISTR_P12 }}
|
||||
|
||||
- name: Configure repository
|
||||
shell: bash
|
||||
run: ./configure.sh
|
||||
|
||||
- name: Compile and upload to TestFlight
|
||||
run: |
|
||||
echo "IOS_VERSION=$(../tools/unix/version.sh ios_version)-$(../tools/unix/version.sh ios_build)" >> "$GITHUB_ENV"
|
||||
|
||||
@@ -59,6 +59,10 @@ jobs:
|
||||
shell: bash
|
||||
run: git submodule update --depth 1 --init --recursive --jobs=$(($(sysctl -n hw.logicalcpu) * 20))
|
||||
|
||||
- name: Configure repository
|
||||
shell: bash
|
||||
run: ./configure.sh
|
||||
|
||||
- name: Configure XCode cache
|
||||
uses: irgaly/xcode-cache@v1
|
||||
with:
|
||||
|
||||
@@ -31,18 +31,13 @@ on:
|
||||
jobs:
|
||||
linux-no-unity:
|
||||
name: Linux no unity build
|
||||
runs-on: ubuntu-24.04
|
||||
runs-on: ubuntu-latest
|
||||
# Cancels previous jobs if the same branch or PR was updated again.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-no-unity-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
steps:
|
||||
- name: Free disk space by removing .NET, Android and Haskell
|
||||
shell: bash
|
||||
run: |
|
||||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -95,7 +90,7 @@ jobs:
|
||||
|
||||
linux-matrix:
|
||||
name: Linux builds and tests
|
||||
runs-on: ubuntu-24.04
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -107,11 +102,6 @@ jobs:
|
||||
cancel-in-progress: true
|
||||
|
||||
steps:
|
||||
- name: Free disk space by removing .NET, Android and Haskell
|
||||
shell: bash
|
||||
run: |
|
||||
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -143,6 +133,14 @@ jobs:
|
||||
with:
|
||||
key: ${{ github.workflow }}-unity-${{ matrix.compiler.CC }}-${{ matrix.CMAKE_BUILD_TYPE }}
|
||||
|
||||
- name: Configure repository
|
||||
shell: bash
|
||||
env:
|
||||
SKIP_MAP_DOWNLOAD: 1
|
||||
SKIP_GENERATE_SYMBOLS: 1
|
||||
SKIP_GENERATE_DRULES: 1
|
||||
run: ./configure.sh
|
||||
|
||||
- name: CMake
|
||||
shell: bash
|
||||
env:
|
||||
|
||||
5
.github/workflows/android-check.yaml
vendored
5
.github/workflows/android-check.yaml
vendored
@@ -23,6 +23,10 @@ jobs:
|
||||
shell: bash
|
||||
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
|
||||
|
||||
- name: Configure repository
|
||||
shell: bash
|
||||
run: SKIP_GENERATE_SYMBOLS=1 ./configure.sh
|
||||
|
||||
- name: Lint
|
||||
shell: bash
|
||||
working-directory: android
|
||||
@@ -62,6 +66,7 @@ jobs:
|
||||
libxinerama-dev \
|
||||
libxcursor-dev \
|
||||
libxi-dev \
|
||||
python3-protobuf \
|
||||
zlib1g-dev
|
||||
|
||||
- name: Checkout sources
|
||||
|
||||
43
.github/workflows/clang-format.yaml
vendored
43
.github/workflows/clang-format.yaml
vendored
@@ -1,43 +0,0 @@
|
||||
name: clang-format
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'android/app/src/**.java'
|
||||
- '.clang-format'
|
||||
- '.github/workflows/clang-format.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'android/app/src/**.java'
|
||||
- '.clang-format'
|
||||
- '.github/workflows/clang-format.yml'
|
||||
|
||||
jobs:
|
||||
check-formatting:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true # TODO(AB): Remove this line when ready to enforce formatting.
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install clang-format
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang-format-19
|
||||
clang-format-19 --version
|
||||
|
||||
- name: Check Java formatting
|
||||
run: |
|
||||
JAVA_FILES=($(find android/app/src -name '*.java'))
|
||||
|
||||
FORMATTING_ISSUES=$(clang-format-19 --dry-run --Werror $JAVA_FILES 2>&1 || true)
|
||||
|
||||
if [ -n "$FORMATTING_ISSUES" ]; then
|
||||
echo "$FORMATTING_ISSUES"
|
||||
echo ""
|
||||
echo "To fix formatting, please run:"
|
||||
echo " clang-format -i <file>"
|
||||
exit 1
|
||||
fi
|
||||
51
.github/workflows/code-style-check.yaml
vendored
Normal file
51
.github/workflows/code-style-check.yaml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
name: Code style check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths: # Should stay in sync with tools/unix/clang-format.sh
|
||||
- '.github/workflows/code-style-check.yaml'
|
||||
- 'android/app/src/**.java'
|
||||
- 'android/sdk/src/**.java'
|
||||
- 'android/sdk/src/main/cpp/**.[ch]pp'
|
||||
- 'dev_sandbox/**.[ch]pp'
|
||||
- 'generator/**.[ch]pp'
|
||||
- 'iphone/**.[ch]pp'
|
||||
- 'iphone/**.[hm]'
|
||||
- 'iphone/**.mm'
|
||||
- 'libs/**.[ch]pp'
|
||||
- 'libs/**.[hm]'
|
||||
- '!libs/indexer/drules_struct.pb.h'
|
||||
- 'libs/**.mm'
|
||||
- 'qt/**.[ch]pp'
|
||||
- 'qt/**.h'
|
||||
- 'tools/**.[ch]pp'
|
||||
- '.clang-format'
|
||||
- '.clang-format-ignore'
|
||||
|
||||
jobs:
|
||||
code-style-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install clang-format
|
||||
run: |
|
||||
sudo apt purge -y clang-format-18 # Remove default old version of clang-format
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
echo 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main' | sudo tee /etc/apt/sources.list.d/llvm-toolchain-noble-20.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang-format-20
|
||||
sudo update-alternatives --force --install /usr/bin/clang-format clang-format /usr/bin/clang-format-20 10
|
||||
sudo update-alternatives --force --install /usr/bin/git-clang-format git-clang-format /usr/bin/git-clang-format-20 10
|
||||
clang-format --version
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check code style
|
||||
run: tools/unix/clang-format.sh
|
||||
|
||||
- name: Post clang-format comments
|
||||
if: failure()
|
||||
uses: reviewdog/action-suggester@v1.21.0
|
||||
with:
|
||||
tool_name: clang-format
|
||||
fail_level: error
|
||||
5
.github/workflows/ios-check.yaml
vendored
5
.github/workflows/ios-check.yaml
vendored
@@ -30,6 +30,7 @@ jobs:
|
||||
run: |
|
||||
brew install qt \
|
||||
optipng
|
||||
pip3 install "protobuf<3.21" --break-system-packages
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -37,6 +38,10 @@ jobs:
|
||||
shell: bash
|
||||
run: git submodule update --depth 1 --init --recursive --jobs=$(($(sysctl -n hw.logicalcpu) * 20))
|
||||
|
||||
- name: Configure repository
|
||||
shell: bash
|
||||
run: ./configure.sh
|
||||
|
||||
- name: Configure XCode cache
|
||||
uses: irgaly/xcode-cache@v1
|
||||
with:
|
||||
|
||||
25
.gitignore
vendored
25
.gitignore
vendored
@@ -14,20 +14,26 @@ stxxl.errlog
|
||||
stxxl.log
|
||||
screenlog.0
|
||||
|
||||
data/styles/*/*/out/*
|
||||
data/resources-*_design/*
|
||||
# symbols png/sdf are now generated at build
|
||||
data/resources-*_*/symbols.png
|
||||
data/resources-*_*/symbols.sdf
|
||||
data/drules_proto_default_design.bin
|
||||
data/colors_design.txt
|
||||
data/patterns_design.txt
|
||||
data/symbols/**/symbols.png
|
||||
data/symbols/**/symbols.sdf
|
||||
|
||||
data/bookmarks
|
||||
data/edits.xml
|
||||
data/World.mwm
|
||||
data/WorldCoasts.mwm
|
||||
data/world_mwm/*
|
||||
data/*_hash
|
||||
data/drules_proto*
|
||||
data/classificator.txt*
|
||||
data/types.txt*
|
||||
data/visibility.txt*
|
||||
data/colors.txt*
|
||||
data/patterns.txt*
|
||||
# TODO: designer is not used at the moment
|
||||
# data/symbols/*/design/
|
||||
# data/colors_design.txt
|
||||
# data/patterns_design.txt
|
||||
|
||||
# Compiled Python
|
||||
*.pyc
|
||||
@@ -46,10 +52,9 @@ omim.sdf
|
||||
*.suo
|
||||
*.aps
|
||||
*.rc
|
||||
!qt/res/windows.rc
|
||||
!qt/res/windows/windows.rc
|
||||
*.pdb
|
||||
out/*
|
||||
qt/mapswithme.log
|
||||
out/
|
||||
|
||||
# XCode
|
||||
xcode/keys/*
|
||||
|
||||
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -65,3 +65,7 @@
|
||||
[submodule "3party/imgui/imgui"]
|
||||
path = 3party/imgui/imgui
|
||||
url = https://github.com/ocornut/imgui
|
||||
[submodule "3party/glaze"]
|
||||
path = 3party/glaze
|
||||
url = https://github.com/stephenberry/glaze
|
||||
branch = main
|
||||
|
||||
@@ -57,6 +57,7 @@ endif()
|
||||
|
||||
add_subdirectory(agg)
|
||||
add_subdirectory(bsdiff-courgette)
|
||||
add_subdirectory(glaze)
|
||||
add_subdirectory(minizip)
|
||||
add_subdirectory(open-location-code)
|
||||
add_subdirectory(opening_hours)
|
||||
|
||||
Submodule 3party/Vulkan-Headers updated: 595c8d4794...f69f0433ba
@@ -4,7 +4,9 @@ set(FT_DISABLE_HARFBUZZ ON)
|
||||
add_subdirectory(freetype)
|
||||
|
||||
# Fix warning with ONE_PIXEL macro clash.
|
||||
target_compile_options(freetype PRIVATE -Wno-macro-redefined)
|
||||
if(NOT MSVC)
|
||||
target_compile_options(freetype PRIVATE -Wno-macro-redefined)
|
||||
endif()
|
||||
|
||||
# Use ft2build.h from the current directory instead of the default.
|
||||
target_include_directories(freetype
|
||||
|
||||
1
3party/glaze
Submodule
1
3party/glaze
Submodule
Submodule 3party/glaze added at 5a58d7936e
@@ -11,14 +11,23 @@ target_include_directories(${PROJECT_NAME}
|
||||
harfbuzz/src
|
||||
)
|
||||
|
||||
# Keep these settigns in sync with xcode/harfbuzz project.
|
||||
target_compile_options(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
-fno-rtti
|
||||
-fno-exceptions
|
||||
-fno-threadsafe-statics
|
||||
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-format-pedantic>
|
||||
)
|
||||
if (MSVC)
|
||||
target_compile_options(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
/GR-
|
||||
/EHsc-
|
||||
/Zc:threadSafeInit-
|
||||
)
|
||||
else()
|
||||
# Keep these settings in sync with xcode/harfbuzz project.
|
||||
target_compile_options(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
-fno-rtti
|
||||
-fno-exceptions
|
||||
-fno-threadsafe-statics
|
||||
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-format-pedantic>
|
||||
)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
@@ -28,14 +37,20 @@ target_compile_definitions(${PROJECT_NAME}
|
||||
#$<$<BOOL:${APPLE}>:HAVE_CORETEXT>
|
||||
HAVE_ATEXIT
|
||||
HAVE_GETPAGESIZE
|
||||
HAVE_MMAP
|
||||
HAVE_MPROTECT
|
||||
HAVE_PTHREAD
|
||||
HAVE_SYSCONF
|
||||
HAVE_SYS_MMAN_H
|
||||
HAVE_UNISTD_H
|
||||
)
|
||||
|
||||
if (NOT MSVC)
|
||||
target_compile_definitions(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
HAVE_MMAP
|
||||
HAVE_PTHREAD
|
||||
HAVE_SYS_MMAN_H
|
||||
HAVE_UNISTD_H
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} Freetype::Freetype)
|
||||
|
||||
add_library(harfbuzz::harfbuzz ALIAS harfbuzz)
|
||||
|
||||
@@ -172,6 +172,7 @@ add_library(icuuc
|
||||
icu/icu4c/source/common/uvector.cpp
|
||||
icu/icu4c/source/common/uvectr32.cpp
|
||||
icu/icu4c/source/common/uvectr64.h
|
||||
icu/icu4c/source/common/wintz.cpp
|
||||
icu/icu4c/source/common/wintz.h
|
||||
)
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ set(SRC
|
||||
protobuf/src/google/protobuf/message_lite.cc
|
||||
protobuf/src/google/protobuf/repeated_field.cc
|
||||
protobuf/src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc
|
||||
protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc
|
||||
protobuf/src/google/protobuf/stubs/bytestream.cc
|
||||
protobuf/src/google/protobuf/stubs/common.cc
|
||||
protobuf/src/google/protobuf/stubs/int128.cc
|
||||
|
||||
Submodule 3party/protobuf/protobuf updated: a6189acd18...9442c12e86
@@ -7,7 +7,6 @@
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/utility.hpp>
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
#include <boost/iostreams/device/mapped_file.hpp>
|
||||
|
||||
#include "mappable_vector.hpp"
|
||||
|
||||
@@ -283,12 +282,6 @@ namespace succinct { namespace mapper {
|
||||
return mapper.bytes_read();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
size_t map(T& val, boost::iostreams::mapped_file_source const& m, uint64_t flags = 0, const char* friendly_name = "<TOP>")
|
||||
{
|
||||
return map(val, m.data(), flags, friendly_name);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
uint64_t size_of(T& val)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/iostreams/device/mapped_file.hpp>
|
||||
|
||||
namespace succinct { namespace util {
|
||||
|
||||
@@ -205,29 +204,6 @@ namespace succinct { namespace util {
|
||||
std::string m_cur_value;
|
||||
};
|
||||
|
||||
struct mmap_lines
|
||||
{
|
||||
typedef buffer_line_iterator iterator;
|
||||
typedef buffer_line_iterator const_iterator;
|
||||
|
||||
mmap_lines(std::string filename)
|
||||
: m_map(filename)
|
||||
{}
|
||||
|
||||
const_iterator begin() const
|
||||
{
|
||||
return const_iterator(m_map.data(), m_map.size());
|
||||
}
|
||||
|
||||
const_iterator end() const
|
||||
{
|
||||
return const_iterator();
|
||||
}
|
||||
|
||||
private:
|
||||
boost::iostreams::mapped_file_source m_map;
|
||||
};
|
||||
|
||||
struct input_error : std::invalid_argument
|
||||
{
|
||||
input_error(std::string const& what)
|
||||
|
||||
@@ -19,7 +19,18 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include "vulkan_wrapper.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
int InitVulkan(void) {
|
||||
#if defined(__APPLE__)
|
||||
@@ -30,6 +41,9 @@ int InitVulkan(void) {
|
||||
if (!libvulkan) {
|
||||
libvulkan = dlopen("libMoltenVK.dylib", RTLD_NOW | RTLD_LOCAL);
|
||||
}
|
||||
#elif defined( _WIN32 )
|
||||
HMODULE libvulkan = LoadLibraryA("vulkan-1.dll");
|
||||
auto dlsym = [](HMODULE h, char const * name) { return GetProcAddress(h, name); };
|
||||
#else
|
||||
void* libvulkan = dlopen("libvulkan.so.1", RTLD_NOW | RTLD_LOCAL);
|
||||
if (!libvulkan) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.22.1)
|
||||
|
||||
project(omim C CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_C_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_C_STANDARD 23)
|
||||
# Our code does not rely on gnu extensions.
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_C_EXTENSIONS OFF)
|
||||
@@ -38,18 +39,16 @@ if (APPLE AND NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android))
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/21963
|
||||
enable_language(OBJC)
|
||||
set(CMAKE_OBJC_EXTENSIONS OFF)
|
||||
set(CMAKE_OBJC_STANDARD 11)
|
||||
set(CMAKE_OBJC_STANDARD 23)
|
||||
set(CMAKE_OBJC_FLAGS -fobjc-arc)
|
||||
set(CMAKE_OBJC_VISIBILITY_PRESET hidden)
|
||||
enable_language(OBJCXX)
|
||||
set(CMAKE_OBJCXX_EXTENSIONS OFF)
|
||||
set(CMAKE_OBJCXX_STANDARD 20)
|
||||
set(CMAKE_OBJCXX_STANDARD 23)
|
||||
set(CMAKE_OBJCXX_FLAGS -fobjc-arc)
|
||||
set(CMAKE_OBJCXX_VISIBILITY_PRESET hidden)
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND "./configure.sh" WORKING_DIRECTORY ${OMIM_ROOT})
|
||||
|
||||
message(STATUS "Using compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
|
||||
|
||||
if (CMAKE_UNITY_BUILD)
|
||||
@@ -86,7 +85,7 @@ if (MSVC)
|
||||
add_compile_options(/utf-8)
|
||||
add_link_options(/INCREMENTAL:NO)
|
||||
else()
|
||||
add_compile_options(-ffast-math)
|
||||
add_compile_options(-ffast-math $<$<CXX_COMPILER_ID:GNU>:-Wno-psabi>)
|
||||
endif()
|
||||
|
||||
if (PLATFORM_WIN)
|
||||
@@ -105,7 +104,7 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
||||
elseif (${CMAKE_BUILD_TYPE} MATCHES "Rel")
|
||||
add_definitions(-DRELEASE)
|
||||
if (NOT MSVC)
|
||||
add_compile_options(-Ofast $<$<CXX_COMPILER_ID:GNU>:-flto=auto>) # Also enables -ffast-math
|
||||
add_compile_options(-O3 $<$<CXX_COMPILER_ID:GNU>:-flto=auto>)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE})
|
||||
@@ -184,7 +183,7 @@ if (NOT PLATFORM_IPHONE AND NOT PLATFORM_ANDROID)
|
||||
endif()
|
||||
|
||||
# To allow #include "base/file_name.hpp" in all sources.
|
||||
include_directories(${CMAKE_HOME_DIRECTORY})
|
||||
include_directories("${CMAKE_HOME_DIRECTORY}" "${CMAKE_HOME_DIRECTORY}/libs" "${CMAKE_HOME_DIRECTORY}/tools")
|
||||
|
||||
if (USE_PCH)
|
||||
message(STATUS "Precompiled headers are ON")
|
||||
@@ -196,7 +195,7 @@ if (USE_PCH)
|
||||
endif()
|
||||
|
||||
# Should be on the root level, not in 3party, so tests can get these dependencies.
|
||||
if (PLATFORM_LINUX OR PLATFORM_WIN)
|
||||
if (PLATFORM_LINUX)
|
||||
find_package(ICU COMPONENTS uc i18n data REQUIRED)
|
||||
find_package(Freetype REQUIRED)
|
||||
find_package(harfbuzz REQUIRED)
|
||||
@@ -226,49 +225,22 @@ endif()
|
||||
# Used in qt/ and shaders/
|
||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||
|
||||
add_subdirectory(base)
|
||||
add_subdirectory(coding)
|
||||
add_subdirectory(descriptions)
|
||||
add_subdirectory(drape)
|
||||
add_subdirectory(drape_frontend)
|
||||
add_subdirectory(editor)
|
||||
add_subdirectory(ge0)
|
||||
add_subdirectory(generator/mwm_diff)
|
||||
add_subdirectory(geometry)
|
||||
add_subdirectory(indexer)
|
||||
add_subdirectory(kml)
|
||||
add_subdirectory(map)
|
||||
add_subdirectory(cppjansson)
|
||||
add_subdirectory(platform)
|
||||
add_subdirectory(routing)
|
||||
add_subdirectory(routing_common)
|
||||
add_subdirectory(search)
|
||||
add_subdirectory(shaders)
|
||||
add_subdirectory(storage)
|
||||
add_subdirectory(tracking)
|
||||
add_subdirectory(traffic)
|
||||
add_subdirectory(transit)
|
||||
add_subdirectory(libs)
|
||||
|
||||
if (PLATFORM_DESKTOP)
|
||||
omim_add_tool_subdirectory(feature_list)
|
||||
add_subdirectory(dev_sandbox)
|
||||
add_subdirectory(generator)
|
||||
add_subdirectory(openlr)
|
||||
add_subdirectory(poly_borders)
|
||||
omim_add_tool_subdirectory(topography_generator)
|
||||
add_subdirectory(track_analyzing)
|
||||
omim_add_tool_subdirectory(track_generator)
|
||||
add_subdirectory(tools)
|
||||
if (NOT SKIP_QT_GUI)
|
||||
add_subdirectory(qt)
|
||||
omim_add_tool_subdirectory(skin_generator)
|
||||
endif()
|
||||
if (GENERATOR_TOOL)
|
||||
add_compile_options(-march=native -mtune=native)
|
||||
message(STATUS "target CPU optimizations enabled, produced binaries will NOT work on a different CPU")
|
||||
endif()
|
||||
add_subdirectory(dev_sandbox)
|
||||
endif()
|
||||
|
||||
omim_add_test_subdirectory(qt_tstfrm)
|
||||
omim_add_test_subdirectory(libs/qt_tstfrm)
|
||||
|
||||
if (PLATFORM_ANDROID)
|
||||
add_subdirectory(android/sdk/src/main/cpp)
|
||||
|
||||
@@ -1 +1 @@
|
||||
See [docs/INSTALL.md](docs/INSTALL.md)
|
||||
See [docs/INSTALL.md](docs/INSTALL.md)
|
||||
|
||||
23
README.md
23
README.md
@@ -19,20 +19,20 @@
|
||||
</div>
|
||||
<div align="center">
|
||||
<p align="center">
|
||||
<a href="https://codeberg.org/comaps/comaps/releases">
|
||||
<img src="https://img.shields.io/github/license/comaps/comaps?style=for-the-badge&logo=opensourceinitiative&logoColor=white&color=588157" alt="License" style="width: 90%; max-width: 150px;"/>
|
||||
<a href="https://codeberg.org/comaps/comaps/src/branch/main/LICENSE">
|
||||
<img src="https://img.shields.io/github/license/comaps/comaps?style=for-the-badge&logo=opensourceinitiative&logoColor=white&color=588157" alt="License"/>
|
||||
</a>
|
||||
<a href="https://github.com/comaps/comaps/actions/workflows/android-check.yaml">
|
||||
<img src="https://img.shields.io/github/actions/workflow/status/comaps/comaps/.github/workflows/android-check.yaml?label=Android%20Build&logo=android&logoColor=white&style=for-the-badge&color=588157" alt="Android Build Status" style="width: 90%; max-width: 170px;"/>
|
||||
<img src="https://img.shields.io/github/actions/workflow/status/comaps/comaps/.github/workflows/android-check.yaml?label=Android%20Build&logo=android&logoColor=white&style=for-the-badge&color=588157" alt="Android Build Status"/>
|
||||
</a>
|
||||
<a href="https://github.com/comaps/comaps/actions/workflows/ios-check.yaml">
|
||||
<img src="https://img.shields.io/github/actions/workflow/status/comaps/comaps/.github/workflows/ios-check.yaml?label=iOS%20Build&logo=apple&logoColor=white&style=for-the-badge&color=588157" alt="iOS Build Status" style="width: 90%; max-width: 145px;"/>
|
||||
<img src="https://img.shields.io/github/actions/workflow/status/comaps/comaps/.github/workflows/ios-check.yaml?label=iOS%20Build&logo=apple&logoColor=white&style=for-the-badge&color=588157" alt="iOS Build Status"/>
|
||||
</a>
|
||||
<a href="https://opencollective.com/comaps">
|
||||
<img src="https://img.shields.io/opencollective/all/comaps?label=Open%20Collective%20Donors&logo=opencollective&logoColor=white&style=for-the-badge&color=588157" alt="Open Collective Donors" style="width: 90%; max-width: 191px;"/>
|
||||
<img src="https://img.shields.io/opencollective/all/comaps?label=Open%20Collective%20Donors&logo=opencollective&logoColor=white&style=for-the-badge&color=588157" alt="Open Collective Donors"/>
|
||||
</a>
|
||||
<a href="https://liberapay.com/CoMaps">
|
||||
<img src="https://img.shields.io/liberapay/patrons/CoMaps.svg?label=Liberapay%20Patrons&logo=liberapay&logoColor=white&style=for-the-badge&color=588157" alt="Liberapay Patrons" style="width: 90%; max-width: 160px;"/>
|
||||
<img src="https://img.shields.io/liberapay/patrons/CoMaps.svg?label=Liberapay%20Patrons&logo=liberapay&logoColor=white&style=for-the-badge&color=588157" alt="Liberapay Patrons"/>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
@@ -41,8 +41,6 @@
|
||||
|
||||
A community-led free & open source maps app based on [OpenStreetMap](https://www.openstreetmap.org), built for transparency, privacy, and not-for-profit values. A fork of Organic Maps, originally based on Maps.ME.
|
||||
|
||||
**Available for:** Android, iOS, ARM macOS, and alpha Linux/macOS desktop builds (also usable on Linux phones).
|
||||
|
||||
<p align="center">
|
||||
<a href="https://apps.apple.com/app/comaps/id6747180809">
|
||||
<img src="docs/badges/apple-appstore.png" alt="App Store" width="160"/>
|
||||
@@ -77,9 +75,10 @@ A community-led free & open source maps app based on [OpenStreetMap](https://www
|
||||
## ⚡️ Highlights
|
||||
|
||||
- **Offline-first**: Navigate without a connection
|
||||
- **Privacy-respecting**: No tracking, Ads or data collection
|
||||
- **Privacy-respecting**: No tracking, ads or data collection
|
||||
- **Lightweight**: Battery- and space-efficient
|
||||
- **Simple**: Polished, user-focused interface
|
||||
- **Cross-platform**: Available for Android, iOS, MacOS, and Linux.
|
||||
- **Community-built**: Free, open source, and collaborative
|
||||
- **Transparent**: Open finances and governance
|
||||
|
||||
@@ -125,10 +124,8 @@ You can help by donating, contributing code, translating, or by telling others a
|
||||
|
||||
- Build instructions: [docs/INSTALL.md](docs/INSTALL.md)
|
||||
- Contribution guide: [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md)
|
||||
> [!NOTE]
|
||||
> Some docs might be outdated, contain broken links or old references to Organic Maps, etc. Its a work in progress and help is much appreciated!
|
||||
|
||||
There is a dedicated Zulip chat for active contributors: [Zulip](https://comaps.zulipchat.com)
|
||||
There is a dedicated [Zulip](https://codeberg.org/comaps/Governance/src/branch/main/contribute.md#3-team-messaging) chat for active contributors.
|
||||
|
||||
---
|
||||
|
||||
@@ -142,7 +139,7 @@ There is a dedicated Zulip chat for active contributors: [Zulip](https://comaps.
|
||||
|
||||
## 💸 Funding
|
||||
|
||||
CoMaps is free. To stay that way, it relies on your support.
|
||||
CoMaps is free. To fund development, we rely on your voluntary support ♥️
|
||||
Donate via [OpenCollective](https://opencollective.com/comaps/donate) or [Liberapay](https://liberapay.com/CoMaps).
|
||||
The project's financial information is completely open and transparent at [our Open Collective](https://opencollective.com/comaps).
|
||||
|
||||
|
||||
@@ -138,8 +138,6 @@ android {
|
||||
disable 'MissingTranslation'
|
||||
// https://github.com/organicmaps/organicmaps/issues/3551
|
||||
disable 'MissingQuantity', 'UnusedQuantity'
|
||||
// https://github.com/organicmaps/organicmaps/issues/3550
|
||||
disable 'ByteOrderMark'
|
||||
// https://github.com/organicmaps/organicmaps/issues/1077
|
||||
disable 'CustomSplashScreen'
|
||||
// https://github.com/organicmaps/organicmaps/issues/3610
|
||||
|
||||
1
android/app/src/fdroid/java/app/organicmaps/location
Symbolic link
1
android/app/src/fdroid/java/app/organicmaps/location
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../google/java/app/organicmaps/location
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../google/java/app/organicmaps/sdk/location
|
||||
@@ -0,0 +1,7 @@
|
||||
• Data OpenStreetMap k 4. 8.
|
||||
• vylepšené barvy mapy pro vodu, lesy, křoviny, různé vybavení, pěší zóny atd.
|
||||
• přidány stanice lesní stráže, krytých parkovišť pro jízdní kola, únikových her, úschoven zavazadel, partnerských pošt
|
||||
• vylepšeny výškové vrstevnice na 20 m pro některé oblíbené turistické oblasti
|
||||
• podpora více zkratek a aliasů pro vyhledávání
|
||||
• přidání ikon pro vyhledávání a záložky pro rychlé občerstvení, jízdní kola a dobíjecí stanice
|
||||
• plynulejší pohyb šipky pro určení polohy
|
||||
@@ -1,9 +1,7 @@
|
||||
Wir stellen vor: Das neue CoMaps-Logo!
|
||||
• Verbesserte Höhenlinien in vielen Regionen (Stufen von 20/50 m)
|
||||
• Links zu Panoramax-Bildern für ausgewählte POIs
|
||||
• OpenStreetMap-Daten vom 13. Juli
|
||||
• Neue Farben für viele Objekte und Farben werden früher angezeigt
|
||||
• Öffnungszeiten werden beim Antippen eines POI angezeigt
|
||||
• Verschiedene Arten von Feuchtgebieten
|
||||
• Neue Farben für Vegetation und andere Features; einige neue Icons
|
||||
• Wandern: bessere Darstellung der Höhenlinien
|
||||
• OpenStreetMap-Daten vom 4. August
|
||||
• Verbesserte Farben für Wasser, Wälder, Gestrüpp, verschiedene Einrichtungen, Fussgängerbereiche etc.
|
||||
• Besucherstationen, überdachte Fahrradparkplätze, Escaperooms, Gepäckschließfächer, und Postpartner hinzugefügt
|
||||
• Konturhöhenlinien aktualisiert, bis zu 20m für beliebte Wanderregionen
|
||||
• Unterstützung für mehr Such-Abkürzungen und Synonyme
|
||||
• Such- und Lesezeichen-Symbole für Fast Food, Rad- und Lade-Stationen
|
||||
• Der Positionspfeil bewegt sich gleichmässiger
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
Introducing CoMaps logo!
|
||||
|
||||
• upgrade altitude contour lines for many regions to 20 or 50 meters step
|
||||
• add Panoramax Picture links to selected POIs
|
||||
• OpenStreetMap data as of July 13
|
||||
• add color fills to many features and display fills earlier for existing features
|
||||
• display opening hours state when selecting a POI
|
||||
• split all wetlands into several distinct types
|
||||
• update vegetation and other map colors, update some map icons
|
||||
• outdoors: bolder altitude contour lines
|
||||
• OpenStreetMap data as of August 4
|
||||
• improve map colors for water, forests, scrubs, various amenities, pedestrian areas etc.
|
||||
• add ranger stations, covered bicycle parkings, escape games, luggage lockers, post office partners
|
||||
• upgrade altitude contour lines to 20m step for some popular hiking regions
|
||||
• support more search abbreviations and aliases
|
||||
• add search and bookmark icons for fast food, bicycle and charging stations
|
||||
• more smooth position arrow movements
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
¡Presentamos el logo de CoMaps!
|
||||
• mejora de isolíneas con más detalle para muchas regiones
|
||||
• añade enlaces de imágenes de Panoramax a POIs seleccionados
|
||||
• datos de OpenStreetMap a 13 de julio
|
||||
• añadidos rellenos de color a muchas características
|
||||
• se muestra el estado de horarios de apertura al seleccionar un POI
|
||||
• se dividen los humedales en tipos distintos
|
||||
• se actualiza la vegetación y otros colores del mapa, así como otros iconos
|
||||
• exteriores: líneas de contorno de altitud más gruesas
|
||||
• Datos de OpenStreetMap a fecha 2025.08.04
|
||||
• Mejora de colores del mapa para agua, bosques, matorrales, servicios, zonas peatonales, etc.
|
||||
• Añadidas estaciones de guardabosques, aparcamientos cubiertos de bicis, juegos de escape, consignas y oficinas de correo
|
||||
• Nuevas curvas de nivel (20 m) en regiones populares para senderismo
|
||||
• Más abreviaturas y alias de búsqueda
|
||||
• Iconos de búsqueda y marcadores para comida rápida, bicicletas y estaciones de recarga
|
||||
• Más fluidez de la flecha de posición
|
||||
|
||||
@@ -24,7 +24,7 @@ Sartu komunitatean eta lagundu maparik onena aplikatzen
|
||||
• Lineaz kanpoko Wikipedia artikuluak
|
||||
• Metroaren garraio geruza eta jarraibideak
|
||||
• Arrastoen grabazioa
|
||||
• Laster-markak eta ibilbideak esportatu eta inportatu KML, KMZ, GPX formatuetan
|
||||
• Markagailuak eta arrastoak esportatu eta inportatu KML, KMZ, GPX formatuetan
|
||||
• Gauean erabiltzeko modu iluna
|
||||
• Hobetu mapako datuak guztiontzat oinarrizko editore integratua erabiliz
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ناوبری آسان نقشه - کشف بیشتر از سفر شما - توسط جامعه
|
||||
1
android/app/src/fdroid/play/listings/fa-IR/title.txt
Normal file
1
android/app/src/fdroid/play/listings/fa-IR/title.txt
Normal file
@@ -0,0 +1 @@
|
||||
CoMaps - کوه نوردی، دوچرخه سواری و رانندگی افلاین و خصوصی
|
||||
@@ -1,7 +0,0 @@
|
||||
Présentation du logo CoMaps !
|
||||
• Amélioration des courbes d’altitude à une précision de 20 ou 50 mètres pour de nombreuses régions
|
||||
• Ajout d'un lien vers les images Panoramax des POI
|
||||
• Données OpenStreetMap du 13 juillet
|
||||
• Affichage de l’état des heures d’ouverture lors de la sélection d’un POI
|
||||
• Mise à jour du style(végétation et zones humides), mise à jour de certaines icônes de la carte
|
||||
• Outdoors: Améliorations de la visibilité des courbes d'altitude
|
||||
@@ -1 +1 @@
|
||||
Navigation cartographique facile - Découvrez davantage de votre voyage - Propulsé par la communauté
|
||||
Navigation de cartes facile - Découvrez le monde - Propulsé par la communauté
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
A CoMaps egy közösség által létrehozott, ingyenes és nyílt forráskódú térképalkalmazás, amely az OpenStreetMap térképadatain alapul, és amelyet az átláthatóság, a magánélet védelme és a nonprofit jelleg iránti elkötelezettség erősít. A CoMaps az Organic Maps villája, amely viszont a Maps.ME villája.
|
||||
|
||||
A projekt előzményeiről és az irányáról a <b><i>codeberg.org/comaps</i></b> oldalon olvashatsz.
|
||||
Csatlakozz ott a közösséghez, és segíts a legjobb térképalkalmazás elkészítésében.
|
||||
• Használd az alkalmazást és terjeszd a hírét
|
||||
• Adj visszajelzést és jelentsd a problémákat
|
||||
• Frissítsd és javítsd a térképadatokat az alkalmazásban vagy az OpenStreetMap weboldalán.
|
||||
|
||||
‣ <b>Offline-fókuszú:</b> Tervezd meg és navigáld külföldi útad mobilszolgáltatás nélkül, keress útpontokat egy távoli túra során stb. Az alkalmazás minden funkcióját úgy terveztük, hogy internetkapcsolat nélkül is működjön.
|
||||
‣ <b>A magánélet tiszteletben tartása:</b> Az alkalmazás az adatvédelem szem előtt tartásával készült, nem azonosítja az embereket, nem követi nyomon és nem gyűjt személyes adatokat, és reklámmentes.
|
||||
‣ <b>Takarékosdik az akkumulátorral és a tárhellyel:</b> Nem meríti le az akkumulátort, mint más navigációs alkalmazások. A jól összeállítot kis méretű térképek értékes helyet takarítanak meg a telefonon.
|
||||
‣ <b>Egyszerű és szép grafikus felület,</b> nagyszerű és könnyen használható funkciók, amelyek egyszerűen működnek.
|
||||
‣ <b>Ingyenes és a közösség által készített:</b> A hozzád hasonló emberek segítettek az alkalmazás létrehozásában azáltal, hogy hozzáadtak helyeket az OpenStreetMap térképhez, tesztelték és visszajelzést adtak a funkciókról, valamint hozzájárultak a fejlesztői képességeikkel és a pénzükkel.
|
||||
‣ <b>Nyílt és átlátható döntéshozatal és pénzügyek, nonprofit és teljesen nyílt forráskódú.</b>
|
||||
|
||||
<b>Főbb jellemzők:</b>
|
||||
• Letölthető részletes térképek olyan helyekkel, amelyek sok kereskedelmi térképen nem állnak rendelkezésre.
|
||||
• Szabadtéri üzemmód kiemelt túraútvonalakkal, táborhelyekkel, vízforrásokkal, csúcsokkal, szintvonalakkal stb.
|
||||
• Sétaútvonalak és kerékpárutak
|
||||
• Érdekes pontok, mint például éttermek, benzinkutak, szállodák, üzletek, látnivalók és még sok minden más
|
||||
• Keresés név, cím vagy az érdekes pontok kategóriája alapján
|
||||
• Navigáció hangutasításokkal gyalogláshoz, kerékpározáshoz vagy vezetéshez
|
||||
• Kedvenc helyeid könyvjelzővel láthatod el egyetlen érintéssel
|
||||
• Wikipedia szócikkek internetkapcsolat nélkül
|
||||
• Metró tranzit réteg és irányok
|
||||
• Útvonal mentése
|
||||
• Könyvjelzők és nyomvonalak exportálása és importálása KML, KMZ, GPX formátumokban
|
||||
• Sötét üzemmód az éjszakai használathoz
|
||||
• Térképadatok javítása mindenki számára egy alapvető beépített szerkesztő segítségével
|
||||
|
||||
<b>Itt van a szabadság</b>
|
||||
Fedezd fel az utadat, navigálj a világban úgy, hogy a magánélet és a közösség kerüljön előtérbe!
|
||||
@@ -0,0 +1 @@
|
||||
Könnyű térképes navigáció - Fedezz fel többet az útjaidról - A közösség erejével
|
||||
@@ -1,4 +1,4 @@
|
||||
Una app sviluppata dalla comunità, gratuita e open-source, basata su OpenStreetMap e sull'impegno alla trasparenza, al rispetto della Privacy senza scopo di lucro. CoMaps è uno spin-off di Organic Maps, che a sua volta deriva da Maps.ME.
|
||||
Una app realizzata dalla community gratuita e open-source, basata su OpenStreetMap e sull'impegno alla trasparenza, al rispetto della Privacy e senza scopo di lucro. CoMaps è uno spin-off di Organic Maps, che a sua volta deriva da Maps.ME.
|
||||
|
||||
Leggi delle ragioni del progetto e della sua direzione futura su <b><i>codeberg.org/comaps</i></b>.
|
||||
Unisciti alla nostra comunità e aiutaci a creare la migliore app di mappe.
|
||||
@@ -15,7 +15,7 @@ Unisciti alla nostra comunità e aiutaci a creare la migliore app di mappe.
|
||||
|
||||
<b>Funzionalità principali</b>:
|
||||
• Scarica mappe dettagliate di luoghi che non sono disponibili su Google Maps
|
||||
• Modalità Outdoor con percorsi escursionistici, campeggi, sorgenti d'acqua, picchi, dislivelli ed altro evidenziati
|
||||
• Modalità Outdoor con percorsi escursionistici, campeggi, sorgenti d'acqua, picchi, dislivelli ed altri punti d'interesse evidenziati
|
||||
• Strade pedonali e piste ciclabili
|
||||
• Punti d'interesse come ristoranti, stazioni di benzina, hotel, negozi, luoghi turistici e molto altro
|
||||
• Cerca per nome, indirizzo o categoria
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
• Dati di OpenStreetMap aggiornati al 4 Agosto
|
||||
• Migliorati i colori per acqua, foreste, servizi etc
|
||||
• Aggiunte le stazioni delle guardie forestali, i parcheggi coperti per bici, gli escape games e altri servizi
|
||||
• Aggiornato l'intervallo delle isolinee a 20 m per le zone escursionistiche più popolari
|
||||
• Aggiunto il supporto per un maggior numero di alias
|
||||
• Aggiunte le icone per i fast food, i punti di ricarica e le biciclette
|
||||
• Resi più fluidi i movimenti della freccia di posizione
|
||||
@@ -1 +1 @@
|
||||
Navigazione semplice - Immergiti nella tua avventura - Sviluppato dalla comunità
|
||||
Navigazione semplice - Immergiti nella tua avventura - Realizzato dalla comunità
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Lett kart navigasjon - Opplev mere på din reise - Drevet av felleskapet
|
||||
@@ -1,9 +0,0 @@
|
||||
Wprowadzamy logo CoMaps!
|
||||
• zwiększenie dokładności izolinii w wielu regionach w krokach 20 do 50 metrów
|
||||
• dodanie linków do zdjęć z Panoramax do wybranych POI
|
||||
• aktualizacja danych OpenStreetMap z 13 lipca
|
||||
• dodanie wypełnienia kolorem dla wielu typów obiektów
|
||||
• wyświetlanie stanu godzin otwarcia przy wyborze POI
|
||||
• podział mokradeł na kilka typów
|
||||
• aktualizacja koloru roślinności i innych kolorów, aktualizacja części ikon na mapie
|
||||
• tryb outdoorowy: pogrubione warstwice wysokości
|
||||
@@ -1,9 +1,7 @@
|
||||
Apresentamos o logo do CoMaps!
|
||||
• Curvas de nível mais detalhadas em muitas regiões
|
||||
• Adicionados links de imagens do Panoramax para pontos de interesse selecionados
|
||||
• Dados OSM de 13/07
|
||||
• Adicionados preenchimentos de cor a muitos elementos
|
||||
• Exibição de horário de funcionamento ao selecionar um ponto de interesse
|
||||
• Divididas áreas úmidas em vários tipos distintos
|
||||
• Atualizada cores/ícones para vegetação e outros elementos
|
||||
• Ar livre: curvas de nível de altitude mais destacadas
|
||||
• Dados OSM de 4/08
|
||||
• Melhoria nas cores para água, florestas, matagais, serviços, áreas de pedestres, etc.
|
||||
• Adição de guarda-florestais, estacionamentos cobertos para bicicletas, jogos de fuga, armários para bagagem e parceiros postais
|
||||
• Melhoria na precisão de curvas de nível para 20 m em algumas regiões populares
|
||||
• Suporte a mais abreviações para busca
|
||||
• Adição de ícones de pesquisa e favoritos para fast food, bicicletas e estações de recarga
|
||||
• Movimentos mais suaves para seta de posição
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Navegação fácil nos mapas - Descubra mais sobre o seu percurso - Feito por todos
|
||||
1
android/app/src/fdroid/play/listings/pt-PT/title.txt
Normal file
1
android/app/src/fdroid/play/listings/pt-PT/title.txt
Normal file
@@ -0,0 +1 @@
|
||||
CoMaps - Mapas e Navegação - Offline e Privada
|
||||
@@ -1,9 +1,7 @@
|
||||
Представляем логотип CoMaps!
|
||||
• Линии высот для многих регионов с шагом 20м или 50м
|
||||
• Ссылки на изображения Panoramax к выбранным POI
|
||||
• Карты OpenStreetMap от 13 июля
|
||||
• Заливки цветом ко многим объектам и более ранняя заливка для существующих объектов
|
||||
• Показ часов работы при выборе POI
|
||||
• Разные водно-болотные угодья отличаются цветом
|
||||
• Обновлены цвета растительности и другие цвета на карте, изменены некоторые иконки
|
||||
• В стиле "Активный отдых" более четкие линии высот
|
||||
• Карты OpenStreetMap от 4 августа
|
||||
• Улучшен цвет воды, леса, кустарников, различных объектов инфраструктуры, пешеходных зон и т.д.
|
||||
• Добавлены лесничества, крытые велопарковки, квесты, камеры хранения
|
||||
• Для некоторых популярных туристических регионов добавлены линии высот 20м
|
||||
• Поддержка дополнительных поисковых сокращений и синонимов
|
||||
• Добавлены иконки меток и результатов поиска для фастфуда, велопарковок и зарядных станций
|
||||
• Более плавное движение стрелки местоположения
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
Представљамо CoMaps лого!
|
||||
• ажуриране изохипсе за многе регионе на кораке од 20 или 50 метара
|
||||
• додате везе ка Panoramax сликама за изабране тачке интересовања (POI)
|
||||
• подаци са OpenStreetMap-а од 13. јула
|
||||
• додате боје за многе елементе и раније приказивање постојећих површина
|
||||
• приказ стања радног времена при избору POI-ја
|
||||
• мочваре подељене на неколико различитих типова
|
||||
• ажуриране боје вегетације и других елемената на мапи, ажуриране поједине иконе
|
||||
• на отвореном: наглашеније изохипсе
|
||||
• подаци из OpenStreetMap-а од 4. августа
|
||||
• побољшане боје на мапи за воду, шуме, жбуње, разне објекте, пешачке зоне итд.
|
||||
• додате станице ренџера, наткривена паркинг места за бицикле, escape room-ови, ормарићи за пртљаг
|
||||
• унапређене изохипсе на кораке од 20 м за популарне планинарске регионе
|
||||
• подршка за више скраћеница и алтернативних назива у претрази
|
||||
• додате иконе за претрагу и обележавање за брзу храну, бицикле и станице за пуњење
|
||||
• равномерније кретање стрелице која приказује позицију
|
||||
@@ -1,4 +1,4 @@
|
||||
package app.organicmaps.sdk.location;
|
||||
package app.organicmaps.location;
|
||||
|
||||
import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
|
||||
import static android.Manifest.permission.ACCESS_FINE_LOCATION;
|
||||
@@ -10,6 +10,7 @@ import android.location.Location;
|
||||
import android.os.Looper;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresPermission;
|
||||
import app.organicmaps.sdk.location.BaseLocationProvider;
|
||||
import app.organicmaps.sdk.util.LocationUtils;
|
||||
import app.organicmaps.sdk.util.log.Logger;
|
||||
import com.google.android.gms.common.api.ApiException;
|
||||
@@ -1,23 +1,25 @@
|
||||
package app.organicmaps.sdk.location;
|
||||
package app.organicmaps.location;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import app.organicmaps.sdk.location.AndroidNativeProvider;
|
||||
import app.organicmaps.sdk.location.BaseLocationProvider;
|
||||
import app.organicmaps.sdk.location.LocationProviderFactory;
|
||||
import app.organicmaps.sdk.util.Config;
|
||||
import app.organicmaps.sdk.util.log.Logger;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
|
||||
public class LocationProviderFactory
|
||||
public class LocationProviderFactoryImpl implements LocationProviderFactory
|
||||
{
|
||||
private static final String TAG = LocationProviderFactory.class.getSimpleName();
|
||||
private static final String TAG = LocationProviderFactoryImpl.class.getSimpleName();
|
||||
|
||||
public static boolean isGoogleLocationAvailable(@NonNull Context context)
|
||||
public boolean isGoogleLocationAvailable(@NonNull Context context)
|
||||
{
|
||||
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context) == ConnectionResult.SUCCESS;
|
||||
}
|
||||
|
||||
public static BaseLocationProvider getProvider(@NonNull Context context,
|
||||
@NonNull BaseLocationProvider.Listener listener)
|
||||
public BaseLocationProvider getProvider(@NonNull Context context, @NonNull BaseLocationProvider.Listener listener)
|
||||
{
|
||||
if (isGoogleLocationAvailable(context) && Config.useGoogleServices())
|
||||
{
|
||||
@@ -1 +1 @@
|
||||
Navigation cartographique facile - Découvrez davantage de votre voyage - Propulsé par la communauté
|
||||
Navigation cartographique facile - Vivez de grands voyages - Propulsé par la communauté
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Könnyű térképes navigáció - Fedezz fel többet az útjaidról - A közösség erejével
|
||||
1
android/app/src/google/play/listings/hu-HU/title.txt
Normal file
1
android/app/src/google/play/listings/hu-HU/title.txt
Normal file
@@ -0,0 +1 @@
|
||||
CoMaps - Az adatvédő navigáció
|
||||
1
android/app/src/google/play/listings/ml-IN/title.txt
Normal file
1
android/app/src/google/play/listings/ml-IN/title.txt
Normal file
@@ -0,0 +1 @@
|
||||
കോമാപ്പ്സ് - സ്വകാര്യതയോടെ സഞ്ചരിക്കൂ
|
||||
1
android/app/src/google/play/listings/pl-PL/title.txt
Normal file
1
android/app/src/google/play/listings/pl-PL/title.txt
Normal file
@@ -0,0 +1 @@
|
||||
CoMaps - Nawigacja szanująca prywatność
|
||||
@@ -7,12 +7,12 @@ Topluluğa katılın ve en iyi harita uygulamasını oluşturmamıza yardım edi
|
||||
|
||||
<i>Geri bildirimleriniz ve 5 yıldızlı yorumlarınız bizim için en iyi destektir!</i>
|
||||
|
||||
‣ <b>Basit ve Temiz</b>: Sadece temel, kullanımı basit, işe yarayan özellikler.
|
||||
‣ <b>Çevrimdışı Odaklı</b>: Mobil veriye ihtiyaç duymadan yurt dışı seyahatinizi planlayın ve gezin, uzun bir yürüyüş sırasında rotanızdaki noktaları bulun ve daha fazlası . Tüm özellikler çevrimdışı çalışmak üzere tasarlanmıştır.
|
||||
‣ <b>Basit ve Temiz</b>: Sadece temel, kullanımı basit ve işe yarayan özellikler.
|
||||
‣ <b>Çevrimdışı Odaklı</b>: Mobil veriye ihtiyaç duymadan yurt dışı seyahatinizi planlayın ve gezin, uzun bir yürüyüş sırasında rotanızdaki noktaları bulun ve daha fazlası. Tüm özellikler çevrimdışı çalışmak üzere tasarlanmıştır.
|
||||
‣ <b>Gizliliğe Saygılı</b>: Uygulama gizliliğe saygılı olarak tasarlanmıştır. Kullanıcı profilinizi çıkarmaz, sizi takip etmez ve kişisel bilgi toplamaz. Üstelik tamamen reklamsızdır.
|
||||
‣ <b>Pil ve Depolamanızdan Tasarruf Eder</b>: Diğer navigasyon uygulamaları gibi pilinizi sömürmez. Compact maps değerli depolama alanınızdan tasarruf eder.
|
||||
‣ <b>Ücretsizdir ve Gücünü Topluluktan Alır</b>: Sizin gibi insanlar OpenStreetMap'e yer ekleyerek, yeni özellikleri test ederek, geri bildirimde bulunarak, program geliştirme becerileri ve bağışlarla katkıda bulunarak uygulamanın oluşturulmasına yardımcı oldu.
|
||||
‣ <b>Açık ve Şeffaf Şekilde Yürütülen Karar Alma ve Fonlama Süreçleri, Kâr Amacı Gütmez ve Tamamen Açık Kaynaklı.</b>
|
||||
‣ <b>Pil ve Depolamanızdan Tasarruf Eder</b>: Diğer navigasyon uygulamaları gibi pilinizi sömürmez. Kompakt harita dosyaları, değerli depolama alanınızdan tasarruf eder.
|
||||
‣ <b>Ücretsizdir ve Gücünü Topluluktan Alır</b>: Sizin gibi insanlar OpenStreetMap'e yer ekleyerek, yeni özellikleri test ederek, geri bildirimde bulunarak, program geliştirme becerileri ve bağışlarla katkıda bulunarak bu uygulamanın oluşturulmasına yardımcı oldular.
|
||||
‣ <b>Açık ve Şeffaf Bir Şekilde Yürütülen Karar Alma ve Fonlama Süreçlerine Sahip, Kâr Amacı Gütmeyen ve Tamamen Açık Kaynaklı Bir Uygulama.</b>
|
||||
|
||||
<b>Ana Özellikler</b>:
|
||||
• Google Haritalar'da bulunmayan yerleri içeren, çevrimdışı detaylı haritalar
|
||||
|
||||
1
android/app/src/huawei/java/app/organicmaps/location
Symbolic link
1
android/app/src/huawei/java/app/organicmaps/location
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../google/java/app/organicmaps/location
|
||||
@@ -1 +0,0 @@
|
||||
../../../../../google/java/app/organicmaps/sdk/location
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<!-- Requiring "android.hardware.touchscreen" here breaks DeX mode -->
|
||||
<uses-feature
|
||||
android:glEsVersion="0x00020000"
|
||||
android:glEsVersion="0x00030000"
|
||||
android:required="true"/>
|
||||
<uses-feature
|
||||
android:name="android.hardware.wifi"
|
||||
|
||||
@@ -10,6 +10,8 @@ import androidx.core.content.ContextCompat;
|
||||
import app.organicmaps.sdk.Framework;
|
||||
import app.organicmaps.sdk.bookmarks.data.BookmarkManager;
|
||||
import app.organicmaps.sdk.bookmarks.data.ElevationInfo;
|
||||
import app.organicmaps.sdk.bookmarks.data.Track;
|
||||
import app.organicmaps.sdk.bookmarks.data.TrackStatistics;
|
||||
import app.organicmaps.util.ThemeUtils;
|
||||
import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.widget.placepage.AxisValueFormatter;
|
||||
@@ -31,17 +33,16 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class ChartController implements OnChartValueSelectedListener,
|
||||
BookmarkManager.OnElevationActivePointChangedListener,
|
||||
BookmarkManager.OnElevationCurrentPositionChangedListener
|
||||
public class ChartController implements OnChartValueSelectedListener
|
||||
{
|
||||
private static final int CHART_Y_LABEL_COUNT = 3;
|
||||
private static final int CHART_X_LABEL_COUNT = 6;
|
||||
private static final int CHART_ANIMATION_DURATION = 1500;
|
||||
private static final int CHART_ANIMATION_DURATION = 0;
|
||||
private static final int CHART_FILL_ALPHA = (int) (0.12 * 255);
|
||||
private static final int CHART_AXIS_GRANULARITY = 100;
|
||||
private static final float CUBIC_INTENSITY = 0.2f;
|
||||
private static final int CURRENT_POSITION_OUT_OF_TRACK = -1;
|
||||
private static final String ELEVATION_PROFILE_POINTS = "ELEVATION_PROFILE_POINTS";
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
@@ -62,6 +63,7 @@ public class ChartController implements OnChartValueSelectedListener,
|
||||
private final Context mContext;
|
||||
private long mTrackId = Utils.INVALID_ID;
|
||||
private boolean mCurrentPositionOutOfTrack = true;
|
||||
private boolean mInformSelectedActivePointToCore = true;
|
||||
|
||||
public ChartController(@NonNull Context context)
|
||||
{
|
||||
@@ -70,8 +72,6 @@ public class ChartController implements OnChartValueSelectedListener,
|
||||
|
||||
public void initialize(@NonNull View view)
|
||||
{
|
||||
BookmarkManager.INSTANCE.setElevationActivePointChangedListener(this);
|
||||
BookmarkManager.INSTANCE.setElevationCurrentPositionChangedListener(this);
|
||||
final Resources resources = mContext.getResources();
|
||||
mChart = view.findViewById(R.id.elevation_profile_chart);
|
||||
|
||||
@@ -101,13 +101,6 @@ public class ChartController implements OnChartValueSelectedListener,
|
||||
initAxises();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void destroy()
|
||||
{
|
||||
BookmarkManager.INSTANCE.setElevationActivePointChangedListener(null);
|
||||
BookmarkManager.INSTANCE.setElevationCurrentPositionChangedListener(null);
|
||||
}
|
||||
|
||||
private void highlightChartCurrentLocation()
|
||||
{
|
||||
mChart.highlightValues(Collections.singletonList(getCurrentPosHighlight()),
|
||||
@@ -142,15 +135,17 @@ public class ChartController implements OnChartValueSelectedListener,
|
||||
mChart.getAxisRight().setEnabled(false);
|
||||
}
|
||||
|
||||
public void setData(@NonNull ElevationInfo info)
|
||||
public void setData(Track track)
|
||||
{
|
||||
mTrackId = info.getId();
|
||||
mTrackId = track.getTrackId();
|
||||
ElevationInfo info = track.getElevationInfo();
|
||||
TrackStatistics stats = track.getTrackStatistics();
|
||||
List<Entry> values = new ArrayList<>();
|
||||
|
||||
for (ElevationInfo.Point point : info.getPoints())
|
||||
values.add(new Entry((float) point.getDistance(), point.getAltitude()));
|
||||
values.add(new Entry((float) point.getDistance(), point.getAltitude(), point));
|
||||
|
||||
LineDataSet set = new LineDataSet(values, "Elevation_profile_points");
|
||||
LineDataSet set = new LineDataSet(values, ELEVATION_PROFILE_POINTS);
|
||||
set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
|
||||
set.setCubicIntensity(CUBIC_INTENSITY);
|
||||
set.setDrawFilled(true);
|
||||
@@ -173,8 +168,8 @@ public class ChartController implements OnChartValueSelectedListener,
|
||||
mChart.setData(data);
|
||||
mChart.animateX(CHART_ANIMATION_DURATION);
|
||||
|
||||
mMinAltitude.setText(Framework.nativeFormatAltitude(info.getMinAltitude()));
|
||||
mMaxAltitude.setText(Framework.nativeFormatAltitude(info.getMaxAltitude()));
|
||||
mMinAltitude.setText(Framework.nativeFormatAltitude(stats.getMinElevation()));
|
||||
mMaxAltitude.setText(Framework.nativeFormatAltitude(stats.getMaxElevation()));
|
||||
|
||||
highlightActivePointManually();
|
||||
}
|
||||
@@ -192,7 +187,9 @@ public class ChartController implements OnChartValueSelectedListener,
|
||||
if (mTrackId == Utils.INVALID_ID)
|
||||
return;
|
||||
|
||||
BookmarkManager.INSTANCE.setElevationActivePoint(mTrackId, e.getX());
|
||||
if (mInformSelectedActivePointToCore)
|
||||
BookmarkManager.INSTANCE.setElevationActivePoint(mTrackId, e.getX(), (ElevationInfo.Point) e.getData());
|
||||
mInformSelectedActivePointToCore = true;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -211,7 +208,6 @@ public class ChartController implements OnChartValueSelectedListener,
|
||||
highlightChartCurrentLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCurrentPositionChanged()
|
||||
{
|
||||
if (mTrackId == Utils.INVALID_ID)
|
||||
@@ -222,7 +218,6 @@ public class ChartController implements OnChartValueSelectedListener,
|
||||
highlightActivePointManually();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onElevationActivePointChanged()
|
||||
{
|
||||
if (mTrackId == Utils.INVALID_ID)
|
||||
@@ -234,6 +229,7 @@ public class ChartController implements OnChartValueSelectedListener,
|
||||
private void highlightActivePointManually()
|
||||
{
|
||||
Highlight highlight = getActivePoint();
|
||||
mInformSelectedActivePointToCore = false;
|
||||
mChart.highlightValue(highlight, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import androidx.annotation.StringRes;
|
||||
import androidx.annotation.StyleRes;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import app.organicmaps.base.BaseMwmFragmentActivity;
|
||||
import app.organicmaps.downloader.MapManagerHelper;
|
||||
import app.organicmaps.intent.Factory;
|
||||
import app.organicmaps.sdk.Framework;
|
||||
import app.organicmaps.sdk.downloader.CountryItem;
|
||||
@@ -35,7 +36,7 @@ import app.organicmaps.sdk.location.LocationListener;
|
||||
import app.organicmaps.sdk.util.Config;
|
||||
import app.organicmaps.sdk.util.ConnectionState;
|
||||
import app.organicmaps.sdk.util.StringUtils;
|
||||
import app.organicmaps.sdk.util.UiUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.util.WindowInsetUtils.PaddingInsetsListener;
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
@@ -116,10 +117,10 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
|
||||
private final app.organicmaps.sdk.DownloadResourcesLegacyActivity.Listener mResourcesDownloadListener =
|
||||
new app.organicmaps.sdk.DownloadResourcesLegacyActivity.Listener() {
|
||||
@Override
|
||||
public void onProgress(final int percent)
|
||||
public void onProgress(final int bytesDownloaded)
|
||||
{
|
||||
if (!isFinishing())
|
||||
mProgress.setProgressCompat(percent, true);
|
||||
mProgress.setProgressCompat(bytesDownloaded, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -150,14 +151,14 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
|
||||
|
||||
switch (item.newStatus)
|
||||
{
|
||||
case CountryItem.STATUS_DONE:
|
||||
mAreResourcesDownloaded = true;
|
||||
showMap();
|
||||
return;
|
||||
case CountryItem.STATUS_DONE:
|
||||
mAreResourcesDownloaded = true;
|
||||
showMap();
|
||||
return;
|
||||
|
||||
case CountryItem.STATUS_FAILED:
|
||||
MapManager.showError(DownloadResourcesLegacyActivity.this, item, null);
|
||||
return;
|
||||
case CountryItem.STATUS_FAILED:
|
||||
MapManagerHelper.showError(DownloadResourcesLegacyActivity.this, item, null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -252,7 +253,8 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
|
||||
setDownloadMessage(bytes);
|
||||
|
||||
mProgress.setMax(bytes);
|
||||
mProgress.setProgressCompat(0, true);
|
||||
// Start progress at 1% according to M3 guidelines
|
||||
mProgress.setProgressCompat(bytes/100, true);
|
||||
}
|
||||
else
|
||||
finishFilesDownload(bytes);
|
||||
@@ -370,10 +372,11 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
|
||||
String fileSizeString = StringUtils.getFileSizeString(this, item.totalSize);
|
||||
mTvMessage.setText(getString(R.string.downloading_country_can_proceed, item.name, fileSizeString));
|
||||
mProgress.setMax((int) item.totalSize);
|
||||
mProgress.setProgressCompat(0, true);
|
||||
// Start progress at 1% according to M3 guidelines
|
||||
mProgress.setProgressCompat((int) (item.totalSize/100), true);
|
||||
|
||||
mCountryDownloadListenerSlot = MapManager.nativeSubscribe(mCountryDownloadListener);
|
||||
MapManager.startDownload(mCurrentCountry);
|
||||
MapManagerHelper.startDownload(mCurrentCountry);
|
||||
setAction(PROCEED_TO_MAP);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -23,6 +23,8 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
public class MapFragment extends BaseMwmFragment implements View.OnTouchListener, SurfaceHolder.Callback
|
||||
{
|
||||
private static final String TAG = MapFragment.class.getSimpleName();
|
||||
|
||||
@NonNull
|
||||
private final Map mMap = new Map(DisplayType.Device);
|
||||
|
||||
public void updateCompassOffset(int offsetX, int offsetY)
|
||||
@@ -84,6 +86,8 @@ public class MapFragment extends BaseMwmFragment implements View.OnTouchListener
|
||||
{
|
||||
Logger.d(TAG);
|
||||
super.onAttach(context);
|
||||
|
||||
mMap.setLocationHelper(MwmApplication.from(requireContext()).getLocationHelper());
|
||||
mMap.setMapRenderingListener((MapRenderingListener) context);
|
||||
mMap.setCallbackUnsupported(this::reportUnsupported);
|
||||
}
|
||||
@@ -159,24 +163,24 @@ public class MapFragment extends BaseMwmFragment implements View.OnTouchListener
|
||||
int pointerIndex = event.getActionIndex();
|
||||
switch (action)
|
||||
{
|
||||
case MotionEvent.ACTION_POINTER_UP -> action = Map.NATIVE_ACTION_UP;
|
||||
case MotionEvent.ACTION_UP ->
|
||||
{
|
||||
action = Map.NATIVE_ACTION_UP;
|
||||
pointerIndex = 0;
|
||||
}
|
||||
case MotionEvent.ACTION_POINTER_DOWN -> action = Map.NATIVE_ACTION_DOWN;
|
||||
case MotionEvent.ACTION_DOWN ->
|
||||
{
|
||||
action = Map.NATIVE_ACTION_DOWN;
|
||||
pointerIndex = 0;
|
||||
}
|
||||
case MotionEvent.ACTION_MOVE ->
|
||||
{
|
||||
action = Map.NATIVE_ACTION_MOVE;
|
||||
pointerIndex = Map.INVALID_POINTER_MASK;
|
||||
}
|
||||
case MotionEvent.ACTION_CANCEL -> action = Map.NATIVE_ACTION_CANCEL;
|
||||
case MotionEvent.ACTION_POINTER_UP -> action = Map.NATIVE_ACTION_UP;
|
||||
case MotionEvent.ACTION_UP ->
|
||||
{
|
||||
action = Map.NATIVE_ACTION_UP;
|
||||
pointerIndex = 0;
|
||||
}
|
||||
case MotionEvent.ACTION_POINTER_DOWN -> action = Map.NATIVE_ACTION_DOWN;
|
||||
case MotionEvent.ACTION_DOWN ->
|
||||
{
|
||||
action = Map.NATIVE_ACTION_DOWN;
|
||||
pointerIndex = 0;
|
||||
}
|
||||
case MotionEvent.ACTION_MOVE ->
|
||||
{
|
||||
action = Map.NATIVE_ACTION_MOVE;
|
||||
pointerIndex = Map.INVALID_POINTER_MASK;
|
||||
}
|
||||
case MotionEvent.ACTION_CANCEL -> action = Map.NATIVE_ACTION_CANCEL;
|
||||
}
|
||||
Map.onTouch(action, event, pointerIndex);
|
||||
return true;
|
||||
|
||||
@@ -12,13 +12,13 @@ import static app.organicmaps.sdk.location.LocationState.FOLLOW;
|
||||
import static app.organicmaps.sdk.location.LocationState.FOLLOW_AND_ROTATE;
|
||||
import static app.organicmaps.sdk.location.LocationState.LOCATION_TAG;
|
||||
import static app.organicmaps.sdk.util.PowerManagment.POWER_MANAGEMENT_TAG;
|
||||
import static app.organicmaps.sdk.util.Utils.dimen;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Configuration;
|
||||
@@ -28,7 +28,6 @@ import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -66,7 +65,6 @@ import app.organicmaps.downloader.OnmapDownloader;
|
||||
import app.organicmaps.editor.EditorActivity;
|
||||
import app.organicmaps.editor.EditorHostFragment;
|
||||
import app.organicmaps.editor.FeatureCategoryActivity;
|
||||
import app.organicmaps.editor.OsmLoginActivity;
|
||||
import app.organicmaps.editor.ReportFragment;
|
||||
import app.organicmaps.help.HelpActivity;
|
||||
import app.organicmaps.intent.Factory;
|
||||
@@ -82,7 +80,6 @@ import app.organicmaps.routing.ManageRouteBottomSheet;
|
||||
import app.organicmaps.routing.NavigationController;
|
||||
import app.organicmaps.routing.NavigationService;
|
||||
import app.organicmaps.routing.RoutingBottomMenuListener;
|
||||
import app.organicmaps.routing.RoutingController;
|
||||
import app.organicmaps.routing.RoutingErrorDialogFragment;
|
||||
import app.organicmaps.routing.RoutingPlanFragment;
|
||||
import app.organicmaps.routing.RoutingPlanInplaceController;
|
||||
@@ -100,7 +97,6 @@ import app.organicmaps.sdk.display.DisplayType;
|
||||
import app.organicmaps.sdk.downloader.MapManager;
|
||||
import app.organicmaps.sdk.downloader.UpdateInfo;
|
||||
import app.organicmaps.sdk.editor.Editor;
|
||||
import app.organicmaps.sdk.editor.OsmOAuth;
|
||||
import app.organicmaps.sdk.location.LocationHelper;
|
||||
import app.organicmaps.sdk.location.LocationListener;
|
||||
import app.organicmaps.sdk.location.LocationState;
|
||||
@@ -108,6 +104,7 @@ import app.organicmaps.sdk.location.SensorListener;
|
||||
import app.organicmaps.sdk.location.TrackRecorder;
|
||||
import app.organicmaps.sdk.maplayer.isolines.IsolinesState;
|
||||
import app.organicmaps.sdk.routing.RouteMarkType;
|
||||
import app.organicmaps.sdk.routing.RoutingController;
|
||||
import app.organicmaps.sdk.routing.RoutingOptions;
|
||||
import app.organicmaps.sdk.search.SearchEngine;
|
||||
import app.organicmaps.sdk.settings.RoadType;
|
||||
@@ -115,8 +112,6 @@ import app.organicmaps.sdk.settings.UnitLocale;
|
||||
import app.organicmaps.sdk.util.Config;
|
||||
import app.organicmaps.sdk.util.LocationUtils;
|
||||
import app.organicmaps.sdk.util.PowerManagment;
|
||||
import app.organicmaps.sdk.util.ThemeSwitcher;
|
||||
import app.organicmaps.sdk.util.UiUtils;
|
||||
import app.organicmaps.sdk.util.log.Logger;
|
||||
import app.organicmaps.sdk.widget.placepage.PlacePageData;
|
||||
import app.organicmaps.search.FloatingSearchToolbarController;
|
||||
@@ -125,7 +120,9 @@ import app.organicmaps.search.SearchFragment;
|
||||
import app.organicmaps.settings.DrivingOptionsActivity;
|
||||
import app.organicmaps.settings.SettingsActivity;
|
||||
import app.organicmaps.util.SharingUtils;
|
||||
import app.organicmaps.util.ThemeSwitcher;
|
||||
import app.organicmaps.util.ThemeUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.util.bottomsheet.MenuBottomSheetFragment;
|
||||
import app.organicmaps.util.bottomsheet.MenuBottomSheetItem;
|
||||
@@ -290,7 +287,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
}
|
||||
|
||||
processIntent();
|
||||
migrateOAuthCredentials();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,36 +341,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
}
|
||||
}
|
||||
|
||||
private void migrateOAuthCredentials()
|
||||
{
|
||||
if (OsmOAuth.containsOAuth1Credentials())
|
||||
{
|
||||
// Remove old OAuth v1 secrets
|
||||
OsmOAuth.clearOAuth1Credentials();
|
||||
|
||||
// Notify user to re-login
|
||||
dismissAlertDialog();
|
||||
final DialogInterface.OnClickListener navigateToLoginHandler =
|
||||
(dialog, which) -> startActivity(new Intent(MwmActivity.this, OsmLoginActivity.class));
|
||||
|
||||
final int marginBase = getResources().getDimensionPixelSize(R.dimen.margin_base);
|
||||
final float textSize = getResources().getDimension(R.dimen.line_spacing_extra_1);
|
||||
final TextView text = new TextView(this);
|
||||
text.setText(getText(R.string.alert_reauth_message));
|
||||
text.setPadding(marginBase, marginBase, marginBase, marginBase);
|
||||
text.setTextSize(textSize);
|
||||
text.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
mAlertDialog = new MaterialAlertDialogBuilder(this, R.style.MwmTheme_AlertDialog)
|
||||
.setTitle(R.string.login_osm)
|
||||
.setView(text)
|
||||
.setPositiveButton(R.string.login, navigateToLoginHandler)
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setOnDismissListener(dialog -> mAlertDialog = null)
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
private static void checkMeasurementSystem()
|
||||
{
|
||||
UnitLocale.initializeCurrentUnits();
|
||||
@@ -492,12 +458,10 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
@StyleRes
|
||||
protected int getThemeResourceId(@NonNull String theme)
|
||||
{
|
||||
Context context = getApplicationContext();
|
||||
|
||||
if (ThemeUtils.isDefaultTheme(context, theme))
|
||||
if (Config.UiTheme.isDefault(theme))
|
||||
return R.style.MwmTheme_MainActivity;
|
||||
|
||||
if (ThemeUtils.isNightTheme(context, theme))
|
||||
if (Config.UiTheme.isNight(theme))
|
||||
return R.style.MwmTheme_Night_MainActivity;
|
||||
|
||||
return super.getThemeResourceId(theme);
|
||||
@@ -619,7 +583,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
|
||||
private void refreshLightStatusBar()
|
||||
{
|
||||
UiUtils.setLightStatusBar(this, !(ThemeUtils.isNightTheme(this) || RoutingController.get().isPlanning()
|
||||
UiUtils.setLightStatusBar(this, !(ThemeUtils.isNightTheme() || RoutingController.get().isPlanning()
|
||||
|| ChoosePositionMode.get() != ChoosePositionMode.None));
|
||||
}
|
||||
|
||||
@@ -629,7 +593,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
UiUtils.setViewInsetsPaddingBottom(mPointChooser, windowInsets);
|
||||
UiUtils.setViewInsetsPaddingNoBottom(mPointChooserToolbar, windowInsets);
|
||||
final int trackRecorderOffset =
|
||||
TrackRecorder.nativeIsTrackRecordingEnabled() ? UiUtils.dimen(this, R.dimen.map_button_size) : 0;
|
||||
TrackRecorder.nativeIsTrackRecordingEnabled() ? dimen(this, R.dimen.map_button_size) : 0;
|
||||
mNavBarHeight = isFullscreen() ? 0 : windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom;
|
||||
// For the first loading, set compass top margin to status bar size
|
||||
// The top inset will be then be updated by the routing controller
|
||||
@@ -683,29 +647,29 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
mPointChooser.findViewById(R.id.done).setOnClickListener(v -> {
|
||||
switch (ChoosePositionMode.get())
|
||||
{
|
||||
case Api:
|
||||
final Intent apiResult = new Intent();
|
||||
final double[] center = Framework.nativeGetScreenRectCenter();
|
||||
apiResult.putExtra(Const.EXTRA_POINT_LAT, center[0]);
|
||||
apiResult.putExtra(Const.EXTRA_POINT_LON, center[1]);
|
||||
apiResult.putExtra(Const.EXTRA_ZOOM_LEVEL, Framework.nativeGetDrawScale());
|
||||
setResult(Activity.RESULT_OK, apiResult);
|
||||
finish();
|
||||
break;
|
||||
case Editor:
|
||||
if (Framework.nativeIsDownloadedMapAtScreenCenter())
|
||||
startActivity(new Intent(MwmActivity.this, FeatureCategoryActivity.class));
|
||||
else
|
||||
{
|
||||
dismissAlertDialog();
|
||||
mAlertDialog = new MaterialAlertDialogBuilder(this, R.style.MwmTheme_AlertDialog)
|
||||
.setTitle(R.string.message_invalid_feature_position)
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setOnDismissListener(dialog -> mAlertDialog = null)
|
||||
.show();
|
||||
}
|
||||
break;
|
||||
case None: throw new IllegalStateException("Unexpected Framework.nativeGetChoosePositionMode()");
|
||||
case Api:
|
||||
final Intent apiResult = new Intent();
|
||||
final double[] center = Framework.nativeGetScreenRectCenter();
|
||||
apiResult.putExtra(Const.EXTRA_POINT_LAT, center[0]);
|
||||
apiResult.putExtra(Const.EXTRA_POINT_LON, center[1]);
|
||||
apiResult.putExtra(Const.EXTRA_ZOOM_LEVEL, Framework.nativeGetDrawScale());
|
||||
setResult(Activity.RESULT_OK, apiResult);
|
||||
finish();
|
||||
break;
|
||||
case Editor:
|
||||
if (Framework.nativeIsDownloadedMapAtScreenCenter())
|
||||
startActivity(new Intent(MwmActivity.this, FeatureCategoryActivity.class));
|
||||
else
|
||||
{
|
||||
dismissAlertDialog();
|
||||
mAlertDialog = new MaterialAlertDialogBuilder(this, R.style.MwmTheme_AlertDialog)
|
||||
.setTitle(R.string.message_invalid_feature_position)
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setOnDismissListener(dialog -> mAlertDialog = null)
|
||||
.show();
|
||||
}
|
||||
break;
|
||||
case None: throw new IllegalStateException("Unexpected Framework.nativeGetChoosePositionMode()");
|
||||
}
|
||||
closePositionChooser();
|
||||
});
|
||||
@@ -772,9 +736,9 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
final View mapView = mMapFragment.getView();
|
||||
if (mapView != null)
|
||||
{
|
||||
int width = mapView.getWidth();
|
||||
int height = mapView.getHeight();
|
||||
Framework.nativeSetVisibleRect(0, 0, width, height);
|
||||
int width = mapView.getWidth();
|
||||
int height = mapView.getHeight();
|
||||
Framework.nativeSetVisibleRect(0, 0, width, height);
|
||||
}
|
||||
}
|
||||
UiUtils.show(mPointChooser);
|
||||
@@ -972,24 +936,24 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
{
|
||||
switch (button)
|
||||
{
|
||||
case zoomIn -> Map.zoomIn();
|
||||
case zoomOut -> Map.zoomOut();
|
||||
case myPosition ->
|
||||
{
|
||||
Logger.i(LOCATION_TAG, "The location button pressed");
|
||||
// Calls onMyPositionModeChanged(mode + 1).
|
||||
LocationState.nativeSwitchToNextMode();
|
||||
}
|
||||
case toggleMapLayer -> toggleMapLayerBottomSheet();
|
||||
case bookmarks -> showBookmarks();
|
||||
case search -> showSearch("");
|
||||
case menu ->
|
||||
{
|
||||
closeFloatingPanels();
|
||||
showBottomSheet(MAIN_MENU_ID);
|
||||
}
|
||||
case help -> showHelp();
|
||||
case trackRecordingStatus -> showTrackSaveDialog();
|
||||
case zoomIn -> Map.zoomIn();
|
||||
case zoomOut -> Map.zoomOut();
|
||||
case myPosition ->
|
||||
{
|
||||
Logger.i(LOCATION_TAG, "The location button pressed");
|
||||
// Calls onMyPositionModeChanged(mode + 1).
|
||||
LocationState.nativeSwitchToNextMode();
|
||||
}
|
||||
case toggleMapLayer -> toggleMapLayerBottomSheet();
|
||||
case bookmarks -> showBookmarks();
|
||||
case search -> showSearch("");
|
||||
case menu ->
|
||||
{
|
||||
closeFloatingPanels();
|
||||
showBottomSheet(MAIN_MENU_ID);
|
||||
}
|
||||
case help -> showHelp();
|
||||
case trackRecordingStatus -> showTrackSaveDialog();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1223,21 +1187,22 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
|
||||
private void onIsolinesStateChanged(@NonNull IsolinesState type)
|
||||
{
|
||||
if (type != IsolinesState.EXPIREDDATA)
|
||||
if (type == IsolinesState.NODATA)
|
||||
{
|
||||
type.activate(this, findViewById(R.id.coordinator), findViewById(R.id.menu_frame));
|
||||
return;
|
||||
Toast.makeText(this, R.string.isolines_location_error_dialog, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
dismissAlertDialog();
|
||||
mAlertDialog = new MaterialAlertDialogBuilder(this, R.style.MwmTheme_AlertDialog)
|
||||
.setTitle(R.string.downloader_update_maps)
|
||||
.setMessage(R.string.isolines_activation_error_dialog)
|
||||
.setPositiveButton(R.string.ok,
|
||||
(dialog, which) -> startActivity(new Intent(this, DownloaderActivity.class)))
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setOnDismissListener(dialog -> mAlertDialog = null)
|
||||
.show();
|
||||
if (type == IsolinesState.EXPIREDDATA)
|
||||
{
|
||||
mAlertDialog = new MaterialAlertDialogBuilder(this, R.style.MwmTheme_AlertDialog)
|
||||
.setTitle(R.string.downloader_update_maps)
|
||||
.setMessage(R.string.isolines_activation_error_dialog)
|
||||
.setPositiveButton(
|
||||
R.string.ok, (dialog, which) -> startActivity(new Intent(this, DownloaderActivity.class)))
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.setOnDismissListener(dialog -> mAlertDialog = null)
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1682,17 +1647,17 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
final int orientation = getResources().getConfiguration().orientation;
|
||||
final boolean isTrackRecordingEnabled = TrackRecorder.nativeIsTrackRecordingEnabled();
|
||||
if (isTrackRecordingEnabled && (orientation != Configuration.ORIENTATION_LANDSCAPE))
|
||||
offsetY += UiUtils.dimen(this, R.dimen.map_button_size);
|
||||
offsetY += dimen(this, R.dimen.map_button_size);
|
||||
if (orientation == Configuration.ORIENTATION_LANDSCAPE)
|
||||
{
|
||||
if (show)
|
||||
{
|
||||
final boolean isSmallScreen = UiUtils.getDisplayTotalHeight(this) < UiUtils.dimen(this, R.dimen.dp_400);
|
||||
final boolean isSmallScreen = UiUtils.getDisplayTotalHeight(this) < dimen(this, R.dimen.dp_400);
|
||||
if (!isSmallScreen || TrackRecorder.nativeIsTrackRecordingEnabled())
|
||||
offsetX += UiUtils.dimen(this, R.dimen.map_button_size);
|
||||
offsetX += dimen(this, R.dimen.map_button_size);
|
||||
}
|
||||
else if (isTrackRecordingEnabled)
|
||||
offsetY += UiUtils.dimen(this, R.dimen.map_button_size);
|
||||
offsetY += dimen(this, R.dimen.map_button_size);
|
||||
}
|
||||
updateCompassOffset(offsetY, offsetX);
|
||||
}
|
||||
@@ -2428,18 +2393,18 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
{
|
||||
switch (keyCode)
|
||||
{
|
||||
case KeyEvent.KEYCODE_DPAD_DOWN: Map.zoomOut(); return true;
|
||||
case KeyEvent.KEYCODE_DPAD_UP: Map.zoomIn(); return true;
|
||||
case KeyEvent.KEYCODE_ESCAPE:
|
||||
final Intent currIntent = getIntent();
|
||||
final String backUrl = Framework.nativeGetParsedBackUrl();
|
||||
if (TextUtils.isEmpty(backUrl) || (currIntent != null && Factory.isStartedForApiResult(currIntent)))
|
||||
{
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onKeyUp(keyCode, event);
|
||||
default: return super.onKeyUp(keyCode, event);
|
||||
case KeyEvent.KEYCODE_DPAD_DOWN: Map.zoomOut(); return true;
|
||||
case KeyEvent.KEYCODE_DPAD_UP: Map.zoomIn(); return true;
|
||||
case KeyEvent.KEYCODE_ESCAPE:
|
||||
final Intent currIntent = getIntent();
|
||||
final String backUrl = Framework.nativeGetParsedBackUrl();
|
||||
if (TextUtils.isEmpty(backUrl) || (currIntent != null && Factory.isStartedForApiResult(currIntent)))
|
||||
{
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onKeyUp(keyCode, event);
|
||||
default: return super.onKeyUp(keyCode, event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2491,7 +2456,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
if (mCurrentWindowInsets != null)
|
||||
{
|
||||
final int offset = mCurrentWindowInsets.getInsets(WindowInsetsCompat.Type.systemBars()).top;
|
||||
updateCompassOffset(offset + UiUtils.dimen(this, R.dimen.map_button_size));
|
||||
updateCompassOffset(offset + dimen(this, R.dimen.map_button_size));
|
||||
}
|
||||
Toast.makeText(this, R.string.track_recording, Toast.LENGTH_SHORT).show();
|
||||
TrackRecordingService.startForegroundService(getApplicationContext());
|
||||
@@ -2584,7 +2549,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
items.add(new MenuBottomSheetItem(R.string.download_maps, R.drawable.ic_download, getDownloadMapsCounter(),
|
||||
this::onDownloadMapsOptionSelected));
|
||||
|
||||
mDonatesUrl = Config.getDonateUrl(getApplicationContext());
|
||||
mDonatesUrl = Utils.getDonateUrl(getApplicationContext());
|
||||
if (!mDonatesUrl.isEmpty())
|
||||
items.add(new MenuBottomSheetItem(R.string.donate, R.drawable.ic_donate, this::onDonateOptionSelected));
|
||||
|
||||
|
||||
@@ -14,11 +14,12 @@ import androidx.lifecycle.DefaultLifecycleObserver;
|
||||
import androidx.lifecycle.LifecycleObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.ProcessLifecycleOwner;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import app.organicmaps.background.OsmUploadWork;
|
||||
import app.organicmaps.downloader.DownloaderNotifier;
|
||||
import app.organicmaps.location.LocationProviderFactoryImpl;
|
||||
import app.organicmaps.location.TrackRecordingService;
|
||||
import app.organicmaps.routing.NavigationService;
|
||||
import app.organicmaps.routing.RoutingController;
|
||||
import app.organicmaps.sdk.Map;
|
||||
import app.organicmaps.sdk.OrganicMaps;
|
||||
import app.organicmaps.sdk.display.DisplayManager;
|
||||
@@ -28,9 +29,11 @@ import app.organicmaps.sdk.location.SensorHelper;
|
||||
import app.organicmaps.sdk.location.TrackRecorder;
|
||||
import app.organicmaps.sdk.maplayer.isolines.IsolinesManager;
|
||||
import app.organicmaps.sdk.maplayer.subway.SubwayManager;
|
||||
import app.organicmaps.sdk.routing.RoutingController;
|
||||
import app.organicmaps.sdk.util.Config;
|
||||
import app.organicmaps.sdk.util.ConnectionState;
|
||||
import app.organicmaps.sdk.util.log.Logger;
|
||||
import app.organicmaps.util.ThemeSwitcher;
|
||||
import app.organicmaps.util.Utils;
|
||||
import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
@@ -40,6 +43,9 @@ public class MwmApplication extends Application implements Application.ActivityL
|
||||
@NonNull
|
||||
private static final String TAG = MwmApplication.class.getSimpleName();
|
||||
|
||||
@NonNull
|
||||
private final LocationProviderFactoryImpl mLocationProviderFactory = new LocationProviderFactoryImpl();
|
||||
|
||||
@SuppressWarnings("NotNullFieldNotInitialized")
|
||||
@NonNull
|
||||
private OrganicMaps mOrganicMaps;
|
||||
@@ -98,6 +104,12 @@ public class MwmApplication extends Application implements Application.ActivityL
|
||||
return mOrganicMaps;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public LocationProviderFactoryImpl getLocationProviderFactory()
|
||||
{
|
||||
return mLocationProviderFactory;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static MwmApplication from(@NonNull Context context)
|
||||
{
|
||||
@@ -118,7 +130,10 @@ public class MwmApplication extends Application implements Application.ActivityL
|
||||
|
||||
sInstance = this;
|
||||
|
||||
mOrganicMaps = new OrganicMaps(getApplicationContext());
|
||||
PreferenceManager.setDefaultValues(this, R.xml.prefs_main, false);
|
||||
mOrganicMaps = new OrganicMaps(getApplicationContext(), BuildConfig.FLAVOR, BuildConfig.APPLICATION_ID,
|
||||
BuildConfig.VERSION_CODE, BuildConfig.VERSION_NAME,
|
||||
BuildConfig.FILE_PROVIDER_AUTHORITY, mLocationProviderFactory);
|
||||
|
||||
ConnectionState.INSTANCE.initialize(this);
|
||||
|
||||
@@ -133,6 +148,8 @@ public class MwmApplication extends Application implements Application.ActivityL
|
||||
public boolean initOrganicMaps(@NonNull Runnable onComplete) throws IOException
|
||||
{
|
||||
return mOrganicMaps.init(() -> {
|
||||
ThemeSwitcher.INSTANCE.initialize(this);
|
||||
ThemeSwitcher.INSTANCE.restart(false);
|
||||
ProcessLifecycleOwner.get().getLifecycle().addObserver(mProcessLifecycleObserver);
|
||||
onComplete.run();
|
||||
});
|
||||
|
||||
@@ -9,7 +9,8 @@ import androidx.annotation.IntegerRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import app.organicmaps.sdk.util.UiUtils;
|
||||
import app.organicmaps.sdk.util.Utils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import org.chromium.base.ObserverList;
|
||||
|
||||
class PanelAnimator
|
||||
@@ -26,7 +27,7 @@ class PanelAnimator
|
||||
PanelAnimator(MwmActivity activity)
|
||||
{
|
||||
mActivity = activity;
|
||||
mWidth = UiUtils.dimen(activity.getApplicationContext(), R.dimen.panel_width);
|
||||
mWidth = Utils.dimen(activity.getApplicationContext(), R.dimen.panel_width);
|
||||
mPanel = mActivity.findViewById(R.id.fragment_container);
|
||||
mDuration = mActivity.getResources().getInteger(R.integer.anim_panel);
|
||||
}
|
||||
|
||||
@@ -60,11 +60,10 @@ public class SplashActivity extends AppCompatActivity
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
final Context context = getApplicationContext();
|
||||
final String theme = Config.getCurrentUiTheme(context);
|
||||
if (ThemeUtils.isDefaultTheme(context, theme))
|
||||
final String theme = Config.UiTheme.getCurrent();
|
||||
if (Config.UiTheme.isDefault(theme))
|
||||
setTheme(R.style.MwmTheme_Splash);
|
||||
else if (ThemeUtils.isNightTheme(context, theme))
|
||||
else if (Config.UiTheme.isNight(theme))
|
||||
setTheme(R.style.MwmTheme_Night_Splash);
|
||||
else
|
||||
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);
|
||||
|
||||
@@ -9,7 +9,7 @@ import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import androidx.annotation.NonNull;
|
||||
import app.organicmaps.base.OnBackPressListener;
|
||||
import app.organicmaps.sdk.util.UiUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
|
||||
public abstract class WebContainerDelegate implements OnBackPressListener
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.organicmaps.backup;
|
||||
|
||||
import static app.organicmaps.sdk.util.StorageUtils.isFolderWritable;
|
||||
import static app.organicmaps.sdk.util.Utils.dimen;
|
||||
import static app.organicmaps.settings.BackupSettingsFragment.MAX_BACKUPS_DEFAULT_COUNT;
|
||||
import static app.organicmaps.settings.BackupSettingsFragment.MAX_BACKUPS_KEY;
|
||||
|
||||
@@ -15,8 +16,8 @@ import android.text.style.AbsoluteSizeSpan;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.documentfile.provider.DocumentFile;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.sdk.util.UiUtils;
|
||||
import app.organicmaps.sdk.util.log.Logger;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
@@ -50,14 +51,14 @@ public class BackupUtils
|
||||
|
||||
String volumeName;
|
||||
if ("primary".equalsIgnoreCase(volumeId))
|
||||
volumeName = context.getString(R.string.maps_storage_shared);
|
||||
volumeName = context.getString(app.organicmaps.sdk.R.string.maps_storage_shared);
|
||||
else
|
||||
volumeName = context.getString(R.string.maps_storage_removable);
|
||||
volumeName = context.getString(app.organicmaps.sdk.R.string.maps_storage_removable);
|
||||
|
||||
SpannableStringBuilder sb = new SpannableStringBuilder();
|
||||
sb.append(volumeName + ": \n", new AbsoluteSizeSpan(UiUtils.dimen(context, R.dimen.text_size_body_3)),
|
||||
sb.append(volumeName + ": \n", new AbsoluteSizeSpan(dimen(context, R.dimen.text_size_body_3)),
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
sb.append("/" + subPath, new AbsoluteSizeSpan(UiUtils.dimen(context, R.dimen.text_size_body_4)),
|
||||
sb.append("/" + subPath, new AbsoluteSizeSpan(dimen(context, R.dimen.text_size_body_4)),
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
return sb;
|
||||
}
|
||||
|
||||
@@ -62,39 +62,39 @@ public class LocalBackupManager implements BookmarkManager.BookmarksSharingListe
|
||||
ErrorCode errorCode = null;
|
||||
switch (result.getCode())
|
||||
{
|
||||
case BookmarkSharingResult.SUCCESS ->
|
||||
{
|
||||
if (!saveBackup(result))
|
||||
{
|
||||
Logger.e(TAG, "Failed to save backup. See system log above");
|
||||
errorCode = ErrorCode.FILE_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.i(TAG, "Backup was created and saved successfully");
|
||||
}
|
||||
}
|
||||
case BookmarkSharingResult.EMPTY_CATEGORY ->
|
||||
{
|
||||
errorCode = ErrorCode.EMPTY_CATEGORY;
|
||||
Logger.e(TAG, "Failed to create backup. Category is empty");
|
||||
}
|
||||
case BookmarkSharingResult.ARCHIVE_ERROR ->
|
||||
{
|
||||
errorCode = ErrorCode.ARCHIVE_ERROR;
|
||||
Logger.e(TAG, "Failed to create archive of bookmarks");
|
||||
}
|
||||
case BookmarkSharingResult.FILE_ERROR ->
|
||||
case BookmarkSharingResult.SUCCESS ->
|
||||
{
|
||||
if (!saveBackup(result))
|
||||
{
|
||||
Logger.e(TAG, "Failed to save backup. See system log above");
|
||||
errorCode = ErrorCode.FILE_ERROR;
|
||||
Logger.e(TAG, "Failed create file for archive");
|
||||
}
|
||||
default ->
|
||||
else
|
||||
{
|
||||
errorCode = ErrorCode.UNSUPPORTED;
|
||||
Logger.e(TAG, "Failed to create backup. Unknown error");
|
||||
Logger.i(TAG, "Backup was created and saved successfully");
|
||||
}
|
||||
}
|
||||
case BookmarkSharingResult.EMPTY_CATEGORY ->
|
||||
{
|
||||
errorCode = ErrorCode.EMPTY_CATEGORY;
|
||||
Logger.e(TAG, "Failed to create backup. Category is empty");
|
||||
}
|
||||
case BookmarkSharingResult.ARCHIVE_ERROR ->
|
||||
{
|
||||
errorCode = ErrorCode.ARCHIVE_ERROR;
|
||||
Logger.e(TAG, "Failed to create archive of bookmarks");
|
||||
}
|
||||
case BookmarkSharingResult.FILE_ERROR ->
|
||||
{
|
||||
errorCode = ErrorCode.FILE_ERROR;
|
||||
Logger.e(TAG, "Failed create file for archive");
|
||||
}
|
||||
default ->
|
||||
{
|
||||
errorCode = ErrorCode.UNSUPPORTED;
|
||||
Logger.e(TAG, "Failed to create backup. Unknown error");
|
||||
}
|
||||
}
|
||||
|
||||
ErrorCode finalErrorCode = errorCode;
|
||||
UiThread.run(() -> {
|
||||
|
||||
@@ -15,7 +15,7 @@ public class BaseMwmDialogFragment extends DialogFragment
|
||||
@StyleRes
|
||||
protected final int getFullscreenTheme()
|
||||
{
|
||||
return ThemeUtils.isNightTheme(requireContext()) ? getFullscreenDarkTheme() : getFullscreenLightTheme();
|
||||
return ThemeUtils.isNightTheme() ? getFullscreenDarkTheme() : getFullscreenLightTheme();
|
||||
}
|
||||
|
||||
protected int getStyle()
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package app.organicmaps.base;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.media.AudioManager;
|
||||
@@ -24,7 +23,6 @@ import app.organicmaps.sdk.util.Config;
|
||||
import app.organicmaps.sdk.util.concurrency.UiThread;
|
||||
import app.organicmaps.sdk.util.log.Logger;
|
||||
import app.organicmaps.util.RtlUtils;
|
||||
import app.organicmaps.util.ThemeUtils;
|
||||
import com.google.android.material.appbar.MaterialToolbar;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -40,12 +38,10 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
|
||||
@StyleRes
|
||||
protected int getThemeResourceId(@NonNull String theme)
|
||||
{
|
||||
Context context = getApplicationContext();
|
||||
|
||||
if (ThemeUtils.isDefaultTheme(context, theme))
|
||||
if (Config.UiTheme.isDefault(theme))
|
||||
return R.style.MwmTheme;
|
||||
|
||||
if (ThemeUtils.isNightTheme(context, theme))
|
||||
if (Config.UiTheme.isNight(theme))
|
||||
return R.style.MwmTheme_Night;
|
||||
|
||||
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);
|
||||
@@ -62,7 +58,7 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
|
||||
protected final void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
mThemeName = Config.getCurrentUiTheme(getApplicationContext());
|
||||
mThemeName = Config.UiTheme.getCurrent();
|
||||
setTheme(getThemeResourceId(mThemeName));
|
||||
EdgeToEdge.enable(this, SystemBarStyle.dark(Color.TRANSPARENT));
|
||||
RtlUtils.manageRtl(this);
|
||||
@@ -122,7 +118,7 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
|
||||
public void onPostResume()
|
||||
{
|
||||
super.onPostResume();
|
||||
if (!mThemeName.equals(Config.getCurrentUiTheme(getApplicationContext())))
|
||||
if (!mThemeName.equals(Config.UiTheme.getCurrent()))
|
||||
{
|
||||
// Workaround described in https://code.google.com/p/android/issues/detail?id=93731
|
||||
UiThread.runLater(this::recreate);
|
||||
|
||||
@@ -14,7 +14,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.sdk.util.UiUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.util.WindowInsetUtils.ScrollableContentInsetsListener;
|
||||
import app.organicmaps.widget.PlaceholderView;
|
||||
|
||||
@@ -10,7 +10,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentFactory;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.sdk.util.UiUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.WindowInsetUtils.PaddingInsetsListener;
|
||||
import com.google.android.material.appbar.MaterialToolbar;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class BookmarkCategoriesActivity extends BaseToolbarActivity
|
||||
@StyleRes
|
||||
public int getThemeResourceId(@NonNull String theme)
|
||||
{
|
||||
return ThemeUtils.getWindowBgThemeResourceId(getApplicationContext(), theme);
|
||||
return ThemeUtils.getWindowBgThemeResourceId(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -66,47 +66,47 @@ public class BookmarkCategoriesAdapter extends BaseBookmarkCategoryAdapter<Recyc
|
||||
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
|
||||
switch (viewType)
|
||||
{
|
||||
case TYPE_ACTION_HEADER ->
|
||||
{
|
||||
View header = inflater.inflate(R.layout.item_bookmark_group_list_header, parent, false);
|
||||
return new HeaderViewHolder(header);
|
||||
}
|
||||
case TYPE_CATEGORY_ITEM ->
|
||||
{
|
||||
View view = inflater.inflate(R.layout.item_bookmark_category, parent, false);
|
||||
final CategoryViewHolder holder = new CategoryViewHolder(view);
|
||||
view.setOnClickListener(new CategoryItemClickListener(holder));
|
||||
view.setOnLongClickListener(new LongClickListener(holder));
|
||||
return holder;
|
||||
}
|
||||
case TYPE_ACTION_ADD ->
|
||||
{
|
||||
View item = inflater.inflate(R.layout.item_bookmark_button, parent, false);
|
||||
item.setOnClickListener(v -> {
|
||||
if (mCategoryListCallback != null)
|
||||
mCategoryListCallback.onAddButtonClick();
|
||||
});
|
||||
return new Holders.GeneralViewHolder(item);
|
||||
}
|
||||
case TYPE_ACTION_IMPORT ->
|
||||
{
|
||||
View item = inflater.inflate(R.layout.item_bookmark_button, parent, false);
|
||||
item.setOnClickListener(v -> {
|
||||
if (mCategoryListCallback != null)
|
||||
mCategoryListCallback.onImportButtonClick();
|
||||
});
|
||||
return new Holders.GeneralViewHolder(item);
|
||||
}
|
||||
case TYPE_ACTION_EXPORT_ALL_AS_KMZ ->
|
||||
{
|
||||
View item = inflater.inflate(R.layout.item_bookmark_button, parent, false);
|
||||
item.setOnClickListener(v -> {
|
||||
if (mCategoryListCallback != null)
|
||||
mCategoryListCallback.onExportButtonClick();
|
||||
});
|
||||
return new Holders.GeneralViewHolder(item);
|
||||
}
|
||||
default -> throw new AssertionError("Invalid item type: " + viewType);
|
||||
case TYPE_ACTION_HEADER ->
|
||||
{
|
||||
View header = inflater.inflate(R.layout.item_bookmark_group_list_header, parent, false);
|
||||
return new HeaderViewHolder(header);
|
||||
}
|
||||
case TYPE_CATEGORY_ITEM ->
|
||||
{
|
||||
View view = inflater.inflate(R.layout.item_bookmark_category, parent, false);
|
||||
final CategoryViewHolder holder = new CategoryViewHolder(view);
|
||||
view.setOnClickListener(new CategoryItemClickListener(holder));
|
||||
view.setOnLongClickListener(new LongClickListener(holder));
|
||||
return holder;
|
||||
}
|
||||
case TYPE_ACTION_ADD ->
|
||||
{
|
||||
View item = inflater.inflate(R.layout.item_bookmark_button, parent, false);
|
||||
item.setOnClickListener(v -> {
|
||||
if (mCategoryListCallback != null)
|
||||
mCategoryListCallback.onAddButtonClick();
|
||||
});
|
||||
return new Holders.GeneralViewHolder(item);
|
||||
}
|
||||
case TYPE_ACTION_IMPORT ->
|
||||
{
|
||||
View item = inflater.inflate(R.layout.item_bookmark_button, parent, false);
|
||||
item.setOnClickListener(v -> {
|
||||
if (mCategoryListCallback != null)
|
||||
mCategoryListCallback.onImportButtonClick();
|
||||
});
|
||||
return new Holders.GeneralViewHolder(item);
|
||||
}
|
||||
case TYPE_ACTION_EXPORT_ALL_AS_KMZ ->
|
||||
{
|
||||
View item = inflater.inflate(R.layout.item_bookmark_button, parent, false);
|
||||
item.setOnClickListener(v -> {
|
||||
if (mCategoryListCallback != null)
|
||||
mCategoryListCallback.onExportButtonClick();
|
||||
});
|
||||
return new Holders.GeneralViewHolder(item);
|
||||
}
|
||||
default -> throw new AssertionError("Invalid item type: " + viewType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,44 +116,44 @@ public class BookmarkCategoriesAdapter extends BaseBookmarkCategoryAdapter<Recyc
|
||||
int type = getItemViewType(position);
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_ACTION_HEADER ->
|
||||
{
|
||||
HeaderViewHolder headerViewHolder = (HeaderViewHolder) holder;
|
||||
headerViewHolder.setAction(mMassOperationAction, BookmarkManager.INSTANCE.areAllCategoriesInvisible());
|
||||
headerViewHolder.getText().setText(R.string.bookmark_lists);
|
||||
}
|
||||
case TYPE_CATEGORY_ITEM ->
|
||||
{
|
||||
final BookmarkCategory category = getCategoryByPosition(toCategoryPosition(position));
|
||||
CategoryViewHolder categoryHolder = (CategoryViewHolder) holder;
|
||||
categoryHolder.setEntity(category);
|
||||
categoryHolder.setName(category.getName());
|
||||
categoryHolder.setSize();
|
||||
categoryHolder.setVisibilityState(category.isVisible());
|
||||
ToggleVisibilityClickListener visibilityListener = new ToggleVisibilityClickListener(categoryHolder);
|
||||
categoryHolder.setVisibilityListener(visibilityListener);
|
||||
CategoryItemMoreClickListener moreClickListener = new CategoryItemMoreClickListener(categoryHolder);
|
||||
categoryHolder.setMoreButtonClickListener(moreClickListener);
|
||||
}
|
||||
case TYPE_ACTION_ADD ->
|
||||
{
|
||||
Holders.GeneralViewHolder generalViewHolder = (Holders.GeneralViewHolder) holder;
|
||||
generalViewHolder.getImage().setImageResource(R.drawable.ic_add_list);
|
||||
generalViewHolder.getText().setText(R.string.bookmarks_create_new_group);
|
||||
}
|
||||
case TYPE_ACTION_IMPORT ->
|
||||
{
|
||||
Holders.GeneralViewHolder generalViewHolder = (Holders.GeneralViewHolder) holder;
|
||||
generalViewHolder.getImage().setImageResource(R.drawable.ic_import);
|
||||
generalViewHolder.getText().setText(R.string.bookmarks_import);
|
||||
}
|
||||
case TYPE_ACTION_EXPORT_ALL_AS_KMZ ->
|
||||
{
|
||||
Holders.GeneralViewHolder generalViewHolder = (Holders.GeneralViewHolder) holder;
|
||||
generalViewHolder.getImage().setImageResource(R.drawable.ic_export);
|
||||
generalViewHolder.getText().setText(R.string.bookmarks_export);
|
||||
}
|
||||
default -> throw new AssertionError("Invalid item type: " + type);
|
||||
case TYPE_ACTION_HEADER ->
|
||||
{
|
||||
HeaderViewHolder headerViewHolder = (HeaderViewHolder) holder;
|
||||
headerViewHolder.setAction(mMassOperationAction, BookmarkManager.INSTANCE.areAllCategoriesInvisible());
|
||||
headerViewHolder.getText().setText(R.string.bookmark_lists);
|
||||
}
|
||||
case TYPE_CATEGORY_ITEM ->
|
||||
{
|
||||
final BookmarkCategory category = getCategoryByPosition(toCategoryPosition(position));
|
||||
CategoryViewHolder categoryHolder = (CategoryViewHolder) holder;
|
||||
categoryHolder.setEntity(category);
|
||||
categoryHolder.setName(category.getName());
|
||||
categoryHolder.setSize();
|
||||
categoryHolder.setVisibilityState(category.isVisible());
|
||||
ToggleVisibilityClickListener visibilityListener = new ToggleVisibilityClickListener(categoryHolder);
|
||||
categoryHolder.setVisibilityListener(visibilityListener);
|
||||
CategoryItemMoreClickListener moreClickListener = new CategoryItemMoreClickListener(categoryHolder);
|
||||
categoryHolder.setMoreButtonClickListener(moreClickListener);
|
||||
}
|
||||
case TYPE_ACTION_ADD ->
|
||||
{
|
||||
Holders.GeneralViewHolder generalViewHolder = (Holders.GeneralViewHolder) holder;
|
||||
generalViewHolder.getImage().setImageResource(R.drawable.ic_add_list);
|
||||
generalViewHolder.getText().setText(R.string.bookmarks_create_new_group);
|
||||
}
|
||||
case TYPE_ACTION_IMPORT ->
|
||||
{
|
||||
Holders.GeneralViewHolder generalViewHolder = (Holders.GeneralViewHolder) holder;
|
||||
generalViewHolder.getImage().setImageResource(R.drawable.ic_import);
|
||||
generalViewHolder.getText().setText(R.string.bookmarks_import);
|
||||
}
|
||||
case TYPE_ACTION_EXPORT_ALL_AS_KMZ ->
|
||||
{
|
||||
Holders.GeneralViewHolder generalViewHolder = (Holders.GeneralViewHolder) holder;
|
||||
generalViewHolder.getImage().setImageResource(R.drawable.ic_export);
|
||||
generalViewHolder.getText().setText(R.string.bookmarks_export);
|
||||
}
|
||||
default -> throw new AssertionError("Invalid item type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import app.organicmaps.R;
|
||||
import app.organicmaps.adapter.OnItemClickListener;
|
||||
import app.organicmaps.sdk.bookmarks.data.BookmarkCategory;
|
||||
import app.organicmaps.sdk.bookmarks.data.BookmarkManager;
|
||||
import app.organicmaps.sdk.util.UiUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.List;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class BookmarkListActivity extends BaseToolbarActivity
|
||||
@StyleRes
|
||||
public int getThemeResourceId(@NonNull String theme)
|
||||
{
|
||||
return ThemeUtils.getCardBgThemeResourceId(getApplicationContext(), theme);
|
||||
return ThemeUtils.getCardBgThemeResourceId(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -442,37 +442,37 @@ public class BookmarkListAdapter extends RecyclerView.Adapter<Holders.BaseBookma
|
||||
Holders.BaseBookmarkHolder holder = null;
|
||||
switch (viewType)
|
||||
{
|
||||
case TYPE_TRACK:
|
||||
Holders.TrackViewHolder trackHolder =
|
||||
new Holders.TrackViewHolder(inflater.inflate(R.layout.item_track, parent, false));
|
||||
trackHolder.setOnClickListener(mClickListener);
|
||||
trackHolder.setOnLongClickListener(mLongClickListener);
|
||||
trackHolder.setTrackIconClickListener(mIconClickListener);
|
||||
trackHolder.setMoreButtonClickListener(mMoreClickListener);
|
||||
holder = trackHolder;
|
||||
break;
|
||||
case TYPE_BOOKMARK:
|
||||
Holders.BookmarkViewHolder bookmarkHolder =
|
||||
new Holders.BookmarkViewHolder(inflater.inflate(R.layout.item_bookmark, parent, false));
|
||||
bookmarkHolder.setOnClickListener(mClickListener);
|
||||
bookmarkHolder.setOnLongClickListener(mLongClickListener);
|
||||
holder = bookmarkHolder;
|
||||
break;
|
||||
case TYPE_SECTION:
|
||||
MaterialTextView tv = (MaterialTextView) inflater.inflate(R.layout.item_category_title, parent, false);
|
||||
holder = new Holders.SectionViewHolder(tv);
|
||||
break;
|
||||
case TYPE_DESC:
|
||||
View desc = inflater.inflate(R.layout.item_category_description, parent, false);
|
||||
MaterialTextView moreBtn = desc.findViewById(R.id.more_btn);
|
||||
MaterialTextView text = desc.findViewById(R.id.text);
|
||||
MaterialTextView title = desc.findViewById(R.id.title);
|
||||
setMoreButtonVisibility(text, moreBtn);
|
||||
holder = new Holders.DescriptionViewHolder(desc, mSectionsDataSource.getCategory());
|
||||
text.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
|
||||
moreBtn.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
|
||||
title.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
|
||||
break;
|
||||
case TYPE_TRACK:
|
||||
Holders.TrackViewHolder trackHolder =
|
||||
new Holders.TrackViewHolder(inflater.inflate(R.layout.item_track, parent, false));
|
||||
trackHolder.setOnClickListener(mClickListener);
|
||||
trackHolder.setOnLongClickListener(mLongClickListener);
|
||||
trackHolder.setTrackIconClickListener(mIconClickListener);
|
||||
trackHolder.setMoreButtonClickListener(mMoreClickListener);
|
||||
holder = trackHolder;
|
||||
break;
|
||||
case TYPE_BOOKMARK:
|
||||
Holders.BookmarkViewHolder bookmarkHolder =
|
||||
new Holders.BookmarkViewHolder(inflater.inflate(R.layout.item_bookmark, parent, false));
|
||||
bookmarkHolder.setOnClickListener(mClickListener);
|
||||
bookmarkHolder.setOnLongClickListener(mLongClickListener);
|
||||
holder = bookmarkHolder;
|
||||
break;
|
||||
case TYPE_SECTION:
|
||||
MaterialTextView tv = (MaterialTextView) inflater.inflate(R.layout.item_category_title, parent, false);
|
||||
holder = new Holders.SectionViewHolder(tv);
|
||||
break;
|
||||
case TYPE_DESC:
|
||||
View desc = inflater.inflate(R.layout.item_category_description, parent, false);
|
||||
MaterialTextView moreBtn = desc.findViewById(R.id.more_btn);
|
||||
MaterialTextView text = desc.findViewById(R.id.text);
|
||||
MaterialTextView title = desc.findViewById(R.id.title);
|
||||
setMoreButtonVisibility(text, moreBtn);
|
||||
holder = new Holders.DescriptionViewHolder(desc, mSectionsDataSource.getCategory());
|
||||
text.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
|
||||
moreBtn.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
|
||||
title.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
|
||||
break;
|
||||
}
|
||||
|
||||
if (holder == null)
|
||||
|
||||
@@ -33,15 +33,15 @@ import app.organicmaps.sdk.bookmarks.data.BookmarkInfo;
|
||||
import app.organicmaps.sdk.bookmarks.data.BookmarkManager;
|
||||
import app.organicmaps.sdk.bookmarks.data.BookmarkSharingResult;
|
||||
import app.organicmaps.sdk.bookmarks.data.CategoryDataSource;
|
||||
import app.organicmaps.sdk.bookmarks.data.Icon;
|
||||
import app.organicmaps.sdk.bookmarks.data.KmlFileType;
|
||||
import app.organicmaps.sdk.bookmarks.data.PredefinedColors;
|
||||
import app.organicmaps.sdk.bookmarks.data.SortedBlock;
|
||||
import app.organicmaps.sdk.bookmarks.data.Track;
|
||||
import app.organicmaps.sdk.search.BookmarkSearchListener;
|
||||
import app.organicmaps.sdk.search.SearchEngine;
|
||||
import app.organicmaps.sdk.util.UiUtils;
|
||||
import app.organicmaps.util.Graphics;
|
||||
import app.organicmaps.util.SharingUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.util.WindowInsetUtils;
|
||||
import app.organicmaps.util.bottomsheet.MenuBottomSheetFragment;
|
||||
@@ -551,12 +551,12 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<ConcatAdapter
|
||||
|
||||
switch (adapter.getItemViewType(position))
|
||||
{
|
||||
case BookmarkListAdapter.TYPE_SECTION, BookmarkListAdapter.TYPE_DESC ->
|
||||
{
|
||||
return;
|
||||
}
|
||||
case BookmarkListAdapter.TYPE_BOOKMARK -> onBookmarkClicked(position, intent, adapter);
|
||||
case BookmarkListAdapter.TYPE_TRACK -> onTrackClicked(position, intent, adapter);
|
||||
case BookmarkListAdapter.TYPE_SECTION, BookmarkListAdapter.TYPE_DESC ->
|
||||
{
|
||||
return;
|
||||
}
|
||||
case BookmarkListAdapter.TYPE_BOOKMARK -> onBookmarkClicked(position, intent, adapter);
|
||||
case BookmarkListAdapter.TYPE_TRACK -> onTrackClicked(position, intent, adapter);
|
||||
}
|
||||
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
@@ -592,7 +592,7 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<ConcatAdapter
|
||||
if (mTrack == null)
|
||||
return;
|
||||
final Bundle args = new Bundle();
|
||||
args.putInt(BookmarkColorDialogFragment.ICON_TYPE, Icon.getColorPosition(mTrack.getColor()));
|
||||
args.putInt(BookmarkColorDialogFragment.ICON_COLOR, PredefinedColors.getPredefinedColorIndex(mTrack.getColor()));
|
||||
final FragmentManager manager = getChildFragmentManager();
|
||||
String className = BookmarkColorDialogFragment.class.getName();
|
||||
final FragmentFactory factory = manager.getFragmentFactory();
|
||||
@@ -601,7 +601,7 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<ConcatAdapter
|
||||
dialogFragment.setArguments(args);
|
||||
dialogFragment.setOnColorSetListener((colorPos) -> {
|
||||
int from = mTrack.getColor();
|
||||
int to = BookmarkManager.ICONS.get(colorPos).argb();
|
||||
int to = PredefinedColors.getColor(colorPos);
|
||||
if (from == to)
|
||||
return;
|
||||
BookmarkManager.INSTANCE.changeTrackColor(mTrack.getTrackId(), to);
|
||||
@@ -621,22 +621,22 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<ConcatAdapter
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case BookmarkListAdapter.TYPE_SECTION:
|
||||
case BookmarkListAdapter.TYPE_DESC:
|
||||
// Do nothing here?
|
||||
break;
|
||||
case BookmarkListAdapter.TYPE_SECTION:
|
||||
case BookmarkListAdapter.TYPE_DESC:
|
||||
// Do nothing here?
|
||||
break;
|
||||
|
||||
case BookmarkListAdapter.TYPE_BOOKMARK:
|
||||
final BookmarkInfo bookmark = (BookmarkInfo) adapter.getItem(mSelectedPosition);
|
||||
MenuBottomSheetFragment.newInstance(BOOKMARKS_MENU_ID, bookmark.getName())
|
||||
.show(getChildFragmentManager(), BOOKMARKS_MENU_ID);
|
||||
break;
|
||||
case BookmarkListAdapter.TYPE_BOOKMARK:
|
||||
final BookmarkInfo bookmark = (BookmarkInfo) adapter.getItem(mSelectedPosition);
|
||||
MenuBottomSheetFragment.newInstance(BOOKMARKS_MENU_ID, bookmark.getName())
|
||||
.show(getChildFragmentManager(), BOOKMARKS_MENU_ID);
|
||||
break;
|
||||
|
||||
case BookmarkListAdapter.TYPE_TRACK:
|
||||
final Track track = (Track) adapter.getItem(mSelectedPosition);
|
||||
MenuBottomSheetFragment.newInstance(TRACK_MENU_ID, track.getName())
|
||||
.show(getChildFragmentManager(), TRACK_MENU_ID);
|
||||
break;
|
||||
case BookmarkListAdapter.TYPE_TRACK:
|
||||
final Track track = (Track) adapter.getItem(mSelectedPosition);
|
||||
MenuBottomSheetFragment.newInstance(TRACK_MENU_ID, track.getName())
|
||||
.show(getChildFragmentManager(), TRACK_MENU_ID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -843,19 +843,19 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<ConcatAdapter
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case BOOKMARKS_MENU_ID ->
|
||||
{
|
||||
return getBookmarkMenuItems();
|
||||
}
|
||||
case TRACK_MENU_ID ->
|
||||
{
|
||||
final Track track = (Track) getBookmarkListAdapter().getItem(mSelectedPosition);
|
||||
return getTrackMenuItems(track);
|
||||
}
|
||||
case OPTIONS_MENU_ID ->
|
||||
{
|
||||
return getOptionsMenuItems();
|
||||
}
|
||||
case BOOKMARKS_MENU_ID ->
|
||||
{
|
||||
return getBookmarkMenuItems();
|
||||
}
|
||||
case TRACK_MENU_ID ->
|
||||
{
|
||||
final Track track = (Track) getBookmarkListAdapter().getItem(mSelectedPosition);
|
||||
return getTrackMenuItems(track);
|
||||
}
|
||||
case OPTIONS_MENU_ID ->
|
||||
{
|
||||
return getOptionsMenuItems();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -57,27 +57,27 @@ public enum BookmarksSharingHelper
|
||||
|
||||
switch (result.getCode())
|
||||
{
|
||||
case BookmarkSharingResult.SUCCESS ->
|
||||
SharingUtils.shareBookmarkFile(context, launcher, result.getSharingPath(), result.getMimeType());
|
||||
case BookmarkSharingResult.EMPTY_CATEGORY ->
|
||||
new MaterialAlertDialogBuilder(context, R.style.MwmTheme_AlertDialog)
|
||||
.setTitle(R.string.bookmarks_error_title_share_empty)
|
||||
.setMessage(R.string.bookmarks_error_message_share_empty)
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.show();
|
||||
case BookmarkSharingResult.ARCHIVE_ERROR, BookmarkSharingResult.FILE_ERROR ->
|
||||
{
|
||||
new MaterialAlertDialogBuilder(context, R.style.MwmTheme_AlertDialog)
|
||||
.setTitle(R.string.dialog_routing_system_error)
|
||||
.setMessage(R.string.bookmarks_error_message_share_general)
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.show();
|
||||
List<String> names = new ArrayList<>();
|
||||
for (long categoryId : result.getCategoriesIds())
|
||||
names.add(BookmarkManager.INSTANCE.getCategoryById(categoryId).getName());
|
||||
Logger.e(TAG, "Failed to share bookmark categories " + names + ", error code: " + result.getCode());
|
||||
}
|
||||
default -> throw new AssertionError("Unsupported bookmark sharing code: " + result.getCode());
|
||||
case BookmarkSharingResult.SUCCESS ->
|
||||
SharingUtils.shareBookmarkFile(context, launcher, result.getSharingPath(), result.getMimeType());
|
||||
case BookmarkSharingResult.EMPTY_CATEGORY ->
|
||||
new MaterialAlertDialogBuilder(context, R.style.MwmTheme_AlertDialog)
|
||||
.setTitle(R.string.bookmarks_error_title_share_empty)
|
||||
.setMessage(R.string.bookmarks_error_message_share_empty)
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.show();
|
||||
case BookmarkSharingResult.ARCHIVE_ERROR, BookmarkSharingResult.FILE_ERROR ->
|
||||
{
|
||||
new MaterialAlertDialogBuilder(context, R.style.MwmTheme_AlertDialog)
|
||||
.setTitle(R.string.dialog_routing_system_error)
|
||||
.setMessage(R.string.bookmarks_error_message_share_general)
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.show();
|
||||
List<String> names = new ArrayList<>();
|
||||
for (long categoryId : result.getCategoriesIds())
|
||||
names.add(BookmarkManager.INSTANCE.getCategoryById(categoryId).getName());
|
||||
Logger.e(TAG, "Failed to share bookmark categories " + names + ", error code: " + result.getCode());
|
||||
}
|
||||
default -> throw new AssertionError("Unsupported bookmark sharing code: " + result.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import androidx.fragment.app.FragmentManager;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.base.BaseMwmDialogFragment;
|
||||
import app.organicmaps.sdk.bookmarks.data.BookmarkManager;
|
||||
import app.organicmaps.sdk.util.UiUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
|
||||
public class ChooseBookmarksSortingTypeFragment
|
||||
extends BaseMwmDialogFragment implements RadioGroup.OnCheckedChangeListener
|
||||
@@ -64,10 +64,10 @@ public class ChooseBookmarksSortingTypeFragment
|
||||
{
|
||||
switch (sortingType)
|
||||
{
|
||||
case BookmarkManager.SORT_BY_TYPE: return R.id.sort_by_type;
|
||||
case BookmarkManager.SORT_BY_DISTANCE: return R.id.sort_by_distance;
|
||||
case BookmarkManager.SORT_BY_TIME: return R.id.sort_by_time;
|
||||
case BookmarkManager.SORT_BY_NAME: return R.id.sort_by_name;
|
||||
case BookmarkManager.SORT_BY_TYPE: return R.id.sort_by_type;
|
||||
case BookmarkManager.SORT_BY_DISTANCE: return R.id.sort_by_distance;
|
||||
case BookmarkManager.SORT_BY_TIME: return R.id.sort_by_time;
|
||||
case BookmarkManager.SORT_BY_NAME: return R.id.sort_by_name;
|
||||
}
|
||||
}
|
||||
return R.id.sort_by_default;
|
||||
|
||||
@@ -6,19 +6,26 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import androidx.annotation.DrawableRes;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.sdk.bookmarks.data.Icon;
|
||||
import app.organicmaps.sdk.bookmarks.data.PredefinedColors;
|
||||
import app.organicmaps.util.Graphics;
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class IconsAdapter extends ArrayAdapter<Icon>
|
||||
public class ColorsAdapter extends ArrayAdapter<Integer>
|
||||
{
|
||||
@PredefinedColors.Color
|
||||
private int mCheckedIconColor;
|
||||
|
||||
public IconsAdapter(Context context, List<Icon> list)
|
||||
@DrawableRes
|
||||
private final int mIconResId;
|
||||
|
||||
public ColorsAdapter(Context context, List<Integer> list, @DrawableRes int iconResId)
|
||||
{
|
||||
super(context, 0, 0, list);
|
||||
mIconResId = iconResId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -35,19 +42,19 @@ public class IconsAdapter extends ArrayAdapter<Icon>
|
||||
else
|
||||
holder = (SpinnerViewHolder) convertView.getTag();
|
||||
|
||||
final Icon icon = getItem(position);
|
||||
@PredefinedColors.Color
|
||||
final int color = Objects.requireNonNull(getItem(position));
|
||||
|
||||
Drawable circle;
|
||||
if (icon.getColor() == mCheckedIconColor)
|
||||
if (color == mCheckedIconColor)
|
||||
{
|
||||
circle = Graphics.drawCircleAndImage(getItem(position).argb(), R.dimen.track_circle_size,
|
||||
app.organicmaps.sdk.R.drawable.ic_bookmark_none, R.dimen.bookmark_icon_size,
|
||||
getContext());
|
||||
circle = Graphics.drawCircleAndImage(PredefinedColors.getColor(mCheckedIconColor), R.dimen.track_circle_size,
|
||||
mIconResId, R.dimen.bookmark_icon_size, getContext());
|
||||
}
|
||||
else
|
||||
{
|
||||
circle =
|
||||
Graphics.drawCircle(getItem(position).argb(), R.dimen.select_color_circle_size, getContext().getResources());
|
||||
circle = Graphics.drawCircle(PredefinedColors.getColor(color), R.dimen.select_color_circle_size,
|
||||
getContext().getResources());
|
||||
}
|
||||
holder.icon.setImageDrawable(circle);
|
||||
return convertView;
|
||||
@@ -18,8 +18,8 @@ import app.organicmaps.sdk.bookmarks.data.BookmarkInfo;
|
||||
import app.organicmaps.sdk.bookmarks.data.BookmarkManager;
|
||||
import app.organicmaps.sdk.bookmarks.data.IconClickListener;
|
||||
import app.organicmaps.sdk.bookmarks.data.Track;
|
||||
import app.organicmaps.sdk.util.UiUtils;
|
||||
import app.organicmaps.util.Graphics;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.widget.recycler.RecyclerClickListener;
|
||||
import app.organicmaps.widget.recycler.RecyclerLongClickListener;
|
||||
|
||||
@@ -26,7 +26,6 @@ import app.organicmaps.car.util.CurrentCountryChangedListener;
|
||||
import app.organicmaps.car.util.IntentUtils;
|
||||
import app.organicmaps.car.util.ThemeUtils;
|
||||
import app.organicmaps.car.util.UserActionRequired;
|
||||
import app.organicmaps.routing.RoutingController;
|
||||
import app.organicmaps.sdk.Framework;
|
||||
import app.organicmaps.sdk.PlacePageActivationListener;
|
||||
import app.organicmaps.sdk.bookmarks.data.MapObject;
|
||||
@@ -34,6 +33,7 @@ import app.organicmaps.sdk.display.DisplayChangedListener;
|
||||
import app.organicmaps.sdk.display.DisplayManager;
|
||||
import app.organicmaps.sdk.display.DisplayType;
|
||||
import app.organicmaps.sdk.location.LocationState;
|
||||
import app.organicmaps.sdk.routing.RoutingController;
|
||||
import app.organicmaps.sdk.util.Config;
|
||||
import app.organicmaps.sdk.util.LocationUtils;
|
||||
import app.organicmaps.sdk.util.log.Logger;
|
||||
|
||||
@@ -27,7 +27,10 @@ public class SurfaceRenderer implements DefaultLifecycleObserver, SurfaceCallbac
|
||||
{
|
||||
private static final String TAG = SurfaceRenderer.class.getSimpleName();
|
||||
|
||||
@NonNull
|
||||
private final CarContext mCarContext;
|
||||
|
||||
@NonNull
|
||||
private final Map mMap = new Map(Car);
|
||||
|
||||
@NonNull
|
||||
@@ -56,6 +59,7 @@ public class SurfaceRenderer implements DefaultLifecycleObserver, SurfaceCallbac
|
||||
mSurface.release();
|
||||
mSurface = surfaceContainer.getSurface();
|
||||
|
||||
mMap.setLocationHelper(MwmApplication.from(mCarContext).getLocationHelper());
|
||||
mMap.onSurfaceCreated(mCarContext, mSurface,
|
||||
new Rect(0, 0, surfaceContainer.getWidth(), surfaceContainer.getHeight()),
|
||||
surfaceContainer.getDpi());
|
||||
|
||||
@@ -28,11 +28,11 @@ import app.organicmaps.car.util.RoutingUtils;
|
||||
import app.organicmaps.car.util.ThemeUtils;
|
||||
import app.organicmaps.car.util.UiHelpers;
|
||||
import app.organicmaps.routing.NavigationService;
|
||||
import app.organicmaps.routing.RoutingController;
|
||||
import app.organicmaps.sdk.Framework;
|
||||
import app.organicmaps.sdk.location.LocationHelper;
|
||||
import app.organicmaps.sdk.location.LocationListener;
|
||||
import app.organicmaps.sdk.routing.JunctionInfo;
|
||||
import app.organicmaps.sdk.routing.RoutingController;
|
||||
import app.organicmaps.sdk.routing.RoutingInfo;
|
||||
import app.organicmaps.sdk.sound.TtsPlayer;
|
||||
import app.organicmaps.sdk.util.LocationUtils;
|
||||
|
||||
@@ -35,11 +35,11 @@ import app.organicmaps.car.util.OnBackPressedCallback;
|
||||
import app.organicmaps.car.util.RoutingHelpers;
|
||||
import app.organicmaps.car.util.UiHelpers;
|
||||
import app.organicmaps.routing.ResultCodesHelper;
|
||||
import app.organicmaps.routing.RoutingController;
|
||||
import app.organicmaps.sdk.Framework;
|
||||
import app.organicmaps.sdk.Router;
|
||||
import app.organicmaps.sdk.bookmarks.data.MapObject;
|
||||
import app.organicmaps.sdk.bookmarks.data.Metadata;
|
||||
import app.organicmaps.sdk.routing.RoutingController;
|
||||
import app.organicmaps.sdk.routing.RoutingInfo;
|
||||
import app.organicmaps.sdk.util.Config;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -12,6 +12,7 @@ import androidx.lifecycle.LifecycleOwner;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.car.screens.ErrorScreen;
|
||||
import app.organicmaps.car.screens.base.BaseScreen;
|
||||
import app.organicmaps.downloader.MapManagerHelper;
|
||||
import app.organicmaps.sdk.downloader.CountryItem;
|
||||
import app.organicmaps.sdk.downloader.MapManager;
|
||||
import app.organicmaps.sdk.util.StringUtils;
|
||||
@@ -169,7 +170,7 @@ class DownloaderScreen extends BaseScreen
|
||||
mIsDownloadFailed = true;
|
||||
final ErrorScreen.Builder builder = new ErrorScreen.Builder(getCarContext())
|
||||
.setTitle(R.string.country_status_download_failed)
|
||||
.setErrorMessage(MapManager.getErrorCodeStrRes(data.errorCode))
|
||||
.setErrorMessage(MapManagerHelper.getErrorCodeStrRes(data.errorCode))
|
||||
.setPositiveButton(R.string.downloader_retry, null);
|
||||
if (!mIsCancelActionDisabled)
|
||||
builder.setNegativeButton(R.string.cancel, this::finish);
|
||||
|
||||
@@ -62,29 +62,29 @@ public final class SearchUiHelpers
|
||||
CarColor color = Colors.DEFAULT;
|
||||
switch (searchResult.description.openNow)
|
||||
{
|
||||
case SearchResult.OPEN_NOW_YES:
|
||||
if (searchResult.description.minutesUntilClosed < 60) // less than 1 hour
|
||||
{
|
||||
final String time = searchResult.description.minutesUntilClosed + " " + carContext.getString(R.string.minute);
|
||||
text = carContext.getString(R.string.closes_in, time);
|
||||
color = Colors.OPENING_HOURS_CLOSES_SOON;
|
||||
}
|
||||
else
|
||||
{
|
||||
text = carContext.getString(R.string.editor_time_open);
|
||||
color = Colors.OPENING_HOURS_OPEN;
|
||||
}
|
||||
break;
|
||||
case SearchResult.OPEN_NOW_NO:
|
||||
if (searchResult.description.minutesUntilOpen < 60) // less than 1 hour
|
||||
{
|
||||
final String time = searchResult.description.minutesUntilOpen + " " + carContext.getString(R.string.minute);
|
||||
text = carContext.getString(R.string.opens_in, time);
|
||||
}
|
||||
else
|
||||
text = carContext.getString(R.string.closed);
|
||||
color = Colors.OPENING_HOURS_CLOSED;
|
||||
break;
|
||||
case SearchResult.OPEN_NOW_YES:
|
||||
if (searchResult.description.minutesUntilClosed < 60) // less than 1 hour
|
||||
{
|
||||
final String time = searchResult.description.minutesUntilClosed + " " + carContext.getString(R.string.minute);
|
||||
text = carContext.getString(R.string.closes_in, time);
|
||||
color = Colors.OPENING_HOURS_CLOSES_SOON;
|
||||
}
|
||||
else
|
||||
{
|
||||
text = carContext.getString(R.string.editor_time_open);
|
||||
color = Colors.OPENING_HOURS_OPEN;
|
||||
}
|
||||
break;
|
||||
case SearchResult.OPEN_NOW_NO:
|
||||
if (searchResult.description.minutesUntilOpen < 60) // less than 1 hour
|
||||
{
|
||||
final String time = searchResult.description.minutesUntilOpen + " " + carContext.getString(R.string.minute);
|
||||
text = carContext.getString(R.string.opens_in, time);
|
||||
}
|
||||
else
|
||||
text = carContext.getString(R.string.closed);
|
||||
color = Colors.OPENING_HOURS_CLOSED;
|
||||
break;
|
||||
}
|
||||
|
||||
result.append(text);
|
||||
|
||||
@@ -7,9 +7,9 @@ import androidx.car.app.CarContext;
|
||||
import androidx.car.app.ScreenManager;
|
||||
import app.organicmaps.car.screens.download.DownloadMapsScreen;
|
||||
import app.organicmaps.car.screens.download.DownloadMapsScreenBuilder;
|
||||
import app.organicmaps.routing.RoutingController;
|
||||
import app.organicmaps.sdk.downloader.CountryItem;
|
||||
import app.organicmaps.sdk.downloader.MapManager;
|
||||
import app.organicmaps.sdk.routing.RoutingController;
|
||||
|
||||
public class CurrentCountryChangedListener implements MapManager.CurrentCountryChangedListener
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user