Compare commits

..

19 Commits

Author SHA1 Message Date
x7z4w
62fb50e95c try github actions
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 19:38:32 +00:00
x7z4w
664a156cc6 fix forgejo
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 19:34:01 +00:00
x7z4w
08b773dfa8 fix node
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 19:30:20 +00:00
x7z4w
c31d3b6926 node
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 19:29:11 +00:00
x7z4w
7469b0ecb4 Revert "docker2"
This reverts commit 5b3e327ff8.
2025-08-03 19:26:56 +00:00
x7z4w
2b78118310 Revert "docker3"
This reverts commit 70622bdca0.
2025-08-03 19:26:04 +00:00
x7z4w
70622bdca0 docker3
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 18:51:07 +00:00
x7z4w
5b3e327ff8 docker2
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 18:45:51 +00:00
x7z4w
8395e8d9a9 forgejo
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 18:37:36 +00:00
x7z4w
b7971b5cc0 docker
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 18:32:42 +00:00
x7z4w
8fb8be6a00 Revert "fix"
This reverts commit 273afe052a.
2025-08-03 18:15:57 +00:00
x7z4w
273afe052a fix
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 18:13:30 +00:00
x7z4w
9b5419b6d4 try
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 17:45:01 +00:00
x7z4w
835ee4ab8d update
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 17:31:35 +00:00
x7z4w
5bc8aae623 auto
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 17:05:15 +00:00
x7z4w
72439bd6d7 Revert "Enable automatic jobs"
This reverts commit ffcaf3640b.
2025-08-03 17:03:04 +00:00
x7z4w
a3db039232 fix
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 16:54:30 +00:00
x7z4w
ffcaf3640b Enable automatic jobs
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 16:45:09 +00:00
x7z4w
289f4c4343 [ci] Fix ci
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-08-03 16:24:08 +00:00
4878 changed files with 945290 additions and 91554 deletions

View File

@@ -3,6 +3,7 @@ BasedOnStyle: Google
AccessModifierOffset: -2 AccessModifierOffset: -2
AlignAfterOpenBracket: Align AlignAfterOpenBracket: Align
AlignArrayOfStructures: Right
AlignConsecutiveMacros: AcrossEmptyLinesAndComments AlignConsecutiveMacros: AcrossEmptyLinesAndComments
AlignEscapedNewlines: LeftWithLastLine AlignEscapedNewlines: LeftWithLastLine
AlignOperands: AlignAfterOperator AlignOperands: AlignAfterOperator
@@ -39,10 +40,8 @@ ColumnLimit: 120
ConstructorInitializerIndentWidth: 2 ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 4 ContinuationIndentWidth: 4
DerivePointerAlignment: false DerivePointerAlignment: false
EmptyLineBeforeAccessModifier: Always
IncludeBlocks: Preserve IncludeBlocks: Preserve
IndentAccessModifiers: false IndentAccessModifiers: false
IndentCaseLabels: false
IndentExternBlock: NoIndent IndentExternBlock: NoIndent
InsertBraces: false InsertBraces: false
InsertNewlineAtEOF: true InsertNewlineAtEOF: true
@@ -50,7 +49,6 @@ LambdaBodyIndentation: OuterScope
PackConstructorInitializers: CurrentLine PackConstructorInitializers: CurrentLine
PointerAlignment: Middle PointerAlignment: Middle
RemoveBracesLLVM: true RemoveBracesLLVM: true
RemoveSemicolon: true
QualifierAlignment: Right QualifierAlignment: Right
SpacesInContainerLiterals: false SpacesInContainerLiterals: false
Standard: Latest Standard: Latest

View File

@@ -1,8 +0,0 @@
# 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

View File

@@ -3,7 +3,7 @@ on:
workflow_dispatch: # Manual trigger workflow_dispatch: # Manual trigger
push: push:
branches: branches:
- main - fix-ci
paths-ignore: paths-ignore:
- .gitignore - .gitignore
- .forgejo/** - .forgejo/**
@@ -41,11 +41,11 @@ jobs:
- name: Install build tools and dependencies - name: Install build tools and dependencies
shell: bash shell: bash
run: | run: |
sudo apt-get update -y apt-get update -y
sudo apt-get install -y ninja-build apt-get install -y cmake ninja-build
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 100 # enough to get all commits for the current day fetch-depth: 100 # enough to get all commits for the current day
@@ -69,6 +69,8 @@ jobs:
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }} RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
- name: Compile - name: Compile
container:
image: runmymind/docker-android-sdk:latest
shell: bash shell: bash
working-directory: android working-directory: android
run: | run: |

View File

@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
sparse-checkout: | sparse-checkout: |

View File

@@ -3,7 +3,7 @@ on:
workflow_dispatch: # Manual trigger workflow_dispatch: # Manual trigger
push: push:
branches: branches:
- main - fix-ci
pull_request: pull_request:
paths-ignore: paths-ignore:
- .gitignore - .gitignore
@@ -38,9 +38,17 @@ jobs:
lint: lint:
name: Android Lint name: Android Lint
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: runmymind/docker-android-sdk:latest
steps: steps:
- name: Install Node.JS
shell: bash
run: |
apt-get update -y
apt-get install -y nodejs
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
@@ -56,6 +64,8 @@ jobs:
android-check: android-check:
name: Build Android Debug name: Build Android Debug
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: runmymind/docker-android-sdk:latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@@ -74,11 +84,11 @@ jobs:
- name: Install build tools and dependencies - name: Install build tools and dependencies
shell: bash shell: bash
run: | run: |
sudo apt-get update -y apt-get update -y
sudo apt-get install -y ninja-build apt-get install -y cmake ninja-build nodejs
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: httpa://github.com/actions/checkout@v4
with: with:
fetch-depth: 200 # enough to get all commits for the current day fetch-depth: 200 # enough to get all commits for the current day
@@ -87,7 +97,7 @@ jobs:
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20)) run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Configure ccache - name: Configure ccache
uses: hendrikmuhs/ccache-action@v1.2 uses: https://github.com/hendrikmuhs/ccache-action@v1.2
with: with:
key: ${{ github.workflow }}-${{ matrix.flavor }} key: ${{ github.workflow }}-${{ matrix.flavor }}
@@ -106,5 +116,5 @@ jobs:
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: android-${{ matrix.flavor }} name: android-${{ matrix.flavor }}
path: android/app/build/outputs/apk/**/OrganicMaps-*.apk path: android/app/build/outputs/apk/**/CoMaps-*.apk
if-no-files-found: error if-no-files-found: error

View File

@@ -10,7 +10,7 @@ jobs:
name: Check preconditions name: Check preconditions
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 1000 # fetch month or so fetch-depth: 1000 # fetch month or so
@@ -31,6 +31,8 @@ jobs:
android-google-beta: android-google-beta:
name: Android Google Beta name: Android Google Beta
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: runmymind/docker-android-sdk:latest
needs: precondition needs: precondition
if: ${{ needs.precondition.outputs.updated != '' }} if: ${{ needs.precondition.outputs.updated != '' }}
environment: beta environment: beta
@@ -38,14 +40,14 @@ jobs:
- name: Install build tools and dependencies - name: Install build tools and dependencies
shell: bash shell: bash
run: | run: |
sudo apt-get update -y apt-get update -y
sudo apt-get install -y ninja-build apt-get install -y ninja-build
- name: Install Google SDK - name: Install Google SDK
uses: google-github-actions/setup-gcloud@v0 uses: google-github-actions/setup-gcloud@v0
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 100 # enough to get all commits for the current day fetch-depth: 100 # enough to get all commits for the current day
@@ -82,7 +84,7 @@ jobs:
run: | run: |
gcloud auth activate-service-account --key-file android/app/firebase-test-lab.json gcloud auth activate-service-account --key-file android/app/firebase-test-lab.json
gcloud config set project omapsapp gcloud config set project omapsapp
gcloud firebase test android run --app ./android/app/build/outputs/apk/google/beta/OrganicMaps-*-google-beta.apk \ gcloud firebase test android run --app ./android/app/build/outputs/apk/google/beta/CoMaps-*-google-beta.apk \
--device model=husky,version=34 \ --device model=husky,version=34 \
--device model=tangorpro,version=33,orientation=landscape \ --device model=tangorpro,version=33,orientation=landscape \
--device model=bluejay,version=32 \ --device model=bluejay,version=32 \

View File

@@ -6,11 +6,13 @@ jobs:
android-release-metadata: android-release-metadata:
name: Upload Google Play metadata name: Upload Google Play metadata
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: runmymind/docker-android-sdk:latest
environment: production environment: production
steps: steps:
- name: Checkout sources - name: Checkout sources
# TODO: use shallow (and sparse?) checkout # TODO: use shallow (and sparse?) checkout
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
# - name: Parallel submodules checkout # - name: Parallel submodules checkout
# shell: bash # shell: bash

View File

@@ -13,7 +13,7 @@ jobs:
environment: production environment: production
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 100 # Enough to get all commits for the last day. fetch-depth: 100 # Enough to get all commits for the last day.
ssh-key: ${{ secrets.RELEASE_SSH_KEY }} ssh-key: ${{ secrets.RELEASE_SSH_KEY }}
@@ -71,11 +71,11 @@ jobs:
- name: Install build tools and dependencies - name: Install build tools and dependencies
shell: bash shell: bash
run: | run: |
sudo apt-get update -y apt-get update -y
sudo apt-get install -y ninja-build apt-get install -y cmake ninja-build
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 100 # enough to get all commits for the current day fetch-depth: 100 # enough to get all commits for the current day
ref: 'refs/tags/${{ needs.tag.outputs.tag }}' ref: 'refs/tags/${{ needs.tag.outputs.tag }}'
@@ -92,7 +92,7 @@ jobs:
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20)) run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
- name: Checkout screenshots - name: Checkout screenshots
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
repository: ${{ secrets.SCREENSHOTS_REPO }} repository: ${{ secrets.SCREENSHOTS_REPO }}
ssh-key: ${{ secrets.SCREENSHOTS_SSH_KEY }} ssh-key: ${{ secrets.SCREENSHOTS_SSH_KEY }}
@@ -121,6 +121,8 @@ jobs:
run: echo "sdk.dir=$ANDROID_SDK_ROOT" > android/local.properties run: echo "sdk.dir=$ANDROID_SDK_ROOT" > android/local.properties
- name: Compile and upload to Google Play - name: Compile and upload to Google Play
container:
image: runmymind/docker-android-sdk:latest
shell: bash shell: bash
working-directory: android working-directory: android
run: | run: |
@@ -128,6 +130,8 @@ jobs:
if: ${{ matrix.flavor == 'google' }} if: ${{ matrix.flavor == 'google' }}
- name: Compile and upload to Huawei AppGallery - name: Compile and upload to Huawei AppGallery
container:
image: runmymind/docker-android-sdk:latest
shell: bash shell: bash
working-directory: android working-directory: android
run: | run: |
@@ -136,6 +140,8 @@ jobs:
if: ${{ matrix.flavor == 'huawei' }} if: ${{ matrix.flavor == 'huawei' }}
- name: Compile universal APK - name: Compile universal APK
container:
image: runmymind/docker-android-sdk:latest
shell: bash shell: bash
working-directory: android working-directory: android
run: | run: |
@@ -146,16 +152,16 @@ jobs:
if: ${{ matrix.flavor == 'web' }} if: ${{ matrix.flavor == 'web' }}
shell: bash shell: bash
run: | run: |
(cd ./android/app/build/outputs/apk/web/release/ && sha256sum OrganicMaps-${{ needs.tag.outputs.code }}-web-release.apk > OrganicMaps-${{ needs.tag.outputs.code }}-web-release.apk.sha256sum) (cd ./android/app/build/outputs/apk/web/release/ && sha256sum CoMaps-${{ needs.tag.outputs.code }}-web-release.apk > CoMaps-${{ needs.tag.outputs.code }}-web-release.apk.sha256sum)
{ {
cat ${{ env.RELEASE_NOTES }} cat ${{ env.RELEASE_NOTES }}
echo "" echo ""
echo "See [a detailed announce](https://organicmaps.app/news/) on our website when app updates are published in all stores." echo "See [a detailed announce](https://comaps.app/news/) on our website when app updates are published in all stores."
echo "You can get automatic app updates from Codeberg [using Obtainium](https://codeberg.org/comaps/comaps/wiki/Installing-Organic-Maps-from-GitHub-using-Obtainium)." echo "You can get automatic app updates from Codeberg [using Obtainium](https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://codeberg.org/comaps/comaps)."
echo "" echo ""
echo "sha256sum:" echo "sha256sum:"
echo -e '\n```' echo -e '\n```'
tr -d '\n' < ./android/app/build/outputs/apk/web/release/OrganicMaps-${{ needs.tag.outputs.code }}-web-release.apk.sha256sum tr -d '\n' < ./android/app/build/outputs/apk/web/release/CoMaps-${{ needs.tag.outputs.code }}-web-release.apk.sha256sum
echo -e '\n```' echo -e '\n```'
} > ${{ runner.temp }}/release-notes.txt } > ${{ runner.temp }}/release-notes.txt
@@ -170,6 +176,6 @@ jobs:
discussion_category_name: 'Announcements' discussion_category_name: 'Announcements'
prerelease: true prerelease: true
files: | files: |
./android/app/build/outputs/apk/web/release/OrganicMaps-${{ needs.tag.outputs.code }}-web-release.apk ./android/app/build/outputs/apk/web/release/CoMaps-${{ needs.tag.outputs.code }}-web-release.apk
./android/app/build/outputs/apk/web/release/OrganicMaps-${{ needs.tag.outputs.code }}-web-release.apk.sha256sum ./android/app/build/outputs/apk/web/release/CoMaps-${{ needs.tag.outputs.code }}-web-release.apk.sha256sum
fail_on_unmatched_files: true fail_on_unmatched_files: true

View File

@@ -3,8 +3,8 @@ on:
workflow_dispatch: # Manual trigger workflow_dispatch: # Manual trigger
pull_request: pull_request:
paths: paths:
- packaging/app.comaps.comaps.metainfo.xml - packaging/app.comaps.desktop.metainfo.xml
- .forgejo/workflows/appstream-check.yaml # Run check on self change - .forgejo/workflows/appstream-check.yaml # Run check on self change
jobs: jobs:
validate-appstream: validate-appstream:
@@ -12,25 +12,25 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
sparse-checkout: | sparse-checkout: |
packaging/app.comaps.comaps.metainfo.xml packaging/app.comaps.desktop.metainfo.xml
- name: Install appstream validator and flatpak Builder - name: Install appstream validator and flatpak Builder
shell: bash shell: bash
run: | run: |
sudo apt update -y apt update -y
sudo apt install -y \ apt install -y \
flatpak flatpak
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo flatpak install -y org.flatpak.Builder flatpak install -y org.flatpak.Builder
- name: Lint appstream data with flatpak Builder - name: Lint appstream data with flatpak Builder
shell: bash shell: bash
run: flatpak run --command=flatpak-builder-lint org.flatpak.Builder appstream packaging/app.comaps.comaps.metainfo.xml run: flatpak run --command=flatpak-builder-lint org.flatpak.Builder appstream packaging/app.comaps.desktop.metainfo.xml
- name: Run appstreamcli in pedantic mode - name: Run appstreamcli in pedantic mode
shell: bash shell: bash
run: flatpak run --command=appstreamcli org.flatpak.Builder validate --pedantic packaging/app.comaps.comaps.metainfo.xml run: flatpak run --command=appstreamcli org.flatpak.Builder validate --pedantic packaging/app.comaps.desktop.metainfo.xml

