Compare commits

..

1 Commits

Author SHA1 Message Date
x7z4w
3364924816 [strings] Support Weblate for cuisines search categories
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-10-18 19:48:58 +00:00
1583 changed files with 12809 additions and 42190 deletions

View File

@@ -1,55 +1,69 @@
# All non-assigned.
* @organicmaps/mergers
# Visual design.
/android/app/src/main/res/drawable*/ @comaps/design
/android/app/src/main/res/font/ @comaps/design
/android/app/src/main/res/mipmap*/ @comaps/design
/data/*.ttf @comaps/design
/data/resources-svg/ @comaps/design
/data/search-icons/ @comaps/design
/iphone/Maps/Images.xcassets/ @comaps/design
/android/app/src/main/res/drawable*/ @organicmaps/design
/android/app/src/main/res/font/ @organicmaps/design
/android/app/src/main/res/mipmap*/ @organicmaps/design
/data/*.ttf @organicmaps/design
/data/resources-svg/ @organicmaps/design
/data/search-icons/ @organicmaps/design
/iphone/Maps/Images.xcassets/ @organicmaps/design
# Android.
/android/ @comaps/android
/android/app/src/main/java/app/comaps/car/ @comaps/android-auto
/docs/ANDROID_LOCATION_TEST.md @comaps/android
/docs/JAVA_STYLE.md @comaps/android
/android/ @organicmaps/android
/android/app/src/main/java/app/organicmaps/car/ @organicmaps/android-auto
/docs/ANDROID_LOCATION_TEST.md @organicmaps/android
/docs/JAVA_STYLE.md @organicmaps/android
# no owner for translation changes
/android/app/src/main/res/values*/strings.xml
# iOS.
/iphone/ @comaps/ios
/xcode/ @comaps/ios
/docs/OBJC_STYLE.md @comaps/ios
/iphone/ @organicmaps/ios
/xcode/ @organicmaps/ios
/docs/OBJC_STYLE.md @organicmaps/ios
# no owner for translation changes
/iphone/plist.txt
/iphone/Maps/LocalizedStrings/
# Qt
/qt/ @organicmaps/qt
# Rendering
/drape/ @organicmaps/rendering
/drape_frontend/ @organicmaps/rendering
# Map Data.
/tools/python/maps_generator/ @organicmaps/data
/generator/ @organicmaps/data
/topography_generator/ @organicmaps/data
/data/borders/ @organicmaps/data
/data/conf/isolines/ @organicmaps/data
/docs/SUBWAY_GENERATION.md @organicmaps/data
/docs/MAPS.md @organicmaps/data
/docs/EXPERIMENTAL_PUBLIC_TRANSPORT_SUPPORT.md @organicmaps/data
# no owner (changed often to add a new POI)
/generator/generator_tests/osm_type_test.cpp
# Map Styles.
/data/styles/ @comaps/styles
/data/types.txt @comaps/styles
/data/visibility.txt @comaps/styles
/data/mapcss-mapping.csv @comaps/styles
/data/replaced_tags.txt @comaps/styles
/data/classificator.txt @comaps/styles
/data/drules_* @comaps/styles
/data/styles/ @organicmaps/styles
/data/types.txt @organicmaps/styles
/data/visibility.txt @organicmaps/styles
/data/mapcss-mapping.csv @organicmaps/styles
/data/replaced_tags.txt @organicmaps/styles
/data/classificator.txt @organicmaps/styles
/data/drules_* @organicmaps/styles
/docs/STYLES.md
/tools/kothic/ @comaps/styles
/tools/kothic/ @organicmaps/styles
# DevOps.
/.forgejo/workflows @comaps/devops
/android/*gradle* @comaps/devops
/docs/RELEASE_MANAGEMENT.md @comaps/devops
/xcode/fastlane/ @comaps/devops
/tools/python/maps_generator/ @comaps/devops
/generator/ @comaps/devops
/topography_generator/ @comaps/devops
/data/borders/ @comaps/devops
/data/conf/isolines/ @comaps/devops
/docs/SUBWAY_GENERATION.md @comaps/devops
/docs/MAPS.md @comaps/devops
/docs/EXPERIMENTAL_PUBLIC_TRANSPORT_SUPPORT.md @comaps/devops
/.forgejo/workflows @organicmaps/devops
/android/*gradle* @organicmaps/devops
/docs/RELEASE_MANAGEMENT.md @organicmaps/devops
/xcode/fastlane/ @organicmaps/devops
# Growth.
README.md @organicmaps/growth
/.forgejo/FUNDING.yml @organicmaps/growth
/android/app/src/fdroid/play/ @organicmaps/growth
/android/app/src/google/play/ @organicmaps/growth
/iphone/metadata/ @organicmaps/growth
# Legal.
LEGAL @comaps/admins
LICENSE @comaps/admins
NOTICE @comaps/admins
CONTRIBUTORS @comaps/admins
/docs/CODE_OF_CONDUCT.md @comaps/admins
/docs/DCO.md @comaps/admins
/docs/GOVERNANCE.md @comaps/admins
LEGAL @organicmaps/legal
LICENSE @organicmaps/legal
NOTICE @organicmaps/legal
CONTRIBUTORS @organicmaps/legal
/docs/CODE_OF_CONDUCT.md @organicmaps/legal
/docs/DCO.md @organicmaps/legal
/docs/GOVERNANCE.md @organicmaps/legal

View File

@@ -1,3 +1 @@
open_collective: comaps
liberapay: comaps
custom: ["https://comaps.app/donate/"]

View File

@@ -1,577 +0,0 @@
name: map-generator
on:
workflow_dispatch: # Manual trigger
inputs:
map-generator-test:
description: 'Test (non-prod) generation?'
required: false
default: false
type: boolean
# run-copy-coasts:
# description: 'Copy last used coastlines?'
# required: false
# default: true
# type: boolean
run-isolines:
description: 'Update altitude isolines?'
required: false
default: false
type: boolean
run-tiger:
description: 'Update TIGER address data?'
required: false
default: true
type: boolean
run-planet-pbf:
description: 'Update PBF planet (for Wiki & subways)?'
required: false
default: true
type: boolean
run-subways:
description: 'Update subways?'
required: false
default: true
type: boolean
run-wiki:
description: 'Update Wikipedia descriptions?'
required: false
default: true
type: boolean
run-planet-o5m:
description: 'Update O5M planet (for mapgen)?'
required: false
default: true
type: boolean
run-mapgen:
description: 'Run maps generation?'
required: false
default: true
type: boolean
map-generator-continue:
description: 'Continue previous map generation?'
required: false
default: false
type: boolean
# map-generator-countries:
# description: 'Generate specific MWMs? (i.e. "US_New York_*, foo")'
# required: false
# type: string
run-upload:
description: 'Upload latest maps to CDN?'
required: false
default: false
type: boolean
# reset:
# description: 'Reset part of the system?'
# required: false
# default: 'no'
# type: choice
# options:
# - 'no'
# - wiki-ratelimit
## RCLONE_CONF is multi-line text containing keys and credentials for us2,ru1,fi1,de1 servers
env:
RCLONE_CONF: ${{ secrets.RCLONE_CONF }}
WIKIMEDIA_USERNAME: ${{ secrets.WIKIMEDIA_USERNAME }}
WIKIMEDIA_PASSWORD: ${{ secrets.WIKIMEDIA_PASSWORD }}
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
ZULIP_API_KEY: ${{ secrets.ZULIP_API_KEY }}
MWMTEST: ${{ inputs.map-generator-test }}
MWMCONTINUE: ${{ inputs.map-generator-continue }}
# MWMCOUNTRIES: ${{ inputs.map-generator-countries }}
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
jobs:
clone-repos:
name: Clone Git Repos
runs-on: mapfilemaker
container:
image: codeberg.org/comaps/maps_generator:f6d53d54f794
volumes:
- /mnt/4tbexternal:/mnt/4tbexternal
concurrency:
group: ${{ github.workflow }}-map-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- uses: actions/cache@v4
with:
path: "~"
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- name: Checkout main repo
shell: bash
run: |
echo "Cloning $FORGEJO_SERVER_URL/$FORGEJO_REPOSITORY branch $FORGEJO_REF_NAME"
cd ~
git clone --depth 1 --recurse-submodules --shallow-submodules -b $FORGEJO_REF_NAME --single-branch $FORGEJO_SERVER_URL/$FORGEJO_REPOSITORY.git comaps
- name: Checkout wikiparser repo
shell: bash
run: |
cd ~
git clone --depth 1 --single-branch https://codeberg.org/comaps/wikiparser.git
- name: Checkout subways repo
shell: bash
run: |
cd ~
git clone --depth 1 --single-branch https://codeberg.org/comaps/subways.git
copy-coasts:
# if: inputs.run-copy-coasts
name: Copy Previously Generated Coasts
runs-on: mapfilemaker
container:
image: codeberg.org/comaps/maps_generator:f6d53d54f794
volumes:
- /mnt/4tbexternal/:/mnt/4tbexternal/
- /mnt/4tbexternal/osm-planet:/home/planet
concurrency:
group: ${{ github.workflow }}-map-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- name: Copy Coasts
shell: bash
run: |
echo "WorldCoasts available:"
ls -al /mnt/4tbexternal/osm-maps/*/intermediate_data/WorldCoasts.*
if [ -f /mnt/4tbexternal/osm-maps/*/intermediate_data/WorldCoasts.geom ]; then
echo "Before:"
ls -al /home/planet/latest_coasts*
# TODO: don't copy coasts from test generations
cp -p /mnt/4tbexternal/osm-maps/*/intermediate_data/WorldCoasts.geom /home/planet/latest_coasts.geom
cp -p /mnt/4tbexternal/osm-maps/*/intermediate_data/WorldCoasts.rawgeom /home/planet/latest_coasts.rawgeom
echo "After:"
ls -al /home/planet/latest_coasts*
else
echo "No WorldCoasts found."
fi
update-isolines:
if: inputs.run-isolines
name: Update Isolines
runs-on: mapfilemaker
needs:
- clone-repos
container:
image: codeberg.org/comaps/maps_generator:f6d53d54f794
volumes:
- /mnt/4tbexternal/:/mnt/4tbexternal/
- /mnt/4tbexternal/osm-planet:/home/planet
concurrency:
group: ${{ github.workflow }}-map-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- uses: actions/cache@v4
with:
path: "~"
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
# TODO: we only need to update these if our SRTM or countries change
# TODO: after update, verify that sizable files exist: /home/planet/isolines/*.isolines
- name: Update Isolines
shell: bash
# TODO: preserve previous isolines version?
# TODO: cleanup the tmp-tiles dir after completion
run: |
cd ~/comaps/
./tools/unix/build_omim.sh -p ~ -R topography_generator_tool
rm -rf /home/planet/isolines/
mkdir /home/planet/isolines/
~/omim-build-relwithdebinfo/topography_generator_tool \
--profiles_path=./data/conf/isolines/isolines-profiles.json \
--countries_to_generate_path=./data/conf/isolines/countries-to-generate.json \
--tiles_isolines_out_dir=/home/planet/isolines/tmp-tiles/ \
--countries_isolines_out_dir=/home/planet/isolines/ \
--data_dir=./data/ \
--srtm_path=/home/planet/SRTM-patched-europe/ \
--threads=96
- name: Check isolines
shell: bash
run: |
NUMISO=$(ls -al /home/planet/isolines/*.isolines | wc -l)
echo "Found $NUMISO isolines"
if [ $NUMISO -lt 10 ]; then
echo "ERROR: Did generation fail?"
exit 1
fi
- name: Notify Zulip
run: |
curl -X POST https://comaps.zulipchat.com/api/v1/messages \
-u $ZULIP_BOT_EMAIL:$ZULIP_API_KEY \
--data-urlencode type=stream \
--data-urlencode 'to="DevOps"' \
--data-urlencode topic=codeberg-bot \
--data-urlencode 'content=Isolines are done!'
update-tiger:
if: inputs.run-tiger
name: Update TIGER
runs-on: mapfilemaker
needs:
- clone-repos
container:
image: codeberg.org/comaps/maps_generator:f6d53d54f794
volumes:
- /mnt/4tbexternal/:/mnt/4tbexternal/
- /mnt/4tbexternal/osm-planet:/home/planet
concurrency:
group: ${{ github.workflow }}-map-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- uses: actions/cache@v4
with:
path: "~"
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- name: Build address_parser
shell: bash
run: |
cd ~/comaps
#rm -rf ~/omim-build-relwithdebinfo/CMakeCache.txt
#rm -rf ~/omim-build-relwithdebinfo/CMakeFiles
./tools/unix/build_omim.sh -p ~ -R address_parser_tool
- name: Update TIGER from Nominatim
shell: bash
# TODO: use curl instead of wget2
run: |
# TODO: maybe remove old osm-planet/tiger first?
cd /home/planet/
mkdir -p tiger
wget2 https://nominatim.org/data/tiger-nominatim-preprocessed-latest.csv.tar.gz
cd ~/comaps
tar -xOzf /home/planet/tiger-nominatim-preprocessed-latest.csv.tar.gz | ~/omim-build-relwithdebinfo/address_parser_tool --output_path=/home/planet/tiger
update-planet-pbf:
if: inputs.run-planet-pbf
name: Update PBF Planet
runs-on: mapfilemaker
container:
image: codeberg.org/comaps/maps_generator:f6d53d54f794
volumes:
- /mnt/4tbexternal/:/mnt/4tbexternal/
- /mnt/4tbexternal/osm-planet:/home/planet
concurrency:
group: ${{ github.workflow }}-map-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- name: Download Planet File if Absent
shell: bash
# TODO: replace wget2 with curl -Z
run: |
if [ ! -d /home/planet/planet/ ]; then
mkdir -p /home/planet/planet/
fi
if [ ! -f /home/planet/planet/planet-latest.osm.pbf ]; then
cd /home/planet/planet/
wget2 --verbose --progress=bar --continue https://ftpmirror.your.org/pub/openstreetmap/pbf/planet-latest.osm.pbf
else
echo "planet-latest.osm.pbf was found, raw download not required."
fi
- name: Update PBF Planet
shell: bash
run: |
cd /home/planet/planet/
rm -f planet-latest-new.osm.pbf
pyosmium-up-to-date planet-latest.osm.pbf -o planet-latest-new.osm.pbf -v --size 16384
mv planet-latest-new.osm.pbf planet-latest.osm.pbf
- name: Notify Zulip
run: |
curl -X POST https://comaps.zulipchat.com/api/v1/messages \
-u $ZULIP_BOT_EMAIL:$ZULIP_API_KEY \
--data-urlencode type=stream \
--data-urlencode 'to="DevOps"' \
--data-urlencode topic=codeberg-bot \
--data-urlencode 'content=PBF planet update is done!'
update-subways:
if: inputs.run-subways
name: Update Subways
runs-on: mapfilemaker
needs:
- clone-repos
container:
image: codeberg.org/comaps/maps_generator:f6d53d54f794
volumes:
- /mnt/4tbexternal/:/mnt/4tbexternal/
- /mnt/4tbexternal/osm-planet:/home/planet
concurrency:
group: ${{ github.workflow }}-map-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- uses: actions/cache@v4
with:
path: "~"
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- name: Update Subways
shell: bash
run: |
cd ~/comaps/
cp tools/unix/maps/settings.sh.prod tools/unix/maps/settings.sh
./tools/unix/maps/generate_subways.sh
- name: Notify Zulip
run: |
curl -X POST https://comaps.zulipchat.com/api/v1/messages \
-u $ZULIP_BOT_EMAIL:$ZULIP_API_KEY \
--data-urlencode type=stream \
--data-urlencode 'to="DevOps"' \
--data-urlencode topic=codeberg-bot \
--data-urlencode 'content=Subways are done!'
wiki-update:
if: inputs.run-wiki
name: Update Wikipedia
runs-on: mapfilemaker
needs:
- clone-repos
container:
image: codeberg.org/comaps/maps_generator:f6d53d54f794
volumes:
- /mnt/4tbexternal/:/mnt/4tbexternal/
- /mnt/4tbexternal/osm-planet:/home/planet
concurrency:
group: ${{ github.workflow }}-map-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- uses: actions/cache@v4
with:
path: "~"
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- name: Check for planet file
shell: bash
# TODO: remove debug output
run: |
if [ ! -f /home/planet/planet/planet-latest.osm.pbf ]; then
echo "ERROR: No file at /home/planet/planet/planet-latest.osm.pbf"
ls -al /home/planet/
ls -al /home/planet/planet/
exit 1
fi
- name: Only get new dumps once per 30 days
shell: bash
run: |
if [[ '${{ inputs.reset }}' == 'wiki-ratelimit' ]]; then
echo "Bypassing wiki rate limit upon request."
exit 0
fi
datediff() {
d1=$(date -d "$1" +%s)
d2=$(date -d "$2" +%s)
echo $(( (d1 - d2) / 86400 ))
}
RECENTDUMPDATE=$(find /home/planet/wikipedia/dumps/ -mindepth 1 -maxdepth 1 -iname "2*" -type d | sort -n -r | head -1 | cut -d/ -f6)
TODAY=$(date +%Y%m%d)
DATEDIFF=$(datediff $TODAY $RECENTDUMPDATE)
if [ $DATEDIFF -lt 30 ]; then
echo "ERROR: The most recent wiki dump is from $RECENTDUMPDATE, $DATEDIFF days ago. Wikimedia limits users to 15 snapshot requests per month."
echo "Set the 'reset' option to 'wiki-ratelimit' to bypass this."
ls -al /home/planet/wikipedia/dumps/
exit 1
fi
- name: Update Wikipedia from Enterprise API
shell: bash
run: |
#todo: curl in download.sh can fail when rate limited and even save error messages to the output. need to validate.
#downloading all languages can also trigger rate limits or fail as well. needs work.
#also: a failure to download means a failure to build, and could result in no wiki descriptions etc.
#also-also: do we want to remove old wiki data in planet between builds? pastk: no need, its being updated / augmented
mkdir -p /home/planet/wikipedia/dumps
mkdir -p /home/planet/wikipedia/build
cd ~/wikiparser
ls -al
echo "Downloading ..."
./download.sh /home/planet/wikipedia/dumps
ls -al /home/planet/wikipedia/dumps/*
echo "Running ..."
./run.sh /home/planet/wikipedia/build \
/home/planet/planet/planet-latest.osm.pbf \
/home/planet/wikipedia/dumps/latest/*.tar.gz
echo "DONE"
- name: Check that the latest dumps are present, recent, and not super tiny
shell: bash
run: |
FAILCHECK=0
# Check all .tar.gz files in /home/planet/wikipedia/dumps/latest/
for file in /home/planet/wikipedia/dumps/latest/*.tar.gz; do
# Check if file exists (handles case where glob doesn't match)
[ -e "$file" ] || continue
# Get file size in MB and modification time in days
size_mb=$(stat -f%z "$file" 2>/dev/null | awk '{print int($1/1024/1024)}' || stat -c%s "$file" | awk
'{print int($1/1024/1024)}')
days_old=$(find "$file" -mtime -7 | wc -l)
# Verify conditions
if [ "$size_mb" -lt 100 ]; then
echo "FAIL: $file is only ${size_mb}MB (< 100MB)"
FAILCHECK=1
elif [ "$days_old" -eq 0 ]; then
echo "FAIL: $file is older than 7 days"
ls -al $file
FAILCHECK=1
else
echo "PASS: $file (${size_mb}MB, modified within 7 days)"
fi
done
exit $FAILCHECK
- name: Notify Zulip
run: |
curl -X POST https://comaps.zulipchat.com/api/v1/messages \
-u $ZULIP_BOT_EMAIL:$ZULIP_API_KEY \
--data-urlencode type=stream \
--data-urlencode 'to="DevOps"' \
--data-urlencode topic=codeberg-bot \
--data-urlencode 'content=Wiki update is done!'
update-planet-o5m:
if: inputs.run-planet-o5m
name: Update O5M Planet
runs-on: mapfilemaker
container:
image: codeberg.org/comaps/maps_generator:f6d53d54f794
volumes:
- /mnt/4tbexternal/:/mnt/4tbexternal/
- /mnt/4tbexternal/osm-planet:/home/planet
concurrency:
group: ${{ github.workflow }}-map-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- name: Check for O5M Planet File
shell: bash
run: |
if [ ! -f /home/planet/planet/planet.o5m ]; then
echo "WARN: No file at /home/planet/planet/planet.o5m"
if [ ! -f /home/planet/planet/planet-latest.osm.pbf ]; then
echo "ERROR: No file at /home/planet/planet/planet-latest.osm.pbf"
ls -al /home/planet/
ls -al /home/planet/planet/
exit 1
fi
echo "Converting planet-latest.osm.pbf to planet.o5m"
cd /home/planet/planet/
osmconvert -v --drop-author --drop-version --hash-memory=4000 planet-latest.osm.pbf -o=planet.o5m
echo "Conversion is done."
fi
- name: Update O5M planet
run: |
echo "Starting..."
cd /home/planet/planet/
rm -f planet-new.o5m
osmupdate -v --drop-author --drop-version --hash-memory=4000 --max-merge=32 --out-o5m planet.o5m planet-new.o5m
mv planet-new.o5m planet.o5m
echo "Done."
- name: Notify Zulip
run: |
curl -X POST https://comaps.zulipchat.com/api/v1/messages \
-u $ZULIP_BOT_EMAIL:$ZULIP_API_KEY \
--data-urlencode type=stream \
--data-urlencode 'to="DevOps"' \
--data-urlencode topic=codeberg-bot \
--data-urlencode 'content=O5M planet update is done!'
generate-maps:
if: inputs.run-mapgen
name: Generate Maps
runs-on: mapfilemaker
needs:
- clone-repos
timeout-minutes: 40320
container:
image: codeberg.org/comaps/maps_generator:f6d53d54f794
volumes:
- /mnt/4tbexternal/:/mnt/4tbexternal/
- /mnt/4tbexternal/osm-planet:/home/planet
options: --ulimit nofile=262144:262144
concurrency:
group: ${{ github.workflow }}-map-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- uses: actions/cache@v4
with:
path: "~"
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- name: Make output folders if necessary
shell: bash
run: |
if [ ! -d /mnt/4tbexternal/osm-maps ]; then
mkdir -p /mnt/4tbexternal/osm-maps
fi
- name: Get SRTM if necessary
# TODO: it should be a separate step like Wiki or isolines
shell: bash
run: |
if [ ! -d /home/planet/SRTM-patched-europe/ ]; then
echo "ERROR: NO SRTM"
exit 1
fi
- name: Run docker_maps_generator.sh
shell: bash
run: |
cd ~/comaps
bash ./tools/unix/maps/docker_maps_generator.sh
- name: Notify Zulip
run: |
curl -X POST https://comaps.zulipchat.com/api/v1/messages \
-u $ZULIP_BOT_EMAIL:$ZULIP_API_KEY \
--data-urlencode type=stream \
--data-urlencode 'to="DevOps"' \
--data-urlencode topic=codeberg-bot \
--data-urlencode 'content=Generator is done!'
upload-maps:
if: inputs.run-upload
name: Upload Maps
runs-on: mapfilemaker
container:
image: codeberg.org/comaps/maps_generator:f6d53d54f794
volumes:
- /mnt/4tbexternal/:/mnt/4tbexternal/
- /mnt/4tbexternal/osm-planet:/home/planet
concurrency:
group: ${{ github.workflow }}-map-generator-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
steps:
- uses: actions/cache@v4
with:
path: "~"
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- name: Write config file
run: |
mkdir -p ~/.config/rclone/
echo "${{ secrets.RCLONE_CONF }}" > ~/.config/rclone/rclone.conf
- name: Upload map files to CDNs
shell: bash
run: |
shopt -s nullglob
buildfolder=$(find /mnt/4tbexternal/osm-maps/ -mindepth 1 -maxdepth 1 -iname "2*" -type d | sort -n -r | head -1 | cut -d/ -f5)
builddate=$(find /mnt/4tbexternal/osm-maps/*/ -mindepth 1 -maxdepth 1 -iname "2*" -type d | sort -n -r | head -1 | cut -d/ -f6)
mwmfiles=( /mnt/4tbexternal/osm-maps/$buildfolder/$builddate/*.mwm )
if (( ${#mwmfiles[@]} )); then
echo "<$(date +%T)> Uploading maps from $buildfolder/$builddate..."
cd ~/comaps/tools/unix/maps
./upload_to_cdn.sh /mnt/4tbexternal/osm-maps/$buildfolder/$builddate
echo "<$(date +%T)> Finished uploading maps from $buildfolder/$builddate."
else
echo "<$(date +%T)> No MWM files in /mnt/4tbexternal/osm-maps/$buildfolder/$builddate/*.mwm, not uploading maps."
echo "<$(date +%T)> Found top level: $(ls -alt /mnt/4tbexternal/osm-maps/*)"
echo "<$(date +%T)> Found second level: $(ls -alt /mnt/4tbexternal/osm-maps/$buildfolder/*)"
fi
- name: Notify Zulip
run: |
curl -X POST https://comaps.zulipchat.com/api/v1/messages \
-u $ZULIP_BOT_EMAIL:$ZULIP_API_KEY \
--data-urlencode type=stream \
--data-urlencode 'to="DevOps"' \
--data-urlencode topic=codeberg-bot \
--data-urlencode 'content=Upload is done!'

3
.github/FUNDING.yml vendored
View File

@@ -1,3 +0,0 @@
open_collective: comaps
liberapay: comaps
custom: ["https://comaps.app/donate/"]

View File

@@ -8,14 +8,14 @@ on:
jobs:
ios-check:
name: Build iOS
runs-on: macos-26
runs-on: macos-15
env:
DEVELOPER_DIR: /Applications/Xcode_26.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_26.app/Contents/Developer
LANG: en_US.UTF-8 # Fastlane complains that the terminal is using ASCII.
LANGUAGE: en_US.UTF-8
LC_ALL: en_US.UTF-8
TEST_RESULTS_BUNDLE_NAME: CoMaps-Test-Results
SIMULATOR_DEVICE: 'iPhone 17 Pro Max'
SIMULATOR_DEVICE: 'iPhone 16 Pro Max'
strategy:
fail-fast: false
matrix:
@@ -31,9 +31,6 @@ jobs:
brew install qt \
optipng
pip3 install "protobuf<3.21" --break-system-packages
xcodebuild -downloadComponent metalToolchain
xcodebuild -downloadPlatform iOS
- name: Checkout sources
uses: actions/checkout@v4
@@ -41,11 +38,11 @@ jobs:
shell: bash
run: git submodule update --depth 1 --init --recursive --jobs=$(($(sysctl -n hw.logicalcpu) * 20))
- name: Configure repository
- name: Configure repository
shell: bash
run: ./configure.sh
- name: Configure Xcode cache
- name: Configure XCode cache
uses: irgaly/xcode-cache@v1
with:
key: xcode-cache-deriveddata-${{ github.workflow }}-${{ matrix.buildType }}-${{ github.sha }}

10
.gitignore vendored
View File

@@ -9,7 +9,6 @@ Makefile.Release
object_script.*.Debug
object_script.*.Release
compile_commands.json
*.local.*
stxxl.errlog
stxxl.log
@@ -39,6 +38,9 @@ data/patterns.txt*
# Auto-generated from data/categories-strings/* by tools/unix/generate_categories.sh
data/categories.txt
# Auto-generated from data/cuisines-strings/* by tools/unix/generate_cuisines.sh
data/categories_cuisines.txt
# Compiled Python
*.pyc
@@ -155,8 +157,6 @@ android/huawei-appgallery.json
android/res/xml/network_security_config.xml
./server/
iphone/Maps/app.omaps/
# Generated file
libs/indexer/localized_types_map.cpp
*.li
@@ -190,6 +190,10 @@ tools/python/maps_generator/var/etc/map_generator.ini
tools/python/routing/etc/*.ini
tools/unix/maps/settings.sh
# Helpers
/node_modules/
/package-lock.json
# Visual Studio
.vs

View File

@@ -114,6 +114,19 @@ if (${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
add_compile_options(-fno-omit-frame-pointer)
endif()
# Linux GCC LTO plugin fix.
if (PLATFORM_LINUX AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_BUILD_TYPE MATCHES "^Rel"))
# To force errors if LTO was not enabled.
add_compile_options(-fno-fat-lto-objects)
# To fix ar and ranlib "plugin needed to handle lto object".
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)
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> --plugin ${plugin} qcs <TARGET> <OBJECTS>")
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_FINISH "<CMAKE_RANLIB> --plugin ${plugin} <TARGET>")
endif()
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
if (PLATFORM_LINUX OR PLATFORM_ANDROID)
@@ -162,10 +175,10 @@ if (NOT PLATFORM_IPHONE AND NOT PLATFORM_ANDROID)
find_package(Qt6 COMPONENTS REQUIRED ${qt_components} PATHS $ENV{QT_PATH} /opt/homebrew/opt/qt@6 /usr/local/opt/qt@6 /usr/lib/x86_64-linux-gnu/qt6)
set(MINIMUM_REQUIRED_QT_VERSION 6.4.0)
if (Qt6_VERSION VERSION_LESS ${MINIMUM_REQUIRED_QT_VERSION})
message(FATAL_ERROR "Unsupported Qt version: ${Qt6_VERSION}, the minimum required is ${MINIMUM_REQUIRED_QT_VERSION}")
if (Qt6Widgets_VERSION VERSION_LESS ${MINIMUM_REQUIRED_QT_VERSION})
message(FATAL_ERROR "Unsupported Qt version: ${Qt6Widgets_VERSION}, the minimum required is ${MINIMUM_REQUIRED_QT_VERSION}")
else()
message(STATUS "Found Qt version: ${Qt6_VERSION}")
message(STATUS "Found Qt version: ${Qt6Widgets_VERSION}")
endif()
endif()
@@ -209,9 +222,6 @@ if (PLATFORM_DESKTOP AND NOT WITH_SYSTEM_PROVIDED_3PARTY)
include_directories("${PROJECT_BINARY_DIR}/3party/gflags/include")
endif()
# Fix for #include <boost/regex.hpp>
include_directories("${OMIM_ROOT}/3party/boost")
# Used in qt/ and shaders/
find_package(Python3 REQUIRED COMPONENTS Interpreter)

View File

@@ -1,17 +1,15 @@
This file contains a list of people who have contributed to this project.
It is not necessarily comprehensive as contributors must manually add themselves.
Its not neccesarily comprehensive.
Feel free to add yourself here along with your first contribution!
--------------------------------------------------------------------------------
CoMaps contributors:
(in alphabetical order)
(in alphabetic order)
--------------------------------------------------------------------------------
Bastian Greshake Tzovaras
clover sage
Harry Bond <me@hbond.xyz>
NoelClick
thesupertechie
vikiawv
Yannik Bloscheck

View File

@@ -23,10 +23,10 @@
<img src="https://img.shields.io/github/license/comaps/comaps?style=for-the-badge&logo=opensourceinitiative&logoColor=white&color=588157" alt="License"/>
</a>
<a href="https://github.com/comaps/comaps/actions/workflows/android-check.yaml">
<img src="https://img.shields.io/github/actions/workflow/status/comaps/comaps/.github/workflows/android-check.yaml?label=Android%20Build&logo=android&logoColor=white&style=for-the-badge" 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"/>
</a>
<a href="https://github.com/comaps/comaps/actions/workflows/ios-check.yaml">
<img src="https://img.shields.io/github/actions/workflow/status/comaps/comaps/.github/workflows/ios-check.yaml?label=iOS%20Build&logo=apple&logoColor=white&style=for-the-badge" 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"/>
</a>
<a href="https://opencollective.com/comaps">
<img src="https://img.shields.io/opencollective/all/comaps?label=Open%20Collective%20Donors&logo=opencollective&logoColor=white&style=for-the-badge&color=588157" alt="Open Collective Donors"/>

View File

@@ -377,7 +377,6 @@ play {
track.set('production')
defaultToAppBundles.set(true)
releaseStatus.set(ReleaseStatus.IN_PROGRESS)
userFraction.set(0.2d) // Rollout to 20% of users
serviceAccountCredentials.set(file('google-play.json'))
}

View File

@@ -1 +0,0 @@
CoMaps - Mapas ensin conexón con privacidá

View File

@@ -1,32 +0,0 @@
Una aplicació de mapes gratuïta i de codi obert dirigida per la comunitat basada en dades d'OpenStreetMap i reforçada amb el compromís amb la transparència, la privadesa i la no ànim de lucre. CoMaps és una derivació/fork d'Organic Maps, que al seu torn és una derivació de Maps.ME.
Llegiu sobre els motius del projecte i la seva direcció a <b><i>codeberg.org/comaps</i></b>.
Uneix-te a la comunitat i ajuda a crear la millor aplicació de mapes
• Utilitza l'aplicació i difon-la
• Dona comentaris i informa de problemes
• Actualitza les dades del mapa a l'aplicació o al lloc web d'OpenStreetMap
‣ <b>Enfocat fora de línia</b>: Planifica i navega pel teu viatge a l'estranger sense necessitat de servei mòbil, cerca punts de referència mentre fas una excursió llunyana, etc. Totes les funcions de l'aplicació estan dissenyades per funcionar fora de línia.
‣ <b>Respecte a la privadesa</b>: L'aplicació està dissenyada tenint en compte la privadesa: no identifica persones, no fa seguiment i no recopila informació personal. Sense anuncis.
‣ <b>Senzill i polit</b>: funcions essencials fàcils d'utilitzar que simplement funcionen.
‣ <b>Estalvia bateria i espai</b>: No consumeix bateria com altres aplicacions de navegació. Els mapes compactes estalvien espai preciós al telèfon.
‣ <b>Gratuït i creat per la comunitat</b>: Gent com tu ha ajudat a crear l'aplicació afegint llocs a OpenStreetMap, provant i donant comentaris sobre les funcions i aportant les seves habilitats de desenvolupament i diners.
‣ <b>Presa de decisions i finances obertes i transparents, sense ànim de lucre i de codi obert.</b>
<b>Característiques principals</b>:
• Mapes detallats descarregables amb llocs que no estan disponibles amb Google Maps
• Mode exterior amb rutes de senderisme destacades, càmpings, fonts d'aigua, pics, corbes de nivell, etc.
• Senders per caminar i carrils bici
• Punts d'interès com restaurants, gasolineres, hotels, botigues, llocs d'interès i molts més
• Cerca per nom, adreça o categoria de punt d'interès
• Navegació amb anuncis de veu per caminar, anar amb bicicleta o conduir
• Marca els teus llocs preferits amb un sol toc
• Articles de la Viquipèdia fora de línia
• Capa i indicacions de trànsit de metro
• Enregistrament de rutes
• Exporta i importa marcadors i rutes en formats KML, KMZ i GPX
• Un mode fosc per utilitzar durant la nit
• Millora les dades del mapa per a tothom mitjançant un editor bàsic integrat
<b>La llibertat és aquí</b>
Descobreix el teu viatge, navega pel món amb la privadesa i la comunitat al capdavant!

View File

@@ -0,0 +1,9 @@
• Vylepšena viditelnost a uživatelské rozhraní pokynů v navigaci
• Přidána možnost vynechat kroky
• Vylepšeno vyhledávání ve více jazycích
• Přidána specifická ikona pro autobusové zastávky
• Opraveny problémy s Android Auto (prostřednictvím projektu OM)
• Vylepšen editor a opraveny drobné problémy
• Vylepšeny styly map (prostřednictvím projektu OM)
• Vylepšeny překlady aplikace
Další změny najdete v našich poznámkách k vydání Codeberg!

View File

@@ -1,33 +0,0 @@
En fællesskabdrevet og åben source kortapp, baseret på kortdata fra OpenStreetMap og styrket i forpligtelsen til værdierne gennemsigtighed, privatlivets fred, og non-profit. CoMaps udspringer af Organic Maps, som selv udsprang af Maps.ME.
Læs mere om grundlaget for projektet og dets udviklingsretnign på <b><i>codeberg.org/comaps</i></b>.
Slut dig til fælleskabet og hjælp til med at bygge den bedste kortapp i verden.
• Brug appen og fortæl andre om den
• Giv feedback anmeld fejl
• Opdater kortdata i appen eller på OpenStreetMap-hjemmesiden.
‣ <b>Offlinefokuseret</b>: Planlæg din rute og find vej i udlandet uden brug af mobildata, søg og find afsidesliggende mål på en afsidesliggende vandretur, mm. Alle funktioner er designet til at fungere uden internetforbindelse.
‣ <b>Respekt for privatlivets fred</b>: Appen er designet med henblik på at respektere dit privatliv den identificerer dig ikke, indeholder ingen sporingsmekanismer, og insamler ingen personlig information. Appen er reklamefri.
‣ <b>Enkel og elegant</b>: de essentielle funktioner er nemme at bruge, og de virker bare.
‣ <b>Sparer på batteriet og på lagerpladsen</b>: Dræner ikke dit batteri hurtigt, som andre kortapps. De kompakte kortfiler minimerer varigt lagerpladsforbrug.
‣ <b>Gratis og bygget i fællesskab</b>: Folk som dig har hjulpet med denne app ved at tilføje steder til OpenStreetMap, ved at teste appens funktioner og give feedback på dem og ved at bidrage til udviklingen af appen med deres tid og penge.
‣ <b>Åben og gennemsigtig beslutningstagningsproces og finanser, non-profit, og fuldt ud åben source.</b>
<b>Hovedfunktioner</b>
• Hent detaljerede kort, der indeholder steder som ikke findes i mange kommericelle kort.
• En frilufts-tilstand med markede vandrestier, teltpladser, kilder, bjerg- og bakketoppe, højdekonturlinjer, mm.
• Gangstier og cykelstier
• Steder, der kan besøges, som f.eks. restauranter, tankstationer, hoteller, butikker, seværdigheder og mange andre.
• Søg efter stednavn, adresse, eller type af sted.
• Gem dine yndlingssteder som bogmærker med et enkelt tryk.
• iCloud synkronisering af bogmærker og optagede spor.
• Offline artikler fra Wikipedia.
• Metro-lag med navigation.
• Optagelse af spor.
• Eksport og import af bogmærker og spor i formaterne KML, KMZ og GPX.
• Mørk tilstand til brug om natten.
• Mulighed for at forbedre kortet vha. en indbygget editor.
• CarPlay understøttes.
<b>Friheden er ankommet</b>
Opdag din rejse, find vej i verden med privatliv og fællesskab i førersædet!

View File

@@ -1,8 +1,9 @@
OpenStreetMap Daten vom 17. Dezember
Map download server nun wählbar
Warnung über veraltete Karten hinzugefügt + Knopf zum updaten
Vermeidung von Parkplatzwegen im Routing
Neuer Zoombutton
• Verbesserte Französchische Suchsynonme
OSM editor: Maximale Länge für OSM-Tags werden nun geprüft
Mehr auf codeberg.org/comaps/comaps/releases
Verbesserte Sichtbarkeit & Benutzeroberfläche für Navigationsanweisungen
Option um Treppen zu vermeiden
Verbesserte Suche in mehreren Sprachen
Spezifisches Symbol für Busbahnöfe hinzugefügt
Probleme mit Android Auto behoben (via OM)
• Verbesserter Editor mit kleinere Bugfixes
Kartenstile verbessert (via OM)
• Verbesserte Übersetzungen
Für weitere Änderungen siehe Codeberg-Versionshinweise

Binary file not shown.

Before

Width:  |  Height:  |  Size: 636 KiB

After

Width:  |  Height:  |  Size: 628 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 KiB

After

Width:  |  Height:  |  Size: 532 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

After

Width:  |  Height:  |  Size: 391 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 KiB

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 KiB

After

Width:  |  Height:  |  Size: 263 KiB

View File

@@ -1,8 +1,9 @@
OpenStreetMap data as of December 17
Make map download server configurable
Added info about outdated maps and an update button to the selected place info card
• Avoid using parking aisles for routing
Changed shape of zoom buttons
• Improved French search synonyms
OSM editor: check length limit for OSM tags in value validation
More details on codeberg.org/comaps/comaps/releases
Improved visibility and UI of instructions in navigation
Added option to avoid steps
Improved search in multiple languages
• Added specific icon for bus stations
Fixed Android Auto issues (via OM project)
• Improved editor and fix minor issues
Improved map styles (via OM project)
• Improved app translations
Check our Codeberg release notes for more changes!

View File

@@ -1,32 +0,0 @@
Komunum-gvidata senpaga kaj malfermkoda mapapliko bazita sur OpenStreetMap-datumoj kaj fortigita per komitado al transparencio, privateco kaj ne-lucro. CoMaps estas forko/spin-off de Organic Maps, kiu turne estas forko de Maps.ME.
Legu plu pri la kialoj por la projekto kaj ĝia direkto ĉe <b><i>codeberg.org/comaps</i></b>.
Aliĝu al la komunumo tie kaj helpu fari la plej bonan mapaplikon
• Uzu la aplikon kaj disvastigu la vorton pri ĝi
• Donu rimarkojn kaj raportu problemojn
• Ĝisdatigu mapajn datumojn en la apliko aŭ sur la OpenStreetMap-retejo
‣ <b>Senkonekta-fokusa</b>: Planu kaj navigu vian vojaĝon eksterlande sen bezono de ĉelulara servico, serĉu vojpunktojn dum malproksima promenado, ktp. Ĉiuj funkcioj de la apliko estas dezajnitaj por funkcii senkonekte.
‣ <b>Rispektante Privatecon</b>: La apliko estas dezajnita kun privateco en menso — ne identigas homojn, ne sekvas, kaj ne kolektas personajn informojn. Sen reklamoj.
‣ <b>Simpla kaj Perfekta</b>: esencaj, facile uzeblaj funkcioj kiuj simple funkcias.
‣ <b>Konservas Vian Baterion kaj Spacon</b>: Ne elĉerpas vian baterion kiel aliaj navigaj aplikaĵoj. Kompaktaj mapoj konservas precian spacon sur via telefono.
‣ <b>Sena kaj Konstruita de la Komunumo</b>: Homoj kiel vi helpis konstrui la aplikon per aldonado de lokoj al OpenStreetMap, testado kaj donado de rimarkoj pri funkcioj kaj kontribuado de siaj programadaj kapabloj kaj mono.
‣ <b>Malferma kaj Transparenta Decidado kaj Financoj, Ne-lucra kaj Tute Malfermkoda.</b>
<b>Ĉefaj Funkcioj</b>:
• Elŝuteblaj detalegaj mapoj kun lokoj kiuj ne estas disponeblaj per Google Maps
• Eksteraj modo kun elstarigitaj promenaj vojoj, kampoj, akvofontoj, pintoj, konturlinioj, ktp
• Promenaj vojoj kaj biciklaj vojoj
• Interesaj punktoj kiel restoracioj, benzinstacioj, hoteloj, vendejoj, vidindaĵoj kaj multaj aliaj
• Serĉo laŭ nomo aŭ adreso aŭ laŭ kategorio de interesaj punktoj
• Navigado kun voĉaj anoncoj por promenado, biciklado aŭ veturado
• Marku viajn favorajn lokojn per unu tuŝo
• Senkonektaj Vikipedio-artikoloj
• Metroa transporta tavolo kaj indikoj
• Enregistraĵo de vojoj
• Eksporto kaj importo de markiloj kaj vojoj en KML, KMZ, GPX formatoj
• Malhela modo por uzi nokte
• Plibonigu mapajn datumojn por ĉiuj uzante bazan enkonstruitan redaktilon
<b>Libereco Estas Ĉi Tie</b>
Malkovru vian vojaĝon, navigu la mondon kun privateco kaj komunumo en la antaŭa plano!

View File

@@ -1 +0,0 @@
Facila mapnaviĝado - Malkovru pli de via vojaĝo - Subtenata de la komunumo

View File

@@ -1 +0,0 @@
CoMaps - Migru, Biciklu, Veturigu Eksterrete

View File

@@ -0,0 +1,8 @@
• Mejora de la visibilidad y la interfaz de usuario de las instrucciones de navegación
• Se ha añadido la opción de evitar escaleras
• Mejora de la búsqueda en varios idiomas como ES
• Se ha añadido un icono específico para las estaciones de autobús
• Se han solucionado los problemas de Android Auto (a través del proyecto OM)
• Se ha mejorado el editor y se han solucionado pequeños problemas
• Se han mejorado los estilos de los mapas (a través del proyecto OM)
Más detalles en Codeberg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 605 KiB

After

Width:  |  Height:  |  Size: 655 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 KiB

After

Width:  |  Height:  |  Size: 532 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 391 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 KiB

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 KiB

After

Width:  |  Height:  |  Size: 263 KiB

View File

@@ -1,8 +1,9 @@
Données OpenStreetMap du 17 décembre
Serveur de téléchargement de cartes configurable
Ajout d'un message d'avertissement pour les cartes trop anciennes
Évitement des allées de parking dans les itinéraires
Mise à jour de l'apparence des boutons de zooms
Amélioration des synonymes de recherche en français
Editeur OSM: vérification de la taille limite des tags OSM
Plus d'informations sur codeberg.org/comaps/comaps/releases
Interface utilisateur et visibilité des instructions en navigation améliorée
Option pour éviter les escaliers ajoutée
Recherche améliorée dans différents languages
Icône pour les gares routières ajoutée
Corrections de bugs liées à Android Auto (via OM)
Editeur amélioré et corrections de bugs
Style de la carte amélioré (via OM)
• Traductions améliorées
Plus d'informations sur notre Codeberg

View File

@@ -1 +1 @@
CoMaps - Randonnée, Vélo, Conduite hors ligne
CoMaps - Rando, vélo, conduite hors ligne & privée

View File

@@ -1 +0,0 @@
Paprasta ir patogi navigacija Turiningesnės kelionės Vystoma bendruomenės

View File

@@ -1 +0,0 @@
CoMaps keliaukite atsijungę ir privačiai

View File

@@ -1,8 +1,9 @@
Dados OSM de 17/12
Servidor de download de mapas configurável
Adição de informações sobre mapas desatualizados e um botão de atualização ao cartão de informações do local selecionado
Evita o uso de corredores de estacionamento para roteamento
Formato dos botões de zoom alterado
Sinônimos de busca em francês aprimorados
• Editor OSM: verificação do limite de comprimento das tags do OSM na validação de valores
Mais detalhes em codeberg.org/comaps/comaps/releases
Visibilidade e interface do usuário aprimoradas para instruções na navegação
Opção adicionada para evitar degraus
Busca aprimorada em vários idiomas
Adição de ícone específico para rodoviárias
Problemas corrigidos no Android Auto (via projeto OM)
Editor aprimorado e correção de problemas menores
• Estilos de mapa aprimorados (via projeto OM)
• Traduções aprimoradas
Confira nossas notas de lançamento do Codeberg para mais mudanças!

View File

@@ -1,32 +0,0 @@
Uma aplicação pela comunidade, grátis e open-source, de mapas baseada em dados do OpenStreetMap e reforçada com compromisso para transparência, privacidade e sem fins lucrativos. CoMaps é um fork/spin-off de Organic Maps, que, por sua vez, é um fork de Maps.ME
Leia sobre as razões deste projeto e a sua direção em <b><i>codeberg.org/comaps</i></b>.
Junte-se à comunidade e ajude a fazer a melhor aplicação de mapas
• Use a aplicação e partilhe-a com outros
• Dê feedback e reporte problemas
• Atualize os dados de mapa na aplicação ou no site do OpenStreetMap
‣ <b>Simples e Polida</b>: funcionalidades essenciais fáceis que “somente funcionam”.
‣ <b>Foco Offline</b>: Planeie e navegue as suas viagens no estrangeiro sem dados móveis, procure locais numa caminhada distante, etc. Todas as funções da aplicação foram criadas com intenção de serem usadas sem internet.
‣ <b>Respeita a privacidade</b>: A aplicação foi criada com privacidade em mente — não identifica o utilizador, não rastreia, e não usa a sua informação pessoal. Sem anúncios.
‣ <b>Saves Your Battery and Space</b>: Não esgota a sua bateria ao contrário de outras aplicações. Mapas compactos salvam espaço no seu telemóvel.
‣ <b>Gratuita e Feita pela Comunidade</b>: Pessoas como si ajudam a criar a aplicação ao adicionar locais ao OpenStreetMap, testando e dando opiniões em funcionalidades e contribuindo com dotes de desenvolvimento e dinheiro.
‣ <b>Decisões e Finanças Abertas e Transparentes, Sem fins lucrativos e Open-Source.</b>
<b>Funcionalidades principais</b>:
• Mapas detalhados descarregáveis com locais que não estão disponíveis com o Google Maps
• Modo ao Ar Livre com trilhos de caminhada destacados, acampamentos, fontes de água, cumes, curvas de nível, etc
• Caminhos pedestres e ciclovias
• Pontos de interesse como restaurantes, estações de serviço, hotéis, lojas, atrações e muitos mais
• Pesquise por nome, endereço, ou por categoria de ponto de interesse
• Navegação com anúncios de voz ao caminhar, pedalar ou conduzir
• Marque os seus locais favoritos com um único clique
• Artigos da Wikipédia Offline
• Camada de metro e direções
• Gravação de Percursos
• Exportar e importar marcadores e percursos em formatos KML, KMZ, GPX
• Um modo escuro para usar durante a noite
• Melhore a informação do mapa para todos com um editor básico embebido
<b>A liberdade chegou</b>
Descubra a sua jornada, navegue o mundo com privacidade e a comunidade à frente!

View File

@@ -1,32 +0,0 @@
Uma aplicação pela comunidade, grátis e open-source, de mapas baseada em dados do OpenStreetMap e reforçada com compromisso para transparência, privacidade e sem fins lucrativos. CoMaps é um fork/spin-off de Organic Maps, que, por sua vez, é um fork de Maps.ME
Leia sobre as razões deste projeto e a sua direção em <b><i>codeberg.org/comaps</i></b>.
Junte-se à comunidade e ajude a fazer a melhor aplicação de mapas
• Use a aplicação e partilhe-a com outros
• Dê feedback e reporte problemas
• Atualize os dados de mapa na aplicação ou no site do OpenStreetMap
‣ <b>Simples e Polida</b>: funcionalidades essenciais fáceis que “somente funcionam”.
‣ <b>Foco Offline</b>: Planeie e navegue as suas viagens no estrangeiro sem dados móveis, procure locais numa caminhada distante, etc. Todas as funções da aplicação foram criadas com intenção de serem usadas sem internet.
‣ <b>Respeita a privacidade</b>: A aplicação foi criada com privacidade em mente — não identifica o utilizador, não rastreia, e não usa a sua informação pessoal. Sem anúncios.
‣ <b>Saves Your Battery and Space</b>: Não esgota a sua bateria ao contrário de outras aplicações. Mapas compactos salvam espaço no seu telemóvel.
‣ <b>Gratuita e Feita pela Comunidade</b>: Pessoas como si ajudam a criar a aplicação ao adicionar locais ao OpenStreetMap, testando e dando opiniões em funcionalidades e contribuindo com dotes de desenvolvimento e dinheiro.
‣ <b>Decisões e Finanças Abertas e Transparentes, Sem fins lucrativos e Open-Source.</b>
<b>Funcionalidades principais</b>:
• Mapas detalhados descarregáveis com locais que não estão disponíveis com o Google Maps
• Modo ao Ar Livre com trilhos de caminhada destacados, acampamentos, fontes de água, cumes, curvas de nível, etc
• Caminhos pedestres e ciclovias
• Pontos de interesse como restaurantes, estações de serviço, hotéis, lojas, atrações e muitos mais
• Pesquise por nome, endereço, ou por categoria de ponto de interesse
• Navegação com anúncios de voz ao caminhar, pedalar ou conduzir
• Marque os seus locais favoritos com um único clique
• Artigos da Wikipédia Offline
• Camada de metro e direções
• Gravação de Percursos
• Exportar e importar marcadores e percursos em formatos KML, KMZ, GPX
• Um modo escuro para usar durante a noite
• Melhore a informação do mapa para todos com um editor básico embebido
<b>A liberdade chegou</b>
Descubra a sua jornada, navegue o mundo com privacidade e a comunidade à frente!

View File

@@ -1 +0,0 @@
Navegação fácil nos mapas - Descubra mais sobre o seu percurso - Feito por todos

View File

@@ -1 +0,0 @@
CoMaps - Mapas e Navegação - Offline e Privada

View File

@@ -1,8 +1,9 @@
Карты OpenStreetMap от 17 декабря
Возможность настройки сервера для скачивания карт
Добавлена ​​информация об устаревании карт и ​​кнопка обновления (при выборе места на карте)
Парковочные проезды больше не используются для транзитной маршрутизации
• Изменены кнопки масштабирования карты
На карту добавлены ирригационные гидранты
Редактор OSM: проверка максимальной длины OSM тегов
Подробнее на codeberg.org/comaps/comaps/releases
Лучшая видимость и интерфейс при навигации
Добавлена возможность пропускать шаги
Улучшен поиск на нескольких языках
Новый значок автостанций
• Исправлены проблемы с Android Auto (через OM)
Улучшен редактор и исправлены мелкие недочёты
Улучшены стили карт (через OM)
• Улучшены переводы приложения
Ознакомьтесь с примечаниями к выпуску Codeberg, чтобы узнать изменениях!

View File

@@ -1,31 +0,0 @@
Brezplačno in odprtokodno zemljevidno orodje, ki ga vodi skupnost, temelji na podatkih OpenStreetMap in je okrepljena s predanostjo transparentnosti, zasebnosti in nepridobitnosti. CoMaps je izpeljanka OrganicMaps, ta pa je izpeljanka Maps.ME.
Preberite si o razlogih za ta projekt in njegovi usmerjenosti na <b><i>codeberg.org/comaps</i></b>.
Pridružite se skupnosti in pomagajte narediti najboljše zemljevidno orodje
• Uporabljajte orodje in širite glas o njem
• Dajajte povratne informacije in poročajte o napakah
• Posodabljajte podatke zemljevida v tem orodju ali na spletni strani OpenStreetMap
‣ <b>Osredotočeno na uporabo brez povezave</b>: Načrtujte in se usmerjajte na vašem potovanju v tujini vrez potrebe po mobilnih podatkih, iščite vmesne točke potovanja ko ste na daljšem pohodu ipd. Vse zmogljivosti orodja so zasnovane za delo brez povezave.
‣ <b>Spoštovanje zasebnosti</b>: orodje je zasnovano z mislijo na zasebnost ne prepoznava oseb, ne sledi in ne zbira osebnih podatkov. Brez oglasov.
‣ <b>Preprosto in dodelano</b>: nujne zmogljivosti, enostavne za uporabo, ki preprosto delujejo.
‣ <b>Prihrani vašo baterijo in prostor.</b>: ne izčrpava vaše baterije kakor druga usmerjevalna orodja. Strnjeni zemljevidi prihranijo dragocen prostor na vašem telefonu.
‣ <b>Brezplačno in ustvarjeno v skupnosti</b>: ljudje kot ste vi pomagajo ustvarjati to orodje, tako da dodajajo kraje na OpenStreetMap, preizkušajo in dajejo povratne informacije o zmogljivostih in prispevajo svoje razvijalske sposobnosti in sredstva.
‣ <b>Odprto in transparentno odločanje in finance, nepridobitno in popolnoma odprtokodno.</b>
<b>Glavne zmogljivosti</b>:
• Prenosljivi podrobni zemljevidi s kraji, ki na Googlovih zemljevidih niso na voljo.
• Prikaz za dejavnosti na prostem s poudarjenimi pohodniškimi potmi, tabornimi prostori, vodnimi viri, vrhovi, plastnicami itd.
• Pešpoti in kolesarke poti
• Kraji zanimanja, npr. restavracije, bencinske črpalke, hoteli, trgovine, znamenitosti in mnogo več
• Iščite po imenu, hišnemu naslovu ali po vrsti
• Usmerjanje z glasovnimi obvestili za hojo, kolesarjenje ali vožnjo avtomobila.
• Zaznamujte svoje najljubše kraje s preprostim dotikom
• Wikipedijini članki brez povezave
• Prometna plast podzemne železnice z usmerjanjem
• Izvozite ali uvozite zaznamke in sledi v oblikah KML, KMZ, GPX
• Temni prikaz za uporabo ponoči
• Izboljšajtw podatke zemljevida za vse z uporabo vgrajenega urejevalnika
<b>Svoboda je tu</b>
Odkijte več o vašem potovanju, usmerjajte se po svetu s poudarkom na zasebnosti in skupnostnem delovanju!

View File

@@ -1 +1 @@
Enostavno usmerjanje Odkrij več o svojem potovanju Podprto v skupnosti
Enostavna navigacija Odkrij več o svojem potovanju Podprto v skupnosti

View File

@@ -1 +0,0 @@
Comaps- Vandra, Cykla, Kör Offline, Privat

View File

@@ -1,32 +0,0 @@
OpenStreetMap தரவை அடிப்படையாகக் கொண்ட சமூகம் தலைமையிலான இலவச மற்றும் திறந்த மூல வரைபட பயன்பாடு மற்றும் வெளிப்படைத்தன்மை, தனியுரிமை மற்றும் இலாப நோக்கற்றது ஆகியவற்றுக்கான அர்ப்பணிப்புடன் வலுவூட்டப்பட்டது. CoMaps என்பது ஆர்கானிக் மேப்சின் ஃபோர்க்/ச்பின்-ஆஃப் ஆகும், இது Maps.ME இன் ஃபோர்க் ஆகும்.
திட்டத்திற்கான காரணங்கள் மற்றும் அதன் திசையை <b><i>codeberg.org/comaps</i></b> இல் படிக்கவும்.
அங்குள்ள சமூகத்தில் சேர்ந்து சிறந்த வரைபட பயன்பாட்டை உருவாக்க உதவுங்கள்
• பயன்பாட்டைப் பயன்படுத்தி, அதைப் பற்றிய தகவலைப் பரப்புங்கள்
• கருத்துக்களை வழங்கவும் மற்றும் சிக்கல்களைப் புகாரளிக்கவும்
• பயன்பாட்டில் அல்லது OpenStreetMap இணையதளத்தில் வரைபடத் தரவைப் புதுப்பிக்கவும்
‣ <b>ஆஃப்லைனில் கவனம் செலுத்தப்பட்டது</b>: செல்லுலார் சேவையின் தேவையின்றி உங்களின் வெளிநாட்டுப் பயணத்தைத் திட்டமிட்டு வழிநடத்துங்கள், தொலைதூர பயணத்தில் இருக்கும் போது வழிப் புள்ளிகளைத் தேடுங்கள்.
‣ <b>தனியுரிமைக்கு மதிப்பளித்தல்</b>: பயன்பாடு தனியுரிமையை மனதில் கொண்டு வடிவமைக்கப்பட்டுள்ளது - நபர்களை அடையாளம் காணாது, கண்காணிக்காது மற்றும் தனிப்பட்ட தகவல்களைச் சேகரிக்காது. விளம்பரங்கள் இல்லாதது.
‣ <b>எளிமையான மற்றும் மெருகூட்டப்பட்டது</b>: செயல்படும் நற்பொருத்தங்கள் பயன்படுத்த எளிதானது.
‣ <b>உங்கள் பேட்டரி மற்றும் இடத்தைச் சேமிக்கிறது</b>: மற்ற வழிசெலுத்தல் பயன்பாடுகளைப் போல உங்கள் பேட்டரியை வெளியேற்றாது. சிறிய வரைபடங்கள் உங்கள் தொலைபேசியில் விலைமதிப்பற்ற இடத்தை சேமிக்கின்றன.
‣ <b>இலவசம் மற்றும் சமூகத்தால் உருவாக்கப்பட்டது</b>: OpenStreetMap இல் இடங்களைச் சேர்ப்பதன் மூலமும், சோதனை செய்து, அம்சங்களைப் பற்றிய கருத்துக்களை வழங்குவதன் மூலமும், அவர்களின் மேம்பாட்டுத் திறன்களையும் பணத்தையும் பங்களிப்பதன் மூலமும் உங்களைப் போன்றவர்கள் பயன்பாட்டை உருவாக்க உதவியுள்ளனர்.
‣ <b>திறந்த மற்றும் வெளிப்படையான முடிவெடுக்கும் மற்றும் நிதியியல், இலாப நோக்கற்ற மற்றும் முழு திறந்த மூல.</b>
<b>முக்கிய அம்சங்கள்</b>:
• கூகுள் மேப்சில் இல்லாத இடங்களுடன் தரவிறக்கம் செய்யக்கூடிய விரிவான வரைபடங்கள்
• ஐகிங் பாதைகள், முகாம்கள், நீர் ஆதாரங்கள், சிகரங்கள், விளிம்பு கோடுகள் போன்றவற்றைக் கொண்ட வெளிப்புறப் பயன்முறை
• நடைபாதைகள் மற்றும் சைக்கிள் பாதைகள்
• உணவகங்கள், எரிவாயு நிலையங்கள், ஓட்டல்கள், கடைகள், சுற்றிப்பார்க்கும் இடங்கள் மற்றும் பல போன்ற ஆர்வமுள்ள இடங்கள்
• பெயர் அல்லது முகவரி அல்லது ஆர்வமுள்ள வகை மூலம் தேடவும்
• நடைபயிற்சி, சைக்கிள் ஓட்டுதல் அல்லது வண்டி ஓட்டுவதற்கான குரல் அறிவிப்புகளுடன் வழிசெலுத்தல்
• ஒரே தட்டினால் உங்களுக்குப் பிடித்த இடங்களை புத்தகக்குறி செய்யவும்
• இணைப்பில்லாத விக்கிபீடியா கட்டுரைகள்
• சுரங்கப்பாதை போக்குவரத்து அடுக்கு மற்றும் திசைகள்
• ட்ராக் ரெக்கார்டிங்
• KML, KMZ, GPX வடிவங்களில் புக்மார்க்குகள் மற்றும் டிராக்குகளை ஏற்றுமதி மற்றும் இறக்குமதி செய்யுங்கள்
• இரவில் பயன்படுத்த ஒரு இருண்ட பயன்முறை
• அடிப்படை உள்ளமைக்கப்பட்ட எடிட்டரைப் பயன்படுத்தி அனைவருக்கும் வரைபடத் தரவை மேம்படுத்தவும்
<b>சுதந்திரம் இங்கே உள்ளது</b>
உங்கள் பயணத்தைக் கண்டறியவும், தனியுரிமை மற்றும் சமூகத்தை முன்னணியில் கொண்டு உலகிற்கு செல்லவும்!

View File

@@ -1 +0,0 @@
எளிய வழிகாட்டி - பயணத்தை மேலும் கண்டறி - சமூகத்தால் இயக்கப்படுகிறது

View File

@@ -1 +0,0 @@
இணைவரைபடங்கள் - மலையேறு, வண்டி, தனிமையில் இயக்கு

View File

@@ -68,4 +68,4 @@ Por favor, informa de errores, sugiere ideas y únete a nuestra comunidad en el
<b>La Libertad Está Aquí</b>
¡Descubre tu camino, navega el mundo con privacidad y con la comunidad como prioridad!
Descubre tu camino, navega el mundo con privacidad y con la comunidad como prioridad.

View File

@@ -1 +0,0 @@
Paprasta ir patogi navigacija Turiningesnės kelionės Vystoma bendruomenės

View File

@@ -1 +0,0 @@
CoMaps naviguokite privačiai

View File

@@ -1,36 +0,0 @@
Aplikacja mapowa tworzona przez społeczność, darmowa i open source, oparta na danych OpenStreetMap, z pełnym naciskiem na transparentność, prywatność i działanie non-profit.
Dołącz do społeczności i pomóż tworzyć najlepszą aplikację mapową
• Korzystaj z aplikacji i polecaj ją innym
• Przekazuj opinie i zgłaszaj problemy
• Aktualizuj dane mapy w aplikacji lub na stronie OpenStreetMap
<i>Twoje opinie i oceny na 5 gwiazdek są dla nas najlepszym wsparciem!</i>
‣ <b>Prosta i dopracowana</b>: najważniejsze, łatwe w użyciu funkcje, które po prostu działają.
‣ <b>Skoncentrowana na trybie offline</b>: planuj i nawiguj za granicą bez sieci komórkowej, wyszukuj punkty na odległych szlakach wszystkie funkcje działają offline.
‣ <b>Z poszanowaniem prywatności</b>: aplikacja nie identyfikuje użytkowników, nie śledzi i nie zbiera danych osobowych. Bez reklam.
‣ <b>Oszczędza baterię i miejsce</b>: nie zużywa baterii jak inne aplikacje nawigacyjne, a kompaktowe mapy oszczędzają miejsce w telefonie.
‣ <b>Darmowa i tworzona przez społeczność</b>: ludzie tacy jak Ty dodają miejsca do OpenStreetMap, testują funkcje, zgłaszają opinie i wspierają projekt.
‣ <b>Otwarte i przejrzyste decyzje i finanse, działanie non-profit, pełne open source.</b>
<b>Główne funkcje</b>:
• Pobierane szczegółowe mapy z miejscami, których nie ma w Google Maps
• Tryb outdoor ze szlakami, biwakami, źródłami wody, szczytami, warstwicami itp.
• Ścieżki piesze i rowerowe
• Punkty zainteresowania: restauracje, stacje paliw, hotele, sklepy, atrakcje i wiele innych
• Wyszukiwanie po nazwie, adresie lub kategorii
• Nawigacja z komunikatami głosowymi dla pieszych, rowerzystów i kierowców
• Dodawanie ulubionych miejsc jednym tapnięciem
• Artykuły Wikipedii dostępne offline
• Warstwa metra i wskazówki dojazdu
• Nagrywanie śladu trasy
• Eksport i import ulubionych miejsc i tras w formatach KML, KMZ, GPX
• Tryb ciemny do używania nocą
• Poprawianie danych mapy za pomocą prostego wbudowanego edytora
• Obsługa Android Auto
Zgłaszaj problemy, proponuj pomysły i dołącz do społeczności na stronie <b><i>comaps.app</i></b>.
<b>Wolność jest tutaj</b>
Odkrywaj swoją drogę i nawiguj po świecie z prywatnością i społecznością na pierwszym miejscu!

View File

@@ -1,36 +0,0 @@
Uma aplicação pela comunidade, grátis e open-source, de mapas baseada em dados do OpenStreetMap e reforçada com compromisso para transparência, privacidade e sem fins lucrativos.
Junte-se à comunidade e ajude a fazer a melhor aplicação de mapas
• Use a aplicação e partilhe-a com outros
• Dê feedback e reporte problemas
• Atualize os dados de mapa na aplicação ou no site do OpenStreetMap
<i>O seu feedback e reviews de 5 estrelas são a melhor maneira de nos ajudar!</i>
‣ <b>Simples e Polida</b>: funcionalidades essenciais fáceis que “somente funcionam”.
‣ <b>Foco Offline</b>: Planeie e navegue as suas viagens no estrangeiro sem dados móveis, procure locais numa caminhada distante, etc. Todas as funções da aplicação foram criadas com intenção de serem usadas sem internet.
‣ <b>Respeita a privacidade</b>: A aplicação foi criada com privacidade em mente — não identifica o utilizador, não rastreia, e não usa a sua informação pessoal. Sem anúncios.
‣ <b>Saves Your Battery and Space</b>: Não esgota a sua bateria ao contrário de outras aplicações. Mapas compactos salvam espaço no seu telemóvel.
‣ <b>Gratuita e Feita pela Comunidade</b>: Pessoas como si ajudam a criar a aplicação ao adicionar locais ao OpenStreetMap, testando e dando opiniões em funcionalidades e contribuindo com dotes de desenvolvimento e dinheiro.
‣ <b>Decisões e Finanças Abertas e Transparentes, Sem fins lucrativos e Open-Source.</b>
<b>Funcionalidades principais</b>:
• Mapas detalhados descarregáveis com locais que não estão disponíveis com o Google Maps
• Modo ao Ar Livre com trilhos de caminhada destacados, acampamentos, fontes de água, cumes, curvas de nível, etc
• Caminhos pedestres e ciclovias
• Pontos de interesse como restaurantes, estações de serviço, hotéis, lojas, atrações e muitos mais
• Pesquise por nome, endereço, ou por categoria de ponto de interesse
• Navegação com anúncios de voz ao caminhar, pedalar ou conduzir
• Marque os seus locais favoritos com um único clique
• Artigos da Wikipédia Offline
• Camada de metro e direções
• Gravação de Percursos
• Exportar e importar marcadores e percursos em formatos KML, KMZ, GPX
• Um modo escuro para usar durante a noite
• Melhore a informação do mapa para todos com um editor básico embebido
• Suporte para Android Auto
Por favor, reporte problemas da aplicação, sugira ideias e junte-se à nossa comunidade no website <b><i>comaps.app</i></b>.
<b>A liberdade chegou</b>
Descubra a sua jornada, navegue o mundo com privacidade e a comunidade à frente!

View File

@@ -1 +1 @@
Enostavno usmerjanje Odkrij več o svojem potovanju Podprto v skupnosti
Enostavna navigacija Odkrij več o svojem potovanju Podprto v skupnosti

View File

@@ -1 +1 @@
CoMaps - Usmerjajte se zasebno
CoMaps - Navigacija z zasebnostjo

View File

@@ -1 +0,0 @@
Comaps- Navigera Privat

View File

@@ -1,36 +0,0 @@
திறந்ததெருவரைபடம் தரவை அடிப்படையாகக் கொண்ட சமூகத்தால் வழிநடத்தப்படும் இலவச & திறந்த மூல வரைபடப் பயன்பாடு, வெளிப்படைத்தன்மை, தனியுரிமை மற்றும் இலாப நோக்கற்ற தன்மை ஆகியவற்றிற்கான அர்ப்பணிப்புடன் வலுப்படுத்தப்பட்டுள்ளது.
சமூகத்தில் சேர்ந்து சிறந்த வரைபடப் பயன்பாட்டை உருவாக்க உதவுங்கள்
• பயன்பாட்டைப் பயன்படுத்தி அதைப் பற்றிய செய்தியைப் பரப்புங்கள்
• கருத்துத் தெரிவிக்கவும் சிக்கல்களைப் புகாரளிக்கவும்
• பயன்பாட்டில் அல்லது OpenStreetMap வலைத்தளத்தில் வரைபடத் தரவைப் புதுப்பிக்கவும்
<i>உங்கள் கருத்து மற்றும் 5-நட்சத்திர மதிப்புரைகள் எங்களுக்குச் சிறந்த ஆதரவாகும்!</i>
‣ <b>எளிமையான மற்றும் மெருகூட்டப்பட்ட</b>: அத்தியாவசியமான பயன்படுத்த எளிதான அம்சங்கள் வேலை செய்கின்றன.
‣ <b>ஆஃப்லைனில் கவனம் செலுத்துகிறது</b>: செல்லுலார் சேவை தேவை இல்லாமல் உங்கள் வெளிநாட்டு பயணத்தைத் திட்டமிட்டு வழிநடத்துங்கள், தொலைதூர நடைபயணத்தின்போது வழிப்புள்ளிகளைத் தேடுங்கள் போன்றவை. அனைத்து பயன்பாட்டு செயல்பாடுகளும் ஆஃப்லைனில் வேலை செய்ய வடிவமைக்கப்பட்டுள்ளன.
‣ <b>தனியுரிமையை மதித்தல்</b>: பயன்பாடு தனியுரிமையை மனதில் கொண்டு வடிவமைக்கப்பட்டுள்ளது - மக்களை அடையாளம் காணாது, கண்காணிக்காது மற்றும் தனிப்பட்ட தகவல்களைச் சேகரிக்காது. விளம்பரங்கள் இல்லாதது.
‣ <b>உங்கள் பேட்டரி மற்றும் இடத்தைச் சேமிக்கிறது</b>: பிற வழிசெலுத்தல் பயன்பாடுகளைப் போல உங்கள் பேட்டரியை வெளியேற்றாது. சிறிய வரைபடங்கள் உங்கள் தொலைபேசியில் விலைமதிப்பற்ற இடத்தைச் சேமிக்கின்றன.
‣ <b>இலவசம் மற்றும் சமூகத்தால் உருவாக்கப்பட்டது</b>: உங்களைப் போன்றவர்கள் OpenStreetMap இல் இடங்களைச் சேர்ப்பதன் மூலமும், அம்சங்கள்குறித்து சோதித்துப் பார்த்துக் கருத்து தெரிவிப்பதன் மூலமும், அவர்களின் மேம்பாட்டுத் திறன்கள் மற்றும் பணத்தை பங்களிப்பதன் மூலமும் பயன்பாட்டை உருவாக்க உதவினார்கள்.
‣ <b>திறந்த மற்றும் வெளிப்படையான முடிவெடுக்கும் மற்றும் நிதி, இலாப நோக்கற்ற மற்றும் முழுமையாகத் திறந்த மூல.</b>
<b>முக்கிய பண்புகள்</b>:
• கூகிள் வரைபடத்தில் கிடைக்காத இடங்களுடன் பதிவிறக்கம் செய்யக்கூடிய விரிவான வரைபடங்கள்
• ஹைகிங் பாதைகள், முகாம் தளங்கள், நீர் ஆதாரங்கள், சிகரங்கள், விளிம்புக் கோடுகள் போன்றவற்றுடன் வெளிப்புற பயன்முறை
• நடைபாதைகள் மற்றும் சைக்கிள் பாதைகள்
• உணவகங்கள், எரிவாயு நிலையங்கள், ஹோட்டல்கள், கடைகள், பார்வையிடல்கள் மற்றும் பல போன்ற ஆர்வமுள்ள இடங்கள்
• பெயர் அல்லது முகவரி அல்லது ஆர்வமுள்ள இட வகைமூலம் தேடுங்கள்
• நடைபயிற்சி, சைக்கிள் ஓட்டுதல் அல்லது வாகனம் ஓட்டுவதற்கான குரல் அறிவிப்புகளுடன் வழிசெலுத்தல்
• உங்களுக்குப் பிடித்த இடங்களை ஒரே தட்டலில் புக்மார்க் செய்யவும்
• ஆஃப்லைன் விக்கிபீடியா கட்டுரைகள்
• சுரங்கப்பாதை போக்குவரத்து அடுக்கு மற்றும் திசைகள்
• பதிவுசெய்தலைக் கண்காணிக்கவும்
• KML, KMZ, GPX வடிவங்களில் புக்மார்க்குகள் மற்றும் தடங்களை ஏற்றுமதி செய்து இறக்குமதி செய்யவும்
• இரவில் பயன்படுத்த ஒரு இருண்ட பயன்முறை
• அடிப்படை உள்ளமைக்கப்பட்ட எடிட்டரைப் பயன்படுத்தி அனைவருக்கும் வரைபடத் தரவை மேம்படுத்தவும்
• ஆண்டாய்டு தானி ஆதரவு
பயன்பாட்டு சிக்கல்களைப் புகாரளிக்கவும், யோசனைகளைப் பரிந்துரைக்கவும் மற்றும் எங்கள் சமூகத்தில் சேரவும் <b><i>comaps.app</i></b> வலைத்தளம்.
<b>சுதந்திரம் இங்கே உள்ளது</b>
உங்கள் பயணத்தைக் கண்டறியவும், தனியுரிமை மற்றும் சமூகத்தை முன்னணியில் வைத்து உலகை வழிநடத்தவும்!

View File

@@ -1 +0,0 @@
எளிய வழிகாட்டி - பயணத்தை மேலும் கண்டறி - சமூகத்தால் இயக்கப்படுகிறது

View File

@@ -1 +0,0 @@
இணைவரைபடங்கள் - தனியுரிமை

View File

@@ -18,7 +18,6 @@ import android.location.Location;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.CallSuper;
@@ -26,15 +25,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.core.view.ViewCompat;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.checkbox.MaterialCheckBox;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.progressindicator.LinearProgressIndicator;
import com.google.android.material.textview.MaterialTextView;
import app.organicmaps.base.BaseMwmFragmentActivity;
import app.organicmaps.dialog.CustomMapServerDialog;
import app.organicmaps.downloader.MapManagerHelper;
import app.organicmaps.intent.Factory;
import app.organicmaps.sdk.Framework;
@@ -47,7 +38,11 @@ import app.organicmaps.sdk.util.StringUtils;
import app.organicmaps.util.UiUtils;
import app.organicmaps.util.Utils;
import app.organicmaps.util.WindowInsetUtils.PaddingInsetsListener;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.checkbox.MaterialCheckBox;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.progressindicator.LinearProgressIndicator;
import com.google.android.material.textview.MaterialTextView;
import java.util.List;
import java.util.Objects;
@@ -59,7 +54,6 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
private MaterialTextView mTvMessage;
private LinearProgressIndicator mProgress;
private MaterialButton mBtnDownload;
private MaterialButton mBtnAdvanced;
private MaterialCheckBox mChbDownloadCountry;
private String mCurrentCountry;
@@ -273,14 +267,6 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
mProgress = findViewById(R.id.progressbar);
mBtnDownload = findViewById(R.id.btn_download_resources);
mChbDownloadCountry = findViewById(R.id.chb_download_country);
mBtnAdvanced = findViewById(R.id.btn_advanced);
mBtnAdvanced.setOnClickListener(v -> {
CustomMapServerDialog.show(this, url -> {
prepareFilesDownload(false);
});
});
mBtnAdvanced.setEnabled(true);
mBtnListeners = new View.OnClickListener[BTN_COUNT];
mBtnNames = new String[BTN_COUNT];
@@ -305,11 +291,6 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
{
mBtnDownload.setOnClickListener(mBtnListeners[action]);
mBtnDownload.setText(mBtnNames[action]);
// Allow changing server only when idle or after an error.
boolean advancedEnabled = (action == DOWNLOAD || action == TRY_AGAIN || action == RESUME);
mBtnAdvanced.setEnabled(advancedEnabled);
mBtnAdvanced.setAlpha(advancedEnabled ? 1f : 0.5f);
}
private void doDownload()
@@ -378,9 +359,6 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
private void finishFilesDownload(int result)
{
mBtnAdvanced.setEnabled(true);
mBtnAdvanced.setAlpha(1f);
if (result == ERR_NO_MORE_FILES)
{
// World and WorldCoasts has been downloaded, we should register maps again to correctly add them to the model.
@@ -450,16 +428,12 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
.setTitle(titleId)
.setMessage(messageId)
.setCancelable(true)
.setOnCancelListener((dialog) -> setAction(RESUME))
.setOnCancelListener((dialog) -> setAction(PAUSE))
.setPositiveButton(R.string.try_again,
(dialog, which) -> {
setAction(TRY_AGAIN);
onTryAgainClicked();
})
.setNegativeButton(R.string.cancel,
(dialog, which) -> {
setAction(RESUME);
})
.setOnDismissListener(dialog -> mAlertDialog = null)
.show();
}

View File

@@ -48,6 +48,7 @@ import androidx.core.content.ContextCompat;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentFactory;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.ViewModelProvider;
@@ -107,7 +108,6 @@ import app.organicmaps.sdk.routing.RoutingOptions;
import app.organicmaps.sdk.search.SearchEngine;
import app.organicmaps.sdk.settings.RoadType;
import app.organicmaps.sdk.settings.UnitLocale;
import app.organicmaps.sdk.sound.TtsPlayer;
import app.organicmaps.sdk.util.Config;
import app.organicmaps.sdk.util.LocationUtils;
import app.organicmaps.sdk.util.PowerManagment;
@@ -133,6 +133,7 @@ import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.textview.MaterialTextView;
import java.util.ArrayList;
import java.util.Objects;
@@ -1813,26 +1814,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
return false;
}
private void deliverTtsMessage()
{
if (Config.isTtsMessageDelivered())
return;
String languageDisplayName = TtsPlayer.INSTANCE.getLanguageDisplayName();
if (languageDisplayName != null)
{
String navigationStartMessage = getResources().getString(R.string.navigation_start_tts_message);
navigationStartMessage += languageDisplayName;
Toast.makeText(this, navigationStartMessage, Toast.LENGTH_LONG).show();
}
else
Toast.makeText(this, getResources().getString(R.string.navigation_start_tts_disabled_message), Toast.LENGTH_LONG)
.show();
Config.setTtsMessageDelivered();
}
private boolean showStartPointNotice()
{
final RoutingController controller = RoutingController.get();
@@ -2209,8 +2190,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
if (!showRoutingDisclaimer())
return;
deliverTtsMessage();
closeFloatingPanels();
setFullscreen(false);
RoutingController.get().start();

View File

@@ -1,13 +1,11 @@
package app.organicmaps.background;
import android.content.Context;
import android.os.Build;
import androidx.annotation.NonNull;
import androidx.work.Constraints;
import androidx.work.ExistingWorkPolicy;
import androidx.work.NetworkType;
import androidx.work.OneTimeWorkRequest;
import androidx.work.OutOfQuotaPolicy;
import androidx.work.WorkManager;
import androidx.work.Worker;
import androidx.work.WorkerParameters;
@@ -37,11 +35,7 @@ public class OsmUploadWork extends Worker
if (Editor.nativeHasSomethingToUpload() && OsmOAuth.isAuthorized())
{
final Constraints c = new Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build();
OneTimeWorkRequest.Builder builder = new OneTimeWorkRequest.Builder(OsmUploadWork.class).setConstraints(c);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
builder.setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST);
}
final OneTimeWorkRequest wr = builder.build();
final OneTimeWorkRequest wr = new OneTimeWorkRequest.Builder(OsmUploadWork.class).setConstraints(c).build();
WorkManager.getInstance(context).beginUniqueWork("UploadOsmChanges", ExistingWorkPolicy.KEEP, wr).enqueue();
}
}

View File

@@ -7,9 +7,15 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StyleRes;
import androidx.fragment.app.DialogFragment;
import app.organicmaps.R;
public class BaseMwmDialogFragment extends DialogFragment
{
@StyleRes
protected final int getFullscreenTheme()
{
return R.style.MwmTheme_DialogFragment_Fullscreen;
}
protected int getStyle()
{

View File

@@ -18,7 +18,9 @@ import androidx.fragment.app.FragmentManager;
import app.organicmaps.MwmApplication;
import app.organicmaps.R;
import app.organicmaps.SplashActivity;
import app.organicmaps.sdk.util.Config;
import app.organicmaps.sdk.util.log.Logger;
import app.organicmaps.util.RtlUtils;
import com.google.android.material.appbar.MaterialToolbar;
import java.util.Objects;
@@ -40,6 +42,7 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
{
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this, SystemBarStyle.dark(Color.TRANSPARENT));
RtlUtils.manageRtl(this);
if (!MwmApplication.from(this).getOrganicMaps().arePlatformAndCoreInitialized())
{
final Intent intent = Objects.requireNonNull(getIntent());

View File

@@ -188,7 +188,7 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment<Bookmark
ArrayList<MenuBottomSheetItem> items = new ArrayList<>();
if (mSelectedCategory != null)
{
items.add(new MenuBottomSheetItem(R.string.edit, R.drawable.ic_edit,
items.add(new MenuBottomSheetItem(R.string.edit, R.drawable.ic_settings,
() -> onSettingsActionSelected(mSelectedCategory)));
items.add(new MenuBottomSheetItem(mSelectedCategory.isVisible() ? R.string.hide : R.string.show,
mSelectedCategory.isVisible() ? R.drawable.ic_hide : R.drawable.ic_show,

View File

@@ -466,10 +466,12 @@ public class BookmarkListAdapter extends RecyclerView.Adapter<Holders.BaseBookma
View desc = inflater.inflate(R.layout.item_category_description, parent, false);
MaterialTextView moreBtn = desc.findViewById(R.id.more_btn);
MaterialTextView text = desc.findViewById(R.id.text);
MaterialTextView title = desc.findViewById(R.id.title);
setMoreButtonVisibility(text, moreBtn);
holder = new Holders.DescriptionViewHolder(desc, mSectionsDataSource.getCategory());
text.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
moreBtn.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
title.setOnClickListener(v -> onMoreButtonClicked(text, moreBtn));
break;
}

View File

@@ -282,11 +282,11 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<ConcatAdapter
{
if (isEmptySearchResults())
{
requirePlaceholder().setContent(R.string.search_not_found, R.string.search_not_found_query, R.drawable.ic_search_fail);
requirePlaceholder().setContent(R.string.search_not_found, R.string.search_not_found_query);
}
else if (isEmpty())
{
requirePlaceholder().setContent(R.string.bookmarks_empty_list_title, R.string.bookmarks_empty_list_message, R.drawable.ic_bookmarks);
requirePlaceholder().setContent(R.string.bookmarks_empty_list_title, R.string.bookmarks_empty_list_message);
}
boolean isEmptyRecycler = isEmpty() || isEmptySearchResults();
@@ -771,7 +771,7 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<ConcatAdapter
items.add(new MenuBottomSheetItem(R.string.export_file_gpx, R.drawable.ic_file_gpx,
() -> onShareOptionSelected(KmlFileType.Gpx)));
}
items.add(new MenuBottomSheetItem(R.string.edit, R.drawable.ic_edit, this::onSettingsOptionSelected));
items.add(new MenuBottomSheetItem(R.string.edit, R.drawable.ic_settings, this::onSettingsOptionSelected));
if (!isLastOwnedCategory())
items.add(new MenuBottomSheetItem(R.string.delete_list, R.drawable.ic_delete, this::onDeleteOptionSelected));
return items;

View File

@@ -438,17 +438,21 @@ public class Holders
static final float SPACING_MULTIPLE = 1.0f;
static final float SPACING_ADD = 0.0f;
@NonNull
private final MaterialTextView mTitle;
@NonNull
private final MaterialTextView mDescText;
DescriptionViewHolder(@NonNull View itemView, @NonNull BookmarkCategory category)
{
super(itemView);
mDescText = itemView.findViewById(R.id.text);
mTitle = itemView.findViewById(R.id.title);
}
@Override
void bind(@NonNull SectionPosition position, @NonNull BookmarkListAdapter.SectionsDataSource sectionsDataSource)
{
mTitle.setText(sectionsDataSource.getCategory().getName());
bindDescription(sectionsDataSource.getCategory());
}
@@ -458,12 +462,9 @@ public class Holders
String formattedDesc = desc.replace("\n", "<br>");
Spanned spannedDesc = Utils.fromHtml(formattedDesc);
if (!TextUtils.isEmpty(spannedDesc)) {
mDescText.setText(spannedDesc);
}
else {
mDescText.setText(R.string.list_description_empty);
}
mDescText.setText(spannedDesc);
UiUtils.showIf(!TextUtils.isEmpty(spannedDesc), mDescText);
}
}
}

View File

@@ -32,8 +32,7 @@ public class DrivingOptionsScreen extends BaseMapScreen
new DrivingOption(RoadType.Dirty, R.string.avoid_unpaved),
new DrivingOption(RoadType.Ferry, R.string.avoid_ferry),
new DrivingOption(RoadType.Motorway, R.string.avoid_motorways),
new DrivingOption(RoadType.Steps, R.string.avoid_steps),
new DrivingOption(RoadType.Paved, R.string.avoid_paved)};
new DrivingOption(RoadType.Steps, R.string.avoid_steps)};
@NonNull
private final Map<RoadType, Boolean> mInitialDrivingOptionsState = new HashMap<>();

View File

@@ -177,7 +177,7 @@ public final class UiHelpers
{
case LocationState.PENDING_POSITION, LocationState.NOT_FOLLOW_NO_POSITION ->
drawableRes = R.drawable.ic_location_off;
case LocationState.NOT_FOLLOW -> drawableRes = R.drawable.ic_location_crosshair;
case LocationState.NOT_FOLLOW -> drawableRes = R.drawable.ic_not_follow;
case LocationState.FOLLOW ->
{
drawableRes = R.drawable.ic_follow;

View File

@@ -1,86 +0,0 @@
package app.organicmaps.dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.preference.PreferenceManager;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;
import app.organicmaps.R;
import app.organicmaps.sdk.Framework;
public final class CustomMapServerDialog
{
public interface OnUrlAppliedListener
{
void onUrlApplied(@NonNull String url);
}
private CustomMapServerDialog() {}
public static void show(@NonNull Context context,
@Nullable OnUrlAppliedListener listener)
{
View dialogView = LayoutInflater.from(context)
.inflate(R.layout.dialog_custom_map_server, null);
TextInputLayout til = dialogView.findViewById(R.id.til_custom_map_server);
TextInputEditText edit = dialogView.findViewById(R.id.edit_custom_map_server);
SharedPreferences prefs =
PreferenceManager.getDefaultSharedPreferences(context);
String current = prefs.getString(context.getString(R.string.pref_custom_map_download_url), "");
edit.setText(current);
MaterialAlertDialogBuilder builder =
new MaterialAlertDialogBuilder(context, R.style.MwmTheme_AlertDialog)
.setTitle(R.string.download_resources_custom_url_title)
.setMessage(R.string.download_resources_custom_url_message)
.setView(dialogView)
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.save, null);
AlertDialog dialog = builder.create();
dialog.setOnShowListener(dlg -> {
Button ok = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
ok.setOnClickListener(v -> {
String url = edit.getText() != null ? edit.getText().toString().trim() : "";
if (!url.isEmpty()
&& !url.startsWith("http://")
&& !url.startsWith("https://"))
{
til.setError(context.getString(R.string.download_resources_custom_url_error_scheme));
return;
}
til.setError(null);
String normalizedUrl = Framework.normalizeServerUrl(url);
prefs.edit()
.putString(context.getString(R.string.pref_custom_map_download_url), normalizedUrl)
.apply();
// Apply to native
Framework.applyCustomMapDownloadUrl(context, normalizedUrl);
if (listener != null)
listener.onUrlApplied(normalizedUrl);
dialog.dismiss();
});
});
dialog.show();
}
}

View File

@@ -357,7 +357,7 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde
private MenuBottomSheetItem getCancelMenuItem()
{
return new MenuBottomSheetItem(R.string.cancel, R.drawable.ic_close, () -> onCancelActionSelected(mSelectedItem));
return new MenuBottomSheetItem(R.string.cancel, R.drawable.ic_cancel, () -> onCancelActionSelected(mSelectedItem));
}
private class ItemViewHolder extends BaseInnerViewHolder<CountryItem>

View File

@@ -222,10 +222,10 @@ public class DownloaderFragment
return;
if (mAdapter != null && mAdapter.isSearchResultsMode())
placeholder.setContent(R.string.search_not_found, R.string.search_not_found_query, R.drawable.ic_search_fail);
placeholder.setContent(R.string.search_not_found, R.string.search_not_found_query);
else
placeholder.setContent(R.string.downloader_no_downloaded_maps_title,
R.string.downloader_no_downloaded_maps_message, R.drawable.ic_download);
R.string.downloader_no_downloaded_maps_message);
}
@Override

View File

@@ -4,7 +4,6 @@ import android.location.Location;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
import app.organicmaps.MwmActivity;
@@ -27,10 +26,6 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
{
private static boolean sAutodownloadLocked;
private static final int HIDE_THRESHOLD = 2;
// Default bundles (e.g., world/coasts). Used to approximate “user-downloaded” count.
private static final int DEFAULT_MAP_BASELINE = 2;
private final MwmActivity mActivity;
private final View mFrame;
private final MaterialTextView mParent;
@@ -38,7 +33,6 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
private final MaterialTextView mSize;
private final WheelProgressView mProgress;
private final MaterialButton mButton;
private final View mOfflineExplanation;
private int mStorageSubscriptionSlot;
@@ -49,10 +43,8 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
@Override
public void onStatusChanged(List<MapManager.StorageCallbackData> data)
{
if (mCurrentCountry == null) {
updateOfflineExplanationVisibility();
if (mCurrentCountry == null)
return;
}
for (MapManager.StorageCallbackData item : data)
{
@@ -66,7 +58,7 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
{
mCurrentCountry.update();
updateProgressState(false);
updateOfflineExplanationVisibility();
return;
}
}
@@ -109,12 +101,6 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
return enqueued || progress || applying;
}
private void updateOfflineExplanationVisibility() {
if (mOfflineExplanation == null) return;
// hide once threshold reached; safe to call repeatedly.
app.organicmaps.util.UiUtils.showIf(MapManager.nativeGetDownloadedCount() < (DEFAULT_MAP_BASELINE + HIDE_THRESHOLD), mOfflineExplanation);
}
private void updateProgressState(boolean shouldAutoDownload)
{
updateStateInternal(shouldAutoDownload);
@@ -122,8 +108,6 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
private void updateStateInternal(boolean shouldAutoDownload)
{
updateOfflineExplanationVisibility();
boolean showFrame =
(mCurrentCountry != null && !mCurrentCountry.present && !RoutingController.get().isNavigating());
if (showFrame)
@@ -207,9 +191,6 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
mProgress = controls.findViewById(R.id.wheel_downloader_progress);
mButton = controls.findViewById(R.id.downloader_button);
mOfflineExplanation = mFrame.findViewById(R.id.offline_explanation);
updateOfflineExplanationVisibility();
mProgress.setOnClickListener(v -> {
if (mCurrentCountry == null)
return;
@@ -266,7 +247,6 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
public void onResume()
{
updateOfflineExplanationVisibility();
if (mStorageSubscriptionSlot == 0)
{
mStorageSubscriptionSlot = MapManager.nativeSubscribe(mStorageCallback);

View File

@@ -1,7 +1,5 @@
package app.organicmaps.editor;
import static android.view.View.INVISIBLE;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
@@ -15,13 +13,14 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.AutoCompleteTextView;
import android.widget.GridLayout;
import android.widget.Toast;
import androidx.annotation.CallSuper;
import androidx.annotation.DrawableRes;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.widget.SwitchCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import app.organicmaps.R;
@@ -43,9 +42,9 @@ import app.organicmaps.util.Graphics;
import app.organicmaps.util.InputUtils;
import app.organicmaps.util.UiUtils;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.card.MaterialCardView;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.materialswitch.MaterialSwitch;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textfield.TextInputLayout;
import com.google.android.material.textview.MaterialTextView;
@@ -116,9 +115,9 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
private MaterialTextView mPhone;
private MaterialButton mEditPhoneLink;
private MaterialTextView mCuisine;
private MaterialSwitch mWifi;
private SwitchCompat mWifi;
private MaterialTextView mSelfService;
private MaterialSwitch mOutdoorSeating;
private SwitchCompat mOutdoorSeating;
// Default Metadata entries.
private static final class MetadataEntry
@@ -154,7 +153,6 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
private final Map<Metadata.MetadataType, View> mDetailsBlocks = new HashMap<>();
private final Map<Metadata.MetadataType, View> mSocialMediaBlocks = new HashMap<>();
private MaterialButton mReset;
private MaterialButton mDisused;
private EditorHostFragment mParent;
@@ -396,18 +394,16 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
typeBtns.removeAllViews();
List<String> SOCKET_TYPES = Arrays.stream(getResources().getStringArray(R.array.charge_socket_types)).toList();
for (String socketType : SOCKET_TYPES)
for (String socket : SOCKET_TYPES)
{
ChargeSocketDescriptor socket = new ChargeSocketDescriptor(socketType,0,0);
MaterialButton btn = (MaterialButton) inflater.inflate(R.layout.button_socket_type, typeBtns, false);
btn.setTag(R.id.socket_type, socket.type());
btn.setTag(R.id.socket_type, socket);
// load SVG icon converted into VectorDrawable in res/drawable
@SuppressLint("DiscouragedApi")
int resIconId =
getResources().getIdentifier("ic_charge_socket_" + socket.visualType(), "drawable", requireContext().getPackageName());
getResources().getIdentifier("ic_charge_socket_" + socket, "drawable", requireContext().getPackageName());
if (resIconId != 0)
{
btn.setIcon(getResources().getDrawable(resIconId));
@@ -415,7 +411,7 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
@SuppressLint("DiscouragedApi")
int resTypeId =
getResources().getIdentifier("charge_socket_" + socket.visualType(), "string", requireContext().getPackageName());
getResources().getIdentifier("charge_socket_" + socket, "string", requireContext().getPackageName());
if (resTypeId != 0)
{
btn.setText(getResources().getString(resTypeId));
@@ -547,7 +543,7 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
updateChargeSockets(socketIndex, socket);
})
.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
.setNegativeButton(R.string.cancel, (dialog, which) -> { dialog.dismiss(); });
}
// Helper method for validation logic
@@ -603,7 +599,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
GridLayout socketsGrid = mChargeSockets.findViewById(R.id.socket_grid_editor);
socketsGrid.removeAllViews();
for (int i = 0; i < sockets.length; i++) {
for (int i = 0; i < sockets.length; i++)
{
final int currentIndex = i;
ChargeSocketDescriptor socket = sockets[i];
@@ -614,42 +611,45 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
MaterialTextView power = itemView.findViewById(R.id.socket_power);
MaterialTextView count = itemView.findViewById(R.id.socket_count);
// load SVG icon converted into VectorDrawable in res/drawable
@SuppressLint("DiscouragedApi")
int resIconId = getResources().getIdentifier("ic_charge_socket_" + socket.visualType(), "drawable",
requireContext().getPackageName());
if (resIconId != 0) {
int resIconId = getResources().getIdentifier("ic_charge_socket_" + socket.type(), "drawable",
requireContext().getPackageName());
if (resIconId != 0)
{
icon.setImageResource(resIconId);
}
@SuppressLint("DiscouragedApi")
int resTypeId =
getResources().getIdentifier("charge_socket_" + socket.visualType(), "string", requireContext().getPackageName());
if (resTypeId != 0) {
getResources().getIdentifier("charge_socket_" + socket.type(), "string", requireContext().getPackageName());
if (resTypeId != 0)
{
type.setText(resTypeId);
}
if (socket.power() != 0) {
if (socket.power() != 0)
{
DecimalFormat df = new DecimalFormat("#.##");
power.setText(getString(R.string.kw_label, df.format(socket.power())));
}
else if (socket.ignorePower()) {
power.setVisibility(INVISIBLE);
}
if (socket.count() != 0)
{
count.setText(getString(R.string.count_label, socket.count()));
}
itemView.setOnClickListener(v -> buildChargeSocketDialog(currentIndex, socket.type(), socket.count(), socket.power()).show());
itemView.setOnClickListener(v -> {
buildChargeSocketDialog(currentIndex, socket.type(), socket.count(), socket.power()).show();
});
socketsGrid.addView(itemView);
}
// add a 'new item' button at the end, to create new sockets
View btnNewItemView = inflater.inflate(R.layout.button_new_item, socketsGrid, false);
btnNewItemView.setOnClickListener(v -> buildChargeSocketDialog(-1, "unknown", -1, -1).show());
btnNewItemView.setOnClickListener(v -> {
buildChargeSocketDialog(-1, "unknown", -1, -1).show();
});
socketsGrid.addView(btnNewItemView);
}
@@ -826,8 +826,6 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
osmInfo.setMovementMethod(LinkMovementMethod.getInstance());
mReset = view.findViewById(R.id.reset);
mReset.setOnClickListener(this);
mDisused = view.findViewById(R.id.disused);
mDisused.setOnClickListener(this);
mDetailsBlocks.put(Metadata.MetadataType.FMD_OPEN_HOURS, blockOpeningHours);
mDetailsBlocks.put(Metadata.MetadataType.FMD_PHONE_NUMBER, blockPhone);
@@ -895,8 +893,6 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
mParent.addLanguage();
else if (id == R.id.reset)
reset();
else if (id == R.id.disused)
placeDisused();
else if (id == R.id.block_outdoor_seating)
mOutdoorSeating.toggle();
}
@@ -942,13 +938,10 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
if (mParent.addingNewObject())
{
UiUtils.hide(mReset);
UiUtils.hide(mDisused);
return;
}
mDisused.setVisibility(Editor.nativeCanMarkPlaceAsDisused() ? View.VISIBLE : View.GONE);
if (Editor.nativeAreSomeFeatureChangesUploaded())
if (Editor.nativeIsMapObjectUploaded())
{
mReset.setText(R.string.editor_place_doesnt_exist);
return;
@@ -966,7 +959,7 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
private void reset()
{
if (Editor.nativeAreSomeFeatureChangesUploaded())
if (Editor.nativeIsMapObjectUploaded())
{
placeDoesntExist();
return;
@@ -1020,19 +1013,6 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
dialogFragment.setTextSaveListener(this::commitPlaceDoesntExists);
}
private void placeDisused()
{
new MaterialAlertDialogBuilder(requireActivity(), R.style.MwmTheme_AlertDialog)
.setTitle(R.string.editor_mark_business_vacant_title)
.setMessage(R.string.editor_mark_business_vacant_description)
.setPositiveButton(R.string.editor_submit, (dlg, which) -> {
Editor.nativeMarkPlaceAsDisused();
mParent.processEditedFeatures();
})
.setNegativeButton(android.R.string.cancel, null)
.show();
}
private void commitPlaceDoesntExists(@NonNull String text)
{
Editor.nativePlaceDoesNotExist(text);

View File

@@ -358,7 +358,7 @@ public class EditorHostFragment
.show();
}
public void processEditedFeatures()
private void processEditedFeatures()
{
if (OsmOAuth.isAuthorized())
{

View File

@@ -1,20 +1,16 @@
package app.organicmaps.editor;
import android.content.res.ColorStateList;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import app.organicmaps.R;
import app.organicmaps.sdk.editor.data.FeatureCategory;
import app.organicmaps.sdk.util.StringUtils;
import app.organicmaps.util.UiUtils;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textview.MaterialTextView;
@@ -123,7 +119,7 @@ public class FeatureCategoryAdapter extends RecyclerView.Adapter<RecyclerView.Vi
protected static class FooterViewHolder extends RecyclerView.ViewHolder
{
private final TextInputEditText mNoteEditText;
private final MaterialButton mSendNoteButton;
private final View mSendNoteButton;
FooterViewHolder(@NonNull View itemView, @NonNull FooterListener listener)
{
@@ -133,29 +129,6 @@ public class FeatureCategoryAdapter extends RecyclerView.Adapter<RecyclerView.Vi
mNoteEditText = itemView.findViewById(R.id.note_edit_text);
mSendNoteButton = itemView.findViewById(R.id.send_note_button);
mSendNoteButton.setOnClickListener(v -> listener.onSendNoteClicked());
final ColorStateList bgButtonColor = new ColorStateList(
new int[][]{
new int[]{android.R.attr.state_enabled}, // enabled
new int[]{-android.R.attr.state_enabled} // disabled
},
new int[]{
ContextCompat.getColor(
mSendNoteButton.getContext(), R.color.base_accent),
ContextCompat.getColor(mSendNoteButton.getContext(), R.color.button_accent_disabled)
});
final ColorStateList textButtonColor = new ColorStateList(
new int[][]{
new int[]{android.R.attr.state_enabled}, // enabled
new int[]{-android.R.attr.state_enabled} // disabled
},
new int[]{
ContextCompat.getColor(
mSendNoteButton.getContext(),
UiUtils.getStyledResourceId(mSendNoteButton.getContext(), android.R.attr.textColorPrimaryInverse)),
ContextCompat.getColor(mSendNoteButton.getContext(), R.color.button_accent_text_disabled)
});
mSendNoteButton.setBackgroundTintList(bgButtonColor);
mSendNoteButton.setTextColor(textButtonColor);
mNoteEditText.addTextChangedListener(new StringUtils.SimpleTextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count)

View File

@@ -1,208 +0,0 @@
package app.organicmaps.editor;
import android.content.res.Configuration;
import android.content.res.Resources;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import com.google.android.material.timepicker.MaterialTimePicker;
import com.google.android.material.timepicker.TimeFormat;
import app.organicmaps.R;
import app.organicmaps.sdk.editor.data.HoursMinutes;
import app.organicmaps.sdk.util.DateUtils;
public class FromToTimePicker
{
private final FragmentActivity mActivity;
private final FragmentManager mFragmentManager;
private final OnPickListener mListener;
private final int mId;
private final boolean mIs24HourFormat;
private final Resources mResources;
private HoursMinutes mFromTime;
private HoursMinutes mToTime;
private MaterialTimePicker mToTimePicker;
private MaterialTimePicker mFromTimePicker;
private boolean mIsFromTimePicked;
private int mInputMode;
public static void pickTime(@NonNull Fragment fragment,
@NonNull FromToTimePicker.OnPickListener listener,
@NonNull HoursMinutes fromTime,
@NonNull HoursMinutes toTime,
int id,
boolean startWithToTime)
{
FromToTimePicker timePicker = new FromToTimePicker(fragment,
listener,
fromTime,
toTime,
id);
if (startWithToTime)
timePicker.showToTimePicker();
else
timePicker.showFromTimePicker();
}
private FromToTimePicker(@NonNull Fragment fragment,
@NonNull FromToTimePicker.OnPickListener listener,
@NonNull HoursMinutes fromTime,
@NonNull HoursMinutes toTime,
int id)
{
mActivity = fragment.requireActivity();
mFragmentManager = fragment.getChildFragmentManager();
mListener = listener;
mFromTime = fromTime;
mToTime = toTime;
mId = id;
mIsFromTimePicked = false;
mInputMode = MaterialTimePicker.INPUT_MODE_CLOCK;
mIs24HourFormat = DateUtils.is24HourFormat(mActivity);
mResources = mActivity.getResources();
mActivity.addOnConfigurationChangedListener(this::handleConfigurationChanged);
}
public void showFromTimePicker()
{
if (mFromTimePicker != null)
{
saveState(mFromTimePicker, true);
mFromTimePicker.dismiss();
}
mFromTimePicker = buildFromTimePicker();
mFromTimePicker.show(mFragmentManager, null);
}
public void showToTimePicker()
{
if (mToTimePicker != null)
{
saveState(mToTimePicker, false);
mToTimePicker.dismiss();
}
mToTimePicker = buildToTimePicker();
mToTimePicker.show(mFragmentManager, null);
}
private MaterialTimePicker buildFromTimePicker()
{
MaterialTimePicker timePicker = buildTimePicker(mFromTime,
mResources.getString(R.string.editor_time_from),
mResources.getString(R.string.next_button),
null);
timePicker.addOnNegativeButtonClickListener(view -> finishTimePicking(false));
timePicker.addOnPositiveButtonClickListener(view ->
{
mIsFromTimePicked = true;
saveState(timePicker, true);
mFromTimePicker = null;
showToTimePicker();
});
timePicker.addOnCancelListener(view -> finishTimePicking(false));
return timePicker;
}
private MaterialTimePicker buildToTimePicker()
{
MaterialTimePicker timePicker = buildTimePicker(mToTime,
mResources.getString(R.string.editor_time_to),
null,
mResources.getString(R.string.back));
timePicker.addOnNegativeButtonClickListener(view ->
{
saveState(timePicker, false);
mToTimePicker = null;
if (mIsFromTimePicked)
showFromTimePicker();
else
finishTimePicking(false);
});
timePicker.addOnPositiveButtonClickListener(view ->
{
saveState(timePicker, false);
finishTimePicking(true);
});
timePicker.addOnCancelListener(view -> finishTimePicking(false));
return timePicker;
}
@NonNull
private MaterialTimePicker buildTimePicker(@NonNull HoursMinutes time,
@NonNull String title,
@Nullable String positiveButtonTextOverride,
@Nullable String negativeButtonTextOverride)
{
MaterialTimePicker.Builder builder = new MaterialTimePicker.Builder()
.setTitleText(title)
.setTimeFormat(mIs24HourFormat ? TimeFormat.CLOCK_24H : TimeFormat.CLOCK_12H)
.setInputMode(mInputMode)
.setTheme(R.style.MwmTheme_MaterialTimePicker)
.setHour((int) time.hours)
.setMinute((int) time.minutes);
if (positiveButtonTextOverride != null)
builder.setPositiveButtonText(positiveButtonTextOverride);
if (negativeButtonTextOverride != null)
builder.setNegativeButtonText(negativeButtonTextOverride);
return builder.build();
}
private void saveState(@NonNull MaterialTimePicker timePicker, boolean isFromTime)
{
mInputMode = timePicker.getInputMode();
if (isFromTime)
mFromTime = getHoursMinutes(timePicker);
else
mToTime = getHoursMinutes(timePicker);
}
private HoursMinutes getHoursMinutes(@NonNull MaterialTimePicker timePicker)
{
return new HoursMinutes(timePicker.getHour(), timePicker.getMinute(), mIs24HourFormat);
}
private void finishTimePicking(boolean isConfirmed)
{
mActivity.removeOnConfigurationChangedListener(this::handleConfigurationChanged);
if (isConfirmed)
mListener.onHoursMinutesPicked(mFromTime, mToTime, mId);
}
private void handleConfigurationChanged(Configuration configuration)
{
if (mFromTimePicker != null && mFromTimePicker.isVisible())
showFromTimePicker();
else if (mToTimePicker != null && mToTimePicker.isVisible())
showToTimePicker();
}
public interface OnPickListener
{
void onHoursMinutesPicked(HoursMinutes from, HoursMinutes to, int id);
}
}

View File

@@ -0,0 +1,211 @@
package app.organicmaps.editor;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.content.res.ColorStateList;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.TimePicker;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.fragment.app.FragmentManager;
import app.organicmaps.R;
import app.organicmaps.base.BaseMwmDialogFragment;
import app.organicmaps.sdk.editor.data.HoursMinutes;
import app.organicmaps.sdk.util.DateUtils;
import app.organicmaps.util.Utils;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.textview.MaterialTextView;
public class HoursMinutesPickerFragment extends BaseMwmDialogFragment
{
private static final String EXTRA_FROM = "HoursMinutesFrom";
private static final String EXTRA_TO = "HoursMinutesTo";
private static final String EXTRA_SELECT_FIRST = "SelectedTab";
private static final String EXTRA_ID = "Id";
public static final int TAB_FROM = 0;
public static final int TAB_TO = 1;
private HoursMinutes mFrom;
private HoursMinutes mTo;
private TimePicker mPicker;
private View mPickerHoursLabel;
@IntRange(from = 0, to = 1)
private int mSelectedTab;
private TabLayout mTabs;
private int mId;
private Button mOkButton;
public interface OnPickListener
{
void onHoursMinutesPicked(HoursMinutes from, HoursMinutes to, int id);
}
public static void pick(Context context, FragmentManager manager, @NonNull HoursMinutes from,
@NonNull HoursMinutes to, @IntRange(from = 0, to = 1) int selectedPosition, int id)
{
final Bundle args = new Bundle();
args.putParcelable(EXTRA_FROM, from);
args.putParcelable(EXTRA_TO, to);
args.putInt(EXTRA_SELECT_FIRST, selectedPosition);
args.putInt(EXTRA_ID, id);
final HoursMinutesPickerFragment fragment = (HoursMinutesPickerFragment) manager.getFragmentFactory().instantiate(
context.getClassLoader(), HoursMinutesPickerFragment.class.getName());
fragment.setArguments(args);
fragment.show(manager, null);
}
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
readArgs();
final View root = createView();
// noinspection ConstantConditions
mTabs.getTabAt(mSelectedTab).select();
final AlertDialog dialog =
new MaterialAlertDialogBuilder(requireActivity(), R.style.MwmMain_DialogFragment_TimePicker)
.setView(root)
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
dialog.setOnShowListener(dialogInterface -> {
mOkButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE);
mOkButton.setOnClickListener(v -> {
if (mSelectedTab == TAB_FROM)
{
// noinspection ConstantConditions
mTabs.getTabAt(TAB_TO).select();
return;
}
saveHoursMinutes();
dismiss();
if (getParentFragment() instanceof OnPickListener)
((OnPickListener) getParentFragment()).onHoursMinutesPicked(mFrom, mTo, mId);
});
refreshPicker();
});
return dialog;
}
private void readArgs()
{
final Bundle args = getArguments();
if (args == null)
throw new IllegalArgumentException("Args must not be null");
mFrom = Utils.getParcelable(args, EXTRA_FROM, HoursMinutes.class);
mTo = Utils.getParcelable(args, EXTRA_TO, HoursMinutes.class);
mSelectedTab = args.getInt(EXTRA_SELECT_FIRST);
mId = args.getInt(EXTRA_ID);
}
private View createView()
{
final LayoutInflater inflater = LayoutInflater.from(requireActivity());
@SuppressLint("InflateParams")
final View root = inflater.inflate(R.layout.fragment_timetable_picker, null);
mPicker = root.findViewById(R.id.picker);
mPicker.setIs24HourView(DateFormat.is24HourFormat(requireActivity()));
@SuppressLint("DiscouragedApi")
int id = getResources().getIdentifier("hours", "id", "android");
if (id != 0)
{
mPickerHoursLabel = mPicker.findViewById(id);
if (!(mPickerHoursLabel instanceof TextView))
mPickerHoursLabel = null;
}
mTabs = root.findViewById(R.id.tabs);
MaterialTextView tabView = (MaterialTextView) inflater.inflate(R.layout.tab_timepicker, mTabs, false);
tabView.setText(getResources().getString(R.string.editor_time_from));
final ColorStateList textColor =
AppCompatResources.getColorStateList(requireContext(), R.color.accent_color_selector);
tabView.setTextColor(textColor);
mTabs.addTab(mTabs.newTab().setCustomView(tabView), true);
tabView = (MaterialTextView) inflater.inflate(R.layout.tab_timepicker, mTabs, false);
tabView.setText(getResources().getString(R.string.editor_time_to));
tabView.setTextColor(textColor);
mTabs.addTab(mTabs.newTab().setCustomView(tabView), true);
mTabs.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab)
{
if (!isInit())
return;
saveHoursMinutes();
mSelectedTab = tab.getPosition();
refreshPicker();
if (mPickerHoursLabel != null)
mPickerHoursLabel.performClick();
}
@Override
public void onTabUnselected(TabLayout.Tab tab)
{}
@Override
public void onTabReselected(TabLayout.Tab tab)
{}
});
return root;
}
private void saveHoursMinutes()
{
boolean is24HourFormat = DateUtils.is24HourFormat(requireContext());
final HoursMinutes hoursMinutes =
new HoursMinutes(mPicker.getCurrentHour(), mPicker.getCurrentMinute(), is24HourFormat);
if (mSelectedTab == TAB_FROM)
mFrom = hoursMinutes;
else
mTo = hoursMinutes;
}
private boolean isInit()
{
return mOkButton != null && mPicker != null;
}
private void refreshPicker()
{
if (!isInit())
return;
HoursMinutes hoursMinutes;
int okBtnRes;
if (mSelectedTab == TAB_FROM)
{
hoursMinutes = mFrom;
okBtnRes = R.string.next_button;
}
else
{
hoursMinutes = mTo;
okBtnRes = R.string.ok;
}
mPicker.setCurrentMinute((int) hoursMinutes.minutes);
mPicker.setCurrentHour((int) hoursMinutes.hours);
mOkButton.setText(okBtnRes);
}
}

View File

@@ -1,10 +1,7 @@
package app.organicmaps.editor;
import android.content.res.Configuration;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.core.os.ConfigurationCompat;
import androidx.core.os.LocaleListCompat;
import androidx.fragment.app.Fragment;
import app.organicmaps.base.BaseMwmRecyclerFragment;
import app.organicmaps.sdk.editor.Editor;
@@ -14,8 +11,6 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.Set;
public class LanguagesFragment extends BaseMwmRecyclerFragment<LanguagesAdapter>
@@ -37,28 +32,10 @@ public class LanguagesFragment extends BaseMwmRecyclerFragment<LanguagesAdapter>
Set<String> existingLanguages =
args != null ? new HashSet<>(args.getStringArrayList(EXISTING_LOCALIZED_NAMES)) : new HashSet<>();
Configuration config = requireContext().getResources().getConfiguration();
LocaleListCompat systemLocales = ConfigurationCompat.getLocales(config);
List<Language> languages = new ArrayList<>();
List<Language> systemLanguages = new ArrayList<>(systemLocales.size());
for (int i = 0; i < systemLocales.size(); i++)
systemLanguages.add(null);
for (Language lang : Editor.nativeGetSupportedLanguages(false))
{
// Separately extract system languages
for (int i = 0; i < systemLocales.size(); i++)
{
Locale locale = systemLocales.get(i);
if (locale != null && locale.getLanguage().equals(lang.code))
{
systemLanguages.add(i, lang);
break;
}
}
if (existingLanguages.contains(lang.code) || systemLanguages.contains(lang))
if (existingLanguages.contains(lang.code))
continue;
languages.add(lang);
@@ -66,8 +43,6 @@ public class LanguagesFragment extends BaseMwmRecyclerFragment<LanguagesAdapter>
Collections.sort(languages, Comparator.comparing(lhs -> lhs.name));
languages.addAll(0, systemLanguages.stream().filter(Objects::nonNull).toList());
return new LanguagesAdapter(this, languages.toArray(new Language[languages.size()]));
}

View File

@@ -6,6 +6,7 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
@@ -22,7 +23,6 @@ import app.organicmaps.util.Utils;
import app.organicmaps.util.WindowInsetUtils;
import app.organicmaps.widget.StackedButtonDialogFragment;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.progressindicator.CircularProgressIndicator;
import com.google.android.material.textview.MaterialTextView;
import java.text.NumberFormat;
@@ -50,7 +50,7 @@ public class ProfileFragment extends BaseMwmToolbarFragment
private MaterialTextView mEditsSent;
private MaterialTextView mProfileName;
private ShapeableImageView mProfileImage;
private CircularProgressIndicator mProfileInfoLoading;
private ProgressBar mProfileInfoLoading;
@Nullable
@Override

View File

@@ -1,17 +1,15 @@
package app.organicmaps.editor;
import android.content.res.ColorStateList;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import androidx.annotation.IdRes;
import androidx.annotation.IntRange;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.appcompat.widget.SwitchCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import app.organicmaps.R;
@@ -24,7 +22,6 @@ import app.organicmaps.sdk.util.Utils;
import app.organicmaps.util.UiUtils;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.checkbox.MaterialCheckBox;
import com.google.android.material.materialswitch.MaterialSwitch;
import com.google.android.material.textview.MaterialTextView;
import java.util.ArrayList;
import java.util.Arrays;
@@ -32,13 +29,13 @@ import java.util.Calendar;
import java.util.List;
class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter.BaseTimetableViewHolder>
implements FromToTimePicker.OnPickListener, TimetableProvider
implements HoursMinutesPickerFragment.OnPickListener, TimetableProvider
{
private static final int TYPE_TIMETABLE = 0;
private static final int TYPE_ADD_TIMETABLE = 1;
private static final int ID_OPENING_TIME = 0;
private static final int ID_CLOSED_SPAN = 1;
private static final int ID_OPENING = 0;
private static final int ID_CLOSING = 1;
private static final int[] DAYS = {R.id.day1, R.id.day2, R.id.day3, R.id.day4, R.id.day5, R.id.day6, R.id.day7};
@@ -72,7 +69,7 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
@Override
public String getTimetables()
{
return OpeningHours.nativeTimetablesToString(mItems.toArray(new Timetable[0]));
return OpeningHours.nativeTimetablesToString(mItems.toArray(new Timetable[mItems.size()]));
}
@Override
@@ -104,7 +101,7 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
private void addTimetable()
{
mItems.add(OpeningHours.nativeGetComplementTimetable(mItems.toArray(new Timetable[0])));
mItems.add(OpeningHours.nativeGetComplementTimetable(mItems.toArray(new Timetable[mItems.size()])));
notifyItemInserted(mItems.size() - 1);
refreshComplement();
}
@@ -118,31 +115,25 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
private void refreshComplement()
{
mComplementItem = OpeningHours.nativeGetComplementTimetable(mItems.toArray(new Timetable[0]));
mComplementItem = OpeningHours.nativeGetComplementTimetable(mItems.toArray(new Timetable[mItems.size()]));
notifyItemChanged(getItemCount() - 1);
}
private void pickTime(int position,
@IntRange(from = ID_OPENING_TIME, to = ID_CLOSED_SPAN) int id,
boolean startWithToTime)
@IntRange(from = HoursMinutesPickerFragment.TAB_FROM, to = HoursMinutesPickerFragment.TAB_TO)
int tab, @IntRange(from = ID_OPENING, to = ID_CLOSING) int id)
{
final Timetable data = mItems.get(position);
mPickingPosition = position;
FromToTimePicker.pickTime(mFragment,
this,
data.workingTimespan.start,
data.workingTimespan.end,
id,
startWithToTime);
HoursMinutesPickerFragment.pick(mFragment.requireActivity(), mFragment.getChildFragmentManager(),
data.workingTimespan.start, data.workingTimespan.end, tab, id);
}
@Override
public void onHoursMinutesPicked(HoursMinutes from, HoursMinutes to, int id)
{
final Timetable item = mItems.get(mPickingPosition);
if (id == ID_OPENING_TIME)
if (id == ID_OPENING)
mItems.set(mPickingPosition, OpeningHours.nativeSetOpeningTime(item, new Timespan(from, to)));
else
mItems.set(mPickingPosition, OpeningHours.nativeAddClosedSpan(item, new Timespan(from, to)));
@@ -157,7 +148,7 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
private void addWorkingDay(int day, int position)
{
final Timetable[] tts = mItems.toArray(new Timetable[0]);
final Timetable[] tts = mItems.toArray(new Timetable[mItems.size()]);
mItems = new ArrayList<>(Arrays.asList(OpeningHours.nativeAddWorkingDay(tts, position, day)));
refreshComplement();
notifyDataSetChanged();
@@ -165,7 +156,7 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
private void removeWorkingDay(int day, int position)
{
final Timetable[] tts = mItems.toArray(new Timetable[0]);
final Timetable[] tts = mItems.toArray(new Timetable[mItems.size()]);
mItems = new ArrayList<>(Arrays.asList(OpeningHours.nativeRemoveWorkingDay(tts, position, day)));
refreshComplement();
notifyDataSetChanged();
@@ -195,7 +186,7 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
SparseArray<MaterialCheckBox> days = new SparseArray<>(7);
View allday;
MaterialSwitch swAllday;
SwitchCompat swAllday;
View schedule;
View openClose;
View open;
@@ -271,13 +262,13 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
{
final int id = v.getId();
if (id == R.id.time_open)
pickTime(getBindingAdapterPosition(), ID_OPENING_TIME, false);
pickTime(getBindingAdapterPosition(), HoursMinutesPickerFragment.TAB_FROM, ID_OPENING);
else if (id == R.id.time_close)
pickTime(getBindingAdapterPosition(), ID_OPENING_TIME, true);
pickTime(getBindingAdapterPosition(), HoursMinutesPickerFragment.TAB_TO, ID_OPENING);
else if (id == R.id.tv__remove_timetable)
removeTimetable(getBindingAdapterPosition());
else if (id == R.id.tv__add_closed)
pickTime(getBindingAdapterPosition(), ID_CLOSED_SPAN, false);
pickTime(getBindingAdapterPosition(), HoursMinutesPickerFragment.TAB_FROM, ID_CLOSING);
else if (id == R.id.allday)
swAllday.toggle();
}
@@ -383,29 +374,6 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
final boolean enable = mComplementItem != null && mComplementItem.weekdays.length != 0;
final String text = mFragment.getString(R.string.editor_time_add);
mAdd.setEnabled(enable);
final ColorStateList bgButtonColor = new ColorStateList(
new int[][]{
new int[]{android.R.attr.state_enabled}, // enabled
new int[]{-android.R.attr.state_enabled} // disabled
},
new int[]{
ContextCompat.getColor(
mAdd.getContext(), R.color.base_accent),
ContextCompat.getColor(mAdd.getContext(), R.color.button_accent_disabled)
});
final ColorStateList textButtonColor = new ColorStateList(
new int[][]{
new int[]{android.R.attr.state_enabled}, // enabled
new int[]{-android.R.attr.state_enabled} // disabled
},
new int[]{
ContextCompat.getColor(
mAdd.getContext(),
UiUtils.getStyledResourceId(mAdd.getContext(), android.R.attr.textColorPrimaryInverse)),
ContextCompat.getColor(mAdd.getContext(), R.color.button_accent_text_disabled)
});
mAdd.setBackgroundTintList(bgButtonColor);
mAdd.setTextColor(textButtonColor);
mAdd.setText(enable ? text + " (" + TimeFormatUtils.formatWeekdays(mComplementItem) + ")" : text);
}
}

View File

@@ -8,9 +8,10 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import app.organicmaps.R;
import app.organicmaps.base.BaseMwmRecyclerFragment;
import app.organicmaps.sdk.editor.data.HoursMinutes;
public class SimpleTimetableFragment extends BaseMwmRecyclerFragment<SimpleTimetableAdapter>
implements TimetableProvider
implements TimetableProvider, HoursMinutesPickerFragment.OnPickListener
{
private SimpleTimetableAdapter mAdapter;
@Nullable
@@ -56,4 +57,10 @@ public class SimpleTimetableFragment extends BaseMwmRecyclerFragment<SimpleTimet
{
mInitTimetables = timetables;
}
@Override
public void onHoursMinutesPicked(HoursMinutes from, HoursMinutes to, int id)
{
mAdapter.onHoursMinutesPicked(from, to, id);
}
}

View File

@@ -2,12 +2,14 @@ package app.organicmaps.maplayer;
import android.content.Context;
import android.view.View;
import androidx.annotation.AttrRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import app.organicmaps.R;
import app.organicmaps.adapter.OnItemClickListener;
import app.organicmaps.sdk.maplayer.Mode;
import app.organicmaps.util.ThemeUtils;
public class LayerBottomSheetItem
{
@@ -35,25 +37,27 @@ public class LayerBottomSheetItem
@DrawableRes
int drawableResId = 0;
@StringRes
int buttonTextResource = switch (mode) {
case OUTDOORS -> {
drawableResId = R.drawable.ic_layers_outdoors;
yield R.string.button_layer_outdoor;
}
case SUBWAY -> {
drawableResId = R.drawable.ic_layers_subway;
yield R.string.subway;
}
case ISOLINES -> {
drawableResId = R.drawable.ic_layers_isoline;
yield R.string.button_layer_isolines;
}
case TRAFFIC -> {
drawableResId = R.drawable.ic_layers_traffic;
yield R.string.button_layer_traffic;
}
};
return new LayerBottomSheetItem(drawableResId, buttonTextResource, mode, layerItemClickListener);
int buttonTextResource = R.string.layers_title;
switch (mode)
{
case OUTDOORS:
drawableResId = R.drawable.ic_layers_outdoors;
buttonTextResource = R.string.button_layer_outdoor;
break;
case SUBWAY:
drawableResId = R.drawable.ic_layers_subway;
buttonTextResource = R.string.subway;
break;
case ISOLINES:
drawableResId = R.drawable.ic_layers_isoline;
buttonTextResource = R.string.button_layer_isolines;
break;
case TRAFFIC:
drawableResId = R.drawable.ic_layers_traffic;
buttonTextResource = R.string.button_layer_traffic;
break;
}
return new LayerBottomSheetItem(drawableResId, buttonTextResource, mode, layerItemClickListener);
}
@NonNull

View File

@@ -5,8 +5,10 @@ import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StyleRes;
import androidx.fragment.app.Fragment;
import app.organicmaps.base.BaseMwmFragmentActivity;
import app.organicmaps.util.ThemeUtils;
public class SearchActivity extends BaseMwmFragmentActivity
{

View File

@@ -21,9 +21,6 @@ import app.organicmaps.util.UiUtils;
class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHolder>
{
private static final int SHORT_HORIZON_CLOSE_MIN = 60;
private static final int SHORT_HORIZON_OPEN_MIN = 15;
private final SearchFragment mSearchFragment;
@Nullable
private SearchResult[] mResults;
@@ -152,32 +149,41 @@ class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHol
{
final Resources resources = mSearchFragment.getResources();
if (result.description.openNow != SearchResult.OPEN_NOW_YES && result.description.openNow != SearchResult.OPEN_NOW_NO)
switch (result.description.openNow)
{
// Hide if unknown opening hours state
UiUtils.hide(mOpen);
return;
case SearchResult.OPEN_NOW_YES ->
{
if (result.description.minutesUntilClosed < 60) // less than 1 hour
{
final String time = result.description.minutesUntilClosed + " " + resources.getString(R.string.minute);
final String string = resources.getString(R.string.closes_in, time);
UiUtils.setTextAndShow(mOpen, string);
mOpen.setTextColor(ContextCompat.getColor(mSearchFragment.getContext(), R.color.base_yellow));
}
else
{
UiUtils.setTextAndShow(mOpen, resources.getString(R.string.editor_time_open));
mOpen.setTextColor(ContextCompat.getColor(mSearchFragment.getContext(), R.color.base_green));
}
}
final boolean isOpen = result.description.openNow == SearchResult.OPEN_NOW_YES;
final int minsToNextState = isOpen ? result.description.minutesUntilClosed : result.description.minutesUntilOpen;
final boolean shortHorizonClosing = isOpen && minsToNextState >= 0 && minsToNextState <= SHORT_HORIZON_CLOSE_MIN;
final boolean shortHorizonOpening = !isOpen && minsToNextState >= 0 && minsToNextState <= SHORT_HORIZON_OPEN_MIN;
if (shortHorizonClosing || shortHorizonOpening)
case SearchResult.OPEN_NOW_NO ->
{
final String minsToChangeStr = resources.getQuantityString(
R.plurals.minutes_short, Math.max(minsToNextState, 1), Math.max(minsToNextState, 1));
final String nextChangeFormatted = resources.getString(isOpen ? R.string.closes_in : R.string.opens_in, minsToChangeStr);
if (result.description.minutesUntilOpen < 60) // less than 1 hour
{
final String time = result.description.minutesUntilOpen + " " + resources.getString(R.string.minute);
final String string = resources.getString(R.string.opens_in, time);
UiUtils.setTextAndShow(mOpen, nextChangeFormatted);
mOpen.setTextColor(ContextCompat.getColor(mSearchFragment.getContext(), R.color.base_yellow));
UiUtils.setTextAndShow(mOpen, string);
mOpen.setTextColor(ContextCompat.getColor(mSearchFragment.getContext(), R.color.base_red));
}
else
{
UiUtils.setTextAndShow(mOpen, resources.getString(R.string.closed));
mOpen.setTextColor(ContextCompat.getColor(mSearchFragment.getContext(), R.color.base_red));
}
}
else
{
UiUtils.setTextAndShow(mOpen, isOpen ? resources.getString(R.string.editor_time_open) : resources.getString(R.string.closed));
mOpen.setTextColor(ContextCompat.getColor(mSearchFragment.getContext(), isOpen ? R.color.base_green : R.color.base_red));
default -> UiUtils.hide(mOpen);
}
}

View File

@@ -273,7 +273,7 @@ public class SearchFragment extends BaseMwmFragment implements SearchListener, C
RecyclerView mResults = mResultsFrame.findViewById(R.id.recycler);
setRecyclerScrollListener(mResults);
mResultsPlaceholder = mResultsFrame.findViewById(R.id.placeholder);
mResultsPlaceholder.setContent(R.string.search_not_found, R.string.search_not_found_query, R.drawable.ic_search_fail);
mResultsPlaceholder.setContent(R.string.search_not_found, R.string.search_not_found_query);
mSearchAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver()
{

View File

@@ -47,7 +47,7 @@ public class SearchHistoryFragment extends BaseMwmRecyclerFragment<SearchHistory
super.onViewCreated(view, savedInstanceState);
getRecyclerView().setLayoutManager(new LinearLayoutManager(view.getContext()));
mPlaceHolder = view.findViewById(R.id.placeholder);
mPlaceHolder.setContent(R.string.search_history_title, R.string.search_history_text, R.drawable.ic_search_recent);
mPlaceHolder.setContent(R.string.search_history_title, R.string.search_history_text);
getAdapter().registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
@Override

View File

@@ -8,9 +8,7 @@ import android.view.ViewGroup;
import android.widget.CompoundButton;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.material.materialswitch.MaterialSwitch;
import androidx.appcompat.widget.SwitchCompat;
import app.organicmaps.R;
import app.organicmaps.base.BaseMwmToolbarFragment;
import app.organicmaps.sdk.routing.RoutingController;
@@ -90,38 +88,30 @@ public class DrivingOptionsFragment extends BaseMwmToolbarFragment
private void initViews(@NonNull View root)
{
MaterialSwitch tollsBtn = root.findViewById(R.id.avoid_tolls_btn);
SwitchCompat tollsBtn = root.findViewById(R.id.avoid_tolls_btn);
tollsBtn.setChecked(RoutingOptions.hasOption(RoadType.Toll));
CompoundButton.OnCheckedChangeListener tollBtnListener = new ToggleRoutingOptionListener(RoadType.Toll, root);
CompoundButton.OnCheckedChangeListener tollBtnListener = new ToggleRoutingOptionListener(RoadType.Toll);
tollsBtn.setOnCheckedChangeListener(tollBtnListener);
MaterialSwitch motorwaysBtn = root.findViewById(R.id.avoid_motorways_btn);
SwitchCompat motorwaysBtn = root.findViewById(R.id.avoid_motorways_btn);
motorwaysBtn.setChecked(RoutingOptions.hasOption(RoadType.Motorway));
CompoundButton.OnCheckedChangeListener motorwayBtnListener =
new ToggleRoutingOptionListener(RoadType.Motorway, root);
CompoundButton.OnCheckedChangeListener motorwayBtnListener = new ToggleRoutingOptionListener(RoadType.Motorway);
motorwaysBtn.setOnCheckedChangeListener(motorwayBtnListener);
MaterialSwitch ferriesBtn = root.findViewById(R.id.avoid_ferries_btn);
SwitchCompat ferriesBtn = root.findViewById(R.id.avoid_ferries_btn);
ferriesBtn.setChecked(RoutingOptions.hasOption(RoadType.Ferry));
CompoundButton.OnCheckedChangeListener ferryBtnListener = new ToggleRoutingOptionListener(RoadType.Ferry, root);
CompoundButton.OnCheckedChangeListener ferryBtnListener = new ToggleRoutingOptionListener(RoadType.Ferry);
ferriesBtn.setOnCheckedChangeListener(ferryBtnListener);
MaterialSwitch dirtyRoadsBtn = root.findViewById(R.id.avoid_dirty_roads_btn);
SwitchCompat dirtyRoadsBtn = root.findViewById(R.id.avoid_dirty_roads_btn);
dirtyRoadsBtn.setChecked(RoutingOptions.hasOption(RoadType.Dirty));
dirtyRoadsBtn.setEnabled(!RoutingOptions.hasOption(RoadType.Paved) || RoutingOptions.hasOption(RoadType.Dirty));
CompoundButton.OnCheckedChangeListener dirtyBtnListener = new ToggleRoutingOptionListener(RoadType.Dirty, root);
CompoundButton.OnCheckedChangeListener dirtyBtnListener = new ToggleRoutingOptionListener(RoadType.Dirty);
dirtyRoadsBtn.setOnCheckedChangeListener(dirtyBtnListener);
MaterialSwitch stepsBtn = root.findViewById(R.id.avoid_steps_btn);
SwitchCompat stepsBtn = root.findViewById(R.id.avoid_steps_btn);
stepsBtn.setChecked(RoutingOptions.hasOption(RoadType.Steps));
CompoundButton.OnCheckedChangeListener stepsBtnListener = new ToggleRoutingOptionListener(RoadType.Steps, root);
CompoundButton.OnCheckedChangeListener stepsBtnListener = new ToggleRoutingOptionListener(RoadType.Steps);
stepsBtn.setOnCheckedChangeListener(stepsBtnListener);
MaterialSwitch pavedBtn = root.findViewById(R.id.avoid_paved_roads_btn);
pavedBtn.setChecked(RoutingOptions.hasOption(RoadType.Paved));
pavedBtn.setEnabled(!RoutingOptions.hasOption(RoadType.Dirty) || RoutingOptions.hasOption(RoadType.Paved));
CompoundButton.OnCheckedChangeListener pavedBtnListener = new ToggleRoutingOptionListener(RoadType.Paved, root);
pavedBtn.setOnCheckedChangeListener(pavedBtnListener);
}
private static class ToggleRoutingOptionListener implements CompoundButton.OnCheckedChangeListener
@@ -129,13 +119,9 @@ public class DrivingOptionsFragment extends BaseMwmToolbarFragment
@NonNull
private final RoadType mRoadType;
@NonNull
private final View mRoot;
private ToggleRoutingOptionListener(@NonNull RoadType roadType, @NonNull View root)
private ToggleRoutingOptionListener(@NonNull RoadType roadType)
{
mRoadType = roadType;
mRoot = root;
}
@Override
@@ -145,27 +131,6 @@ public class DrivingOptionsFragment extends BaseMwmToolbarFragment
RoutingOptions.addOption(mRoadType);
else
RoutingOptions.removeOption(mRoadType);
MaterialSwitch dirtyRoadsBtn = mRoot.findViewById(R.id.avoid_dirty_roads_btn);
MaterialSwitch pavedBtn = mRoot.findViewById(R.id.avoid_paved_roads_btn);
if (mRoadType == RoadType.Dirty)
{
pavedBtn.setEnabled(!isChecked);
if (isChecked)
{
pavedBtn.setChecked(false);
dirtyRoadsBtn.setEnabled(true);
}
}
else if (mRoadType == RoadType.Paved)
{
dirtyRoadsBtn.setEnabled(!isChecked);
if (isChecked)
{
dirtyRoadsBtn.setChecked(false);
pavedBtn.setEnabled(true);
}
}
}
}
}

View File

@@ -4,23 +4,16 @@ import static app.organicmaps.leftbutton.LeftButtonsHolder.DISABLE_BUTTON_CODE;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceManager;
import androidx.preference.TwoStatePreference;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import app.organicmaps.MwmApplication;
import app.organicmaps.R;
import app.organicmaps.dialog.CustomMapServerDialog;
import app.organicmaps.downloader.OnmapDownloader;
import app.organicmaps.editor.LanguagesFragment;
import app.organicmaps.editor.ProfileActivity;
@@ -42,7 +35,7 @@ import app.organicmaps.sdk.util.SharedPropertiesUtils;
import app.organicmaps.sdk.util.log.LogsManager;
import app.organicmaps.util.ThemeSwitcher;
import app.organicmaps.util.Utils;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -80,7 +73,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment implements La
initScreenSleepEnabledPrefsCallbacks();
initShowOnLockScreenPrefsCallbacks();
initLeftButtonPrefs();
initCustomMapDownloadUrlPrefsCallbacks();
}
private void initLeftButtonPrefs()
@@ -543,34 +535,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment implements La
});
}
private void initCustomMapDownloadUrlPrefsCallbacks()
{
Preference customUrlPref = getPreference(getString(R.string.pref_custom_map_download_url));
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(requireContext());
String current = prefs.getString(getString(R.string.pref_custom_map_download_url), "");
String normalizedUrl = Framework.normalizeServerUrl(current);
// Initial summary
customUrlPref.setSummary(normalizedUrl.isEmpty()
? getString(R.string.download_resources_custom_url_summary_none)
: normalizedUrl);
// Sync native
Framework.applyCustomMapDownloadUrl(requireContext(), normalizedUrl);
// Show dialog
customUrlPref.setOnPreferenceClickListener(preference -> {
CustomMapServerDialog.show(requireContext(), url -> {
preference.setSummary(url.isEmpty()
? getString(R.string.download_resources_custom_url_summary_none)
: url);
});
return true;
});
}
private void removePreference(@NonNull String categoryKey, @NonNull Preference preference)
{
final PreferenceCategory category = getPreference(categoryKey);

View File

@@ -0,0 +1,25 @@
package app.organicmaps.util;
import android.app.Activity;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.core.text.TextUtilsCompat;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
public class RtlUtils
{
private final static List<String> rtlLocalesWithTranslation = Arrays.asList("ar", "fa");
public static void manageRtl(@NonNull final Activity activity)
{
final String currentLanguage = Locale.getDefault().getLanguage();
final boolean isRTL =
TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_RTL;
if (isRTL && rtlLocalesWithTranslation.contains(currentLanguage))
activity.getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
else
activity.getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
}
}

View File

@@ -90,7 +90,8 @@ public enum ThemeSwitcher
{
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_YES);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
else
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
if (RoutingController.get().isVehicleNavigation())
style = MapStyle.VehicleDark;
@@ -103,7 +104,8 @@ public enum ThemeSwitcher
{
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_NO);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
else
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
if (RoutingController.get().isVehicleNavigation())
style = MapStyle.VehicleClear;

View File

@@ -11,7 +11,6 @@ import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.core.content.ContextCompat;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textview.MaterialTextView;
@@ -177,10 +176,9 @@ public class PlaceholderView extends LinearLayout
return view.getMeasuredHeight() + params.bottomMargin + params.topMargin;
}
public void setContent(@StringRes int titleRes, @StringRes int subtitleRes, @DrawableRes int iconRes)
public void setContent(@StringRes int titleRes, @StringRes int subtitleRes)
{
mTitle.setText(titleRes);
mSubtitle.setText(subtitleRes);
mImage.setImageDrawable(ContextCompat.getDrawable(getContext(), iconRes));
}
}

View File

@@ -7,6 +7,7 @@ import androidx.annotation.DrawableRes;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.appcompat.widget.AppCompatRadioButton;
import app.organicmaps.R;
import app.organicmaps.util.ThemeUtils;
public class RoutingToolbarButton extends AppCompatRadioButton
{

View File

@@ -67,7 +67,7 @@ public class MyPositionButton
{
case LocationState.PENDING_POSITION -> R.drawable.ic_menu_location_pending;
case LocationState.NOT_FOLLOW_NO_POSITION -> R.drawable.ic_location_off;
case LocationState.NOT_FOLLOW -> R.drawable.ic_location_crosshair;
case LocationState.NOT_FOLLOW -> R.drawable.ic_not_follow;
case LocationState.FOLLOW -> R.drawable.ic_follow;
case LocationState.FOLLOW_AND_ROTATE -> R.drawable.ic_follow_and_rotate;
default -> throw new IllegalArgumentException("Invalid button mode: " + mode);

View File

@@ -1,6 +1,5 @@
package app.organicmaps.widget.placepage;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
@@ -15,7 +14,6 @@ import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentFactory;
import androidx.fragment.app.FragmentManager;
import app.organicmaps.R;
@@ -105,9 +103,9 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
public EditBookmarkFragment() {}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(DialogFragment.STYLE_NORMAL, R.style.MwmTheme_FullScreenDialog);
protected int getCustomTheme()
{
return getFullscreenTheme();
}
@Nullable
@@ -183,12 +181,6 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
public void onStart()
{
super.onStart();
Dialog dialog = getDialog();
if (dialog != null) {
dialog.getWindow().setLayout(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
}
// Focus name and show keyboard for "Unknown Place" bookmarks
if (mBookmark != null

View File

@@ -1,49 +0,0 @@
package app.organicmaps.widget.placepage;
import java.time.ZonedDateTime;
import java.time.format.TextStyle;
import java.util.Locale;
public class OpenStateTextFormatter
{
private OpenStateTextFormatter() {}
static String formatHoursMinutes(int hour, int minute, boolean use24h)
{
if (use24h)
return String.format(Locale.ROOT, "%02d:%02d", hour, minute);
int h = hour % 12;
if (h == 0) h = 12;
String ampm = (hour < 12) ? "AM" : "PM";
return String.format(Locale.ROOT, "%d:%02d %s", h, minute, ampm);
}
static boolean isSameLocalDate(ZonedDateTime a, ZonedDateTime b)
{
return a.toLocalDate().isEqual(b.toLocalDate());
}
static String dayShort(ZonedDateTime t, Locale locale)
{
return t.getDayOfWeek().getDisplayName(TextStyle.SHORT, locale);
}
static String buildAtLabel(
boolean opens,
boolean isToday,
String dayShort,
String time,
String opensAtLocalized,
String closesAtLocalized,
String opensDayAtLocalized,
String closesDayAtLocalized
)
{
if (isToday)
return opens ? String.format(Locale.ROOT, opensAtLocalized, time) // Opens at %s
: String.format(Locale.ROOT, closesAtLocalized, time); // Closes at %s
return opens ? String.format(Locale.ROOT, opensDayAtLocalized, dayShort, time) // Opens %s at %s
: String.format(Locale.ROOT, closesDayAtLocalized, dayShort, time); // Closes %s at %s
}
}

View File

@@ -31,7 +31,6 @@ import androidx.fragment.app.FragmentFactory;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import app.organicmaps.MwmActivity;
import app.organicmaps.MwmApplication;
import app.organicmaps.R;
@@ -56,6 +55,7 @@ import app.organicmaps.sdk.downloader.MapManager;
import app.organicmaps.sdk.editor.Editor;
import app.organicmaps.sdk.editor.OhState;
import app.organicmaps.sdk.editor.OpeningHours;
import app.organicmaps.sdk.editor.data.HoursMinutes;
import app.organicmaps.sdk.editor.data.Timetable;
import app.organicmaps.sdk.location.LocationListener;
import app.organicmaps.sdk.location.SensorListener;
@@ -85,11 +85,9 @@ import com.google.android.material.textview.MaterialTextView;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.TextStyle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
public class PlacePageView extends Fragment
implements View.OnClickListener, View.OnLongClickListener, LocationListener, SensorListener, Observer<MapObject>,
@@ -107,9 +105,6 @@ public class PlacePageView extends Fragment
private static final String LINKS_FRAGMENT_TAG = "LINKS_FRAGMENT_TAG";
private static final String TRACK_SHARE_MENU_ID = "TRACK_SHARE_MENU_ID";
private static final int SHORT_HORIZON_CLOSE_MIN = 60;
private static final int SHORT_HORIZON_OPEN_MIN = 15;
private static final List<CoordinatesFormat> visibleCoordsFormat =
Arrays.asList(CoordinatesFormat.LatLonDMS, CoordinatesFormat.LatLonDecimal, CoordinatesFormat.OLCFull,
CoordinatesFormat.UTM, CoordinatesFormat.MGRS, CoordinatesFormat.OSMLink);
@@ -154,11 +149,10 @@ public class PlacePageView extends Fragment
private MaterialTextView mTvLastChecked;
private View mEditPlace;
private View mAddPlace;
private View mMapTooOld;
private View mEditTopSpace;
private ShapeableImageView mColorIcon;
private MaterialTextView mTvCategory;
private MaterialButton mEditBookmark;
private ShapeableImageView mEditBookmark;
// Data
private CoordinatesFormat mCoordsFormat = CoordinatesFormat.LatLonDecimal;
@@ -319,7 +313,6 @@ public class PlacePageView extends Fragment
mTvLastChecked = mFrame.findViewById(R.id.place_page_last_checked);
mEditPlace = mFrame.findViewById(R.id.ll__place_editor);
mAddPlace = mFrame.findViewById(R.id.ll__place_add);
mMapTooOld = mFrame.findViewById(R.id.cv__map_too_old);
mEditTopSpace = mFrame.findViewById(R.id.edit_top_space);
latlon.setOnLongClickListener(this);
address.setOnLongClickListener(this);
@@ -686,84 +679,28 @@ public class PlacePageView extends Fragment
if (RoutingController.get().isNavigating() || RoutingController.get().isPlanning())
{
UiUtils.hide(mEditPlace, mAddPlace, mEditTopSpace, mMapTooOld);
UiUtils.hide(mEditPlace, mAddPlace, mEditTopSpace);
}
else
{
UiUtils.showIf(Editor.nativeShouldShowEditPlace(), mEditPlace);
UiUtils.showIf(Editor.nativeShouldShowAddPlace(), mAddPlace);
UiUtils.hide(mMapTooOld);
MaterialButton mTvEditPlace = mEditPlace.findViewById(R.id.mb__place_editor);
MaterialButton mTvAddPlace = mAddPlace.findViewById(R.id.mb__place_add);
boolean shouldEnableEditPlace = Editor.nativeShouldEnableEditPlace();
if (shouldEnableEditPlace)
{
mTvEditPlace.setEnabled(true);
mTvAddPlace.setEnabled(true);
mTvEditPlace.setOnClickListener(this);
mTvAddPlace.setOnClickListener(this);
}
else
{
String countryId = MapManager.nativeGetSelectedCountry();
if (countryId != null && MapManager.nativeIsMapTooOldToEdit(countryId))
{
// map editing is disabled because the map is too old
mTvEditPlace.setEnabled(true);
mTvAddPlace.setEnabled(true);
mTvEditPlace.setOnClickListener((v) -> {
Utils.showSnackbar(v.getContext(), v.getRootView(), R.string.place_page_too_old_to_edit);
});
mTvAddPlace.setOnClickListener((v) -> {
Utils.showSnackbar(v.getContext(), v.getRootView(), R.string.place_page_too_old_to_edit);
});
CountryItem map = CountryItem.fill(countryId);
if (map.status == CountryItem.STATUS_UPDATABLE || map.status == CountryItem.STATUS_DONE
|| map.status == CountryItem.STATUS_FAILED)
{
UiUtils.show(mMapTooOld);
boolean canUpdateMap = map.status != CountryItem.STATUS_DONE;
MaterialButton mTvUpdateTooOldMap = mMapTooOld.findViewById(R.id.mb__update_too_old_map);
UiUtils.showIf(canUpdateMap, mTvUpdateTooOldMap);
MaterialTextView mapTooOldDescription = mMapTooOld.findViewById(R.id.tv__map_too_old_description);
if (canUpdateMap)
{
mapTooOldDescription.setText(R.string.place_page_map_too_old_description);
mTvUpdateTooOldMap.setOnClickListener((v) -> {
MapManagerHelper.warn3gAndDownload(requireActivity(), map.id, null);
UiUtils.hide(mMapTooOld);
});
}
else
mapTooOldDescription.setText(R.string.place_page_app_too_old_description);
}
}
else
{
// map editing is disabled for other reasons
mTvEditPlace.setEnabled(false);
mTvAddPlace.setEnabled(false);
}
}
final int editButtonColor =
shouldEnableEditPlace
mTvEditPlace.setOnClickListener(this);
mTvAddPlace.setOnClickListener(this);
mTvEditPlace.setEnabled(Editor.nativeShouldEnableEditPlace());
mTvAddPlace.setEnabled(Editor.nativeShouldEnableAddPlace());
final int editPlaceButtonColor =
Editor.nativeShouldEnableEditPlace()
? ContextCompat.getColor(
getContext(),
UiUtils.getStyledResourceId(getContext(), com.google.android.material.R.attr.colorSecondary))
: ContextCompat.getColor(getContext(), R.color.button_accent_text_disabled);
mTvEditPlace.setTextColor(editButtonColor);
mTvAddPlace.setTextColor(editButtonColor);
mTvEditPlace.setStrokeColor(ColorStateList.valueOf(editButtonColor));
mTvAddPlace.setStrokeColor(ColorStateList.valueOf(editButtonColor));
mTvEditPlace.setTextColor(editPlaceButtonColor);
mTvAddPlace.setTextColor(editPlaceButtonColor);
mTvEditPlace.setStrokeColor(ColorStateList.valueOf(editPlaceButtonColor));
mTvAddPlace.setStrokeColor(ColorStateList.valueOf(editPlaceButtonColor));
UiUtils.showIf(
UiUtils.isVisible(mEditPlace) || UiUtils.isVisible(mAddPlace),
mEditTopSpace);
@@ -849,127 +786,57 @@ public class PlacePageView extends Fragment
final String ohStr = mMapObject.getMetadata(Metadata.MetadataType.FMD_OPEN_HOURS);
final Timetable[] timetables = OpeningHours.nativeTimetablesFromString(ohStr);
// No valid timetable
if (timetables == null || timetables.length == 0)
if (timetables != null && timetables.length != 0)
{
UiUtils.hide(mTvOpenState);
return;
}
final Context context = requireContext();
final OhState poiState = OpeningHours.nativeCurrentState(timetables);
final Context context = requireContext();
final OhState poiState = OpeningHours.nativeCurrentState(timetables);
// Ignore unknown rule state
if (poiState.state == OhState.State.Unknown)
{
UiUtils.hide(mTvOpenState);
return;
}
// Get colours
final ForegroundColorSpan colorGreen =
new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_green));
final ForegroundColorSpan colorYellow =
new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_yellow));
final ForegroundColorSpan colorRed = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_red));
// Get next state info
final SpannableStringBuilder openStateString = new SpannableStringBuilder();
final boolean isOpen = (poiState.state == OhState.State.Open); // False == Closed due to early exit for Unknown
final long nextStateTime = isOpen ? poiState.nextTimeClosed : poiState.nextTimeOpen; // Unix time (seconds)
ZonedDateTime nextChangeLocal = null;
boolean hasFiniteNextChange = false;
final long nowSec = System.currentTimeMillis() / 1000;
final int minsToNextState = (int) ((nextStateTime - nowSec) / 60);
// Try to resolve a finite next-change time; handle 24/7 case
final boolean looksLike247 = "24/7".equals(ohStr.trim());
final int ONE_WEEK_MIN = 7 * 24 * 60;
final boolean noRealNextChange = looksLike247 || minsToNextState >= ONE_WEEK_MIN;
if (!noRealNextChange)
{
try
// Ignore unknown rule state
if (poiState.state == OhState.State.Unknown)
{
if (nextStateTime > 0 && nextStateTime < Long.MAX_VALUE / 2)
{
// NOTE: Timezone is currently device timezone. TODO: use feature-specific timezone.
nextChangeLocal = ZonedDateTime.ofInstant(
Instant.ofEpochSecond(nextStateTime), ZoneId.systemDefault()
);
hasFiniteNextChange = true;
}
UiUtils.hide(mTvOpenState);
return;
}
catch (Throwable ignored) {}
}
if (!hasFiniteNextChange) // No valid next change
{
if (isOpen)
// Get colours
final ForegroundColorSpan colorGreen =
new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_green));
final ForegroundColorSpan colorYellow =
new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_yellow));
final ForegroundColorSpan colorRed = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_red));
// Get next state info
final SpannableStringBuilder openStateString = new SpannableStringBuilder();
final boolean isOpen = (poiState.state == OhState.State.Open); // False == Closed due to early exit for Unknown
final long nextStateTime = isOpen ? poiState.nextTimeClosed : poiState.nextTimeOpen; // Unix time (seconds)
final int minsToNextState = (int) ((nextStateTime - (System.currentTimeMillis() / 1000)) / 60);
if (minsToNextState <= 60) // POI opens/closes in 60 mins
{
final String minsToChangeStr = minsToNextState + " " + getString(R.string.minute);
final String nextChangeFormatted = getString(isOpen ? R.string.closes_in : R.string.opens_in, minsToChangeStr);
final ForegroundColorSpan nextChangeColor = isOpen ? colorYellow : colorRed;
// TODO: We should check closed/open time for specific feature's timezone.
ZonedDateTime time = ZonedDateTime.ofInstant(Instant.ofEpochSecond(nextStateTime), ZoneId.systemDefault());
String localizedTime =
new HoursMinutes(time.getHour(), time.getMinute(), DateUtils.is24HourFormat(context)).toString();
openStateString.append(nextChangeFormatted, nextChangeColor, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
.append("") // Add spacer
.append(getString(R.string.at, localizedTime));
}
else if (isOpen)
openStateString.append(getString(R.string.open_now), colorGreen, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
else
// TODO: Add "Closes at 18:00" etc
else // Closed
openStateString.append(getString(R.string.closed_now), colorRed, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
// TODO: Add "Opens at 18:00" etc
UiUtils.setTextAndHideIfEmpty(mTvOpenState, openStateString);
return;
}
String localizedTimeString = OpenStateTextFormatter.formatHoursMinutes(
nextChangeLocal.getHour(), nextChangeLocal.getMinute(), DateUtils.is24HourFormat(context));
final boolean shortHorizonClosing = isOpen && minsToNextState >= 0 && minsToNextState <= SHORT_HORIZON_CLOSE_MIN;
final boolean shortHorizonOpening = !isOpen && minsToNextState >= 0 && minsToNextState <= SHORT_HORIZON_OPEN_MIN;
if (shortHorizonClosing || shortHorizonOpening) // POI Opens/Closes in 60 mins • at 18:00
{
final String minsToChangeStr = getResources().getQuantityString(
R.plurals.minutes_short, Math.max(minsToNextState, 1), Math.max(minsToNextState, 1));
final String nextChangeFormatted = getString(isOpen ? R.string.closes_in : R.string.opens_in, minsToChangeStr);
openStateString.append(nextChangeFormatted, colorYellow, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
.append("") // Add spacer
.append(getString(R.string.at, localizedTimeString));
}
else
{
final String opensAtStr = getString(R.string.opens_at); // "Opens at %s"
final String closesAtStr = getString(R.string.closes_at); // "Closes at %s"
final String opensDayAtStr = getString(R.string.opens_day_at); // "Opens %1$s at %2$s"
final String closesDayAtStr = getString(R.string.closes_day_at); // "Closes %1$s at %2$s"
final boolean isToday =
OpenStateTextFormatter.isSameLocalDate(nextChangeLocal, ZonedDateTime.now(nextChangeLocal.getZone()));
// Full weekday name per design feedback.
final String dayName =
nextChangeLocal.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.getDefault());
if (isOpen) // > 60 minutes OR negative (safety). Show “Open now • Closes at 18:00”
{
openStateString.append(getString(R.string.open_now), colorGreen, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
final String atLabel =
OpenStateTextFormatter.buildAtLabel(false, isToday, dayName, localizedTimeString,
opensAtStr, closesAtStr, opensDayAtStr, closesDayAtStr);
if (!TextUtils.isEmpty(atLabel))
openStateString.append("").append(atLabel);
}
else // Closed
{
openStateString.append(getString(R.string.closed_now), colorRed, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
final String atLabel =
OpenStateTextFormatter.buildAtLabel(true, isToday, dayName, localizedTimeString,
opensAtStr, closesAtStr, opensDayAtStr, closesDayAtStr);
if (!TextUtils.isEmpty(atLabel))
openStateString.append("").append(atLabel);
}
}
UiUtils.setTextAndHideIfEmpty(mTvOpenState, openStateString);
// No valid timetable
UiUtils.hide(mTvOpenState);
}
private void addPlace()

View File

@@ -59,6 +59,8 @@ public class PlacePageBookmarkFragment extends Fragment implements View.OnClickL
mFrame = view;
mTvBookmarkNote = mFrame.findViewById(R.id.tv__bookmark_notes);
mTvBookmarkNote.setOnLongClickListener(this);
final View editBookmarkBtn = mFrame.findViewById(R.id.tv__bookmark_edit);
editBookmarkBtn.setOnClickListener(this);
}
private void initWebView()

View File

@@ -1,13 +1,13 @@
package app.organicmaps.widget.placepage.sections;
import static android.view.View.INVISIBLE;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridLayout;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
@@ -21,6 +21,7 @@ import app.organicmaps.R;
import app.organicmaps.sdk.Framework;
import app.organicmaps.sdk.bookmarks.data.ChargeSocketDescriptor;
import app.organicmaps.sdk.bookmarks.data.MapObject;
import app.organicmaps.sdk.bookmarks.data.Metadata;
import app.organicmaps.widget.placepage.PlacePageViewModel;
import java.text.DecimalFormat;
@@ -88,7 +89,7 @@ public class PlacePageChargeSocketsFragment extends Fragment implements Observer
// load SVG icon converted into VectorDrawable in res/drawable
@SuppressLint("DiscouragedApi")
int resIconId = getResources().getIdentifier("ic_charge_socket_" + socket.visualType(), "drawable",
int resIconId = getResources().getIdentifier("ic_charge_socket_" + socket.type(), "drawable",
requireContext().getPackageName());
if (resIconId != 0)
{
@@ -97,7 +98,7 @@ public class PlacePageChargeSocketsFragment extends Fragment implements Observer
@SuppressLint("DiscouragedApi")
int resTypeId =
getResources().getIdentifier("charge_socket_" + socket.visualType(), "string", requireContext().getPackageName());
getResources().getIdentifier("charge_socket_" + socket.type(), "string", requireContext().getPackageName());
if (resTypeId != 0)
{
type.setText(resTypeId);
@@ -108,9 +109,6 @@ public class PlacePageChargeSocketsFragment extends Fragment implements Observer
DecimalFormat df = new DecimalFormat("#.##");
power.setText(getString(R.string.kw_label, df.format(socket.power())));
}
else if (socket.ignorePower()) {
power.setVisibility(INVISIBLE);
}
if (socket.count() != 0)
{

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