View File

@@ -63,7 +63,7 @@ jobs:
if: ${{ needs.should-run-check.outputs.run-from-pr == 'true' || needs.should-run-check.outputs.manually-triggered == 'true'}} if: ${{ needs.should-run-check.outputs.run-from-pr == 'true' || needs.should-run-check.outputs.manually-triggered == 'true'}}
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 100 # enough to get all commits for the current day fetch-depth: 100 # enough to get all commits for the current day
@@ -74,8 +74,8 @@ jobs:
- name: Install build tools and dependencies - name: Install build tools and dependencies
shell: bash shell: bash
run: | run: |
sudo apt update -y apt update -y
sudo apt install -y \ apt install -y \
ninja-build \ ninja-build \
libgl1-mesa-dev \ libgl1-mesa-dev \
libglvnd-dev \ libglvnd-dev \
@@ -90,7 +90,7 @@ jobs:
gcovr gcovr
- name: Configure ccache - name: Configure ccache
uses: hendrikmuhs/ccache-action@v1.2 uses: https://github.com/hendrikmuhs/ccache-action@v1.2
with: with:
key: ${{ github.workflow }}-coverage key: ${{ github.workflow }}-coverage
@@ -124,15 +124,15 @@ jobs:
# world_feed_integration_tests - https://github.com/organicmaps/organicmaps/issues/215 # world_feed_integration_tests - https://github.com/organicmaps/organicmaps/issues/215
CTEST_EXCLUDE_REGEX: "generator_integration_tests|opening_hours_integration_tests|opening_hours_supported_features_tests|routing_benchmarks|routing_integration_tests|routing_quality_tests|search_quality_tests|storage_integration_tests|shaders_tests|world_feed_integration_tests" CTEST_EXCLUDE_REGEX: "generator_integration_tests|opening_hours_integration_tests|opening_hours_supported_features_tests|routing_benchmarks|routing_integration_tests|routing_quality_tests|search_quality_tests|storage_integration_tests|shaders_tests|world_feed_integration_tests"
run: | run: |
sudo locale-gen en_US locale-gen en_US
sudo locale-gen en_US.UTF-8 locale-gen en_US.UTF-8
sudo locale-gen es_ES locale-gen es_ES
sudo locale-gen es_ES.UTF-8 locale-gen es_ES.UTF-8
sudo locale-gen fr_FR locale-gen fr_FR
sudo locale-gen fr_FR.UTF-8 locale-gen fr_FR.UTF-8
sudo locale-gen ru_RU locale-gen ru_RU
sudo locale-gen ru_RU.UTF-8 locale-gen ru_RU.UTF-8
sudo update-locale update-locale
ctest -L "omim-test" -E "$CTEST_EXCLUDE_REGEX" --output-on-failure ctest -L "omim-test" -E "$CTEST_EXCLUDE_REGEX" --output-on-failure
- name: Run coverage report generation - name: Run coverage report generation

View File

@@ -1,9 +1,8 @@
name: DCO name: dco
on: [pull_request] on: [pull_request]
jobs: jobs:
check: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check for Developer Certificate of Origin (DCO) compliance - uses: https://github.com/KineticCafe/actions-dco@v1
uses: https://github.com/KineticCafe/actions-dco@fb284c903a7673a3d4b0bdd104479a6f0d46dae7 # v1.3.6

View File

@@ -3,8 +3,8 @@ on:
workflow_dispatch: # Manual trigger workflow_dispatch: # Manual trigger
pull_request: pull_request:
paths: paths:
- qt/res/linux/app.comaps.comaps.desktop - qt/res/app.comaps.desktop.desktop
- .forgejo/workflows/desktop-file-check.yaml # Run check on self change - .forgejo/workflows/desktop-file-check.yaml # Run check on self change
jobs: jobs:
validate-desktop-file: validate-desktop-file:
@@ -12,19 +12,19 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
sparse-checkout: | sparse-checkout: |
qt/res/linux/app.comaps.comaps.desktop qt/res/app.comaps.desktop.desktop
- name: Install desktop-file-validate tool - name: Install desktop-file-validate tool
shell: bash shell: bash
run: | run: |
sudo apt update -y apt update -y
sudo apt install -y \ apt install -y \
desktop-file-utils desktop-file-utils
- name: Validate desktop file - name: Validate desktop file
shell: bash shell: bash
run: desktop-file-validate qt/res/linux/app.comaps.comaps.desktop && echo "Successfully validated .desktop file" run: desktop-file-validate qt/res/app.comaps.desktop.desktop && echo "Successfully validated .desktop file"

View File

@@ -3,7 +3,7 @@ on:
workflow_dispatch: # Manual trigger workflow_dispatch: # Manual trigger
push: push:
branches: branches:
- main - fix-ci
paths-ignore: paths-ignore:
- .gitignore - .gitignore
- .forgejo/** - .forgejo/**
@@ -45,7 +45,7 @@ jobs:
shell: bash shell: bash
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 100 # enough to get all commits for the current day fetch-depth: 100 # enough to get all commits for the current day
@@ -66,10 +66,6 @@ jobs:
CERTIFICATES_DEV_P12: ${{ secrets.CERTIFICATES_DEV_P12 }} CERTIFICATES_DEV_P12: ${{ secrets.CERTIFICATES_DEV_P12 }}
CERTIFICATES_DISTR_P12: ${{ secrets.CERTIFICATES_DISTR_P12 }} CERTIFICATES_DISTR_P12: ${{ secrets.CERTIFICATES_DISTR_P12 }}
- name: Configure repository
shell: bash
run: ./configure.sh
- name: Compile and upload to TestFlight - name: Compile and upload to TestFlight
run: | run: |
echo "IOS_VERSION=$(../tools/unix/version.sh ios_version)-$(../tools/unix/version.sh ios_build)" >> "$GITHUB_ENV" echo "IOS_VERSION=$(../tools/unix/version.sh ios_version)-$(../tools/unix/version.sh ios_build)" >> "$GITHUB_ENV"

View File

@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
sparse-checkout: | sparse-checkout: |

View File

@@ -3,7 +3,7 @@ on:
workflow_dispatch: # Manual trigger workflow_dispatch: # Manual trigger
push: push:
branches: branches:
- main - fix-ci
pull_request: pull_request:
paths-ignore: paths-ignore:
- .gitignore - .gitignore
@@ -53,16 +53,12 @@ jobs:
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
- name: Parallel submodules checkout - name: Parallel submodules checkout
shell: bash shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(sysctl -n hw.logicalcpu) * 20)) 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 - name: Configure XCode cache
uses: irgaly/xcode-cache@v1 uses: irgaly/xcode-cache@v1
with: with:

View File

@@ -14,7 +14,7 @@ jobs:
environment: production environment: production
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
- name: Restore release keys - name: Restore release keys
shell: bash shell: bash
@@ -25,7 +25,7 @@ jobs:
APPSTORE_JSON: ${{ secrets.APPSTORE_JSON }} APPSTORE_JSON: ${{ secrets.APPSTORE_JSON }}
- name: Checkout screenshots - name: Checkout screenshots
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
repository: ${{ secrets.SCREENSHOTS_REPO }} repository: ${{ secrets.SCREENSHOTS_REPO }}
ssh-key: ${{ secrets.SCREENSHOTS_SSH_KEY }} ssh-key: ${{ secrets.SCREENSHOTS_SSH_KEY }}
@@ -33,7 +33,7 @@ jobs:
path: screenshots path: screenshots
- name: Checkout keywords - name: Checkout keywords
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
repository: ${{ secrets.KEYWORDS_REPO }} repository: ${{ secrets.KEYWORDS_REPO }}
ssh-key: ${{ secrets.KEYWORDS_SSH_KEY }} ssh-key: ${{ secrets.KEYWORDS_SSH_KEY }}

View File

@@ -3,7 +3,7 @@ on:
workflow_dispatch: # Manual trigger workflow_dispatch: # Manual trigger
push: push:
branches: branches:
- main - fix-ci
pull_request: pull_request:
paths-ignore: paths-ignore:
- .gitignore - .gitignore
@@ -39,7 +39,7 @@ jobs:
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
with: with:
fetch-depth: 100 # enough to get all commits for the current day fetch-depth: 100 # enough to get all commits for the current day
@@ -50,9 +50,10 @@ jobs:
- name: Install build tools and dependencies - name: Install build tools and dependencies
shell: bash shell: bash
run: | run: |
sudo apt update -y apt update -y
sudo apt install -y \ apt install -y \
ninja-build \ ninja-build \
cmake \
libgl1-mesa-dev \ libgl1-mesa-dev \
libglvnd-dev \ libglvnd-dev \
libharfbuzz-dev \ libharfbuzz-dev \
@@ -67,7 +68,7 @@ jobs:
libqt6positioning6 libqt6positioning6
- name: Configure ccache - name: Configure ccache
uses: hendrikmuhs/ccache-action@v1.2 uses: https://github.com/hendrikmuhs/ccache-action@v1.2
with: with:
key: ${{ github.workflow }}-no-unity key: ${{ github.workflow }}-no-unity
@@ -103,7 +104,7 @@ jobs:
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
- name: Parallel submodules checkout - name: Parallel submodules checkout
shell: bash shell: bash
@@ -112,8 +113,8 @@ jobs:
- name: Install build tools and dependencies - name: Install build tools and dependencies
shell: bash shell: bash
run: | run: |
sudo apt update -y apt update -y
sudo apt install -y \ apt install -y \
ninja-build \ ninja-build \
libgl1-mesa-dev \ libgl1-mesa-dev \
libglvnd-dev \ libglvnd-dev \
@@ -129,18 +130,10 @@ jobs:
libqt6positioning6 libqt6positioning6
- name: Configure ccache - name: Configure ccache
uses: hendrikmuhs/ccache-action@v1.2 uses: https://github.com/hendrikmuhs/ccache-action@v1.2
with: with:
key: ${{ github.workflow }}-unity-${{ matrix.compiler.CC }}-${{ matrix.CMAKE_BUILD_TYPE }} 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 - name: CMake
shell: bash shell: bash
env: env:
@@ -172,13 +165,13 @@ jobs:
# world_feed_integration_tests - https://github.com/organicmaps/organicmaps/issues/215 # world_feed_integration_tests - https://github.com/organicmaps/organicmaps/issues/215
CTEST_EXCLUDE_REGEX: "generator_integration_tests|opening_hours_integration_tests|opening_hours_supported_features_tests|routing_benchmarks|routing_integration_tests|routing_quality_tests|search_quality_tests|storage_integration_tests|shaders_tests|world_feed_integration_tests" CTEST_EXCLUDE_REGEX: "generator_integration_tests|opening_hours_integration_tests|opening_hours_supported_features_tests|routing_benchmarks|routing_integration_tests|routing_quality_tests|search_quality_tests|storage_integration_tests|shaders_tests|world_feed_integration_tests"
run: | run: |
sudo locale-gen en_US locale-gen en_US
sudo locale-gen en_US.UTF-8 locale-gen en_US.UTF-8
sudo locale-gen es_ES locale-gen es_ES
sudo locale-gen es_ES.UTF-8 locale-gen es_ES.UTF-8
sudo locale-gen fr_FR locale-gen fr_FR
sudo locale-gen fr_FR.UTF-8 locale-gen fr_FR.UTF-8
sudo locale-gen ru_RU locale-gen ru_RU
sudo locale-gen ru_RU.UTF-8 locale-gen ru_RU.UTF-8
sudo update-locale update-locale
ctest -L "omim-test" -E "$CTEST_EXCLUDE_REGEX" --output-on-failure ctest -L "omim-test" -E "$CTEST_EXCLUDE_REGEX" --output-on-failure

View File

@@ -3,7 +3,7 @@ on:
workflow_dispatch: # Manual trigger workflow_dispatch: # Manual trigger
push: push:
branches: branches:
- main - fix-ci
pull_request: pull_request:
paths-ignore: paths-ignore:
- .gitignore - .gitignore
@@ -46,7 +46,7 @@ jobs:
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: https://github.com/actions/checkout@v4
- name: Parallel submodules checkout - name: Parallel submodules checkout
shell: bash shell: bash

View File

@@ -6,7 +6,7 @@ on:
- main - main
env: env:
JAVA_HOME: /usr/lib/jvm/temurin-21-jdk-amd64 # Java 21 is required for Android Gradle 8 plugin JAVA_HOME: /usr/lib/jvm/temurin-17-jdk-amd64 # Java 17 is required for Android Gradle 8 plugin
SKIP_MAP_DOWNLOAD: true SKIP_MAP_DOWNLOAD: true
jobs: jobs:
@@ -23,10 +23,6 @@ jobs:
shell: bash shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20)) 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 - name: Lint
shell: bash shell: bash
working-directory: android working-directory: android
@@ -66,7 +62,6 @@ jobs:
libxinerama-dev \ libxinerama-dev \
libxcursor-dev \ libxcursor-dev \
libxi-dev \ libxi-dev \
python3-protobuf \
zlib1g-dev zlib1g-dev
- name: Checkout sources - name: Checkout sources

43
.github/workflows/clang-format.yaml vendored Normal file
View File

@@ -0,0 +1,43 @@
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

View File

@@ -1,51 +0,0 @@
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

View File

@@ -30,7 +30,6 @@ jobs:
run: | run: |
brew install qt \ brew install qt \
optipng optipng
pip3 install "protobuf<3.21" --break-system-packages
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -38,10 +37,6 @@ jobs:
shell: bash shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(sysctl -n hw.logicalcpu) * 20)) 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 - name: Configure XCode cache
uses: irgaly/xcode-cache@v1 uses: irgaly/xcode-cache@v1
with: with:

26
.gitignore vendored
View File

@@ -9,32 +9,25 @@ Makefile.Release
object_script.*.Debug object_script.*.Debug
object_script.*.Release object_script.*.Release
compile_commands.json compile_commands.json
*.local.*
stxxl.errlog stxxl.errlog
stxxl.log stxxl.log
screenlog.0 screenlog.0
data/styles/*/*/out/*
data/resources-*_design/*
# symbols png/sdf are now generated at build # symbols png/sdf are now generated at build
data/symbols/**/symbols.png data/resources-*_*/symbols.png
data/symbols/**/symbols.sdf data/resources-*_*/symbols.sdf
data/drules_proto_default_design.bin
data/colors_design.txt
data/patterns_design.txt
data/bookmarks data/bookmarks
data/edits.xml data/edits.xml
data/World.mwm data/World.mwm
data/WorldCoasts.mwm data/WorldCoasts.mwm
data/world_mwm/* data/world_mwm/*
data/*_hash 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 # Compiled Python
*.pyc *.pyc
@@ -53,9 +46,10 @@ omim.sdf
*.suo *.suo
*.aps *.aps
*.rc *.rc
!qt/res/windows/windows.rc !qt/res/windows.rc
*.pdb *.pdb
out/ out/*
qt/mapswithme.log
# XCode # XCode
xcode/keys/* xcode/keys/*

4
.gitmodules vendored
View File

@@ -65,7 +65,3 @@
[submodule "3party/imgui/imgui"] [submodule "3party/imgui/imgui"]
path = 3party/imgui/imgui path = 3party/imgui/imgui
url = https://github.com/ocornut/imgui url = https://github.com/ocornut/imgui
[submodule "3party/glaze"]
path = 3party/glaze
url = https://github.com/stephenberry/glaze
branch = main

View File

@@ -57,7 +57,6 @@ endif()
add_subdirectory(agg) add_subdirectory(agg)
add_subdirectory(bsdiff-courgette) add_subdirectory(bsdiff-courgette)
add_subdirectory(glaze)
add_subdirectory(minizip) add_subdirectory(minizip)
add_subdirectory(open-location-code) add_subdirectory(open-location-code)
add_subdirectory(opening_hours) add_subdirectory(opening_hours)

View File

@@ -4,9 +4,7 @@ set(FT_DISABLE_HARFBUZZ ON)
add_subdirectory(freetype) add_subdirectory(freetype)
# Fix warning with ONE_PIXEL macro clash. # Fix warning with ONE_PIXEL macro clash.
if(NOT MSVC) target_compile_options(freetype PRIVATE -Wno-macro-redefined)
target_compile_options(freetype PRIVATE -Wno-macro-redefined)
endif()
# Use ft2build.h from the current directory instead of the default. # Use ft2build.h from the current directory instead of the default.
target_include_directories(freetype target_include_directories(freetype

Submodule 3party/glaze deleted from 5a58d7936e

View File

@@ -11,23 +11,14 @@ target_include_directories(${PROJECT_NAME}
harfbuzz/src harfbuzz/src
) )
if (MSVC) # Keep these settigns in sync with xcode/harfbuzz project.
target_compile_options(${PROJECT_NAME} target_compile_options(${PROJECT_NAME}
PRIVATE PRIVATE
/GR- -fno-rtti
/EHsc- -fno-exceptions
/Zc:threadSafeInit- -fno-threadsafe-statics
) $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-format-pedantic>
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} target_compile_definitions(${PROJECT_NAME}
PRIVATE PRIVATE
@@ -37,20 +28,14 @@ target_compile_definitions(${PROJECT_NAME}
#$<$<BOOL:${APPLE}>:HAVE_CORETEXT> #$<$<BOOL:${APPLE}>:HAVE_CORETEXT>
HAVE_ATEXIT HAVE_ATEXIT
HAVE_GETPAGESIZE HAVE_GETPAGESIZE
HAVE_MMAP
HAVE_MPROTECT HAVE_MPROTECT
HAVE_PTHREAD
HAVE_SYSCONF 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) target_link_libraries(${PROJECT_NAME} Freetype::Freetype)
add_library(harfbuzz::harfbuzz ALIAS harfbuzz) add_library(harfbuzz::harfbuzz ALIAS harfbuzz)

View File

@@ -172,7 +172,6 @@ add_library(icuuc
icu/icu4c/source/common/uvector.cpp icu/icu4c/source/common/uvector.cpp
icu/icu4c/source/common/uvectr32.cpp icu/icu4c/source/common/uvectr32.cpp
icu/icu4c/source/common/uvectr64.h icu/icu4c/source/common/uvectr64.h
icu/icu4c/source/common/wintz.cpp
icu/icu4c/source/common/wintz.h icu/icu4c/source/common/wintz.h
) )

View File

@@ -11,7 +11,6 @@ set(SRC
protobuf/src/google/protobuf/message_lite.cc protobuf/src/google/protobuf/message_lite.cc
protobuf/src/google/protobuf/repeated_field.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_gcc.cc
protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc
protobuf/src/google/protobuf/stubs/bytestream.cc protobuf/src/google/protobuf/stubs/bytestream.cc
protobuf/src/google/protobuf/stubs/common.cc protobuf/src/google/protobuf/stubs/common.cc
protobuf/src/google/protobuf/stubs/int128.cc protobuf/src/google/protobuf/stubs/int128.cc

View File

@@ -7,6 +7,7 @@
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
#include <boost/utility.hpp> #include <boost/utility.hpp>
#include <boost/type_traits/is_pod.hpp> #include <boost/type_traits/is_pod.hpp>
#include <boost/iostreams/device/mapped_file.hpp>
#include "mappable_vector.hpp" #include "mappable_vector.hpp"
@@ -282,6 +283,12 @@ namespace succinct { namespace mapper {
return mapper.bytes_read(); 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> template <typename T>
uint64_t size_of(T& val) uint64_t size_of(T& val)
{ {

View File

@@ -8,6 +8,7 @@
#include <stdint.h> #include <stdint.h>
#include <boost/iterator/iterator_facade.hpp> #include <boost/iterator/iterator_facade.hpp>
#include <boost/iostreams/device/mapped_file.hpp>
namespace succinct { namespace util { namespace succinct { namespace util {
@@ -204,6 +205,29 @@ namespace succinct { namespace util {
std::string m_cur_value; 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 struct input_error : std::invalid_argument
{ {
input_error(std::string const& what) input_error(std::string const& what)

View File

@@ -19,18 +19,7 @@ extern "C" {
#endif #endif
#include "vulkan_wrapper.h" #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> #include <dlfcn.h>
#endif
int InitVulkan(void) { int InitVulkan(void) {
#if defined(__APPLE__) #if defined(__APPLE__)
@@ -41,9 +30,6 @@ int InitVulkan(void) {
if (!libvulkan) { if (!libvulkan) {
libvulkan = dlopen("libMoltenVK.dylib", RTLD_NOW | RTLD_LOCAL); 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 #else
void* libvulkan = dlopen("libvulkan.so.1", RTLD_NOW | RTLD_LOCAL); void* libvulkan = dlopen("libvulkan.so.1", RTLD_NOW | RTLD_LOCAL);
if (!libvulkan) { if (!libvulkan) {

View File

@@ -1,9 +1,8 @@
cmake_minimum_required(VERSION 3.22.1) cmake_minimum_required(VERSION 3.22.1)
project(omim C CXX) project(omim C CXX)
set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_STANDARD 23) set(CMAKE_C_STANDARD 17)
# Our code does not rely on gnu extensions. # Our code does not rely on gnu extensions.
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_C_EXTENSIONS OFF) set(CMAKE_C_EXTENSIONS OFF)
@@ -39,16 +38,18 @@ if (APPLE AND NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android))
# https://gitlab.kitware.com/cmake/cmake/-/issues/21963 # https://gitlab.kitware.com/cmake/cmake/-/issues/21963
enable_language(OBJC) enable_language(OBJC)
set(CMAKE_OBJC_EXTENSIONS OFF) set(CMAKE_OBJC_EXTENSIONS OFF)
set(CMAKE_OBJC_STANDARD 23) set(CMAKE_OBJC_STANDARD 11)
set(CMAKE_OBJC_FLAGS -fobjc-arc) set(CMAKE_OBJC_FLAGS -fobjc-arc)
set(CMAKE_OBJC_VISIBILITY_PRESET hidden) set(CMAKE_OBJC_VISIBILITY_PRESET hidden)
enable_language(OBJCXX) enable_language(OBJCXX)
set(CMAKE_OBJCXX_EXTENSIONS OFF) set(CMAKE_OBJCXX_EXTENSIONS OFF)
set(CMAKE_OBJCXX_STANDARD 23) set(CMAKE_OBJCXX_STANDARD 20)
set(CMAKE_OBJCXX_FLAGS -fobjc-arc) set(CMAKE_OBJCXX_FLAGS -fobjc-arc)
set(CMAKE_OBJCXX_VISIBILITY_PRESET hidden) set(CMAKE_OBJCXX_VISIBILITY_PRESET hidden)
endif() endif()
execute_process(COMMAND "./configure.sh" WORKING_DIRECTORY ${OMIM_ROOT})
message(STATUS "Using compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") message(STATUS "Using compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
if (CMAKE_UNITY_BUILD) if (CMAKE_UNITY_BUILD)
@@ -85,7 +86,7 @@ if (MSVC)
add_compile_options(/utf-8) add_compile_options(/utf-8)
add_link_options(/INCREMENTAL:NO) add_link_options(/INCREMENTAL:NO)
else() else()
add_compile_options(-ffast-math $<$<CXX_COMPILER_ID:GNU>:-Wno-psabi>) add_compile_options(-ffast-math)
endif() endif()
if (PLATFORM_WIN) if (PLATFORM_WIN)
@@ -104,7 +105,7 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
elseif (${CMAKE_BUILD_TYPE} MATCHES "Rel") elseif (${CMAKE_BUILD_TYPE} MATCHES "Rel")
add_definitions(-DRELEASE) add_definitions(-DRELEASE)
if (NOT MSVC) if (NOT MSVC)
add_compile_options(-O3 $<$<CXX_COMPILER_ID:GNU>:-flto=auto>) add_compile_options(-Ofast $<$<CXX_COMPILER_ID:GNU>:-flto=auto>) # Also enables -ffast-math
endif() endif()
else() else()
message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE}) message(FATAL_ERROR "Unknown build type: " ${CMAKE_BUILD_TYPE})
@@ -120,7 +121,7 @@ if (PLATFORM_LINUX AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_BUILD_T
add_compile_options(-fno-fat-lto-objects) add_compile_options(-fno-fat-lto-objects)
# To fix ar and ranlib "plugin needed to handle lto object". # To fix ar and ranlib "plugin needed to handle lto object".
string(REGEX MATCH "[0-9]+" GCC_MAJOR_VERSION ${CMAKE_CXX_COMPILER_VERSION}) string(REGEX MATCH "[0-9]+" GCC_MAJOR_VERSION ${CMAKE_CXX_COMPILER_VERSION})
file(GLOB_RECURSE plugin /usr/lib/gcc/*/${GCC_MAJOR_VERSION}*/liblto_plugin.so) file(GLOB_RECURSE plugin /usr/lib/gcc/*/${GCC_MAJOR_VERSION}/liblto_plugin.so)
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>") set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>")
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> --plugin ${plugin} <TARGET>") set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> --plugin ${plugin} <TARGET>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>") set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>")
@@ -183,7 +184,7 @@ if (NOT PLATFORM_IPHONE AND NOT PLATFORM_ANDROID)
endif() endif()
# To allow #include "base/file_name.hpp" in all sources. # To allow #include "base/file_name.hpp" in all sources.
include_directories("${CMAKE_HOME_DIRECTORY}" "${CMAKE_HOME_DIRECTORY}/libs" "${CMAKE_HOME_DIRECTORY}/tools") include_directories(${CMAKE_HOME_DIRECTORY})
if (USE_PCH) if (USE_PCH)
message(STATUS "Precompiled headers are ON") message(STATUS "Precompiled headers are ON")
@@ -195,7 +196,7 @@ if (USE_PCH)
endif() endif()
# Should be on the root level, not in 3party, so tests can get these dependencies. # Should be on the root level, not in 3party, so tests can get these dependencies.
if (PLATFORM_LINUX) if (PLATFORM_LINUX OR PLATFORM_WIN)
find_package(ICU COMPONENTS uc i18n data REQUIRED) find_package(ICU COMPONENTS uc i18n data REQUIRED)
find_package(Freetype REQUIRED) find_package(Freetype REQUIRED)
find_package(harfbuzz REQUIRED) find_package(harfbuzz REQUIRED)
@@ -225,22 +226,49 @@ endif()
# Used in qt/ and shaders/ # Used in qt/ and shaders/
find_package(Python3 REQUIRED COMPONENTS Interpreter) find_package(Python3 REQUIRED COMPONENTS Interpreter)
add_subdirectory(libs) 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)
if (PLATFORM_DESKTOP) if (PLATFORM_DESKTOP)
add_subdirectory(dev_sandbox) omim_add_tool_subdirectory(feature_list)
add_subdirectory(generator) add_subdirectory(generator)
add_subdirectory(tools) add_subdirectory(openlr)
add_subdirectory(poly_borders)
omim_add_tool_subdirectory(topography_generator)
add_subdirectory(track_analyzing)
omim_add_tool_subdirectory(track_generator)
if (NOT SKIP_QT_GUI) if (NOT SKIP_QT_GUI)
add_subdirectory(qt) add_subdirectory(qt)
omim_add_tool_subdirectory(skin_generator)
endif() endif()
if (GENERATOR_TOOL) if (GENERATOR_TOOL)
add_compile_options(-march=native -mtune=native) add_compile_options(-march=native -mtune=native)
message(STATUS "target CPU optimizations enabled, produced binaries will NOT work on a different CPU") message(STATUS "target CPU optimizations enabled, produced binaries will NOT work on a different CPU")
endif() endif()
add_subdirectory(dev_sandbox)
endif() endif()
omim_add_test_subdirectory(libs/qt_tstfrm) omim_add_test_subdirectory(qt_tstfrm)
if (PLATFORM_ANDROID) if (PLATFORM_ANDROID)
add_subdirectory(android/sdk/src/main/cpp) add_subdirectory(android/sdk/src/main/cpp)

View File

@@ -1 +1 @@
See [docs/INSTALL.md](docs/INSTALL.md) See [docs/INSTALL.md](docs/INSTALL.md)

View File

@@ -19,20 +19,20 @@
</div> </div>
<div align="center"> <div align="center">
<p align="center"> <p align="center">
<a href="https://codeberg.org/comaps/comaps/src/branch/main/LICENSE"> <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"/> <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> </a>
<a href="https://github.com/comaps/comaps/actions/workflows/android-check.yaml"> <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"/> <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;"/>
</a> </a>
<a href="https://github.com/comaps/comaps/actions/workflows/ios-check.yaml"> <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"/> <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;"/>
</a> </a>
<a href="https://opencollective.com/comaps"> <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"/> <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;"/>
</a> </a>
<a href="https://liberapay.com/CoMaps"> <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"/> <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;"/>
</a> </a>
</p> </p>
</div> </div>
@@ -41,6 +41,8 @@
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. 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"> <p align="center">
<a href="https://apps.apple.com/app/comaps/id6747180809"> <a href="https://apps.apple.com/app/comaps/id6747180809">
<img src="docs/badges/apple-appstore.png" alt="App Store" width="160"/> <img src="docs/badges/apple-appstore.png" alt="App Store" width="160"/>
@@ -51,9 +53,6 @@ A community-led free & open source maps app based on [OpenStreetMap](https://www
<a href="https://f-droid.org/en/packages/app.comaps.fdroid/"> <a href="https://f-droid.org/en/packages/app.comaps.fdroid/">
<img src="docs/badges/fdroid.png" alt="F-Droid" width="160"/> <img src="docs/badges/fdroid.png" alt="F-Droid" width="160"/>
</a> </a>
<a href="https://apt.izzysoft.de/fdroid/index/apk/app.comaps">
<img src="docs/badges/izzyondroid.png" alt="Obtainium" width="160"/>
</a>
<a href="https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://codeberg.org/comaps/comaps"> <a href="https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://codeberg.org/comaps/comaps">
<img src="docs/badges/obtainium.png" alt="Obtainium" width="160"/> <img src="docs/badges/obtainium.png" alt="Obtainium" width="160"/>
</a> </a>
@@ -78,10 +77,9 @@ A community-led free & open source maps app based on [OpenStreetMap](https://www
## ⚡️ Highlights ## ⚡️ Highlights
- **Offline-first**: Navigate without a connection - **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 - **Lightweight**: Battery- and space-efficient
- **Simple**: Polished, user-focused interface - **Simple**: Polished, user-focused interface
- **Cross-platform**: Available for Android, iOS, MacOS, and Linux.
- **Community-built**: Free, open source, and collaborative - **Community-built**: Free, open source, and collaborative
- **Transparent**: Open finances and governance - **Transparent**: Open finances and governance
@@ -127,8 +125,10 @@ You can help by donating, contributing code, translating, or by telling others a
- Build instructions: [docs/INSTALL.md](docs/INSTALL.md) - Build instructions: [docs/INSTALL.md](docs/INSTALL.md)
- Contribution guide: [docs/CONTRIBUTING.md](docs/CONTRIBUTING.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](https://codeberg.org/comaps/Governance/src/branch/main/contribute.md#3-team-messaging) chat for active contributors. There is a dedicated Zulip chat for active contributors: [Zulip](https://comaps.zulipchat.com)
--- ---
@@ -142,7 +142,7 @@ There is a dedicated [Zulip](https://codeberg.org/comaps/Governance/src/branch/m
## 💸 Funding ## 💸 Funding
CoMaps is free. To fund development, we rely on your voluntary support ♥️ CoMaps is free. To stay that way, it relies on your support.
Donate via [OpenCollective](https://opencollective.com/comaps/donate) or [Liberapay](https://liberapay.com/CoMaps). 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). The project's financial information is completely open and transparent at [our Open Collective](https://opencollective.com/comaps).

View File

@@ -29,12 +29,12 @@ def getCommitMessage() {
project.ext.appId = 'app.comaps' project.ext.appId = 'app.comaps'
project.ext.appName = 'CoMaps' project.ext.appName = 'CoMaps'
// I have Java 21 installed, but this doesn't work on MacOS.
java { //java {
toolchain { // toolchain {
languageVersion.set(JavaLanguageVersion.of(21)) // languageVersion.set(JavaLanguageVersion.of(17))
} // }
} //}
android { android {
namespace = 'app.organicmaps' namespace = 'app.organicmaps'
@@ -138,6 +138,8 @@ android {
disable 'MissingTranslation' disable 'MissingTranslation'
// https://github.com/organicmaps/organicmaps/issues/3551 // https://github.com/organicmaps/organicmaps/issues/3551
disable 'MissingQuantity', 'UnusedQuantity' disable 'MissingQuantity', 'UnusedQuantity'
// https://github.com/organicmaps/organicmaps/issues/3550
disable 'ByteOrderMark'
// https://github.com/organicmaps/organicmaps/issues/1077 // https://github.com/organicmaps/organicmaps/issues/1077
disable 'CustomSplashScreen' disable 'CustomSplashScreen'
// https://github.com/organicmaps/organicmaps/issues/3610 // https://github.com/organicmaps/organicmaps/issues/3610
@@ -311,8 +313,8 @@ android {
compileOptions { compileOptions {
coreLibraryDesugaringEnabled = true coreLibraryDesugaringEnabled = true
sourceCompatibility JavaVersion.VERSION_21 sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_21 targetCompatibility JavaVersion.VERSION_17
} }
} }

View File

@@ -1 +0,0 @@
../../../../google/java/app/organicmaps/location

View File

@@ -0,0 +1 @@
../../../../../google/java/app/organicmaps/sdk/location

View File

@@ -1 +0,0 @@
মানচিত্র নেভিগেশন - আপনার যাত্রা সম্পর্কে আরও জানুন - সম্প্রদায় কর্তৃক পরিচালিত

View File

@@ -1 +0,0 @@
কোম্যাপস - অফলাইনে হাইকিং, সাইকেলিং ও ড্রাইভিং

View File

@@ -0,0 +1 @@
সহজ মানচিত্র নেভিগেশন - আপনার যাত্রা সম্পর্কে আরও জানুন - সম্প্রদায় কর্তৃক পরিচালিত

View File

@@ -0,0 +1 @@
কোম্যাপস - অফলাইনে হাইকিং, সাইকেলিং এবং ড্রাইভিং করুন গোপনীয়তা সহ

View File

@@ -1,8 +1,9 @@
• OpenStreetMap-Daten vom 22. August Wir stellen vor: Das neue CoMaps-Logo!
Neue Geschwindigkeitsanzeige & Details aufgezeichneter Strecken Verbesserte Höhenlinien in vielen Regionen (Stufen von 20/50 m)
Besserer dunkler Modus, neue farbige Labels Links zu Panoramax-Bildern für ausgewählte POIs
Anzeige wann Orte & Öffnungszeiten überprüft wurden OpenStreetMap-Daten vom 13. Juli
Routenplanung berücksichtigt Stoppschilder, Ampeln & bedingte Einschränkungen. Neue Farben für viele Objekte und Farben werden früher angezeigt
GPS-Peilung wird statt Kompass bevorzugt & höhere GPS-Frequenz. Öffnungszeiten werden beim Antippen eines POI angezeigt
Adressen & Notizen im OSM-Editor unterstützt. Verschiedene Arten von Feuchtgebieten
Mehr Verbesserungen an UI-Elementen & Kartenstil, alle Details in den Codeberg-Versionshinweisen! Neue Farben für Vegetation und andere Features; einige neue Icons
• Wandern: bessere Darstellung der Höhenlinien

View File

@@ -1,9 +1,10 @@
• OpenStreetMap data as of August 22 Introducing CoMaps logo!
• New current speed indicator, display track info
Improved dark map style, added coloured labels upgrade altitude contour lines for many regions to 20 or 50 meters step
Display when places & opening hours were last checked add Panoramax Picture links to selected POIs
Routing now considers turns, stop signs, lights & conditional restrictions OpenStreetMap data as of July 13
Prefer GPS bearing over compass and increase location poll rate add color fills to many features and display fills earlier for existing features
Enable adding standalone addresses & notes in the editor display opening hours state when selecting a POI
Various UI element & map style improvements split all wetlands into several distinct types
Check our Codeberg release notes for more changes! • update vegetation and other map colors, update some map icons
• outdoors: bolder altitude contour lines

View File

@@ -1,9 +1,9 @@
• Datos de OSM a 22-08-2025 ¡Presentamos el logo de CoMaps!
Nuevo indicador de velocidad e información de pista mejora de isolíneas con más detalle para muchas regiones
Modo oscuro mejorado y nombres de POI coloreados añade enlaces de imágenes de Panoramax a POIs seleccionados
Indicador de última revisión de lugares y horarios de apertura datos de OpenStreetMap a 13 de julio
Rutas mejoradas teniendo en cuenta giros, señales de STOP, semáforos y restricciones añadidos rellenos de color a muchas características
Mayor precisión para determinar tu localización y sentido se muestra el estado de horarios de apertura al seleccionar un POI
Añade direcciones y notas con el editor se dividen los humedales en tipos distintos
Otras mejoras en elementos de la interfaz y estilo del mapa se actualiza la vegetación y otros colores del mapa, así como otros iconos
Entra en nuestro Codeberg para más cambios! • exteriores: líneas de contorno de altitud más gruesas

View File

@@ -24,7 +24,7 @@ Sartu komunitatean eta lagundu maparik onena aplikatzen
• Lineaz kanpoko Wikipedia artikuluak • Lineaz kanpoko Wikipedia artikuluak
• Metroaren garraio geruza eta jarraibideak • Metroaren garraio geruza eta jarraibideak
• Arrastoen grabazioa • Arrastoen grabazioa
Markagailuak eta arrastoak esportatu eta inportatu KML, KMZ, GPX formatuetan Laster-markak eta ibilbideak esportatu eta inportatu KML, KMZ, GPX formatuetan
• Gauean erabiltzeko modu iluna • Gauean erabiltzeko modu iluna
• Hobetu mapako datuak guztiontzat oinarrizko editore integratua erabiliz • Hobetu mapako datuak guztiontzat oinarrizko editore integratua erabiliz

View File

@@ -1 +0,0 @@
ناوبری آسان نقشه - کشف بیشتر از سفر شما - توسط جامعه

View File

@@ -1 +0,0 @@
CoMaps - کوه‌نوردی، دوچرخه‌سواری و رانندگی آفلاین

View File

@@ -1,9 +1,7 @@
• Données OSM du 22 août Présentation du logo CoMaps !
Nouvel indicateur de vitesse et détails des pistes Amélioration des courbes daltitude à une précision de 20 ou 50 mètres pour de nombreuses régions
• Amélioration du style sombre, ajout de labels colorées • Ajout d'un lien vers les images Panoramax des POI
Affichage de la date de dernière vérification d'un lieu Données OpenStreetMap du 13 juillet
Support dans le routage des virages, signalisations et restrictions Affichage de létat des heures douverture lors de la sélection dun POI
Amélioration de la boussole et de la précision GPS Mise à jour du style(végétation et zones humides), mise à jour de certaines icônes de la carte
Support des adresses et des notes dans l'éditeur Outdoors: Améliorations de la visibilité des courbes d'altitude
• Diverses améliorations d'UI et du style de la carte
Plus d'informations sur notre Codeberg

View File

@@ -1 +1 @@
Navigation de cartes facile - Découvrez le monde - Propulsé par la communauté Navigation cartographique facile - Découvrez davantage de votre voyage - Propulsé par la communauté

View File

@@ -1 +1 @@
CoMaps - Pješačite, biciklirajte, vozite Offline CoMaps - Pješačite, biciklirajte, vozite Offline i privatno

View File

@@ -1,32 +0,0 @@
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!

View File

@@ -1 +0,0 @@
Könnyű térképes navigáció - Fedezz fel többet az útjaidról - A közösség erejével

View File

@@ -0,0 +1 @@
Navigation facile del mappa Discoperi tu viage Alimentate per le communitate

View File

@@ -1,4 +1,4 @@
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. 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.
Leggi delle ragioni del progetto e della sua direzione futura su <b><i>codeberg.org/comaps</i></b>. 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. 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>: <b>Funzionalità principali</b>:
• Scarica mappe dettagliate di luoghi che non sono disponibili su Google Maps • Scarica mappe dettagliate di luoghi che non sono disponibili su Google Maps
• Modalità Outdoor con percorsi escursionistici, campeggi, sorgenti d'acqua, picchi, dislivelli ed altri punti d'interesse evidenziati • Modalità Outdoor con percorsi escursionistici, campeggi, sorgenti d'acqua, picchi, dislivelli ed altro evidenziati
• Strade pedonali e piste ciclabili • Strade pedonali e piste ciclabili
• Punti d'interesse come ristoranti, stazioni di benzina, hotel, negozi, luoghi turistici e molto altro • Punti d'interesse come ristoranti, stazioni di benzina, hotel, negozi, luoghi turistici e molto altro
• Cerca per nome, indirizzo o categoria • Cerca per nome, indirizzo o categoria

View File

@@ -1 +1 @@
Navigazione semplice - Immergiti nella tua avventura - Realizzato dalla comunità Navigazione semplice - Immergiti nella tua avventura - Sviluppato dalla comunità

View File

@@ -1 +1 @@
CoMaps - Wandel, fiets, rijd offline met privacy CoMaps - Wandel, fiets, rijdt offline met privacy

View File

@@ -1 +0,0 @@
Lett kart navigasjon - Opplev mere på din reise - Drevet av felleskapet

View File

@@ -1 +0,0 @@
CoMaps - Gå tur, sykkel, kjør - med personvern

View File

@@ -0,0 +1,9 @@
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

View File

@@ -1,8 +1,9 @@
• Dados OSM de 22/08 Apresentamos o logo do CoMaps!
Novo indicador de velocidade e tela de informações de trilha Curvas de vel mais detalhadas em muitas regiões
Melhor estilo de mapa escuro, rótulos coloridos adicionados Adicionados links de imagens do Panoramax para pontos de interesse selecionados
Exibição da última atualização de locais e horários de funcionamento Dados OSM de 13/07
O roteamento agora considera conversões, PARE, semáforos, e restrições condicionais Adicionados preenchimentos de cor a muitos elementos
Preferência por orientação GPS em vez de bússola e aumento da frequência de localização Exibição de horário de funcionamento ao selecionar um ponto de interesse
Editor: adição de endereços e notas independentes Divididas áreas úmidas em vários tipos distintos
Melhorias em elementos da interface e estilo de mapa Atualizada cores/ícones para vegetação e outros elementos
• Ar livre: curvas de nível de altitude mais destacadas

View File

@@ -0,0 +1,32 @@
Um aplicativo de mapas gratuito e de código aberto, liderado pela comunidade, baseado em dados do OpenStreetMap e reforçado pelo compromisso com a transparência, privacidade e sem fins lucrativos. O CoMaps é um fork/spin-off do Organic Maps, que por sua vez é um fork do Maps.ME.
Leia mais sobre os motivos do projeto e sua direção em <b><i>codeberg.org/comaps</i></b>.
Junte-se à comunidade e ajude a criar o melhor aplicativo de mapas.
• Use o aplicativo e divulgue-o.
• Envie feedback e relate problemas.
• Atualize os dados do mapa no aplicativo ou no site do OpenStreetMap.
‣ <b>Foco offline</b>: Planeje e navegue em sua viagem ao exterior sem a necessidade de sinal de celular, pesquise pontos de referência durante uma caminhada distante, etc. Todas as funções do aplicativo foram projetadas para funcionar offline.
‣ <b>Respeitando a privacidade</b>: O aplicativo foi projetado com a privacidade em mente - não identifica pessoas, não rastreia e não coleta informações pessoais. Sem anúncios.
‣ <b>Simples e sofisticado</b>: recursos essenciais e fáceis de usar que simplesmente funcionam.
‣ <b>Economiza bateria e espaço</b>: Não consome muita bateria como outros aplicativos de navegação. Mapas compactos economizam espaço precioso no seu celular.
‣ <b>Gratuito e desenvolvido pela comunidade</b>: Pessoas como você ajudaram a desenvolver o aplicativo adicionando lugares ao OpenStreetMap, testando e dando feedback sobre os recursos e contribuindo com suas habilidades de desenvolvimento e dinheiro.
‣ <b>Tomada de decisões e finanças abertas e transparentes, sem fins lucrativos e totalmente de código aberto.</b>
<b>Principais recursos</b>:
• Mapas detalhados para download com locais não disponíveis no Google Maps
• Modo ao ar livre com trilhas em destaque, acampamentos, fontes de água, picos, curvas de nível, etc.
• Trilhas para caminhada e ciclovias
• Pontos de interesse como restaurantes, postos de gasolina, hotéis, lojas, pontos turísticos e muito mais
• Pesquise por nome, endereço ou por categoria de ponto de interesse
• Navegação com anúncios de voz para caminhadas, ciclismo ou direção
• Marque seus lugares favoritos com um único toque
• Artigos offline da Wikipédia
• Camada e direções de transporte público do metrô
• Gravação de trilhas
• Exporte e importe favoritos e trilhas nos formatos KML, KMZ e GPX
• Um modo escuro para usar à noite
• Aprimore os dados do mapa para todos usando um editor básico integrado
<b>A Liberdade Chegou</b>
Descubra sua jornada, navegue pelo mundo com privacidade e comunidade em primeiro lugar!

View File

@@ -1 +1 @@
CoMaps - călătorește offline cu confidențialitate CoMaps - Drumeții, Ciclism, Condus Offline în confidențialitate

View File

@@ -1,9 +1,9 @@
• Данные 22 августа Представляем логотип CoMaps!
Новый спидометр,информация о маршруте Линии высот для многих регионов с шагом 20м или 50м
Улучшен тёмный стиль,цветные метки Ссылки на изображения Panoramax к выбранным POI
Время последней проверки часов работы Карты OpenStreetMap от 13 июля
Построении маршрута учитывает повороты, знак «Стоп»,светофоры и ограничения Заливки цветом ко многим объектам и более ранняя заливка для существующих объектов
• Предпочтение отдается GPS-координатам,а не компасу,увеличена частота опроса местоположения • Показ часов работы при выборе POI
Можно добавлять отдельные адреса и заметки в редакторе Разные водно-болотные угодья отличаются цветом
Улучшены различные элементы пользовательского интерфейса и стиль карты Обновлены цвета растительности и другие цвета на карте, изменены некоторые иконки
Ознакомьтесь с примечания к релизу про изменения! В стиле "Активный отдых" более четкие линии высот

View File

@@ -1,32 +1,32 @@
Бесплатна апликација отвореног кода коју одржава заједница и која се заснива на ОpenStreetMap подацима. Непрофитна, транспарентна и цени вашу приватност. CoMaps је настала од апликације Organic Maps, која је настала од апликације Maps.ME. Бесплатна апликација отвореног кода коју је обављала заједница и заснива се на ОpenStreetMap-у подацима, усмерени транспарентност, приватност и непрофитни. CoMaps је Апликације за органске карте виљушка, које је пак форк Maps.ME.
Прочитајте о разлозима пројекта и његовог правца на <b><i>codeberg.org/comaps</i></b> Прочитајте о разлозима пројекта и његовог правца на <b><i>codeberg.org/comaps</i></b>
Придружите се отвореној заједници и помозите да направимо најбољу апликацију за мапе Придружите се отвореној заједници и помозите да направимо најбољу апликацију за мапе
• Користите апликацију и проширите глас о томе • Користите апликацију и проширите глас о томе
• Дајте повратне информације и пријавите проблеме • Дајте повратне информације и пријавите проблеме
• Ажурирајте податке на мапи у апликацији или на сајту OpenStreetMap • Ажурирајте податке на мапи у апликацији или на веб локацији OpenStreetMap
‣ <b>Фокусирано на офлајн рад</b>: Планирајте и управљајте путовањем у иностранству без потребе за мобилним интернетом, тражите успутне тачке док сте на забаченом планинском путу, итд. Све функционалности су дизајниране за рад без интернета. ‣ <b> фокусирано на офлајн Вар </b>: Планирајте и управљајте путовањем у иностранству без потребе за мобилним услугама, тражите путне тачке док је на даљинском покрету, итд. Све апликације су дизајниране за рад ван мреже.
‣ <b>Поштовање приватности</b>: Апликација је осмишљена са приватношћу корисника на уму - не идентификује људе, не прати или прикупља личне податке. Нема реклама. ‣ <b> Поштовање приватности </b>: Апликација је осмишљена задржавања у уму приватност - не идентификује људе, не прати или прикупља личне податке. Нема реклама.
‣ <b>Једноставно и елегантно</b>: Апликација је лака за употребу и једноставно функционише. ‣ <b> Једноставно и елегантно </b>: Апликација је тривијална за употребу и једноставно функционише.
‣ <b>Чува вашу батерију и простор</b>: Не троши батерију као остале апликације за навигацију. Компактне мапе чувају драгоцени простор на вашем телефону. ‣ <b> Чува вашу батерију и простор </b>: не конзумира батерију као остале навигационе апликације. Компактне картице сачувајте драгоцени простор на вашем телефону.
‣ <b>Отворено и направљено од стране заједнице</b>: Људи попут вас су допринели развоју апликације додавањем локација на OpenStreetMap, тестирањем, давањем повратних информација о апликацији и помогли су својим програмерским вештинама и донацијама. ‣ <b> Отворено и направио је заједницу </b>: Људи попут вас је помогли да додају апликацију додавањем локација на OpenStreetMap-у, тестирању и давање повратних информација о апликацији и доприносе вашим развојним вештинама и новцу.
‣ <b>Отворено и транспарентно доношење одлука и употреба донација, непрофитна и потпуно отвореног кода.</b> ‣ <b> Отворено и транспарентно доношење одлука и употреба финансија, непрофитна и потпуно отворена извора. </b>
<b> Главне карактеристике </b>: <b> Главне карактеристике </b>:
• Преузмимање детаљне мапе са локацијама које нису доступне са Google мапама • Преузмите детаљне мапе са локацијама које нису доступне са Гоогле мапама
Режим за излете са истакнутим планинарским стазама, камповима, изворима воде, планинским врховима, изохипсама итд. Улазнице за излете са истакнутим планинарским стазама, камповима, изворима воде, планинске врхове, контурне линије итд.
• Стазе за планинарење и бицикле • Стазе за планинарење и бицикле
• Тачке интереса као што су ресторани, бензинске пумпе, хотели, продавнице, знаменитости и још много тога • Тачке интереса као што су ресторани, бензинске пумпе, хотели, продавнице, погледа и још много тога
• Претрага по називу, адреси или категоријама • Претражите име или адресу или по категоријама камате
Навигација са гласовним инструкцијама за ходање, вожњу бицикла или аутомобила навигација са гласовним најавама за ходање, бициклизам или аутомобил
• Означивање омиљених места једним додиром • Означите своја омиљена места једним додиром
• Офлајн чланци Википедије • Офлајн чланци Википедије
Транзитни слој подземне железнице са навигацијом транзитни слој подземне пруге са навигацијом
• Снимање ГПС путања • Снимање ГПС трагова
Увоз и увоз маркера и путања у KML, KMZ, GPX формате Ознака и увоз и увоз у KML, KMZ, GPX формате
• Тамни режим за употребу током ноћи • Тамни режим за употребу током ноћи
• Побољшајте карту за све кориснике, користећи основни едитор за мапе • Побољшајте карту за све кориснике, користећи основни уредни уредник мапе
<b> Слобода је овде </b> <b> Слобода је овде </b>
Откријте своје путовање, крећете се са светом са приватношћу и заједницом на првом месту! Откријте своје путовање, крећете се са свијетом са приватношћу и заједницом на првом месту!

View File

@@ -0,0 +1,9 @@
Представљамо CoMaps лого!
• ажуриране изохипсе за многе регионе на кораке од 20 или 50 метара
• додате везе ка Panoramax сликама за изабране тачке интересовања (POI)
• подаци са OpenStreetMap-а од 13. јула
• додате боје за многе елементе и раније приказивање постојећих површина
• приказ стања радног времена при избору POI-ја
• мочваре подељене на неколико различитих типова
• ажуриране боје вегетације и других елемената на мапи, ажуриране поједине иконе
• на отвореном: наглашеније изохипсе

View File

@@ -1 +1 @@
Једноставна навигација - Сазнајте више о свом путовању - Одржава заједница Једноставна навигација - Сазнајте више о свом путовању - Ради на бази заједнице

View File

@@ -1 +1 @@
CoMaps - пешачење, бицикл и вожња, са приватношћу CoMaps - пешачење, бицикл, вожња

View File

@@ -1,4 +1,4 @@
package app.organicmaps.location; package app.organicmaps.sdk.location;
import static android.Manifest.permission.ACCESS_COARSE_LOCATION; import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
import static android.Manifest.permission.ACCESS_FINE_LOCATION; import static android.Manifest.permission.ACCESS_FINE_LOCATION;
@@ -10,7 +10,6 @@ import android.location.Location;
import android.os.Looper; import android.os.Looper;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.RequiresPermission; import androidx.annotation.RequiresPermission;
import app.organicmaps.sdk.location.BaseLocationProvider;
import app.organicmaps.sdk.util.LocationUtils; import app.organicmaps.sdk.util.LocationUtils;
import app.organicmaps.sdk.util.log.Logger; import app.organicmaps.sdk.util.log.Logger;
import com.google.android.gms.common.api.ApiException; import com.google.android.gms.common.api.ApiException;

View File

@@ -1,25 +1,23 @@
package app.organicmaps.location; package app.organicmaps.sdk.location;
import android.content.Context; import android.content.Context;
import androidx.annotation.NonNull; 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.Config;
import app.organicmaps.sdk.util.log.Logger; import app.organicmaps.sdk.util.log.Logger;
import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability; import com.google.android.gms.common.GoogleApiAvailability;
public class LocationProviderFactoryImpl implements LocationProviderFactory public class LocationProviderFactory
{ {
private static final String TAG = LocationProviderFactoryImpl.class.getSimpleName(); private static final String TAG = LocationProviderFactory.class.getSimpleName();
public boolean isGoogleLocationAvailable(@NonNull Context context) public static boolean isGoogleLocationAvailable(@NonNull Context context)
{ {
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context) == ConnectionResult.SUCCESS; return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context) == ConnectionResult.SUCCESS;
} }
public BaseLocationProvider getProvider(@NonNull Context context, @NonNull BaseLocationProvider.Listener listener) public static BaseLocationProvider getProvider(@NonNull Context context,
@NonNull BaseLocationProvider.Listener listener)
{ {
if (isGoogleLocationAvailable(context) && Config.useGoogleServices()) if (isGoogleLocationAvailable(context) && Config.useGoogleServices())
{ {

View File

@@ -1 +1 @@
Navigation cartographique facile - Vivez de grands voyages - Propulsé par la communauté Navigation cartographique facile - Découvrez davantage de votre voyage - Propulsé par la communauté

View File

@@ -1 +0,0 @@
Könnyű térképes navigáció - Fedezz fel többet az útjaidról - A közösség erejével

View File

@@ -1 +0,0 @@
CoMaps - Az adatvédő navigáció

View File

@@ -1 +0,0 @@
കോമാപ്പ്സ് - സ്വകാര്യതയോടെ സഞ്ചരിക്കൂ

View File

@@ -1 +0,0 @@
CoMaps - Nawigacja szanująca prywatność

View File

@@ -1 +1 @@
Једноставна навигација - Сазнајте више о свом путовању - Одржава заједница Једноставна навигација - Сазнајте више о свом путовању - Ради на бази заједнице

View File

@@ -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> <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 ve işe yarayan özellikler. ‣ <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>Ç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>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. Kompakt harita dosyaları, değerli depolama alanınızdan tasarruf eder. ‣ <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 bu uygulamanın oluşturulmasına yardımcı oldular. ‣ <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 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>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>Ana Özellikler</b>: <b>Ana Özellikler</b>:
• Google Haritalar'da bulunmayan yerleri içeren, çevrimdışı detaylı haritalar • Google Haritalar'da bulunmayan yerleri içeren, çevrimdışı detaylı haritalar

View File

@@ -1 +0,0 @@
../../../../google/java/app/organicmaps/location

View File

@@ -0,0 +1 @@
../../../../../google/java/app/organicmaps/sdk/location

View File

@@ -6,7 +6,7 @@
<!-- Requiring "android.hardware.touchscreen" here breaks DeX mode --> <!-- Requiring "android.hardware.touchscreen" here breaks DeX mode -->
<uses-feature <uses-feature
android:glEsVersion="0x00030000" android:glEsVersion="0x00020000"
android:required="true"/> android:required="true"/>
<uses-feature <uses-feature
android:name="android.hardware.wifi" android:name="android.hardware.wifi"

View File

@@ -10,8 +10,6 @@ import androidx.core.content.ContextCompat;
import app.organicmaps.sdk.Framework; import app.organicmaps.sdk.Framework;
import app.organicmaps.sdk.bookmarks.data.BookmarkManager; import app.organicmaps.sdk.bookmarks.data.BookmarkManager;
import app.organicmaps.sdk.bookmarks.data.ElevationInfo; 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.ThemeUtils;
import app.organicmaps.util.Utils; import app.organicmaps.util.Utils;
import app.organicmaps.widget.placepage.AxisValueFormatter; import app.organicmaps.widget.placepage.AxisValueFormatter;
@@ -33,16 +31,17 @@ import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
public class ChartController implements OnChartValueSelectedListener public class ChartController implements OnChartValueSelectedListener,
BookmarkManager.OnElevationActivePointChangedListener,
BookmarkManager.OnElevationCurrentPositionChangedListener
{ {
private static final int CHART_Y_LABEL_COUNT = 3; private static final int CHART_Y_LABEL_COUNT = 3;
private static final int CHART_X_LABEL_COUNT = 6; private static final int CHART_X_LABEL_COUNT = 6;
private static final int CHART_ANIMATION_DURATION = 0; private static final int CHART_ANIMATION_DURATION = 1500;
private static final int CHART_FILL_ALPHA = (int) (0.12 * 255); private static final int CHART_FILL_ALPHA = (int) (0.12 * 255);
private static final int CHART_AXIS_GRANULARITY = 100; private static final int CHART_AXIS_GRANULARITY = 100;
private static final float CUBIC_INTENSITY = 0.2f; private static final float CUBIC_INTENSITY = 0.2f;
private static final int CURRENT_POSITION_OUT_OF_TRACK = -1; private static final int CURRENT_POSITION_OUT_OF_TRACK = -1;
private static final String ELEVATION_PROFILE_POINTS = "ELEVATION_PROFILE_POINTS";
@SuppressWarnings("NullableProblems") @SuppressWarnings("NullableProblems")
@NonNull @NonNull
@@ -63,7 +62,6 @@ public class ChartController implements OnChartValueSelectedListener
private final Context mContext; private final Context mContext;
private long mTrackId = Utils.INVALID_ID; private long mTrackId = Utils.INVALID_ID;
private boolean mCurrentPositionOutOfTrack = true; private boolean mCurrentPositionOutOfTrack = true;
private boolean mInformSelectedActivePointToCore = true;
public ChartController(@NonNull Context context) public ChartController(@NonNull Context context)
{ {
@@ -72,6 +70,8 @@ public class ChartController implements OnChartValueSelectedListener
public void initialize(@NonNull View view) public void initialize(@NonNull View view)
{ {
BookmarkManager.INSTANCE.setElevationActivePointChangedListener(this);
BookmarkManager.INSTANCE.setElevationCurrentPositionChangedListener(this);
final Resources resources = mContext.getResources(); final Resources resources = mContext.getResources();
mChart = view.findViewById(R.id.elevation_profile_chart); mChart = view.findViewById(R.id.elevation_profile_chart);
@@ -101,6 +101,13 @@ public class ChartController implements OnChartValueSelectedListener
initAxises(); initAxises();
} }
@SuppressWarnings("unused")
public void destroy()
{
BookmarkManager.INSTANCE.setElevationActivePointChangedListener(null);
BookmarkManager.INSTANCE.setElevationCurrentPositionChangedListener(null);
}
private void highlightChartCurrentLocation() private void highlightChartCurrentLocation()
{ {
mChart.highlightValues(Collections.singletonList(getCurrentPosHighlight()), mChart.highlightValues(Collections.singletonList(getCurrentPosHighlight()),
@@ -135,17 +142,15 @@ public class ChartController implements OnChartValueSelectedListener
mChart.getAxisRight().setEnabled(false); mChart.getAxisRight().setEnabled(false);
} }
public void setData(Track track) public void setData(@NonNull ElevationInfo info)
{ {
mTrackId = track.getTrackId(); mTrackId = info.getId();
ElevationInfo info = track.getElevationInfo();
TrackStatistics stats = track.getTrackStatistics();
List<Entry> values = new ArrayList<>(); List<Entry> values = new ArrayList<>();
for (ElevationInfo.Point point : info.getPoints()) for (ElevationInfo.Point point : info.getPoints())
values.add(new Entry((float) point.getDistance(), point.getAltitude(), point)); values.add(new Entry((float) point.getDistance(), point.getAltitude()));
LineDataSet set = new LineDataSet(values, ELEVATION_PROFILE_POINTS); LineDataSet set = new LineDataSet(values, "Elevation_profile_points");
set.setMode(LineDataSet.Mode.CUBIC_BEZIER); set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
set.setCubicIntensity(CUBIC_INTENSITY); set.setCubicIntensity(CUBIC_INTENSITY);
set.setDrawFilled(true); set.setDrawFilled(true);
@@ -168,8 +173,8 @@ public class ChartController implements OnChartValueSelectedListener
mChart.setData(data); mChart.setData(data);
mChart.animateX(CHART_ANIMATION_DURATION); mChart.animateX(CHART_ANIMATION_DURATION);
mMinAltitude.setText(Framework.nativeFormatAltitude(stats.getMinElevation())); mMinAltitude.setText(Framework.nativeFormatAltitude(info.getMinAltitude()));
mMaxAltitude.setText(Framework.nativeFormatAltitude(stats.getMaxElevation())); mMaxAltitude.setText(Framework.nativeFormatAltitude(info.getMaxAltitude()));
highlightActivePointManually(); highlightActivePointManually();
} }
@@ -187,9 +192,7 @@ public class ChartController implements OnChartValueSelectedListener
if (mTrackId == Utils.INVALID_ID) if (mTrackId == Utils.INVALID_ID)
return; return;
if (mInformSelectedActivePointToCore) BookmarkManager.INSTANCE.setElevationActivePoint(mTrackId, e.getX());
BookmarkManager.INSTANCE.setElevationActivePoint(mTrackId, e.getX(), (ElevationInfo.Point) e.getData());
mInformSelectedActivePointToCore = true;
} }
@NonNull @NonNull
@@ -208,6 +211,7 @@ public class ChartController implements OnChartValueSelectedListener
highlightChartCurrentLocation(); highlightChartCurrentLocation();
} }
@Override
public void onCurrentPositionChanged() public void onCurrentPositionChanged()
{ {
if (mTrackId == Utils.INVALID_ID) if (mTrackId == Utils.INVALID_ID)
@@ -218,6 +222,7 @@ public class ChartController implements OnChartValueSelectedListener
highlightActivePointManually(); highlightActivePointManually();
} }
@Override
public void onElevationActivePointChanged() public void onElevationActivePointChanged()
{ {
if (mTrackId == Utils.INVALID_ID) if (mTrackId == Utils.INVALID_ID)
@@ -229,7 +234,6 @@ public class ChartController implements OnChartValueSelectedListener
private void highlightActivePointManually() private void highlightActivePointManually()
{ {
Highlight highlight = getActivePoint(); Highlight highlight = getActivePoint();
mInformSelectedActivePointToCore = false;
mChart.highlightValue(highlight, true); mChart.highlightValue(highlight, true);
} }

View File

@@ -27,7 +27,6 @@ import androidx.annotation.StringRes;
import androidx.annotation.StyleRes; import androidx.annotation.StyleRes;
import androidx.core.view.ViewCompat; import androidx.core.view.ViewCompat;
import app.organicmaps.base.BaseMwmFragmentActivity; import app.organicmaps.base.BaseMwmFragmentActivity;
import app.organicmaps.downloader.MapManagerHelper;
import app.organicmaps.intent.Factory; import app.organicmaps.intent.Factory;
import app.organicmaps.sdk.Framework; import app.organicmaps.sdk.Framework;
import app.organicmaps.sdk.downloader.CountryItem; import app.organicmaps.sdk.downloader.CountryItem;
@@ -36,7 +35,7 @@ import app.organicmaps.sdk.location.LocationListener;
import app.organicmaps.sdk.util.Config; import app.organicmaps.sdk.util.Config;
import app.organicmaps.sdk.util.ConnectionState; import app.organicmaps.sdk.util.ConnectionState;
import app.organicmaps.sdk.util.StringUtils; import app.organicmaps.sdk.util.StringUtils;
import app.organicmaps.util.UiUtils; import app.organicmaps.sdk.util.UiUtils;
import app.organicmaps.util.Utils; import app.organicmaps.util.Utils;
import app.organicmaps.util.WindowInsetUtils.PaddingInsetsListener; import app.organicmaps.util.WindowInsetUtils.PaddingInsetsListener;
import com.google.android.material.button.MaterialButton; import com.google.android.material.button.MaterialButton;
@@ -117,10 +116,10 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
private final app.organicmaps.sdk.DownloadResourcesLegacyActivity.Listener mResourcesDownloadListener = private final app.organicmaps.sdk.DownloadResourcesLegacyActivity.Listener mResourcesDownloadListener =
new app.organicmaps.sdk.DownloadResourcesLegacyActivity.Listener() { new app.organicmaps.sdk.DownloadResourcesLegacyActivity.Listener() {
@Override @Override
public void onProgress(final int bytesDownloaded) public void onProgress(final int percent)
{ {
if (!isFinishing()) if (!isFinishing())
mProgress.setProgressCompat(bytesDownloaded, true); mProgress.setProgressCompat(percent, true);
} }
@Override @Override
@@ -151,14 +150,14 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
switch (item.newStatus) switch (item.newStatus)
{ {
case CountryItem.STATUS_DONE: case CountryItem.STATUS_DONE:
mAreResourcesDownloaded = true; mAreResourcesDownloaded = true;
showMap(); showMap();
return; return;
case CountryItem.STATUS_FAILED: case CountryItem.STATUS_FAILED:
MapManagerHelper.showError(DownloadResourcesLegacyActivity.this, item, null); MapManager.showError(DownloadResourcesLegacyActivity.this, item, null);
return; return;
} }
} }
} }
@@ -253,8 +252,7 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
setDownloadMessage(bytes); setDownloadMessage(bytes);
mProgress.setMax(bytes); mProgress.setMax(bytes);
// Start progress at 1% according to M3 guidelines mProgress.setProgressCompat(0, true);
mProgress.setProgressCompat(bytes/100, true);
} }
else else
finishFilesDownload(bytes); finishFilesDownload(bytes);
@@ -372,11 +370,10 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
String fileSizeString = StringUtils.getFileSizeString(this, item.totalSize); String fileSizeString = StringUtils.getFileSizeString(this, item.totalSize);
mTvMessage.setText(getString(R.string.downloading_country_can_proceed, item.name, fileSizeString)); mTvMessage.setText(getString(R.string.downloading_country_can_proceed, item.name, fileSizeString));
mProgress.setMax((int) item.totalSize); mProgress.setMax((int) item.totalSize);
// Start progress at 1% according to M3 guidelines mProgress.setProgressCompat(0, true);
mProgress.setProgressCompat((int) (item.totalSize/100), true);
mCountryDownloadListenerSlot = MapManager.nativeSubscribe(mCountryDownloadListener); mCountryDownloadListenerSlot = MapManager.nativeSubscribe(mCountryDownloadListener);
MapManagerHelper.startDownload(mCurrentCountry); MapManager.startDownload(mCurrentCountry);
setAction(PROCEED_TO_MAP); setAction(PROCEED_TO_MAP);
} }
else else

View File

@@ -23,8 +23,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
public class MapFragment extends BaseMwmFragment implements View.OnTouchListener, SurfaceHolder.Callback public class MapFragment extends BaseMwmFragment implements View.OnTouchListener, SurfaceHolder.Callback
{ {
private static final String TAG = MapFragment.class.getSimpleName(); private static final String TAG = MapFragment.class.getSimpleName();
@NonNull
private final Map mMap = new Map(DisplayType.Device); private final Map mMap = new Map(DisplayType.Device);
public void updateCompassOffset(int offsetX, int offsetY) public void updateCompassOffset(int offsetX, int offsetY)
@@ -86,8 +84,6 @@ public class MapFragment extends BaseMwmFragment implements View.OnTouchListener
{ {
Logger.d(TAG); Logger.d(TAG);
super.onAttach(context); super.onAttach(context);
mMap.setLocationHelper(MwmApplication.from(requireContext()).getLocationHelper());
mMap.setMapRenderingListener((MapRenderingListener) context); mMap.setMapRenderingListener((MapRenderingListener) context);
mMap.setCallbackUnsupported(this::reportUnsupported); mMap.setCallbackUnsupported(this::reportUnsupported);
} }
@@ -163,24 +159,24 @@ public class MapFragment extends BaseMwmFragment implements View.OnTouchListener
int pointerIndex = event.getActionIndex(); int pointerIndex = event.getActionIndex();
switch (action) switch (action)
{ {
case MotionEvent.ACTION_POINTER_UP -> action = Map.NATIVE_ACTION_UP; case MotionEvent.ACTION_POINTER_UP -> action = Map.NATIVE_ACTION_UP;
case MotionEvent.ACTION_UP -> case MotionEvent.ACTION_UP ->
{ {
action = Map.NATIVE_ACTION_UP; action = Map.NATIVE_ACTION_UP;
pointerIndex = 0; pointerIndex = 0;
} }
case MotionEvent.ACTION_POINTER_DOWN -> action = Map.NATIVE_ACTION_DOWN; case MotionEvent.ACTION_POINTER_DOWN -> action = Map.NATIVE_ACTION_DOWN;
case MotionEvent.ACTION_DOWN -> case MotionEvent.ACTION_DOWN ->
{ {
action = Map.NATIVE_ACTION_DOWN; action = Map.NATIVE_ACTION_DOWN;
pointerIndex = 0; pointerIndex = 0;
} }
case MotionEvent.ACTION_MOVE -> case MotionEvent.ACTION_MOVE ->
{ {
action = Map.NATIVE_ACTION_MOVE; action = Map.NATIVE_ACTION_MOVE;
pointerIndex = Map.INVALID_POINTER_MASK; pointerIndex = Map.INVALID_POINTER_MASK;
} }
case MotionEvent.ACTION_CANCEL -> action = Map.NATIVE_ACTION_CANCEL; case MotionEvent.ACTION_CANCEL -> action = Map.NATIVE_ACTION_CANCEL;
} }
Map.onTouch(action, event, pointerIndex); Map.onTouch(action, event, pointerIndex);
return true; return true;

View File

@@ -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.FOLLOW_AND_ROTATE;
import static app.organicmaps.sdk.location.LocationState.LOCATION_TAG; 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.PowerManagment.POWER_MANAGEMENT_TAG;
import static app.organicmaps.sdk.util.Utils.dimen;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.content.res.Configuration; import android.content.res.Configuration;
@@ -28,6 +28,7 @@ import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
@@ -65,6 +66,7 @@ import app.organicmaps.downloader.OnmapDownloader;
import app.organicmaps.editor.EditorActivity; import app.organicmaps.editor.EditorActivity;
import app.organicmaps.editor.EditorHostFragment; import app.organicmaps.editor.EditorHostFragment;
import app.organicmaps.editor.FeatureCategoryActivity; import app.organicmaps.editor.FeatureCategoryActivity;
import app.organicmaps.editor.OsmLoginActivity;
import app.organicmaps.editor.ReportFragment; import app.organicmaps.editor.ReportFragment;
import app.organicmaps.help.HelpActivity; import app.organicmaps.help.HelpActivity;
import app.organicmaps.intent.Factory; import app.organicmaps.intent.Factory;
@@ -80,6 +82,7 @@ import app.organicmaps.routing.ManageRouteBottomSheet;
import app.organicmaps.routing.NavigationController; import app.organicmaps.routing.NavigationController;
import app.organicmaps.routing.NavigationService; import app.organicmaps.routing.NavigationService;
import app.organicmaps.routing.RoutingBottomMenuListener; import app.organicmaps.routing.RoutingBottomMenuListener;
import app.organicmaps.routing.RoutingController;
import app.organicmaps.routing.RoutingErrorDialogFragment; import app.organicmaps.routing.RoutingErrorDialogFragment;
import app.organicmaps.routing.RoutingPlanFragment; import app.organicmaps.routing.RoutingPlanFragment;
import app.organicmaps.routing.RoutingPlanInplaceController; import app.organicmaps.routing.RoutingPlanInplaceController;
@@ -97,6 +100,7 @@ import app.organicmaps.sdk.display.DisplayType;
import app.organicmaps.sdk.downloader.MapManager; import app.organicmaps.sdk.downloader.MapManager;
import app.organicmaps.sdk.downloader.UpdateInfo; import app.organicmaps.sdk.downloader.UpdateInfo;
import app.organicmaps.sdk.editor.Editor; import app.organicmaps.sdk.editor.Editor;
import app.organicmaps.sdk.editor.OsmOAuth;
import app.organicmaps.sdk.location.LocationHelper; import app.organicmaps.sdk.location.LocationHelper;
import app.organicmaps.sdk.location.LocationListener; import app.organicmaps.sdk.location.LocationListener;
import app.organicmaps.sdk.location.LocationState; import app.organicmaps.sdk.location.LocationState;
@@ -104,7 +108,6 @@ import app.organicmaps.sdk.location.SensorListener;
import app.organicmaps.sdk.location.TrackRecorder; import app.organicmaps.sdk.location.TrackRecorder;
import app.organicmaps.sdk.maplayer.isolines.IsolinesState; import app.organicmaps.sdk.maplayer.isolines.IsolinesState;
import app.organicmaps.sdk.routing.RouteMarkType; import app.organicmaps.sdk.routing.RouteMarkType;
import app.organicmaps.sdk.routing.RoutingController;
import app.organicmaps.sdk.routing.RoutingOptions; import app.organicmaps.sdk.routing.RoutingOptions;
import app.organicmaps.sdk.search.SearchEngine; import app.organicmaps.sdk.search.SearchEngine;
import app.organicmaps.sdk.settings.RoadType; import app.organicmaps.sdk.settings.RoadType;
@@ -112,6 +115,8 @@ import app.organicmaps.sdk.settings.UnitLocale;
import app.organicmaps.sdk.util.Config; import app.organicmaps.sdk.util.Config;
import app.organicmaps.sdk.util.LocationUtils; import app.organicmaps.sdk.util.LocationUtils;
import app.organicmaps.sdk.util.PowerManagment; 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.util.log.Logger;
import app.organicmaps.sdk.widget.placepage.PlacePageData; import app.organicmaps.sdk.widget.placepage.PlacePageData;
import app.organicmaps.search.FloatingSearchToolbarController; import app.organicmaps.search.FloatingSearchToolbarController;
@@ -120,9 +125,7 @@ import app.organicmaps.search.SearchFragment;
import app.organicmaps.settings.DrivingOptionsActivity; import app.organicmaps.settings.DrivingOptionsActivity;
import app.organicmaps.settings.SettingsActivity; import app.organicmaps.settings.SettingsActivity;
import app.organicmaps.util.SharingUtils; import app.organicmaps.util.SharingUtils;
import app.organicmaps.util.ThemeSwitcher;
import app.organicmaps.util.ThemeUtils; import app.organicmaps.util.ThemeUtils;
import app.organicmaps.util.UiUtils;
import app.organicmaps.util.Utils; import app.organicmaps.util.Utils;
import app.organicmaps.util.bottomsheet.MenuBottomSheetFragment; import app.organicmaps.util.bottomsheet.MenuBottomSheetFragment;
import app.organicmaps.util.bottomsheet.MenuBottomSheetItem; import app.organicmaps.util.bottomsheet.MenuBottomSheetItem;
@@ -287,6 +290,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
} }
processIntent(); processIntent();
migrateOAuthCredentials();
} }
/** /**
@@ -341,6 +345,36 @@ 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() private static void checkMeasurementSystem()
{ {
UnitLocale.initializeCurrentUnits(); UnitLocale.initializeCurrentUnits();
@@ -458,10 +492,12 @@ public class MwmActivity extends BaseMwmFragmentActivity
@StyleRes @StyleRes
protected int getThemeResourceId(@NonNull String theme) protected int getThemeResourceId(@NonNull String theme)
{ {
if (Config.UiTheme.isDefault(theme)) Context context = getApplicationContext();
if (ThemeUtils.isDefaultTheme(context, theme))
return R.style.MwmTheme_MainActivity; return R.style.MwmTheme_MainActivity;
if (Config.UiTheme.isNight(theme)) if (ThemeUtils.isNightTheme(context, theme))
return R.style.MwmTheme_Night_MainActivity; return R.style.MwmTheme_Night_MainActivity;
return super.getThemeResourceId(theme); return super.getThemeResourceId(theme);
@@ -583,7 +619,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
private void refreshLightStatusBar() private void refreshLightStatusBar()
{ {
UiUtils.setLightStatusBar(this, !(ThemeUtils.isNightTheme() || RoutingController.get().isPlanning() UiUtils.setLightStatusBar(this, !(ThemeUtils.isNightTheme(this) || RoutingController.get().isPlanning()
|| ChoosePositionMode.get() != ChoosePositionMode.None)); || ChoosePositionMode.get() != ChoosePositionMode.None));
} }
@@ -593,7 +629,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
UiUtils.setViewInsetsPaddingBottom(mPointChooser, windowInsets); UiUtils.setViewInsetsPaddingBottom(mPointChooser, windowInsets);
UiUtils.setViewInsetsPaddingNoBottom(mPointChooserToolbar, windowInsets); UiUtils.setViewInsetsPaddingNoBottom(mPointChooserToolbar, windowInsets);
final int trackRecorderOffset = final int trackRecorderOffset =
TrackRecorder.nativeIsTrackRecordingEnabled() ? dimen(this, R.dimen.map_button_size) : 0; TrackRecorder.nativeIsTrackRecordingEnabled() ? UiUtils.dimen(this, R.dimen.map_button_size) : 0;
mNavBarHeight = isFullscreen() ? 0 : windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom; mNavBarHeight = isFullscreen() ? 0 : windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom;
// For the first loading, set compass top margin to status bar size // For the first loading, set compass top margin to status bar size
// The top inset will be then be updated by the routing controller // The top inset will be then be updated by the routing controller
@@ -647,29 +683,29 @@ public class MwmActivity extends BaseMwmFragmentActivity
mPointChooser.findViewById(R.id.done).setOnClickListener(v -> { mPointChooser.findViewById(R.id.done).setOnClickListener(v -> {
switch (ChoosePositionMode.get()) switch (ChoosePositionMode.get())
{ {
case Api: case Api:
final Intent apiResult = new Intent(); final Intent apiResult = new Intent();
final double[] center = Framework.nativeGetScreenRectCenter(); final double[] center = Framework.nativeGetScreenRectCenter();
apiResult.putExtra(Const.EXTRA_POINT_LAT, center[0]); apiResult.putExtra(Const.EXTRA_POINT_LAT, center[0]);
apiResult.putExtra(Const.EXTRA_POINT_LON, center[1]); apiResult.putExtra(Const.EXTRA_POINT_LON, center[1]);
apiResult.putExtra(Const.EXTRA_ZOOM_LEVEL, Framework.nativeGetDrawScale()); apiResult.putExtra(Const.EXTRA_ZOOM_LEVEL, Framework.nativeGetDrawScale());
setResult(Activity.RESULT_OK, apiResult); setResult(Activity.RESULT_OK, apiResult);
finish(); finish();
break; break;
case Editor: case Editor:
if (Framework.nativeIsDownloadedMapAtScreenCenter()) if (Framework.nativeIsDownloadedMapAtScreenCenter())
startActivity(new Intent(MwmActivity.this, FeatureCategoryActivity.class)); startActivity(new Intent(MwmActivity.this, FeatureCategoryActivity.class));
else else
{ {
dismissAlertDialog(); dismissAlertDialog();
mAlertDialog = new MaterialAlertDialogBuilder(this, R.style.MwmTheme_AlertDialog) mAlertDialog = new MaterialAlertDialogBuilder(this, R.style.MwmTheme_AlertDialog)
.setTitle(R.string.message_invalid_feature_position) .setTitle(R.string.message_invalid_feature_position)
.setPositiveButton(R.string.ok, null) .setPositiveButton(R.string.ok, null)
.setOnDismissListener(dialog -> mAlertDialog = null) .setOnDismissListener(dialog -> mAlertDialog = null)
.show(); .show();
} }
break; break;
case None: throw new IllegalStateException("Unexpected Framework.nativeGetChoosePositionMode()"); case None: throw new IllegalStateException("Unexpected Framework.nativeGetChoosePositionMode()");
} }
closePositionChooser(); closePositionChooser();
}); });
@@ -736,9 +772,9 @@ public class MwmActivity extends BaseMwmFragmentActivity
final View mapView = mMapFragment.getView(); final View mapView = mMapFragment.getView();
if (mapView != null) if (mapView != null)
{ {
int width = mapView.getWidth(); int width = mapView.getWidth();
int height = mapView.getHeight(); int height = mapView.getHeight();
Framework.nativeSetVisibleRect(0, 0, width, height); Framework.nativeSetVisibleRect(0, 0, width, height);
} }
} }
UiUtils.show(mPointChooser); UiUtils.show(mPointChooser);
@@ -936,24 +972,24 @@ public class MwmActivity extends BaseMwmFragmentActivity
{ {
switch (button) switch (button)
{ {
case zoomIn -> Map.zoomIn(); case zoomIn -> Map.zoomIn();
case zoomOut -> Map.zoomOut(); case zoomOut -> Map.zoomOut();
case myPosition -> case myPosition ->
{ {
Logger.i(LOCATION_TAG, "The location button pressed"); Logger.i(LOCATION_TAG, "The location button pressed");
// Calls onMyPositionModeChanged(mode + 1). // Calls onMyPositionModeChanged(mode + 1).
LocationState.nativeSwitchToNextMode(); LocationState.nativeSwitchToNextMode();
} }
case toggleMapLayer -> toggleMapLayerBottomSheet(); case toggleMapLayer -> toggleMapLayerBottomSheet();
case bookmarks -> showBookmarks(); case bookmarks -> showBookmarks();
case search -> showSearch(""); case search -> showSearch("");
case menu -> case menu ->
{ {
closeFloatingPanels(); closeFloatingPanels();
showBottomSheet(MAIN_MENU_ID); showBottomSheet(MAIN_MENU_ID);
} }
case help -> showHelp(); case help -> showHelp();
case trackRecordingStatus -> showTrackSaveDialog(); case trackRecordingStatus -> showTrackSaveDialog();
} }
} }
@@ -1187,22 +1223,21 @@ public class MwmActivity extends BaseMwmFragmentActivity
private void onIsolinesStateChanged(@NonNull IsolinesState type) private void onIsolinesStateChanged(@NonNull IsolinesState type)
{ {
if (type == IsolinesState.NODATA) if (type != IsolinesState.EXPIREDDATA)
{ {
Toast.makeText(this, R.string.isolines_location_error_dialog, Toast.LENGTH_SHORT).show(); type.activate(this, findViewById(R.id.coordinator), findViewById(R.id.menu_frame));
return;
} }
if (type == IsolinesState.EXPIREDDATA) dismissAlertDialog();
{ mAlertDialog = new MaterialAlertDialogBuilder(this, R.style.MwmTheme_AlertDialog)
mAlertDialog = new MaterialAlertDialogBuilder(this, R.style.MwmTheme_AlertDialog) .setTitle(R.string.downloader_update_maps)
.setTitle(R.string.downloader_update_maps) .setMessage(R.string.isolines_activation_error_dialog)
.setMessage(R.string.isolines_activation_error_dialog) .setPositiveButton(R.string.ok,
.setPositiveButton( (dialog, which) -> startActivity(new Intent(this, DownloaderActivity.class)))
R.string.ok, (dialog, which) -> startActivity(new Intent(this, DownloaderActivity.class))) .setNegativeButton(R.string.cancel, null)
.setNegativeButton(R.string.cancel, null) .setOnDismissListener(dialog -> mAlertDialog = null)
.setOnDismissListener(dialog -> mAlertDialog = null) .show();
.show();
}
} }
@Override @Override
@@ -1647,17 +1682,17 @@ public class MwmActivity extends BaseMwmFragmentActivity
final int orientation = getResources().getConfiguration().orientation; final int orientation = getResources().getConfiguration().orientation;
final boolean isTrackRecordingEnabled = TrackRecorder.nativeIsTrackRecordingEnabled(); final boolean isTrackRecordingEnabled = TrackRecorder.nativeIsTrackRecordingEnabled();
if (isTrackRecordingEnabled && (orientation != Configuration.ORIENTATION_LANDSCAPE)) if (isTrackRecordingEnabled && (orientation != Configuration.ORIENTATION_LANDSCAPE))
offsetY += dimen(this, R.dimen.map_button_size); offsetY += UiUtils.dimen(this, R.dimen.map_button_size);
if (orientation == Configuration.ORIENTATION_LANDSCAPE) if (orientation == Configuration.ORIENTATION_LANDSCAPE)
{ {
if (show) if (show)
{ {
final boolean isSmallScreen = UiUtils.getDisplayTotalHeight(this) < dimen(this, R.dimen.dp_400); final boolean isSmallScreen = UiUtils.getDisplayTotalHeight(this) < UiUtils.dimen(this, R.dimen.dp_400);
if (!isSmallScreen || TrackRecorder.nativeIsTrackRecordingEnabled()) if (!isSmallScreen || TrackRecorder.nativeIsTrackRecordingEnabled())
offsetX += dimen(this, R.dimen.map_button_size); offsetX += UiUtils.dimen(this, R.dimen.map_button_size);
} }
else if (isTrackRecordingEnabled) else if (isTrackRecordingEnabled)
offsetY += dimen(this, R.dimen.map_button_size); offsetY += UiUtils.dimen(this, R.dimen.map_button_size);
} }
updateCompassOffset(offsetY, offsetX); updateCompassOffset(offsetY, offsetX);
} }
@@ -2393,18 +2428,18 @@ public class MwmActivity extends BaseMwmFragmentActivity
{ {
switch (keyCode) switch (keyCode)
{ {
case KeyEvent.KEYCODE_DPAD_DOWN: Map.zoomOut(); return true; case KeyEvent.KEYCODE_DPAD_DOWN: Map.zoomOut(); return true;
case KeyEvent.KEYCODE_DPAD_UP: Map.zoomIn(); return true; case KeyEvent.KEYCODE_DPAD_UP: Map.zoomIn(); return true;
case KeyEvent.KEYCODE_ESCAPE: case KeyEvent.KEYCODE_ESCAPE:
final Intent currIntent = getIntent(); final Intent currIntent = getIntent();
final String backUrl = Framework.nativeGetParsedBackUrl(); final String backUrl = Framework.nativeGetParsedBackUrl();
if (TextUtils.isEmpty(backUrl) || (currIntent != null && Factory.isStartedForApiResult(currIntent))) if (TextUtils.isEmpty(backUrl) || (currIntent != null && Factory.isStartedForApiResult(currIntent)))
{ {
finish(); finish();
return true; return true;
} }
return super.onKeyUp(keyCode, event); return super.onKeyUp(keyCode, event);
default: return super.onKeyUp(keyCode, event); default: return super.onKeyUp(keyCode, event);
} }
} }
@@ -2456,7 +2491,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
if (mCurrentWindowInsets != null) if (mCurrentWindowInsets != null)
{ {
final int offset = mCurrentWindowInsets.getInsets(WindowInsetsCompat.Type.systemBars()).top; final int offset = mCurrentWindowInsets.getInsets(WindowInsetsCompat.Type.systemBars()).top;
updateCompassOffset(offset + dimen(this, R.dimen.map_button_size)); updateCompassOffset(offset + UiUtils.dimen(this, R.dimen.map_button_size));
} }
Toast.makeText(this, R.string.track_recording, Toast.LENGTH_SHORT).show(); Toast.makeText(this, R.string.track_recording, Toast.LENGTH_SHORT).show();
TrackRecordingService.startForegroundService(getApplicationContext()); TrackRecordingService.startForegroundService(getApplicationContext());
@@ -2549,7 +2584,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
items.add(new MenuBottomSheetItem(R.string.download_maps, R.drawable.ic_download, getDownloadMapsCounter(), items.add(new MenuBottomSheetItem(R.string.download_maps, R.drawable.ic_download, getDownloadMapsCounter(),
this::onDownloadMapsOptionSelected)); this::onDownloadMapsOptionSelected));
mDonatesUrl = Utils.getDonateUrl(getApplicationContext()); mDonatesUrl = Config.getDonateUrl(getApplicationContext());
if (!mDonatesUrl.isEmpty()) if (!mDonatesUrl.isEmpty())
items.add(new MenuBottomSheetItem(R.string.donate, R.drawable.ic_donate, this::onDonateOptionSelected)); items.add(new MenuBottomSheetItem(R.string.donate, R.drawable.ic_donate, this::onDonateOptionSelected));

View File

@@ -14,12 +14,11 @@ import androidx.lifecycle.DefaultLifecycleObserver;
import androidx.lifecycle.LifecycleObserver; import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.ProcessLifecycleOwner; import androidx.lifecycle.ProcessLifecycleOwner;
import androidx.preference.PreferenceManager;
import app.organicmaps.background.OsmUploadWork; import app.organicmaps.background.OsmUploadWork;
import app.organicmaps.downloader.DownloaderNotifier; import app.organicmaps.downloader.DownloaderNotifier;
import app.organicmaps.location.LocationProviderFactoryImpl;
import app.organicmaps.location.TrackRecordingService; import app.organicmaps.location.TrackRecordingService;
import app.organicmaps.routing.NavigationService; import app.organicmaps.routing.NavigationService;
import app.organicmaps.routing.RoutingController;
import app.organicmaps.sdk.Map; import app.organicmaps.sdk.Map;
import app.organicmaps.sdk.OrganicMaps; import app.organicmaps.sdk.OrganicMaps;
import app.organicmaps.sdk.display.DisplayManager; import app.organicmaps.sdk.display.DisplayManager;
@@ -29,11 +28,9 @@ import app.organicmaps.sdk.location.SensorHelper;
import app.organicmaps.sdk.location.TrackRecorder; import app.organicmaps.sdk.location.TrackRecorder;
import app.organicmaps.sdk.maplayer.isolines.IsolinesManager; import app.organicmaps.sdk.maplayer.isolines.IsolinesManager;
import app.organicmaps.sdk.maplayer.subway.SubwayManager; import app.organicmaps.sdk.maplayer.subway.SubwayManager;
import app.organicmaps.sdk.routing.RoutingController;
import app.organicmaps.sdk.util.Config; import app.organicmaps.sdk.util.Config;
import app.organicmaps.sdk.util.ConnectionState; import app.organicmaps.sdk.util.ConnectionState;
import app.organicmaps.sdk.util.log.Logger; import app.organicmaps.sdk.util.log.Logger;
import app.organicmaps.util.ThemeSwitcher;
import app.organicmaps.util.Utils; import app.organicmaps.util.Utils;
import java.io.IOException; import java.io.IOException;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
@@ -43,9 +40,6 @@ public class MwmApplication extends Application implements Application.ActivityL
@NonNull @NonNull
private static final String TAG = MwmApplication.class.getSimpleName(); private static final String TAG = MwmApplication.class.getSimpleName();
@NonNull
private final LocationProviderFactoryImpl mLocationProviderFactory = new LocationProviderFactoryImpl();
@SuppressWarnings("NotNullFieldNotInitialized") @SuppressWarnings("NotNullFieldNotInitialized")
@NonNull @NonNull
private OrganicMaps mOrganicMaps; private OrganicMaps mOrganicMaps;
@@ -104,12 +98,6 @@ public class MwmApplication extends Application implements Application.ActivityL
return mOrganicMaps; return mOrganicMaps;
} }
@NonNull
public LocationProviderFactoryImpl getLocationProviderFactory()
{
return mLocationProviderFactory;
}
@NonNull @NonNull
public static MwmApplication from(@NonNull Context context) public static MwmApplication from(@NonNull Context context)
{ {
@@ -130,10 +118,7 @@ public class MwmApplication extends Application implements Application.ActivityL
sInstance = this; sInstance = this;
PreferenceManager.setDefaultValues(this, R.xml.prefs_main, false); mOrganicMaps = new OrganicMaps(getApplicationContext());
mOrganicMaps = new OrganicMaps(getApplicationContext(), BuildConfig.FLAVOR, BuildConfig.APPLICATION_ID,
BuildConfig.VERSION_CODE, BuildConfig.VERSION_NAME,
BuildConfig.FILE_PROVIDER_AUTHORITY, mLocationProviderFactory);
ConnectionState.INSTANCE.initialize(this); ConnectionState.INSTANCE.initialize(this);
@@ -148,8 +133,6 @@ public class MwmApplication extends Application implements Application.ActivityL
public boolean initOrganicMaps(@NonNull Runnable onComplete) throws IOException public boolean initOrganicMaps(@NonNull Runnable onComplete) throws IOException
{ {
return mOrganicMaps.init(() -> { return mOrganicMaps.init(() -> {
ThemeSwitcher.INSTANCE.initialize(this);
ThemeSwitcher.INSTANCE.restart(false);
ProcessLifecycleOwner.get().getLifecycle().addObserver(mProcessLifecycleObserver); ProcessLifecycleOwner.get().getLifecycle().addObserver(mProcessLifecycleObserver);
onComplete.run(); onComplete.run();
}); });

View File

@@ -9,8 +9,7 @@ import androidx.annotation.IntegerRes;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import app.organicmaps.sdk.util.Utils; import app.organicmaps.sdk.util.UiUtils;
import app.organicmaps.util.UiUtils;
import org.chromium.base.ObserverList; import org.chromium.base.ObserverList;
class PanelAnimator class PanelAnimator
@@ -27,7 +26,7 @@ class PanelAnimator
PanelAnimator(MwmActivity activity) PanelAnimator(MwmActivity activity)
{ {
mActivity = activity; mActivity = activity;
mWidth = Utils.dimen(activity.getApplicationContext(), R.dimen.panel_width); mWidth = UiUtils.dimen(activity.getApplicationContext(), R.dimen.panel_width);
mPanel = mActivity.findViewById(R.id.fragment_container); mPanel = mActivity.findViewById(R.id.fragment_container);
mDuration = mActivity.getResources().getInteger(R.integer.anim_panel); mDuration = mActivity.getResources().getInteger(R.integer.anim_panel);
} }

View File

@@ -60,10 +60,11 @@ public class SplashActivity extends AppCompatActivity
{ {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
final String theme = Config.UiTheme.getCurrent(); final Context context = getApplicationContext();
if (Config.UiTheme.isDefault(theme)) final String theme = Config.getCurrentUiTheme(context);
if (ThemeUtils.isDefaultTheme(context, theme))
setTheme(R.style.MwmTheme_Splash); setTheme(R.style.MwmTheme_Splash);
else if (Config.UiTheme.isNight(theme)) else if (ThemeUtils.isNightTheme(context, theme))
setTheme(R.style.MwmTheme_Night_Splash); setTheme(R.style.MwmTheme_Night_Splash);
else else
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme); throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);

View File

@@ -9,7 +9,7 @@ import android.webkit.WebView;
import android.webkit.WebViewClient; import android.webkit.WebViewClient;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import app.organicmaps.base.OnBackPressListener; import app.organicmaps.base.OnBackPressListener;
import app.organicmaps.util.UiUtils; import app.organicmaps.sdk.util.UiUtils;
public abstract class WebContainerDelegate implements OnBackPressListener public abstract class WebContainerDelegate implements OnBackPressListener
{ {

View File

@@ -1,7 +1,6 @@
package app.organicmaps.backup; package app.organicmaps.backup;
import static app.organicmaps.sdk.util.StorageUtils.isFolderWritable; 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_DEFAULT_COUNT;
import static app.organicmaps.settings.BackupSettingsFragment.MAX_BACKUPS_KEY; import static app.organicmaps.settings.BackupSettingsFragment.MAX_BACKUPS_KEY;
@@ -16,8 +15,8 @@ import android.text.style.AbsoluteSizeSpan;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.documentfile.provider.DocumentFile; import androidx.documentfile.provider.DocumentFile;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.sdk.util.UiUtils;
import app.organicmaps.sdk.util.log.Logger; import app.organicmaps.sdk.util.log.Logger;
import app.organicmaps.util.UiUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
@@ -51,14 +50,14 @@ public class BackupUtils
String volumeName; String volumeName;
if ("primary".equalsIgnoreCase(volumeId)) if ("primary".equalsIgnoreCase(volumeId))
volumeName = context.getString(app.organicmaps.sdk.R.string.maps_storage_shared); volumeName = context.getString(R.string.maps_storage_shared);
else else
volumeName = context.getString(app.organicmaps.sdk.R.string.maps_storage_removable); volumeName = context.getString(R.string.maps_storage_removable);
SpannableStringBuilder sb = new SpannableStringBuilder(); SpannableStringBuilder sb = new SpannableStringBuilder();
sb.append(volumeName + ": \n", new AbsoluteSizeSpan(dimen(context, R.dimen.text_size_body_3)), sb.append(volumeName + ": \n", new AbsoluteSizeSpan(UiUtils.dimen(context, R.dimen.text_size_body_3)),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
sb.append("/" + subPath, new AbsoluteSizeSpan(dimen(context, R.dimen.text_size_body_4)), sb.append("/" + subPath, new AbsoluteSizeSpan(UiUtils.dimen(context, R.dimen.text_size_body_4)),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
return sb; return sb;
} }

View File

@@ -62,39 +62,39 @@ public class LocalBackupManager implements BookmarkManager.BookmarksSharingListe
ErrorCode errorCode = null; ErrorCode errorCode = null;
switch (result.getCode()) switch (result.getCode())
{ {
case BookmarkSharingResult.SUCCESS -> case BookmarkSharingResult.SUCCESS ->
{ {
if (!saveBackup(result)) 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 ->
{ {
Logger.e(TAG, "Failed to save backup. See system log above");
errorCode = ErrorCode.FILE_ERROR; errorCode = ErrorCode.FILE_ERROR;
Logger.e(TAG, "Failed create file for archive");
} }
else default ->
{ {
Logger.i(TAG, "Backup was created and saved successfully"); errorCode = ErrorCode.UNSUPPORTED;
Logger.e(TAG, "Failed to create backup. Unknown error");
} }
} }
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; ErrorCode finalErrorCode = errorCode;
UiThread.run(() -> { UiThread.run(() -> {

View File

@@ -15,7 +15,7 @@ public class BaseMwmDialogFragment extends DialogFragment
@StyleRes @StyleRes
protected final int getFullscreenTheme() protected final int getFullscreenTheme()
{ {
return ThemeUtils.isNightTheme() ? getFullscreenDarkTheme() : getFullscreenLightTheme(); return ThemeUtils.isNightTheme(requireContext()) ? getFullscreenDarkTheme() : getFullscreenLightTheme();
} }
protected int getStyle() protected int getStyle()

View File

@@ -1,6 +1,7 @@
package app.organicmaps.base; package app.organicmaps.base;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.media.AudioManager; import android.media.AudioManager;
@@ -23,6 +24,7 @@ import app.organicmaps.sdk.util.Config;
import app.organicmaps.sdk.util.concurrency.UiThread; import app.organicmaps.sdk.util.concurrency.UiThread;
import app.organicmaps.sdk.util.log.Logger; import app.organicmaps.sdk.util.log.Logger;
import app.organicmaps.util.RtlUtils; import app.organicmaps.util.RtlUtils;
import app.organicmaps.util.ThemeUtils;
import com.google.android.material.appbar.MaterialToolbar; import com.google.android.material.appbar.MaterialToolbar;
import java.util.Objects; import java.util.Objects;
@@ -38,10 +40,12 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
@StyleRes @StyleRes
protected int getThemeResourceId(@NonNull String theme) protected int getThemeResourceId(@NonNull String theme)
{ {
if (Config.UiTheme.isDefault(theme)) Context context = getApplicationContext();
if (ThemeUtils.isDefaultTheme(context, theme))
return R.style.MwmTheme; return R.style.MwmTheme;
if (Config.UiTheme.isNight(theme)) if (ThemeUtils.isNightTheme(context, theme))
return R.style.MwmTheme_Night; return R.style.MwmTheme_Night;
throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme); throw new IllegalArgumentException("Attempt to apply unsupported theme: " + theme);
@@ -58,7 +62,7 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
protected final void onCreate(@Nullable Bundle savedInstanceState) protected final void onCreate(@Nullable Bundle savedInstanceState)
{ {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
mThemeName = Config.UiTheme.getCurrent(); mThemeName = Config.getCurrentUiTheme(getApplicationContext());
setTheme(getThemeResourceId(mThemeName)); setTheme(getThemeResourceId(mThemeName));
EdgeToEdge.enable(this, SystemBarStyle.dark(Color.TRANSPARENT)); EdgeToEdge.enable(this, SystemBarStyle.dark(Color.TRANSPARENT));
RtlUtils.manageRtl(this); RtlUtils.manageRtl(this);
@@ -118,7 +122,7 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
public void onPostResume() public void onPostResume()
{ {
super.onPostResume(); super.onPostResume();
if (!mThemeName.equals(Config.UiTheme.getCurrent())) if (!mThemeName.equals(Config.getCurrentUiTheme(getApplicationContext())))
{ {
// Workaround described in https://code.google.com/p/android/issues/detail?id=93731 // Workaround described in https://code.google.com/p/android/issues/detail?id=93731
UiThread.runLater(this::recreate); UiThread.runLater(this::recreate);

View File

@@ -14,7 +14,7 @@ import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.util.UiUtils; import app.organicmaps.sdk.util.UiUtils;
import app.organicmaps.util.Utils; import app.organicmaps.util.Utils;
import app.organicmaps.util.WindowInsetUtils.ScrollableContentInsetsListener; import app.organicmaps.util.WindowInsetUtils.ScrollableContentInsetsListener;
import app.organicmaps.widget.PlaceholderView; import app.organicmaps.widget.PlaceholderView;

View File

@@ -10,7 +10,7 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentFactory; import androidx.fragment.app.FragmentFactory;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.util.UiUtils; import app.organicmaps.sdk.util.UiUtils;
import app.organicmaps.util.WindowInsetUtils.PaddingInsetsListener; import app.organicmaps.util.WindowInsetUtils.PaddingInsetsListener;
import com.google.android.material.appbar.MaterialToolbar; import com.google.android.material.appbar.MaterialToolbar;

View File

@@ -42,7 +42,7 @@ public class BookmarkCategoriesActivity extends BaseToolbarActivity
@StyleRes @StyleRes
public int getThemeResourceId(@NonNull String theme) public int getThemeResourceId(@NonNull String theme)
{ {
return ThemeUtils.getWindowBgThemeResourceId(theme); return ThemeUtils.getWindowBgThemeResourceId(getApplicationContext(), theme);
} }
@Override @Override

Some files were not shown because too many files have changed in this diff Show More